Skip to main content
Glama

ed-mcp

Lines of code

An MCP server and CLI for Ed Discussion. It gives LLMs (and you) access to threads, comments, attendance, moderation, file uploads, and instant local search through 43 tools. Works with Claude Desktop, Claude Code, or any MCP-compatible client.

What can I do with this?

Once set up, you can ask Claude things like:

"What questions haven't been answered yet in ENVX2001?"

Claude will look up your course, find unanswered questions, and show you a summary.

Here are some more examples:

You say

What happens

"Give me a quick overview of my stats course"

Fetches enrollment, unanswered questions, unresolved threads, and top categories (get_course_stats)

"Show me thread #42 in ENVX2001"

Looks up the thread by its number and shows the full content and replies (get_course_thread)

"Search for posts about peer review in my course"

Searches threads by keyword and returns a summary list (search_threads)

"Reply to that thread saying the deadline has been extended"

Posts a comment on the thread (reply_to_thread)

"Pin the announcement about the exam"

Pins the thread to the top of the course feed (pin_thread)

"Mark that question as answered -- the first reply is correct"

Accepts the reply as the answer (accept_answer)

"Move all the project 2 threads into the Assignments category"

Recategorises multiple threads at once (bulk_recategorise)

"What has student Jane Smith been posting about?"

Looks up the student and shows their recent activity (get_user_activity)

"This question is a duplicate of #35, mark it"

Marks the thread as a duplicate and links to the original (mark_duplicate)

"Show me today's attendance session"

Lists attendance sessions and their check-ins (list_attendance_sessions)

"Mark students 12345 and 67890 as present for the Week 3 tutorial"

Manually checks in students by user ID (manual_check_in)

"Give me an attendance report for the whole course"

Returns all sessions and check-ins in one call (get_attendance_analytics)

"Summarise this week's posts with staff answers into a FAQ"

Syncs local index, searches with staff reply filter, returns full content (sync_index + search_index)

"Find answered threads similar to this question about R errors"

Searches local index with BM25 ranking, stemming, and fuzzy matching (search_index)

Related MCP server: Canvas LMS MCP Server

Setup

1. Prerequisites

You will need two things installed on your computer:

  • Python 3.11 or newer -- check with python3 --version in your terminal. If you don't have it, download it from python.org.

  • uv (a Python package manager) -- install it by running this in your terminal:

    curl -LsSf https://astral.sh/uv/install.sh | sh

    On Windows, use: powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

2. Get your Ed API token

Go to your Ed settings page, create a new token, and copy it.

3. Download and install

Go to the GitHub repository and click the green Code button, then Download ZIP. Extract it somewhere on your computer (e.g. your Desktop or Documents folder).

If you have git installed, you can clone it instead:

git clone https://github.com/januarharianto/ed-mcp.git

Then open a terminal, navigate to the folder, and install dependencies:

cd /path/to/ed-mcp
uv sync

Replace /path/to/ed-mcp with the actual folder path.

4. Connect to Claude

Claude Desktop

