Moodle Student MCP
Provides tools for querying a Moodle site as a student, including courses, assignments, grades, forums, and files.
Click on "Install 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 Student MCPWhat's due 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 Student MCP
An MCP server that lets Claude (or any MCP
client) query your Moodle as a student — no admin access required. It
uses the official Moodle mobile-app web service (moodle_mobile_app) with a
personal token, so it only sees what you already see: your courses, topics,
assignments, deadlines, grades, forums, and downloadable files.
Works with any Moodle site that has the official mobile app / web services enabled, and with any login method — a local password, or SSO via SAML/CAS/ OAuth (e.g. Google or Microsoft).
Tools
Tool | What it does |
| Confirm the token and show who you are |
| Courses you are enrolled in |
| Sections/topics and activities of a course |
| Assignments with due dates |
| Whether you submitted, grade and feedback |
| Timeline of pending work / deadlines |
| Your grades in a course |
| Forums / announcements |
| Recent posts in a forum |
| Downloadable files in a course |
| Download files to |
All read-only. Nothing is submitted or modified on Moodle.
Skills (Claude Code)
Project skills under .claude/skills/:
/moodle-tasks— prioritized weekly pending work + an execution plan for the next deadline (also cross-checks undated assignments and the "Avisos" forum for announced dates)./moodle-materials— download a course's PDFs/slides/notebooks and analyze them by reading them natively./moodle-grades— grades across courses, current standing, and what's needed to reach a target./moodle-digest— proactive briefing of what's new and what's coming (announcements, deadlines, unsubmitted work, new grades); pairs with/scheduleor/loop./moodle-study— build a study guide (summary, flashcards, practice questions) from a topic's materials.
1. Install
Requires Python 3.10+. In the project folder:
python -m venv .venv
.\.venv\Scripts\Activate.ps1 # optional, recommended
pip install -e ".[browser]" # [browser] enables automatic token capture
python -m playwright install chromium # only needed for the --browser flow2. Get the token
The server needs a Web Services token for the official mobile-app service. Pick the method that matches how you log in to Moodle.
Local-password account
If you sign in to Moodle with a username and password it validates directly:
python -m moodle_student_mcp.token_helper --url https://your-moodle-site --username USER --password PASSSSO account (SAML / CAS / OAuth — e.g. Google or Microsoft)
SSO accounts have no local password, so use the browser flow — the same way the official Moodle app authenticates.
Automatic (recommended) — opens a browser and captures the token for you:
python -m moodle_student_mcp.token_helper --url https://your-moodle-site --browserA Chromium window opens; log in normally (your institution's login, MFA if any).
The script intercepts the moodlemobile://token=... redirect, validates the
token and writes it to .env. You'll see ✅ Token OK! Logged in as: <your name>.
Manual (no Playwright):
python -m moodle_student_mcp.token_helper --url https://your-moodle-siteIt prints a .../admin/tool/mobile/launch.php?... link. Open it (logged in),
finish the login; the browser then tries to open moodlemobile://token=....
Capture it via F12 → Network → Preserve log → launch.php → Location, and paste
it back. (--paste "moodlemobile://token=..." skips the prompt.)
Already have a token (e.g. from Moodle → Preferences → Security keys)? Pass it directly with
--paste <token>.
3. Connect to Claude
Claude Code
Create a .mcp.json at the project root (copy .mcp.json.example) pointing at
your venv's Python with an absolute path (on macOS/Linux use
.venv/bin/python):
{
"mcpServers": {
"moodle-student": {
"command": "<path-to-project>/.venv/Scripts/python.exe",
"args": ["-m", "moodle_student_mcp"]
}
}
}Reload the VS Code window (or reopen Claude Code) to pick up the server; approve
the project MCP server when prompted. The token is read from .env
automatically (resolved by absolute project path, independent of the cwd).
Claude Desktop
Edit %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"moodle-student": {
"command": "<path-to-project>/.venv/Scripts/python.exe",
"args": ["-m", "moodle_student_mcp"]
}
}
}Then ask things like "What's due in the next two weeks?", "Summarize the topics of course X and what I haven't completed", "Do I have any submitted but not-yet-graded assignments?".
Security and limits
The token is like a password. It lives in
.env(git-ignored). Don't commit or share it. To revoke: Moodle → Preferences → Security keys → remove the mobile app token.Read-only, your data only — every call still goes through your account's permissions on the server.
Acceptable use: automating access to your university's Moodle, even read-only with your own account, may conflict with the institution's IT policy. Use modest request volumes and check the rules. Admins can see token usage in the web service logs.
If the token stops working (password/SSO change, expiry, maintenance), just redo step 2.
Troubleshooting
Error | Likely cause |
| Token mis-pasted / expired — redo step 2 |
| Account is SSO (no local password) — use the browser flow |
| The mobile service was disabled by the admin |
| Web services disabled on the site |
Tool returns empty | Not enrolled / no data in that course |
Development
.\.venv\Scripts\python.exe -m py_compile moodle_student_mcp\*.py # syntax check
.\.venv\Scripts\python.exe smoke_test.py # exercise tools on real dataMaintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/tcpassos/moodle-student-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server