Moodle MCP Server
Enables AI assistants to interact with Moodle LMS via browser automation, using a server and browser extension to keep credentials local and route commands securely.
README
Moodle MCP
A bridge that lets AI assistants interact with Moodle LMS through your browser. Works with any Moodle instance—including those using SSO/LDAP—because it uses your existing browser session.
Architecture
┌─────────────────────────────────────────────────────────────────────────┐
│ YOUR MACHINE │
├─────────────────────────────────────────────────────────────────────────┤
│ ┌────────────────┐ ┌────────────────────────────────────┐ │
│ │ AI Assistant │ │ Browser (Chrome/Edge) │ │
│ │ (Claude, │ │ ┌──────────────────────────────┐ │ │
│ │ Cursor, etc) │ │ │ Your Moodle (logged in) │ │ │
│ └───────┬────────┘ │ └──────────────────────────────┘ │ │
│ │ MCP Protocol │ ┌──────────────────────────────┐ │ │
│ │ │ │ Browser Extension │ │ │
│ │ │ │ (executes commands securely) │ │ │
│ │ │ └─────────────┬────────────────┘ │ │
└──────────┼───────────────────────┼────────────────┼───────────────────┘
│ │ │ WebSocket
▼ │ ▼
┌──────────────────────────────────┴────────────────────────────────────┐
│ Moodle MCP Server (Hosted) │
│ Routes commands · Never sees your credentials │
└───────────────────────────────────────────────────────────────────────┘
Key principle: Your Moodle credentials never leave your browser. The server only routes commands between your AI assistant and the browser extension.
Components
| Component | Description |
|---|---|
Server (server/) |
Hono-based Node.js server with Google OAuth, JWT auth, WebSocket bridge |
Browser Extension (browser-extension/) |
Chrome extension that executes MCP commands in your Moodle session |
MCP Remote (mcp-remote/) |
Generic stdio-to-HTTP bridge for MCP clients that only support stdio |
Quick Start
For Users (Hosted Service)
- Sign up at the hosted service (get URL from your administrator)
- Get API key from the dashboard
- Install extension from the dashboard
- Configure AI client (see Setup Guide)
For Developers (Local)
# Clone and install
git clone https://github.com/arunlakhotia/moodle-mcp.git
cd moodle-mcp/server
npm install
# Configure environment
cp env.example .env
# Edit .env with your Google OAuth credentials
# Start server
npm run dev
Then:
- Load
browser-extension/in Chrome (chrome://extensions→ Developer mode → Load unpacked) - Visit
http://localhost:8080/devto create test credentials - Configure your AI client (see below)
AI Client Configuration
Cursor IDE (with stdio bridge)
Cursor requires stdio-based MCP servers. Use the mcp-remote bridge:
cd mcp-remote && npm install
Add to .cursor/mcp.json:
{
"mcpServers": {
"moodle": {
"command": "npx",
"args": ["tsx", "/path/to/moodle-mcp/mcp-remote/src/index.ts"],
"env": {
"MCP_SERVER_URL": "http://localhost:8080",
"MCP_API_KEY": "your-api-key"
}
}
}
}
Claude Desktop (SSE transport)
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"moodle": {
"transport": {
"type": "sse",
"url": "http://localhost:8080/mcp/sse"
},
"headers": {
"Authorization": "Bearer your-api-key"
}
}
}
}
Available Tools
Navigation & Content
| Tool | Description |
|---|---|
browse_moodle |
Navigate to any Moodle URL |
extract_page_content |
Get content from current page |
click_element |
Click elements on the page |
type_text |
Type into input fields |
set_editor_content |
Set HTML in Moodle rich text editors |
Courses
| Tool | Description |
|---|---|
get_courses |
List your enrolled courses |
open_course |
Navigate to a specific course |
get_course_content |
Get course activities and resources |
get_course_sections |
Get section IDs and names |
Participants & Users
| Tool | Description |
|---|---|
list_participants |
List enrolled users with roles |
get_enrolled_users |
Get enrolled user details |
send_message |
Send direct message to a user |
bulk_send_message |
Send message to multiple users |
Assignments
| Tool | Description |
|---|---|
list_assignments |
List assignments with due dates |
get_assignment |
Get assignment details |
get_assignment_submissions |
Get submission status |
create_assignment |
Create new assignment |
edit_assignment |
Modify assignment settings |
extend_assignment_deadline |
Grant deadline extension |
bulk_shift_deadlines |
Shift multiple deadlines |
Forums
| Tool | Description |
|---|---|
forum_list_discussions |
List forum discussions |
find_forum_discussion |
Search discussions by subject |
create_forum_post |
Create new discussion |
delete_forum_discussion |
Delete a discussion |
analyze_forum |
Get participation statistics |
Feedback Activities
| Tool | Description |
|---|---|
find_activity |
Find any activity by name/type |
analyze_feedback |
Get response statistics |
Course Management
| Tool | Description |
|---|---|
edit_section |
Rename course sections |
add_section |
Add new sections |
delete_section |
Remove sections |
hide_section |
Show/hide sections |
move_section |
Reorder sections |
enable_editing |
Enable editing mode |
Security & Privacy
- 🔐 Credentials stay local — Your Moodle session never leaves your browser
- 🔑 API keys are hashed — Server stores only hashes
- 🚫 No data storage — Server routes commands only
- 🔒 HTTPS/WSS — All traffic encrypted in production
- 🎓 FERPA Compliant — Student PII is masked before reaching AI services
Student Data Protection
Moodle MCP protects student privacy through automatic PII masking:
Your Browser Cloud Server AI Service
───────────── ──────────── ──────────
"John Smith" → "M12345_name" → "M12345_name"
(real name) (masked token) (masked token)
Student names, emails, and IDs are replaced with anonymous tokens before leaving your browser. The AI never sees real student information. Learn more →
Documentation
- Setup Guide — Detailed setup for various AI clients
- Deployment Guide — Self-hosting the server
- Architecture — Technical details
- FERPA Compliance — Student data privacy & protection
- Privacy Quick Reference — One-page privacy summary
License
MIT License — see LICENSE
Acknowledgments
- Model Context Protocol by Anthropic
- Moodle Learning Management System
- University of Louisiana at Lafayette
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.