Model Context Protocol (MCP) server for Ed Discussion platform integration.
This MCP server provides Claude Code with tools to interact with Ed Stem:
- Get user info: View your enrolled courses
- List threads: Browse course discussions with filters (unresolved, unanswered, etc.)
- Get thread: Read full thread with all comments
- Post thread: Create new discussion threads
- Edit thread: Update existing threads
- Search threads: Find threads by keywords
- List users: View course enrollment
- Clone the repository:
git clone <repository-url>
cd edstem-mcp- Create virtual environment and install dependencies:
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt-
Get your Ed API token:
- Go to https://edstem.org/us/settings/api-tokens
- Create a new token
- Copy the token value
-
Create
.envfile:
cp .env.example .env
# Edit .env and add your tokenAdd to your Claude Code MCP settings file:
Linux/Mac: ~/.claude_code/mcp_settings.json
{
"mcpServers": {
"edstem": {
"command": "/home/jeremy/edstem-mcp/venv/bin/python",
"args": ["/home/jeremy/edstem-mcp/server.py"],
"env": {
"ED_API_TOKEN": "your_token_here"
}
}
}
}Replace /home/jeremy with your actual home directory path, and add your actual token.
Once configured, you can use natural language in Claude Code:
- "List recent threads in my CSE 421 course"
- "Show me unanswered questions in course 12345"
- "Create a thread asking about the homework deadline"
- "Search for threads about dynamic programming"
- "Get details for thread #6789"
Get information about authenticated user and enrolled courses.
List threads in a course with optional filtering.
- Parameters:
course_id(required): Course IDlimit(optional): Maximum threads to return (default: 30)offset(optional): Pagination offset (default: 0)sort(optional): Sort order - 'new', 'top', 'trending' (default: 'new')filter(optional): Filter threads - 'unresolved', 'unanswered', 'mine', 'following'
Get detailed thread information including all comments.
- Parameters:
thread_id
Create a new thread.
- Parameters:
course_id,title,content,category,subcategory,is_private,is_anonymous
Edit an existing thread.
- Parameters:
thread_id,title,content,category
Search for threads by keyword.
- Parameters:
course_id,query,limit
List users enrolled in a course.
- Parameters:
course_id
The server exposes:
edstem://user- Current user information and courses
- Content search: Search now looks in both thread titles AND content (not just titles)
- Better results: More accurate matching for finding relevant discussions
- Unresolved: Show only threads without accepted answers
- Unanswered: Show threads with no responses yet
- Mine: Show only threads you created
- Following: Show threads you're following
- Specific error types: Authentication errors, API errors, and validation errors are handled separately
- Detailed messages: Clear error messages help diagnose issues
- Graceful degradation: Errors don't crash the server
- Log file: All operations logged to
/tmp/edstem-mcp.log - Structured logging: Timestamps, log levels, and detailed messages
- Tool tracking: Every tool call is logged with its parameters
- Error tracing: Full exception tracebacks for debugging
All tools now return consistent data structures:
list_threads: Returns{threads: [...], count: N, limit: M, offset: O}list_users: Returns{users: [...], count: N}search_threads: Returns{threads: [...], count: N, query: "..."}
- Treat your API token as a password - anyone with it can access your Ed account
- Never commit
.envor tokens to version control - The Ed API is in beta and may change without notice
MIT
Uses the unofficial edapi library for Ed Stem API access.