Ed Discussion is available over MCP (Model Context Protocol) in three ways: a server that runs on your machine, a hosted server, and a Cloudflare Worker you can deploy yourself from the same source. All three expose the same tool catalog — see Ed Discussion MCP tools — and all three need an Ed API token somewhere in the chain. For how to point a specific client (Claude, Codex, ChatGPT, and others) at any of these, see Connect a client and its sibling pages; this page only covers what each option does.

Run it locally: edstem-mcp

The package also installs edstem-mcp, an MCP server that runs on your own machine — your MCP client starts it for you:
It uses the token and Ed site saved by edstem auth login, so after signing in once it needs no configuration. To pass a token instead, set EDSTEM_TOKEN (and EDSTEM_REGION for us.edstem.org or eu.edstem.org) in the server’s env, the same variables the CLI reads. This is the server to use for an account on us.edstem.org or eu.edstem.org: the hosted server and a self-deployed Worker reach edstem.org only. The create_thread and reply_thread tools — the only tools that post to Ed — are disabled by default. Set EDSTEM_ALLOW_POSTING=1 in the server’s environment to enable them. Every other tool is always available without that variable, but not all of them are read-only: mark_lessons_read, submit_slide, and submit_slide_answer write to Ed too, marking lesson progress and submitting quiz answers, without needing EDSTEM_ALLOW_POSTING.

Hosted server

A hosted server is available at https://edstem.tuuhub.com/mcp for clients that connect over OAuth rather than running a local program, such as Claude and ChatGPT on the web. Add it as a custom connector and sign in with your Ed token when the client asks. It works with edstem.org accounts only.

What the hosted service stores

You paste your Ed token into the service’s authorization, reconnect, or settings form. The service checks it against Ed before storing anything — a token that fails verification is never stored. Your token is encrypted before it’s stored, and the key that decrypts it is kept separately, as a server secret. Alongside it the service keeps only your Ed user ID, your Ed user name, when it was last verified, and whether it’s still valid — never the token in readable form. Your MCP client never receives your raw Ed token. Instead, the service issues its own access and refresh tokens for your client to use, so those can be revoked or expire independently of your Ed account. Full data handling and retention terms, including what account deletion removes and what backups may retain, are in the service’s Terms of Service.

Interactive views

In hosts that support MCP Apps (Claude and ChatGPT among them), four tools draw a view in the chat instead of a wall of text: Views are the default. Ask for a plain-text answer and the assistant uses the list_* and read_* tools instead. Hosts without MCP Apps get the same data as text, and EDSTEM_WIDGETS=0 removes the views from edstem-mcp. The teach_lesson prompt runs the lesson guide end to end.

Files over MCP

list_lesson_files and list_thread_files return each file as a link the client can open. A remote server cannot save to your disk, so use edstem files get when you want the files in a folder.

Self-hosting

Want your own endpoint instead of the hosted one? See Ed Discussion CLI for scripts and agents for the deploy steps, the Worker’s environment variables, and the static-token mode it accepts instead of OAuth.

MCP overview

What an MCP server is and how the moodle-cli family exposes one.

How MCP servers work here

Local vs. hosted MCP servers, and how tools map to CLI commands.

Ed Discussion tool catalog

Every tool, what it accepts, and whether it writes.

Connect a client

Client-specific setup for Codex, Claude, ChatGPT, and others.