mcp server
MCP-LMS-OSS
The gole of this project is to build the MCP server around the open sourse learning management platform, also this will act as reference for the blog on MCP related blog on jayantkhd.vencel.app
Set up
Runs on your computer. Pick your agent and operating system.
This project does not publish an install method we can turn into a config. Follow the README instead.
README
synced Oct 22, 2026MCP-LMS-OSS
A production-grade MCP (Model Context Protocol) server wrapping a self-hosted Moodle LMS — exposing role-gated tools, resources, and prompts to any AI client (Claude Desktop, Claude Code, Cursor, and more).
📝 This repo doubles as the reference implementation for a blog series on MCP at jayantkhd.vercel.app.
What makes this different from a toy MCP server
- Role-gated tool lists — a student and a teacher connecting to the same server see different tools. A learner's client never even sees
create_course. - Real auth, done twice — first with Moodle web-service token mapping, then the full MCP OAuth 2.1 spec (Keycloak, Protected Resource Metadata, scopes, Dynamic Client Registration).
- All three MCP primitives — tools, resources (
course://{id},quiz://{id}), and prompts (quiz_me,study_plan). - Clean tools over a messy legacy API — Moodle's Web Services API is famously clunky; the MCP layer is where the design work lives.
Architecture
AI client ──(stdio → Streamable HTTP + OAuth 2.1)──▶ MCP Server (Python/FastMCP)
│
Moodle Web Services (REST)
▼
Moodle + DB (Docker Compose)
(+ Keycloak IdP in Phase 5)
Repo layout
| Path | What |
|---|---|
CLAUDE.md | Full project plan, locked decisions, phase roadmap |
docker/ | Docker Compose for Moodle + DB (+ Keycloak later) |
mcp_server/ | The MCP server (Python, FastMCP, uv-managed) |
docs/briefs/ | Per-phase blog briefs — the posts themselves are published on the blog, not here |
notes/ | API cheat-sheets, gotchas, decisions |
Status
🚧 Phase 1 complete — Moodle 5.2.1 running in Docker Compose with a fully scripted seed (courses, weighted quiz, test users, Web Services + REST tokens). Next up: exploring the Moodle API by hand, then the MCP server itself.
See the phased plan in CLAUDE.md for the full roadmap.
Quick start
cd docker
cp .env.example .env # edit passwords (no spaces in MOODLE_SITENAME!)
docker compose up -d # first boot auto-installs Moodle (~2-3 min)
# seed: web services, users, courses, content, quiz, API tokens
docker compose cp seed/seed_phase1.php moodle:/tmp/
docker compose exec -T moodle php /tmp/seed_phase1.php
docker compose cp seed/seed_phase1_content.php moodle:/tmp/
docker compose exec -T moodle php /tmp/seed_phase1_content.php
Moodle at http://localhost:8080 — full steps and smoke tests in notes/phase-1-seed-plan.md.
License
MIT for the code in this repo. Moodle itself is GPL and is not redistributed here — the compose files pull official/community images.