Moodle MCP Server
Read-only access to a Moodle instance, exposing courses, assignments (with due dates, status, and submission URLs), calendar events, announcements, course materials, and participant lists through browser automation with persistent CAS-authenticated sessions.
Click on "Deploy 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 MCP Serverwhat assignments are due this week?"
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 MCP Server
A read-only MCP (Model Context Protocol) server for IIIT Hyderabad's Moodle instance. Exposes courses, assignments, calendar events, announcements, and more via browser automation with persistent CAS-authenticated sessions.
Features
Phase 1: Core Tools ✓
check_health— Service status and authentication statecheck_session— Verify authentication (never logs secrets)get_courses— Enrolled courses with filteringget_assignments— Assignments with due dates, status, and submission URLsget_calendar— Upcoming calendar events with event types
Phase 2: Enhanced Tools ✓
get_course— Full course detail with sections, resources, and tabsget_announcements— Course and site-wide announcementsget_course_materials— Lectures, files, and links organized by sectionget_participants— Enrolled students and instructors
Related MCP server: dutic-mcp
Installation
Prerequisites
Python 3.9+
Raspberry Pi 4B with 4GB RAM (tested on Debian 13, aarch64) or Windows/Mac/Linux
Chromium (bundled with Playwright)
Setup
# 1. Clone or download the project
git clone https://github.com/blank6890/moodle-mcp-server.git
cd moodle-mcp-server
# 2. Create a virtual environment
python -m venv venv
# Linux/Mac
source venv/bin/activate
# Windows
.\venv\Scripts\activate
# 3. Install dependencies
pip install -r requirements.txt
# 4. Install Playwright Chromium
playwright install chromiumQuick Start
Step 1: Interactive Login
Login to Moodle via CAS SSO in a visible browser window:
python scripts/login.pyThis script:
Launches a visible browser window
Waits for you to complete CAS login (username, password, MFA, CAPTCHA)
Saves session cookies to
./session/state.json(persistent profile)Prints confirmation when done
Timeout: 5 minutes. If you need more time, run the script again.
Step 2: Use in Claude Code
Run this command inside the project directory to add the MCP server to Claude Code:
claude mcp add moodle python -s local -e SESSION_DIR=./session -e PYTHONPATH=. -- -m app.mainStep 3: Start the MCP Server (Alternative manual start)
# stdio transport
python app/main.py
# SSE transport
python app/main.py --sseClaude Skill
This repository includes a skill file (.claude/skills/moodle.md) that teaches Claude how to use the MCP tools seamlessly. By invoking the skill or asking about courses/deadlines, Claude automatically aggregates data via the MCP endpoints and formats them beautifully!
Configuration
Set environment variables to customize behavior:
Variable | Default | Description |
|
| Bind address (SSE mode only) |
|
| Bind port (SSE mode only) |
|
| Moodle instance URL |
|
| CAS SSO login URL |
|
| Browser profile persistence |
|
| HTML dump directory |
|
| In-memory cache TTL (seconds) |
|
| Min delay between requests (seconds) |
Security Model
No Password Storage — Passwords never enter the system. Only CAS session cookies are saved natively by Playwright.
Interactive Auth — User completes CAS login in a visible browser; no automation of MFA/CAPTCHA.
Read-Only — The integration strictly fetches DOM structures without engaging in POST forms or destructive actions.
Troubleshooting
Session Expired
Error: Redirected to CAS login at https://login.iiit.ac.in...
Solution: The session has naturally expired. Rerun the login script to re-authenticate:
python scripts/login.pyThis server cannot be deployed
Maintenance
Related MCP Connectors
Read-only MCP server for ClassQuill, a tutoring-business-management platform.
OAuth-protected, read-only-by-default MCP server for provenance-labeled QuillCaddie project memory.
MCP server for the Inistate platform: module discovery, entry management, and activity submission.
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP server that turns UPB Virtual (Moodle) into a structured knowledge source, enabling AI assistants to query courses, assignments, deadlines, announcements, and sync materials via REST API.MIT
- AlicenseAqualityBmaintenanceMCP server for the DUTIC virtual classroom (Moodle) at UNSA. Allows viewing tasks (including hidden ones), courses, resources, and downloading files, from terminal or AI agents.24172 npmMIT
- AlicenseAqualityAmaintenanceRead-only MCP server for Canvas LMS that exposes tools to list courses, assignments, grades, submissions, syllabi, announcements, modules, pages, and files, without any write operations.1111 npm1MIT
- AlicenseAqualityAmaintenanceRead-only MCP server for Canvas LMS that works without API tokens by using session cookies, enabling AI assistants to access courses, assignments, grades, announcements, and more.3012 npm1MIT