Teach your agent Moodle

One static Rust binary. Twenty typed tools, plus an opt-in escape hatch to every Moodle web service. Document conversion and an auth CLI in the box — speaking the Model Context Protocol over stdio.

Model Context Protocol

Works with Claude Code, Codex, OpenCode, and pi · Moodle 3.7 → 5.x

Curated

22 human-shaped tools that mirror how you already click through Moodle — not a dump of 350 raw web-service functions.

Agent-native

Tools trade local file paths, not base64 blobs. Every result embeds the IDs for the next call. Errors suggest the fix.

Safe by default

Write tools ask before they act. Submissions stay drafts until you say finalize. Quiz-taking is intentionally missing.

Follow a full run

get_schedule · next 14 days

MON 20HW2 released

THU 23Quiz 3 closes 23:59

TUE 28Lab report due

FRI 31HW1 · final deadline

Deadline sweep

One call merges every due date, quiz close, and course event into a single timeline your agent can plan a study week around.

journey · brief → draft

✓ get_assignment brief + attachments

✓ fetch_file hw1.pdf → markdown

● agent drafting answers

○ upload_file draft.md

○ submit_assignment finalize=false

Assignment autopilot

From brief to draft: read the assignment, convert the attached PDF, work the problems, upload, and submit a draft — then read it back to verify.

Course map

get_course_overview merges five endpoints into one markdown map, every ID and file URL embedded.

PDF → markdown

Assignment briefs become readable requirements — math, tables, and slides included.

Grades & feedback

Cross-course summaries or every grade item of one course, weights and comments included.

Forums & messaging

Catch up on announcement threads, then draft a message to your teacher — with confirmation.

Escape hatch

Opt in with MOODLE_ENABLE_WS_FUNCTION=true and call_ws_function reaches every other enabled web-service function your token can call.

Version-adaptive

Built against Moodle 3.7 and designed through 5.x — response differences are absorbed for you.

Open Source

moodle-mcp is MIT-licensed and built in the open. Its tests run fully offline; its release binaries are reproducible from CI.

21Stars
1Forks
2Contributors
5Releases

One prompt, the whole journey

moodle-mcp doesn't lock your agent into one vendor flow — it gives every MCP client typed tools that chain on their own.

One question, one call. The agent merges deadlines across every enrolled course into a plan that fits your week.

The full loop: read the brief, convert the attached PDF, work the problems, upload the solution, submit a draft, verify.

Missed a week? The agent reads notifications and forum threads, then hands you a digest with links back to the source.

Opt in with MOODLE_ENABLE_WS_FUNCTION=true and the escape hatch opens the full web-service surface your token allows — anything the curated tools don't cover.

get_schedule{ days: 14 }→6 deadlines · 2 quiz closes

get_course_overview{ course_id: 42 }→section map + materials

A study plan, balanced against real due dates.

get_assignment{ assignment_id: 917 }→brief + hw1.pdf

fetch_file{ url: …pluginfile… }→4,812 chars of markdown

upload_file{ path: 'draft.md' }→item_id 55210

submit_assignment{ finalize: false }→draft saved ✓

A draft in your draft area — final submit stays yours.

get_notifications{ limit: 20 }→3 announcements

get_forum_discussions{ forum_id: 301 }→12 threads

get_discussion_posts{ discussion_id: 5 }→thread as markdown

Every announcement, summarized and sourced.

list_ws_functions{ query: 'calendar' }→core_calendar_create_events …

call_ws_function{ wsfunction: …, params }→typed JSON, nulls stripped

~350 functions, PHP bracket notation handled.

20 curated tools

Typed tools that mirror the student journey — courses, assignments, files, forums, grades, messaging — with an opt-in escape hatch for the rest.

whoamiread

Token owner identity + site release.

the agent, on your behalf

list_coursesread

Enrolled courses, optional name filter.

the agent, on your behalf

get_course_overviewread

Whole-course markdown map in one call.

the agent, on your behalf

get_assignmentread

Full assignment document: brief, files, state.

the agent, on your behalf

fetch_fileread

PDF/DOCX/PPTX/XLSX → markdown.

the agent, on your behalf

download_fileread

Raw bytes → a local path.

the agent, on your behalf

upload_filewrite

Local file → your private draft area.

the agent, on your behalf

submit_assignmentwrite

Submit text and/or draft files; draft-first.

the agent, on your behalf

get_forum_discussionsread

Thread list with opening-post previews.

the agent, on your behalf

get_discussion_postsread

Whole thread as markdown.

the agent, on your behalf

create_forum_discussionwrite

Start a thread.

the agent, on your behalf

reply_to_discussionwrite

Reply to a post or thread.

the agent, on your behalf

get_gradesread

Cross-course summary or per-course items.

the agent, on your behalf

get_scheduleread

Merged deadline timeline, next 30 days.

the agent, on your behalf

get_notificationsread

Recent notifications, read filter.

the agent, on your behalf

get_conversationsread

Conversations with member ids.

the agent, on your behalf

send_messagewrite

Direct message — confirms with you first.

the agent, on your behalf

get_quiz_attemptsread

Attempt records, read-only.

the agent, on your behalf

get_userread

Profile lookup.

the agent, on your behalf

search_usersread

User search.

the agent, on your behalf

call_ws_functionwrite

Opt-in escape hatch: any enabled WS function.

the agent, on your behalf

list_ws_functionsread

Opt-in discovery: callable web-service functions by keyword.

the agent, on your behalf

Hardened by default

The token is a live credential — it carries your full student permissions. The server treats it that way before your agent says a word.

The token is injected only into same-site pluginfile URLs, and redirects that leave your Moodle host are stopped. It never appears in tool output or errors.

Plain HTTP is rejected unless the host is loopback — or you set MOODLE_ALLOW_HTTP yourself, for isolated networks where you accept the risk.

100 MB inline fetches, 500 MB streamed downloads, 100 MB uploads. Downloads stream to disk, bounded by a read timeout so stalled connections still die.

MOODLE_READ_ONLY=1 removes every write tool before the agent ever sees them. Nothing you say in a prompt can bring them back.

tool output — redaction built in

error: request failed url=https://moodle.example.com/webservice/rest/server.php

&token=[REDACTED]→ hint: check MOODLE_URL has no trailing slash

stdout stays clean — logs go to stderr, data to stdout

HTTPS-first

Cleartext URLs are rejected; loopback test sites stay exempt.

Host-locked redirects

A redirect off your Moodle host never carries the token, and site redirects never drop to plain http.

Redacted errors

Any token in a rendered message becomes token=[REDACTED].

Draft-first writes

Uploads land in your draft area; finalizing is explicit.

No quiz-taking

Attempt records are readable; answering for you is not provided.

Same-site files only

fetch_file and download_file stay on your site unless you opt out.

Read-only mode

One env var hides all six write tools from the tool list.

Timezone-aware

Timestamps render in the zone Moodle itself uses for you.

A LETTER

From the maintainer

Studying with an agent shouldn't mean five browser tabs, hand-download PDFs, and copy-pasted forum threads. moodle-mcp started as a way to hand my own coursework agent the same access the official mobile app has — no scraping, no browser automation, just the web services Moodle already exposes.


Everything ships in one static Rust binary: 22 typed tools, document conversion, and an auth CLI. Writes ask first, drafts come before finals, and quiz-taking stays out on purpose. If that trade sounds right to you, install it and ask your agent what's due.

G36maid

maintainer

---
moodle-mcp icon

Your Moodle, one prompt away

Single binary. Twenty tools. Zero browser tabs.

or cargo install moodle-mcp — needs Rust 1.88+