MCP server exposing Moodle Web Services to AI assistants (Claude, Cursor, etc.)
Project description
mcp-moodle
An MCP server that exposes Moodle Web Services to any MCP-compatible AI assistant — Claude Code, Claude Desktop, Cursor, Codex, and others.
Ask your assistant things like "what's due this week?", "list my courses", "download the slides from CS101 week 3" — without leaving the chat.
Features
site_info— verify the token and get the authenticated userlist_my_courses— courses you're enrolled inget_course_contents— sections, modules, file URLssearch_courses— search the public cataloglist_assignments— assignments across one or all coursesupcoming_events— calendar deadlines and sessionsget_user_grades— your grades for a coursedownload_file— save any Moodle file locally (token appended automatically)
Works with any Moodle 3.5+ instance that has Web Services enabled.
Install
The recommended way is uv — no virtualenv to manage:
# One-off run (no install)
uvx mcp-moodle
# Or persist as a tool
uv tool install mcp-moodle
Plain pip works too:
pip install mcp-moodle
Get a token
Moodle Web Services require a personal token. The package ships a helper that handles every common login flow — native accounts, SSO (Microsoft, Google, SAML, OAuth), or manual paste:
# Default: opens a Chromium window, you complete SSO, token is captured
uvx --from "mcp-moodle[token]" mcp-moodle-token https://moodle.example.org
# Native (non-SSO) account
uvx --from "mcp-moodle[token]" mcp-moodle-token https://moodle.example.org \
--method local --user jdoe
# Headless server fallback (paste the moodlemobile:// URL by hand)
uvx --from "mcp-moodle[token]" mcp-moodle-token https://moodle.example.org \
--method manual-mobile
The token is written to ./.env (chmod 600) as MOODLE_URL and MOODLE_TOKEN.
Pass --stdout to print it to stdout instead.
The
[token]extra pulls in Playwright. First run downloads Chromium (~150 MB, one-time). Skip the extra if you only ever use--method local,--method web, or--method manual-mobile.
Configure your MCP client
Claude Code
claude mcp add moodle \
--env MOODLE_URL=https://moodle.example.org \
--env MOODLE_TOKEN=your_token_here \
-- uvx mcp-moodle
Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json
(macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"moodle": {
"command": "uvx",
"args": ["mcp-moodle"],
"env": {
"MOODLE_URL": "https://moodle.example.org",
"MOODLE_TOKEN": "your_token_here"
}
}
}
}
Cursor / other clients
Any MCP client that supports stdio servers works the same way: command
uvx, args ["mcp-moodle"], env MOODLE_URL and MOODLE_TOKEN.
Verify it works
In your MCP client, ask: "call the moodle site_info tool". You should see your name, username, and the site URL.
Development
git clone git@github.com:Snaw80/moodle-mcp.git
cd moodle-mcp
uv sync --all-extras
uv run mcp-moodle
Security notes
- Your token is the equivalent of a password for Moodle Web Services — keep
.envout of version control (the included.gitignorealready does this). - The server reads
MOODLE_TOKENfrom the environment and never logs it. download_fileappends the token to the URL; that URL is not logged either, but be mindful if your client echoes tool arguments.
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_moodle-0.1.1.tar.gz.
File metadata
- Download URL: mcp_moodle-0.1.1.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
058a70e7bcb05767c3ca27f13c1ab50d3dc2dc654585b2702b8d8082d98a05f8
|
|
| MD5 |
00636f8976528b4ea6dee19d7493ccb7
|
|
| BLAKE2b-256 |
a539146587a43c6d179a8b36b18844600127302028a3ecfa6571ff4bd3ba05ca
|
Provenance
The following attestation bundles were made for mcp_moodle-0.1.1.tar.gz:
Publisher:
release.yml on Snaw80/moodle-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_moodle-0.1.1.tar.gz -
Subject digest:
058a70e7bcb05767c3ca27f13c1ab50d3dc2dc654585b2702b8d8082d98a05f8 - Sigstore transparency entry: 1572848666
- Sigstore integration time:
-
Permalink:
Snaw80/moodle-mcp@9330cf267142dab05cc4babcf3af0d54f4686af0 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Snaw80
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9330cf267142dab05cc4babcf3af0d54f4686af0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mcp_moodle-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mcp_moodle-0.1.1-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6b7c2ebe43e03506d2db3c843c9717471adb3f842b26f5ea095443a507f5467
|
|
| MD5 |
abce8738d8f11fa87c47e6ceb822018a
|
|
| BLAKE2b-256 |
558a70d0359a3f36179a3736c43de3d4a3184997f314e396b9436650259e4941
|
Provenance
The following attestation bundles were made for mcp_moodle-0.1.1-py3-none-any.whl:
Publisher:
release.yml on Snaw80/moodle-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_moodle-0.1.1-py3-none-any.whl -
Subject digest:
b6b7c2ebe43e03506d2db3c843c9717471adb3f842b26f5ea095443a507f5467 - Sigstore transparency entry: 1572848678
- Sigstore integration time:
-
Permalink:
Snaw80/moodle-mcp@9330cf267142dab05cc4babcf3af0d54f4686af0 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Snaw80
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9330cf267142dab05cc4babcf3af0d54f4686af0 -
Trigger Event:
push
-
Statement type: