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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。