moodle-mcp
Read-only access to a Moodle site (4.x and most 3.x with the mobile app enabled), exposing courses and their sections/materials, file and PDF contents, recent updates, deadlines and calendar events, notifications, forums and discussions, assignments with due dates and submission/grading status, grades, and private or group messages.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@moodle-mcp What's due on Moodle in the next two weeks?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
moodle-mcp
Ask Claude (or any MCP client) about your Moodle: courses, slides, deadlines, announcements, forums, private messages and grades.
"What's due on Moodle in the next two weeks?" "Summarise the slides of lecture 3 in Linear Algebra." "Anything new in my courses since Monday?" "Did anyone message me on Moodle?"
It works with any Moodle site (4.x and most 3.x) that has the Moodle mobile app enabled, which almost every university does. It is read-only by default: it can't submit, post, change or mark anything as read. Sending messages and forum replies can be switched on, with your confirmation for every send.
Quick start
You need uv (one command to install).
uv tool install git+https://github.com/rahul069/moodle-mcp
moodle-mcp setupsetup asks for your Moodle address, signs you in, and adds the server to Claude Code
if it is installed. For other apps it prints the config to paste. That's it.
uvx --from git+https://github.com/rahul069/moodle-mcp moodle-mcp setupRelated MCP server: Moodle MCP
Signing in
moodle-mcp setup looks up how your Moodle handles logins and picks the right way:
Username and password (sites with their own Moodle accounts): type them once. They go only to your Moodle to get a token and are not saved.
University single sign-on (Shibboleth, SAML, Microsoft, ...): setup gives you a link.
Log in to Moodle in your browser as usual.
Open the link from setup in the same browser. Moodle then tries to open the Moodle app with an address starting with
moodlemobile://token=.Copy that address and paste it into setup.
Firefox: it is in the address bar or on the error page.
Chrome / Edge: cancel the "open app" dialog, press F12, open Network, reload, click the
launch.phprow and copy Location from the response headers.
The token is stored in your system keyring (macOS Keychain, Windows Credential Manager,
GNOME Keyring / KWallet). On machines without a keyring it is stored in
~/.config/moodle-mcp/token with permissions 600.
Use it in your MCP client
Claude Code: moodle-mcp setup offers to add it, or run moodle-mcp add-to-claude.
Claude Desktop, Cursor, Windsurf, VS Code, ...: add this to the app's MCP config (Claude Desktop: Settings → Developer → Edit Config):
{
"mcpServers": {
"moodle": { "command": "moodle-mcp" }
}
}If the app can't find moodle-mcp, use the full path (which moodle-mcp) or
"command": "uvx", "args": ["--from", "git+https://github.com/rahul069/moodle-mcp", "moodle-mcp"].
Tools
Tool | What it does |
| your courses with ids |
| sections and materials of a course, with |
| text of a page or PDF, saves files to |
| what changed in the last N days (files, forum posts, grades) |
| upcoming deadlines and calendar events |
| latest notifications (announcements, feedback, grades) |
| forums, discussions and posts |
| assignments with due dates and submission or grading status |
| your grades in a course |
| private and group chats |
Courses can be named by id or by any part of their name ("linear alg", "algorithms").
Sending messages and forum replies (optional, off by default)
Two write tools can be switched on for local use:
Tool | What it does |
| private message into an existing chat, or to a person |
| reply to a forum post (everyone in the course can read it) |
claude mcp add --scope user moodle -e MOODLE_ALLOW_WRITE=1 -- moodle-mcp(or set "env": {"MOODLE_ALLOW_WRITE": "1"} in your client's MCP config).
Safety rails:
You confirm every send in a desktop dialog that shows the recipient and the exact text (zenity on Linux), or in your MCP client's own prompt (MCP elicitation). The AI can't confirm for you. If neither is available, nothing is sent.
Rate limit: 5 sends per hour, 20 per day (
MOODLE_WRITE_MAX_PER_HOUR,MOODLE_WRITE_MAX_PER_DAY).Log: every send is recorded in
~/.local/state/moodle-mcp/writes.log.Never remote: the remote connector (
moodle-mcp serve) never offers write tools.Nothing graded: there are no tools to submit assignments, attempt quizzes, delete or edit anything.
Your messages and posts are your responsibility: read what you confirm. Using AI for graded work can break your university's exam rules.
Commands
moodle-mcp run the MCP server (what your MCP client starts)
moodle-mcp setup connect your Moodle account
moodle-mcp test check the connection
moodle-mcp add-to-claude register with Claude Code
moodle-mcp logout delete the saved site and tokenSettings via environment variables (all optional):
Variable | Meaning |
| use these instead of what |
| file containing the token (or a |
| where |
| don't return the text of PDFs, only save them |
Use it from claude.ai and your phone (optional)
Run moodle-mcp on an always-on machine (a home server or a small cloud VM) as a remote connector and add it in claude.ai → Settings → Connectors → Add custom connector. It then also works in the Claude mobile apps.
moodle-mcp setup # on the server (paste the token; no browser needed there)
moodle-mcp set-passphrase # the passphrase you'll type when connecting claude.ai
moodle-mcp serve --public-url https://your-server.example.comIt listens on 127.0.0.1:8790 only, so put HTTPS in front of it, e.g.
tailscale funnel --bg 8790, a Cloudflare Tunnel, or Caddy/nginx. In claude.ai, use
https://your-server.example.com/mcp as the connector URL. A sign-in page asks for your
passphrase (5 wrong tries lock it for 15 minutes).
# /etc/systemd/system/moodle-mcp.service
[Unit]
Description=Moodle MCP connector
After=network-online.target
[Service]
User=youruser
Environment=MOODLE_TOKEN_FILE=/home/youruser/.config/moodle-mcp/token
ExecStart=/home/youruser/.local/bin/moodle-mcp serve --public-url https://your-server.example.com
Restart=on-failure
NoNewPrivileges=true
ProtectSystem=strict
ReadWritePaths=/home/youruser/.local/state/moodle-mcp /home/youruser/Downloads
PrivateTmp=true
[Install]
WantedBy=multi-user.targetOther clients: only claude.ai/claude.com (and localhost) may receive sign-in codes. To allow
another client, add its redirect host, e.g. for Gemini:
--allow-redirect-host oauth-redirect.googleusercontent.com. moodle-mcp revoke-all signs
every client out.
Privacy and security
Read-only by construction. The client can only call the Moodle web-service functions listed in
api.py(READ_ONLY); everything else is refused before any request is sent. The three send functions (WRITE) work only withMOODLE_ALLOW_WRITE=1and a confirmation from you.Your data stays between your computer and your Moodle. No telemetry, no third-party servers. Your MCP client (e.g. Claude) sees the tool results you ask for.
The token gives access to your Moodle account. Keep it private. To revoke it, delete it on Moodle under Preferences → Security keys (
/user/managetoken.php), then runmoodle-mcp logout.Content from Moodle (posts, messages, files) is written by other people. Good MCP clients treat it as data, but be aware of prompt injection when you let an assistant act on it.
Development
git clone https://github.com/rahul069/moodle-mcp && cd moodle-mcp
uv sync
uv run pytest
uv run moodle-mcp setupLicense
MIT. Not affiliated with Moodle Pty Ltd. "Moodle" is a registered trademark of Moodle Pty Ltd.
Available Tools
12 toolsmoodle_assignmentsBRead-onlyIdempotent
Assignments with due dates and your submission and grading status. Leave course empty for all courses.
Inputs: course, include_past. Returns: result
moodle_conversationARead-onlyIdempotent
Read the latest messages of one Moodle conversation (conversation_id from moodle_messages), oldest first. Nothing is marked as read.
Inputs: conversation_id (required), limit. Returns: result
moodle_courseARead-onlyIdempotent
Show a course's sections and materials (files, pages, forums, assignments, links) with their [module ids].
course is the course id or part of its name.
Inputs: course (required). Returns: result
moodle_coursesARead-onlyIdempotent
List the Moodle courses you are enrolled in, with their ids.
Inputs: no named parameters. Returns: result
moodle_deadlinesBRead-onlyIdempotent
Upcoming deadlines and calendar events (assignments, quizzes, course events) for the next days days.
Inputs: days. Returns: result
moodle_discussionARead-onlyIdempotent
Read all posts of one forum discussion (discussion_id from moodle_forum).
Inputs: discussion_id (required). Returns: result
moodle_forumARead-onlyIdempotent
List a course's forums (no forum_id), or the latest discussions in one forum (forum_id from that list).
Inputs: course (required), limit, forum_id. Returns: result
moodle_gradesARead-onlyIdempotent
Your grades in one course (id or part of its name).
Inputs: course (required). Returns: result
moodle_messagesARead-onlyIdempotent
Your Moodle private chats and group conversations (newest first): who, unread count and the last message. Open one with moodle_conversation(conversation_id). Nothing is marked as read.
Inputs: limit. Returns: result
moodle_notificationsBRead-onlyIdempotent
Your latest Moodle notifications (announcements, forum posts, feedback, grades), newest first.
Inputs: limit. Returns: result
moodle_openARead-onlyIdempotent
Open one item from moodle_course by its [module id]: returns the text of pages, labels, links and PDFs,
and saves attached files under ~/Downloads/moodle//. Long PDFs come back in parts (about 40,000
characters each); call again with start_page to read the rest. Give course (id or name) to make it faster.
Inputs: module_id (required), course, start_page. Returns: result
moodle_updatesARead-onlyIdempotent
What changed in your courses in the last days days (new or updated files, forum posts, grades, ...).
Leave course empty for all courses.
Inputs: days, course. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
moodle_courses (list enrolled courses) vs moodle_course (show one course's contents) differ only by an 's', which is a real misselection hazard despite the descriptions. There is also partial overlap among moodle_updates, moodle_notifications, and moodle_deadlines, and moodle_assignments partially duplicates due-date info found in moodle_deadlines.
Every tool uses a uniform moodle_<resource> snake_case pattern, which is predictable and readable. The only blemish is the singular/plural pair moodle_courses/moodle_course, which is technically consistent but semantically fragile.
Twelve tools is well within the healthy range and each maps to a distinct Moodle entity or activity stream. Nothing feels padded or redundant at the count level.
Read coverage is broad (courses, materials, forums, discussions, assignments, grades, messages, deadlines), but the surface is entirely read-only: no submitting assignments, uploading files, replying to forums, or sending messages. Agents asked to act on Moodle rather than summarize it will hit dead ends, even though assignment submission status is exposed.
Related MCP Connectors
Read your plat.plus courses, tasks, course pages, sessions, files and messages. Read-only.
Read-only MCP access to Sanket Patel’s profile, projects, notebook, and portfolio search.
Read-only access to a student's recorded classes: transcripts, notes, slides and concept map.
Public read-only MCP access to digital learning concepts, semantic relationships, and citations.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables read-only Moodle access through MCP for querying courses, content, assignments, grades, forums, discussions, submissions, and calendar events, while supporting multiple profiles and local ICS export.MIT
- AlicenseNot gradedqualityCmaintenanceEnables users to read Moodle course information, list courses, outlines, resources, assignments, and deadlines, and download or extract text from course files locally via an MCP-compatible client.MIT
- AlicenseAqualityBmaintenanceEnables AI apps to read a student's Moodle courses, upcoming and overdue due dates, assignment submission statuses, course grades, gradebook items and announcements. It is strictly read only, so it can never submit, edit or delete anything.1796 npmMIT
- AlicenseAqualityCmaintenanceEnables AI assistants to securely read course outlines, deadlines, announcements, forum discussions, and files from Moodle, track changes, and download or mirror course materials with a personal read-only token.101MIT