moodle-mcp
Provides read-only access to a Moodle instance as a student, with tools for viewing deadlines, courses, course materials, assignments, forums, grades, searching files and content, and syncing course files locally.
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 assignments are due this week for my courses?"
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
A read-only MCP server that gives AI agents (Claude Code, Claude Desktop, claude.ai…) access to your EPFL Moodle as a student: deadlines, course files, assignments, forums, grades.
It's built for moodle.epfl.ch and for macOS, where it keeps your Moodle key in the Keychain. It isn't affiliated with EPFL or Moodle.
Tools
Tool | What it answers |
| What's due soon, and whether Moodle still expects something from you |
| Your courses (code, name, id) |
| Sections and items of a course, with ids |
| Any item: PDF text, assignment brief + submission status, page text, forum threads, folder files, links, quizzes |
| Text of an attachment or folder file (also saved to |
| Find items by name across courses (Moodle's global search is disabled at EPFL) |
| Full-text search inside course PDFs, code and pages; returns pages + snippets and the call to read just those pages |
| Recent posts in Announcements forums |
| A full forum thread |
| Grade items, scores and feedback |
| New/edited items, files, grades and forum posts since your last check (or |
| Download a course's files, attachments and pages to |
Courses accept CS-214, cs214, a numeric id, or part of the name.
Courses hidden on your Moodle dashboard are skipped unless named explicitly.
The tools only read from Moodle; sync_course writes only to your own disk.
Token use
Long PDFs open as a page map (one line per page, repeated slide builds merged into ranges,
plus the PDF outline if it has one); the agent then asks for pages="12-14". A 127-slide deck
costs ~1.4k tokens to map instead of ~9k to dump. search_in_files indexes a course's files on
first use (text cached in ~/.cache/moodle-mcp/files, refreshed when a file changes on Moodle),
so later searches are instant and return only the matching pages.
Related MCP server: fiuba-mcp
Install
You need macOS and uv (it fetches Python 3.12+ itself). Clone this repository, then from its folder:
claude mcp add --scope user moodle -- "$(command -v uv)" --directory "$PWD" run moodle-mcpFor Claude Desktop (chat/Cowork), add the same command to mcpServers in
~/Library/Application Support/Claude/claude_desktop_config.json, with absolute paths:
{
"mcpServers": {
"moodle": {
"command": "/opt/homebrew/bin/uv",
"args": ["--directory", "/path/to/moodle-mcp", "run", "moodle-mcp"]
}
}
}Then install the key helper (see below) and ask your agent anything about Moodle. Since no key is stored yet, it answers with a link to get one.
sh scripts/install_url_handler.shThe Moodle key
The server uses a Moodle mobile web service token (the key the Moodle app uses), read from the
macOS Keychain item moodle-epfl or from $MOODLE_TOKEN. EPFL's Security keys page doesn't
hand one out, so it comes from the app sign-in flow: launch.php redirects a signed-in browser to
moodlemobile://token=…. Keys expire from time to time.
Getting or renewing it
When the key has expired, or none is stored yet, tools answer with renewal steps that the agent
walks you through. You never paste the key into the chat. With Moodle Key Helper installed
(scripts/install_url_handler.sh puts it in ~/Applications), it takes one link:
The local server makes up a random passport, saves it to
~/.cache/moodle-mcp/pending_renewal.json(valid 15 minutes) and gives youlaunch.php?…&passport=<it>.You open the link in a browser signed in to Moodle (if you aren't, Moodle carries on after sign-in) and let the browser open Moodle Key Helper. Moodle redirects to
moodlemobile://token=…, which holds the key signed with md5(site URL + passport).The helper runs
save_token.py --from-app. It accepts the link only if the signature matches the pending passport, checks the key with Moodle, stores it in the Keychain, sends it to your hosted server if you have one, and confirms with a notification. The running server picks it up on the next call.
Any web page can open a moodlemobile:// link, or send your browser to launch.php with a passport
of its own, but it can't know the pending one. So a page can't plant a key (for example, one for
another account), and links that arrive when no renewal is pending are ignored.
By hand
Without the helper, the renewal steps also give the manual route, with the same link:
Signed in to moodle.epfl.ch in Chrome, open DevTools → Network (tick Preserve log).
Open the link (any passport works here, e.g.
https://moodle.epfl.ch/admin/tool/mobile/launch.php?service=moodle_mobile_app&passport=12345&urlscheme=moodlemobile).Copy the
location: moodlemobile://token=…header of thelaunch.php303 response.python3 scripts/save_token.pyand paste it (input is hidden, and the key is never printed).
To revoke the key, reset the "Moodle mobile web service" key on moodle.epfl.ch → Preferences → Security keys, then get a fresh one.
On your phone, the web and cloud sessions (optional)
You can also host the server on fly.io and add it as a claude.ai custom connector. It then works in the Claude mobile apps, claude.ai, Claude Code on the web and routines. Connector calls come from Anthropic's servers, so cloud sandboxes don't need network access to it.
It's the same server with MOODLE_MCP_URL set, which switches it to HTTP behind a small OAuth
sign-in (oauth.py). Approving a connection takes a passphrase only you have, and sign-ins are
only handed back to Claude (claude.ai / claude.com) or to localhost. sync_course is left out
there, since it would save to the server's disk. The file cache, the whats_new marker and
sign-ins live on a volume.
Setup (once, with flyctl installed in ~/.fly/bin and logged in):
cp fly.example.toml fly.tomland pick an app name. SetMOODLE_MCP_URLto where it will be served:https://<app>.fly.dev, or your own domain (flyctl certs add).fly.tomlis ignored by git.flyctl apps create <app>andflyctl volumes create moodle_data --region cdg --size 1.sh scripts/setup_hosted.sh: creates the passphrase (Keychain itemmoodle-mcp-remote) and sends it and your Moodle key to fly as secrets, without printing either.flyctl deploy(also after code changes).On claude.ai: Settings → Connectors → Add custom connector, with your
MOODLE_MCP_URLfollowed by/mcp. When the sign-in page asks, paste the passphrase:security find-generic-password -s moodle-mcp-remote -w | pbcopy
When the Moodle key expires, renew it on your Mac: save_token.py also sends the new key to the
hosted server (the app in fly.toml), which restarts with it. The hosted server can't start a
renewal on your Mac, so it only gives the manual steps. For the one-link renewal, ask the local
server anything about Moodle instead: it uses the same key, so it gives you the link.
To disconnect every client: flyctl ssh console -C "rm /data/oauth.json", then flyctl apps restart <app>.
Configuration
Variable | Default | Purpose |
| – | Use this key instead of the Keychain (e.g. on the hosted server) |
|
| Keychain item holding the key |
|
| File cache, |
| – | Public URL; when set, serve over HTTP with OAuth sign-in |
| – | Passphrase that approves connections to the hosted server |
|
| HTTP port of the hosted server |
License
MIT, see LICENSE. PDF text extraction uses PyMuPDF, which is licensed under the AGPL-3.0 (or a commercial license from Artifex).
Available Tools
12 toolsannouncementsARead-only
Recent posts in the courses' Announcements (news) forums.
Args:
days: How far back to look.
course: Limit to one course (code like "CS-214", id, or name).
Inputs: days, course. Returns: result
course_overviewARead-only
Show a course's sections and every item in them (files, assignments, pages, links, forums...) with ids.
Args:
course: Course code like "CS-214", numeric id, or part of the name.
section: Only show sections whose number or name matches (e.g. "3" or "Semantics").
Inputs: course (required), section. Returns: result
gradesARead-only
Your grades in a course: every grade item with score, range, percentage and feedback.
Args:
course: Course code like "CS-214", numeric id, or part of the name.
Inputs: course (required). Returns: result
list_coursesARead-only
List the courses you're enrolled in, most recently visited first.
Courses hidden on your Moodle dashboard are ones you don't follow; other tools skip them
unless you name them explicitly.
Args:
include_past: Also list courses whose end date has passed.
include_hidden: Also list courses hidden on your dashboard.
Inputs: include_past, include_hidden. Returns: result
open_itemARead-only
Open any course item by id and return its content.
- file (resource): the extracted text. Long PDFs return a page map (one line per page)
first; then call again with pages="12-14" for just the pages you need
- assignment: instructions, dates, attachments, your submission status and grade
- page: its text
- forum: latest discussions (read one with read_discussion)
- folder: its files (read one with read_file)
- link (url): the target URL
- quiz: open/close dates, time limit, attempts, best grade
Args:
item_id: The [id ...] from course_overview, search or upcoming_deadlines.
pages: For PDFs, which pages to read, e.g. "1-5", "2,4,10-12" or "all".
max_chars: Maximum characters of file text to return; longer PDFs get a page map.
Inputs: item_id (required), pages, max_chars. Returns: result
read_discussionARead-only
Read a whole forum thread (all posts, oldest first).
Args:
discussion_id: The [discussion ...] id from open_item on a forum, or from announcements.
Inputs: discussion_id (required). Returns: result
read_fileARead-only
Download a Moodle file (e.g. an assignment attachment or a file in a folder) and return its text.
Long PDFs return a page map first; call again with pages="12-14" for the pages you need.
Code and text files come back as-is. On the user's Mac the file is also saved locally (path in the output).
Args:
file_url: A moodle.epfl.ch .../pluginfile.php/... URL from open_item, search_in_files or read_discussion.
pages: For PDFs, which pages to read, e.g. "1-5", "2,4,10-12" or "all".
max_chars: Maximum characters of text to return; longer PDFs get a page map.
Inputs: file_url (required), pages, max_chars. Returns: result
searchARead-only
Find course items (files, assignments, pages, links...) and sections by name across your courses.
Matches words in item names, file names and section names (accents and case ignored).
Args:
query: Words to look for, e.g. "homework 3" or "lecture 5 slides".
course: Limit to one course; by default searches all ongoing courses.
Inputs: query (required), course. Returns: result
search_in_filesARead-only
Full-text search inside course files (PDF slides, lecture notes, handouts, code) and pages.
Returns the best-matching pages with a snippet and the exact call to read them, so you can
read only the relevant pages instead of whole files. The first search in a course downloads
and indexes its files (can take a minute); later searches are instant.
Args:
query: Words that must all appear on the same page, e.g. "big-step semantics".
course: Limit to one course (recommended); by default searches all ongoing courses.
max_results: How many matching pages to return.
Inputs: query (required), course, max_results. Returns: result
sync_courseAIdempotent
Download a course's materials into a local folder, one subfolder per section.
Saves files, folder contents, assignment attachments and pages (as .md), plus an INDEX.md
listing everything with links, due dates and item ids. Only new or changed files are
downloaded, so it's cheap to run again. Nothing on Moodle is changed.
Args:
course: Course code like "CS-214", numeric id, or part of the name.
folder: Where to save. Defaults to ~/Moodle/<course code>.
max_file_mb: Skip files larger than this (e.g. lecture videos).
Inputs: course (required), folder, max_file_mb. Returns: result
upcoming_deadlinesARead-only
What's due soon: assignment/quiz deadlines plus other calendar events, with whether you still need to act.
"TODO" means Moodle still expects something from you (e.g. nothing or only a draft submitted);
"done" means it doesn't (already submitted, or nothing to hand in).
Args:
days: How many days ahead to look.
course: Limit to one course (code like "CS-214", id, or name).
include_past_days: Also show deadlines from the last N days (to catch overdue work).
Inputs: days, course, include_past_days. Returns: result
whats_newARead-only
What changed in your courses: new or edited items and files, new grades, new forum posts.
By default covers the time since you last called whats_new without `since` (or the last
7 days the first time), then remembers now as the new "last check".
Args:
since: Look back this far instead: "3d", "12h", "2w", or a date like "2026-09-20".
Doesn't move the "last check" marker.
course: Limit to one course (code like "CS-214", id, or name).
Inputs: since, 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
Most tools have clearly distinct purposes: listing courses, deadlines, course content, files, discussions, announcements, grades, search, and sync. However, open_item and read_file both handle file content, and search vs search_in_files could be confused (name search vs full-text search), though descriptions clarify the difference.
Tool names mostly follow a verb_noun pattern (list_courses, open_item, read_file, read_discussion, sync_course). Minor deviations: 'search' and 'search_in_files' are less consistent than 'search_items'/'search_files', and 'whats_new' lacks an underscore, but overall the pattern is readable and predictable.
12 tools is well-scoped for a Moodle assistant covering course browsing, deadlines, content retrieval, search, grades, announcements, and offline sync. Each tool serves a distinct workflow need without redundancy.
The surface covers the main student workflows: listing courses, viewing deadlines, reading content, searching, checking grades, and syncing. Minor gaps: no tool to submit assignments, create forum posts, or manage calendar events, but these are likely outside the server's read-oriented purpose.
Related MCP Connectors
Read-only access to Epivo's live course catalogue for AI agents.
Search university course materials, your flashcards, quizzes, streak and quota. All tools read-only.
Read your plat.plus courses, tasks, course pages, sessions, files and messages. Read-only.
Read-only Google Search Console and Google Analytics for AI agents.
Related MCP Servers
- 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.17101 npmMIT
- AlicenseAqualityCmaintenanceProvides read-only access to a university's Moodle virtual campus, letting an AI assistant browse courses, sections and files, check upcoming deadlines, view assignment status and grades, and read forum announcements and threads. Authentication uses a Moodle token stored locally, with support for both undergraduate and postgraduate campus URLs.8MIT
- AlicenseNot gradedqualityBmaintenanceEnables an AI agent to access a Moodle Campus Virtual account with the user's own credentials, reading course content, files, forums, notices, calendar, grades and quiz attempts for every enrolled course. Teachers, managers and course creators also get access to other participants' data and to planned, verified write operations such as forums, grading, attendance, quizzes, groups, content and H5P activities.4Apache 2.0
- AlicenseAqualityBmaintenanceGives AI agents read-only access to a learning platform's courses, assignment details and deadlines, and downloadable course files through the official Web Services API. It automatically works around VPN/DPI network blocking and incomplete TLS certificate chains, and deliberately offers no submission or upload tools.8MIT