Open your Claude Desktop config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Add this inside the "mcpServers" section (create the file if it doesn't exist).

Important: Claude Desktop does not inherit your shell's PATH, so you must use the full path to uv. Find it by running which uv (macOS/Linux) or where uv (Windows) in your terminal.

{
  "mcpServers": {
    "edstem": {
      "command": "/full/path/to/uv",
      "args": ["run", "--directory", "/path/to/ed-mcp", "python", "-m", "edstem_mcp.server"],
      "env": {
        "ED_API_TOKEN": "your_token_here"
      }
    }
  }
}

Replace /full/path/to/uv with the output from which uv (macOS/Linux) or where uv (Windows), and /path/to/ed-mcp with the actual folder path.

Restart Claude Desktop after saving the file.

Claude Code

The repository includes an .mcp.json file, so Claude Code discovers the MCP server automatically when you open the project folder.

Create a .env file in the project root with your token:

ED_API_TOKEN=your_token_here

The repository also ships with four Claude Code skills in skills/ that are auto-discovered. They provide structured workflows for common tasks like thread management, attendance, moderation, and course admin.

5. Test it

Ask Claude: "What courses am I enrolled in on Ed?" If everything is set up correctly, you'll see a list of your courses.


CLI

The ed command gives you the same functionality from your terminal. Output is JSON, so it pipes well into jq or other tools.

uv run ed usage          # print the full command reference

Command group

What it does

ed courses

List courses, get stats, list users, list categories

ed threads

List, search, read, create, edit, reply, delete, moderate, recategorise

ed attendance

List sessions, check in students, undo check-ins, get analytics

ed comments

Edit or delete comments

ed users

View a user's activity

ed files

Upload files

ed config

Save a default course ID

Most commands that need a course ID accept --course. To avoid typing it every time:

uv run ed config set-course 12345

After that, commands like ed threads list and ed attendance analytics will use course 12345 by default.


Tool reference

Courses and users

  • get_user -- Your profile info.

  • list_courses -- All enrolled courses.

  • get_course_stats -- Quick overview: enrollment, unanswered/unresolved counts, top categories.

  • get_enrollment_counts -- Headcount by role (students, staff, admins).

  • list_users -- Students and staff in a course (with role filtering and pagination).

  • get_user_activity -- A user's thread and comment history.

Threads

  • list_threads -- Browse threads with sorting and filtering.

  • search_threads -- Search by keyword.

  • get_thread -- Full thread content by ID.

  • get_course_thread -- Full thread content by number (e.g. #42).

  • get_thread_by_url -- Full thread content from an Ed URL.

  • list_categories -- All categories and subcategories.

  • create_thread -- Create a post, question, or announcement.

  • edit_thread -- Update title, content, or category.

  • delete_thread -- Delete a thread.

  • bulk_recategorise -- Move multiple threads to a new category.

Comments

  • reply_to_thread -- Post a comment or answer (supports nested replies).

  • edit_comment -- Edit a comment.

  • delete_comment -- Delete a comment.

Moderation

  • lock_thread / unlock_thread -- Control whether new comments are allowed.

  • pin_thread / unpin_thread -- Pin or unpin from the course feed.

  • endorse_thread / unendorse_thread -- Instructor endorsement badge.

  • accept_answer -- Mark the accepted answer on a question.

  • mark_duplicate / unmark_duplicate -- Flag duplicate threads.

Attendance

  • list_attendance_sessions -- List all sessions in a course.

  • get_attendance_session -- Full session detail with check-ins.

  • create_attendance_session -- Create a new session.

  • update_attendance_session -- Rename, close/reopen, or hide/show a session.

  • delete_attendance_session -- Delete a session and its check-ins.

  • list_check_ins -- List check-ins by course or session.

  • manual_check_in -- Mark students as present, late, excused, or absent.

  • undo_check_in -- Remove check-in records.

  • get_attendance_analytics -- Combined attendance report for a course.

Files

  • upload_file -- Upload a file to Ed and get its URL.

  • upload_file_url -- Upload a file from a URL directly to Ed (no local download needed).

  • download_file -- Download a file from an Ed CDN URL to a local path.

  • download_thread_files -- Batch download all images and attachments from a thread.

These tools provide instant, offline, full-text search across an entire course's threads. The search index is built from a bulk download of all threads and uses SQLite FTS5 with BM25 ranking and Porter stemming. No new dependencies -- sqlite3 is part of Python's standard library.

  • sync_index -- Download all threads for a course and build a local search index. Takes ~0.4 seconds. Call this once, then use search_index for instant results.

  • search_index -- Search the local index with BM25 ranking. Supports phrases ("peer review"), prefix matching (assign*), boolean operators (AND/OR/NOT), and column-specific queries (title:exam, staff_replies:deadline). Filter by category, type, staff replies, or answered status. Returns full thread content for top results. Auto-syncs on first call and refreshes when stale (>30 minutes).

After you reply to, edit, create, or delete a thread, the local index is automatically updated (write-through).

Response efficiency

All tool responses are trimmed for LLM context efficiency:

  • List/search tools return compact summaries (key subset, no content body).

  • Detail tools return full content but strip metadata bloat.

  • Write tools return minimal confirmations (id, number, title).

  • Booleans like is_pinned and is_locked are only included when true.

  • Timestamps are date-only in summaries, full precision in detail views.

  • Null/empty values are omitted from all responses.

Use get_thread or get_course_thread when you need full thread content.

Environment variables

Variable

Required

Description

ED_API_TOKEN

Yes

Your Ed Discussion API token

ED_BASE_URL

No

API base URL (defaults to https://edstem.org/api)

ED_STRIP_PII

No

Strip emails, user IDs, avatars from responses (defaults to true; set to false to include all fields)

ED_REGION

No

Region prefix for Ed URLs in responses -- e.g. au, us (defaults to us)

License

MIT

Available Tools

43 tools
accept_answerA

Mark a comment as the accepted answer on a question thread. Use get_thread first to find the comment_id of the correct answer.

Args: thread_id: The global thread ID (from list_threads or search_threads). comment_id: The ID of the comment to accept (from get_thread results).

Inputs: thread_id (required), comment_id (required). Returns: result

bulk_recategoriseA

Move multiple threads to a new category at once. Use search_threads or list_threads to find thread IDs, and list_categories for valid category names. Set dry_run=true to preview changes without applying them.

Args: thread_ids: List of global thread IDs to move. category: Target category name (use list_categories to see options). subcategory: Target subcategory name (optional). dry_run: If true, show what would change without applying. Default false.

Inputs: category (required), thread_ids (required), dry_run, subcategory. Returns: result

create_attendance_sessionA

Create a new attendance session in a course.

Args: course_id: The course ID (use list_courses to find it). title: Session title (e.g. "Week 3 Tutorial"). start: Optional start time in ISO 8601 format (e.g. "2026-03-01T09:00:00+11:00"). Defaults to now. is_hidden: If true, the session is hidden from students.

Inputs: title (required), course_id (required), start, is_hidden. Returns: result

create_threadA

Create a new thread in a course. Wrap content in Ed XML: Your text here. Use list_categories to find valid category names.

Args: course_id: The course ID (use list_courses to find it). title: Thread title. content: Thread body in Ed XML format. type: "post" for a discussion, "question" for a question that can be answered, or "announcement" for a course-wide notice. category: Category name (use list_categories to see options). subcategory: Subcategory name (optional). is_private: If true, only staff can see the thread. is_anonymous: If true, the author's name is hidden.

Inputs: title (required), content (required), course_id (required), type, +4 more. Returns: result

delete_attendance_sessionA

Permanently delete an attendance session and all its check-ins. This cannot be undone.

Args: event_id: The session ID (from list_attendance_sessions results).

Inputs: event_id (required). Returns: result

delete_commentA

Permanently delete a comment. This cannot be undone.

Args: comment_id: The comment ID (from get_thread results).

Inputs: comment_id (required). Returns: result

delete_threadA

Permanently delete a thread and all its comments. This cannot be undone.

Args: thread_id: The global thread ID (from list_threads or search_threads).

Inputs: thread_id (required). Returns: result

download_fileA

Download a file from an Ed Discussion CDN URL to a temporary local path. Returns the local file path so you can read or view it.

Args: url: The Ed CDN URL (e.g. https://static.au.edusercontent.com/files/...).

Inputs: url (required). Returns: result

download_thread_filesA

Download all images and file attachments from a thread's content, answers, and comments to temporary local files. Returns local file paths so you can read or view them.

Args: thread_id: The global thread ID (from list_threads or search_threads results).

Inputs: thread_id (required). Returns: result

edit_commentA

Edit an existing comment's content. Replaces the entire body with the new content in Ed XML format.

Args: comment_id: The comment ID (from get_thread results). content: New body in Ed XML format.

Inputs: content (required), comment_id (required). Returns: result

edit_threadA

Edit an existing thread's title, content, or category. Only provided fields are updated; omitted fields are left unchanged.

Args: thread_id: The global thread ID (from list_threads or search_threads). title: New title (omit to keep current). content: New body in Ed XML format (omit to keep current). category: New category name (omit to keep current; use list_categories for valid names). subcategory: New subcategory name (omit to keep current).

Inputs: thread_id (required), title, content, category, +1 more. Returns: result

endorse_threadA

Endorse a thread with an instructor badge to signal it contains good content or a correct answer.

Args: thread_id: The global thread ID (from list_threads or search_threads).

Inputs: thread_id (required). Returns: result

get_attendance_analyticsA

Get a combined attendance report for a course — all sessions with all check-ins. Useful for generating attendance summaries.

Args: course_id: The course ID (use list_courses to find it).

Inputs: course_id (required). Returns: result

get_attendance_sessionA

Get full details of an attendance session, including its check-ins.

Args: event_id: The session ID (from list_attendance_sessions results).

Inputs: event_id (required). Returns: result

get_course_statsA

Get a quick course overview for daily review. Returns enrollment count, number of unanswered questions, number of unresolved threads, number of threads with new follow-up replies, and top categories by volume.

Args: course_id: The course ID (use list_courses to find it).

Inputs: course_id (required). Returns: result

get_course_threadA

Read a thread by its number as shown in the Ed UI (e.g. #42, #220). Use this when someone refers to a thread by number. Returns full content, comments, and answers.

Args: course_id: The course ID (use list_courses to find it). thread_number: The thread number as shown in the UI (e.g. 42 for thread #42).

Inputs: course_id (required), thread_number (required). Returns: result

get_enrollment_countsA

Get a quick headcount for a course. Returns student count and total enrolled. Use this to answer "how many students" questions without loading the full user list. For per-role breakdowns (staff, admin), use list_users with a role filter.

Args: course_id: The course ID (use list_courses to find it).

Inputs: course_id (required). Returns: result

get_threadA

Read a thread's full content, comments, and answers. Use this when you have a thread ID (a large number like 2785693) from list_threads or search_threads results. For looking up a thread by its UI number (e.g. #42), use get_course_thread instead.

Args: thread_id: The global thread ID (a large number from list_threads or search_threads, not the #number shown in the UI).

Inputs: thread_id (required). Returns: result

get_thread_by_urlA

Read a thread by pasting its Ed Discussion URL. Use this when someone shares a link to a thread. Returns full content, comments, and answers.

Args: url: Full Ed Discussion thread URL (e.g. https://edstem.org/au/courses/20849/discussion/2785693).

Inputs: url (required). Returns: result

get_userA

Get the authenticated user's profile (name, role). Call list_courses instead to see enrolled courses.

Inputs: no named parameters. Returns: result

get_user_activityA

See what a specific user has been posting and commenting in a course. Use list_users first to find the user_id.

Args: user_id: The user ID (use list_users to find it). course_id: The course ID (use list_courses to find it). limit: Max entries to return (default 30). offset: Pagination offset (use with limit to page through results). filter: Narrow results — "thread" for threads only, "answer" for answers only, "comment" for comments only, or "all" for everything (default).

Inputs: user_id (required), course_id (required), limit, filter, +1 more. Returns: result

list_attendance_sessionsA

List attendance sessions in a course. Returns compact summaries. Use get_attendance_session to see full details.

Args: course_id: The course ID (use list_courses to find it).

Inputs: course_id (required). Returns: result

list_categoriesA

List the available thread categories and subcategories in a course. Use this to find valid category names before creating or recategorising threads.

Args: course_id: The course ID (use list_courses to find it).

Inputs: course_id (required). Returns: result

list_check_insA

List attendance check-ins. Provide either course_id for all check-ins across sessions, or event_id for a single session.

Args: course_id: The course ID — returns check-ins across all sessions. event_id: A specific session ID — returns only that session's check-ins.

Inputs: event_id, course_id. Returns: result

list_coursesA

List courses the user is enrolled in. Call this first to find a course_id before using other tools. Returns id, code, name, year, session, and status.

Args: status: Filter by status — "active", "archived", or "inactive". Omit for all. year: Filter by year (e.g. "2025"). Omit for all years. code: Filter by course code substring, case-insensitive (e.g. "ENVX"). Omit for all codes.

Inputs: code, year, status. Returns: result

list_threadsA

FALLBACK browse tool. PREFER search_index for almost all browsing — it runs locally over all threads, supports rich queries, and auto-syncs. Only use list_threads when you need the freshest N threads (sort=new/top/trending) or a personal/triage filter the index doesn't expose: unread, starred, watching, mine, following, new_replies. Returns compact summaries (no full content). Use get_thread or get_course_thread to read a specific thread.

Args: course_id: The course ID (use list_courses to find it). limit: Max threads to return (default 50, max 100). offset: Pagination offset (use with limit to page through results). sort: Sort order — "new" for most recent, "top" for most voted, or "trending" for currently active. filter: Narrow results. Triage filters: "unanswered", "unresolved", "new_replies". Personal filters: "unread", "starred", "watching", "mine", "following". Visibility filters: "private", "public", "staff", "endorsed". Invalid values silently return empty results. category: Filter by category name (case-insensitive). Only returns threads in this category.

Inputs: course_id (required), sort, limit, filter, +2 more. Returns: result

list_usersA

List enrolled users in a course. Use get_enrollment_counts for a quick headcount. Use this when you need names or user IDs (e.g. before calling get_user_activity).

Args: course_id: The course ID (use list_courses to find it). role: Filter by role — "student", "staff", or "admin". Omit for all roles. limit: Max users to return (default 50). offset: Pagination offset (use with limit to page through results).

Inputs: course_id (required), role, limit, offset. Returns: result

lock_threadA

Lock a thread to prevent new comments. Useful after a question is resolved or a discussion is concluded.

Args: thread_id: The global thread ID (from list_threads or search_threads).

Inputs: thread_id (required). Returns: result

manual_check_inA

Manually mark students' attendance for a session. Use list_users to find user IDs.

Args: event_id: The session ID (from list_attendance_sessions results). user_ids: List of user IDs to check in. kind: Attendance status — "present", "late", "excused", or "absent".

Inputs: event_id (required), user_ids (required), kind. Returns: result

mark_duplicateA

Mark a thread as a duplicate of another thread. Use this when a question has already been answered elsewhere to point students to the original.

Args: thread_id: The global ID of the duplicate thread (from list_threads or search_threads). original_thread_id: The global ID of the original thread it duplicates.

Inputs: thread_id (required), original_thread_id (required). Returns: result

pin_threadA

Pin a thread so it stays at the top of the course feed. Good for important announcements or FAQs.

Args: thread_id: The global thread ID (from list_threads or search_threads).

Inputs: thread_id (required). Returns: result

reply_to_threadA

Reply to a thread with a comment or answer. Wrap content in Ed XML: Your text here

Args: thread_id: The global thread ID (from list_threads or search_threads). content: Reply body in Ed XML format. type: "comment" for a general reply, or "answer" for a direct answer (only works on "question" type threads). is_private: If true, only staff can see this reply. is_anonymous: If true, the author's name is hidden. parent_id: To nest this reply under an existing comment, pass that comment's ID here.

Inputs: content (required), thread_id (required), type, parent_id, +2 more. Returns: result

search_indexA

DEFAULT thread search/browse tool. Searches the local BM25-ranked index over all threads in a course. Returns ranked results with full content for top hits. Auto-syncs when the index is missing or stale (>30 min) — you do NOT need to call sync_index first in normal use. Supports phrases, prefix, boolean, and column-specific queries. If a refresh fails but a prior index exists, falls back to the stale data — check the returned last_synced timestamp before treating results as fresh. First call on a large unsynced course may take several seconds while the initial sync runs. Use this for any thread lookup, search, or filtered browse before falling back to list_threads/search_threads.

Args: course_id: The course ID (use list_courses to find it). query: Search query. Supports phrases ("peer review"), prefix (assign*), boolean (AND/OR/NOT), and column-specific (title:exam, staff_replies:deadline). Implicit AND between terms. limit: Max results (default 20). category: Filter by category name (e.g. "Assignments"). type: Filter by thread type — "question", "post", or "announcement". has_staff_reply: If true, only threads with staff/admin replies. is_answered: If true, only answered threads.

Inputs: query (required), course_id (required), type, limit, +3 more. Returns: result

search_threadsA

FALLBACK keyword search via the Ed API. PREFER search_index — it's faster, BM25-ranked, supports phrase/prefix/boolean/column queries, and auto-syncs the local index. Only use search_threads when the local index is unavailable or sync fails. Returns compact summaries. Use get_thread to read full content of a result.

Args: course_id: The course ID (use list_courses to find it). query: Search keywords (e.g. "peer review", "exam", "deadline"). limit: Max results (default 20). type: Filter by thread type — "question", "post", or "announcement". Omit for all types. exclude_pinned: If true, exclude pinned threads from results (useful to skip announcements). Default false.

Inputs: query (required), course_id (required), type, limit, +1 more. Returns: result

sync_indexA

Force-refresh the local search index for a course. You usually do NOT need to call this — search_index auto-syncs when its index is missing or stale (>30 min). Call sync_index directly only to force an immediate refresh after known external changes (e.g. a bulk import you just performed, or to clear a stale-fallback after a previous sync failure). First sync of a large course may take several seconds (full thread download).

Args: course_id: The course ID (use list_courses to find it).

Inputs: course_id (required). Returns: result

undo_check_inA

Remove check-in records for specific users in a session. This undoes both manual and self check-ins.

Args: event_id: The session ID. user_ids: List of user IDs whose check-ins to remove.

Inputs: event_id (required), user_ids (required). Returns: result

unendorse_threadA

Remove the instructor endorsement badge from a thread.

Args: thread_id: The global thread ID (from list_threads or search_threads).

Inputs: thread_id (required). Returns: result

unlock_threadA

Unlock a thread to allow new comments again.

Args: thread_id: The global thread ID (from list_threads or search_threads).

Inputs: thread_id (required). Returns: result

unmark_duplicateA

Remove the duplicate mark from a thread, restoring it as a standalone thread.

Args: thread_id: The global ID of the thread to unmark (from list_threads or search_threads).

Inputs: thread_id (required). Returns: result

unpin_threadA

Unpin a thread from the top of the course feed.

Args: thread_id: The global thread ID (from list_threads or search_threads).

Inputs: thread_id (required). Returns: result

update_attendance_sessionA

Update an attendance session. Use this to close/reopen, hide/unhide, or rename a session.

Args: event_id: The session ID (from list_attendance_sessions results). title: New title (omit to keep current). is_closed: Set true to close the session, false to reopen. is_hidden: Set true to hide from students, false to show.

Inputs: event_id (required), title, is_closed, is_hidden. Returns: result

upload_fileA

Upload a file from your computer to Ed Discussion and get a URL you can use in thread content or comments.

Args: file_path: Absolute path to the file on your computer.

Inputs: file_path (required). Returns: result

upload_file_urlA

Upload a file from a URL directly to Ed Discussion without downloading it locally first. Returns the Ed CDN URL you can use in thread content or comments.

Args: url: Public URL of the file to upload (e.g. an image or document URL from the web).

Inputs: url (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 43 tools

    Disambiguation4/5

    Most tools have clearly distinct purposes (threads, comments, attendance, files, search). The three thread retrieval tools are differentiated by input type (global ID, UI number, URL), and the two search tools are explicitly distinguished as default vs fallback. Minor overlap exists between list_threads and search_index for browsing, but descriptions are clear.

    Naming Consistency4/5

    The verb_noun pattern is consistent across most tools (create_thread, delete_comment, list_courses). Minor deviations like 'bulk_recategorise' and 'manual_check_in' slightly break the pattern, but the overall naming is predictable and readable.

    Tool Count2/5

    43 tools is far beyond the typical well-scoped range. While the platform (Ed Discussion) has many features, this many tools creates a heavy surface for agents to navigate and increases selection risk.

    Completeness5/5

    The toolset provides comprehensive CRUD and lifecycle coverage for threads, comments, attendance sessions, and check-ins, plus search, files, and user/course info. No major dead ends; some minor gaps like category creation/editing exist but don't hamper core workflows.

    Maintenance

    ActivityNo data
    ResponsivenessSyncing

    Related MCP Connectors

    Related MCP Servers