Moodle and MCP: letting AI agents into your LMS without regret
There is no official Moodle MCP server. Community ones run on web service tokens, and the token decides everything. How to give an AI agent access to Moodle safely.
Short answer: you can connect Claude, ChatGPT or any other agent to Moodle today through the Model Context Protocol, but not with anything Moodle HQ ships. Every Moodle MCP server we found is a community project, and every one of them works the same way underneath: it calls Moodle’s REST web services with a token. So the question is not which MCP server to pick. It is what that token is allowed to do.
What is MCP, in one paragraph?
The Model Context Protocol is an open standard for giving AI assistants tools. An MCP server describes a set of actions, such as “list my courses” or “create a quiz”, and an AI client like Claude Desktop, an IDE or an agent framework can call them. It has become the default way to plug software into AI agents, which is why every product is now asked “do you have an MCP server?”
Does Moodle have an official MCP server?
No. As of October 2026, ibl.ai, which publishes Moodle connectors, says it “found no MCP server published by Moodle HQ itself” and recommends wrapping Moodle’s web services yourself.1 We could not find a tracker issue or an HQ statement about MCP in core either.
What exists is community work:
| Project | What it does |
|---|---|
| csmediapro/moodle-mcp-server | Reads Moodle data for AI agents through web services, tools as plugin modules |
| MarcosNahuel/moodle-mcp | Lets agents publish lessons, resources and activities, with idempotent writes |
| linomck/moodle-mcp | Lets assistants browse courses, fetch content and search resources |
webservice_mcp | A Moodle plugin that adds MCP as a web service protocol inside Moodle itself |
The three GitHub projects had between zero and one star when we checked on 2 November 2026, and GitHub detects a licence file in none of them. That is not a criticism of the authors. It means you are adopting someone’s side project, so read the code before you hand it a token.
Why does the token matter more than the server?
Because Moodle doesn’t know an AI is calling. It sees a web service request with a token, and a token belongs to a Moodle user. Whatever that user can do, the agent can do.
Here is what that looks like in practice. You connect an agent with an admin’s token “just to try it”. The agent can now read every user’s email address and grades, delete courses, change roles and call any function your site exposes. Then someone pastes a student’s forum post into the chat, the post contains instructions, and the agent follows them. Prompt injection is not hypothetical. It is the standard way agents get misused, and an admin token turns it into a site takeover.
Grades, submissions and enrolment records are also student records, protected by FERPA in the US and the GDPR in Europe.1 Sending them to a model provider is a data protection decision, not a settings change.
How do you connect an agent to Moodle safely?
Moodle already has every control you need. It just doesn’t turn them on for you.
- Create a dedicated user for the agent. Never use a real person’s account, and never an admin.
- Give it a role with only the capabilities it needs, in only the contexts it needs. Reading one category’s courses is a role assigned in that category, not a site-wide role.
- Create a custom external service (Site administration, Server, Web services, External services) and add only the functions the agent should call. Tick “Authorised users only” and authorise just the agent’s user.
- Create the token for that service only, with an IP restriction and a “valid until” date. A token that expires is a token you will remember to review.
- Start read only. Functions that list and get things. Add write functions one at a time, when you know you need them.
- Watch the logs. Moodle logs each web service call as an event, so you can see what the agent actually did, as which user.
- Keep humans in the loop for writes. Most MCP clients can ask for confirmation before a tool runs. Leave that on for anything that changes data.
None of this is specific to AI. It is how any integration with Moodle should be set up. Agents just make the cost of skipping it higher, because they act on text they read, and text can be written by anyone.
What is actually worth doing with an agent?
The useful cases so far are narrow and read heavy:
- Course authors drafting content in a sandbox course, then a human publishing it. The idempotent publishing in MarcosNahuel’s server is built for exactly this.
- Support staff asking questions about a user’s enrolments or a course’s settings without clicking through ten admin pages.
- Reports in plain language, such as “which courses had no activity this month”, on top of read-only functions.
What we would not do yet: let an agent grade, change enrolments in bulk or touch site configuration, even with a scoped token. Moodle’s own AI subsystem, which arrived in 4.5 and grew through 5.x, keeps AI inside defined placements for the same reason.2 It is a sensible line.
Should you build your own?
If an off-the-shelf server does what you need with a scoped token, use it. Build your own when:
- you need tools that don’t map to existing web service functions, such as one step that checks five things and returns a summary;
- you want the tools defined inside Moodle, versioned and reviewed like any other code, instead of in a script on someone’s laptop;
- you need write actions with your own guardrails: limits, approvals, audit records.
All three come down to custom web service functions in a Moodle plugin. They’re a normal part of Moodle development, with capability checks, parameter validation and tests. It’s the same pattern behind Autoflow, our open source workflow tool, where every step runs as a real user and goes through Moodle’s own permission checks. If you want agents in your Moodle with that level of control, that is a plugin we can scope.
Sources
-
ibl.ai, Moodle LMS MCP server and agent skill, checked 2 November 2026. ↑ ↑
-
Background on Moodle’s AI subsystem and where custom plugins fit: Moodle AI features and custom plugins. ↑
Need a Moodle plugin built or rescued?
Tell the scoping assistant what you need. You get a fixed price and a timeline in a few minutes, and an engineer reviews it within one business day.
Get a fixed quote