Moodle Student MCP

Moodle Student MCP

Enables read-only querying of Moodle as a student, including courses, assignments, grades, forums, and files, using a personal web services token.

Category
Visit Server

README

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
whoami Confirm the token and show who you are
list_courses Courses you are enrolled in
get_course_contents(course_id) Sections/topics and activities of a course
list_assignments(course_ids?) Assignments with due dates
get_submission_status(assign_id) Whether you submitted, grade and feedback
get_upcoming_deadlines(days=30) Timeline of pending work / deadlines
get_grades(course_id) Your grades in a course
list_forums(course_ids?) Forums / announcements
get_forum_discussions(forum_id) Recent posts in a forum
list_files(course_id) Downloadable files in a course
download_files(course_id, fileurls?) Download files to materials/

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 /schedule or /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 flow

2. 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 PASS

SSO 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 --browser

A 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-site

It 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
invalidtoken on validate Token mis-pasted / expired — redo step 2
invalidlogin in password flow Account is SSO (no local password) — use the browser flow
servicenotavailable The mobile service was disabled by the admin
enablewsdescription 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 data

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured