Open-source MCP server that connects AI agents to Moodle LMS data through Moodle Web Services.
- ✓Open-source license (AGPL-3.0)
- ✓Actively maintained (<30d)
- ✓Clear description
- ✓Topics declared
- ✓Documented (README)
git clone https://github.com/csmediapro/moodle-mcp-server{
"mcpServers": {
"moodle": {
"command": "node",
"args": ["/path/to/moodle-mcp-server/dist/index.js"],
"env": {
"ANTHROPIC_API_KEY": "<anthropic_api_key>",
"OPENAI_API_KEY": "<openai_api_key>"
}
}
}
}ANTHROPIC_API_KEYOPENAI_API_KEYMCP Servers overview
# moodle-mcp-server — AI-Powered LMS Analytics
> **Ask your Moodle instance anything. Get structured answers in seconds.**
`moodle-mcp-server` is an open-source MCP (Model Context Protocol) server that connects AI agents directly to Moodle's Web Services API. It is the Moodle connector behind CSMediaPro's broader Agentic Query Layer (AQL) work.
Instead of learning report builders, writing SQL, or exporting CSVs, you ask questions in plain English — the AI agent queries your LMS and returns structured data.
**Project home:** https://csmediapro.com/products/moodle-mcp-server
**npm package:** https://www.npmjs.com/package/moodle-mcp-server-aql
**MCP Registry:** `io.github.csmediapro/moodle-mcp-server-aql`
---
## Features
- **Core query tools** — course catalog, user enrollment, assignments, category navigation, site metadata, user lookup, and cache management
- **Premium reporting plugins** — optional tools such as course completion reports and recent activity can be attached through the plugin runtime
- **LLM-agnostic** — works with Claude, GPT, Gemini, Ollama, or any MCP-compatible AI client
- **Zero LMS modification** — uses Moodle's existing Web Services API, no plugin installation required
- **Compliance-ready data handling** — secure, efficient data processing with privacy by design
- **Read-only** — never modifies Moodle data, safe for production
- **Plugin-extensible** — drop new tool modules into a directory; tools and optional agent routing hints auto-register at runtime
---
## Quick Start
### Prerequisites
- Node.js 20+
- A Moodle instance with Web Services enabled
- A Moodle API token (Site administration → Plugins → Web services → Manage tokens)
### Use With An MCP Client
Most users launch the server through an MCP client such as Claude Desktop:
```json
{
"mcpServers": {
"moodle-mcp-server-aql": {
"command": "npx",
"args": ["-y", "moodle-mcp-server-aql"],
"env": {
"MOODLE_URL": "https://your-moodle-instance.example",
"MOODLE_TOKEN": "your-moodle-web-services-token"
}
}
}
}
```
### Setup From Source
```bash
# Clone the repo
git clone https://github.com/csmediapro/moodle-mcp-server
cd moodle-mcp-server
# Install dependencies
npm install
# Configure
cp packages/server/.env.example packages/server/.env
# Edit .env: add your MOODLE_URL and MOODLE_TOKEN
# Run (stdio mode)
npm run server:build
node packages/server/dist/index.js
```
### User field schema
User field display settings are generated per Moodle instance and stored locally at
`packages/server/data/user-field-schema.json`. This file is intentionally ignored by git
because it can include site-specific custom profile fields.
After connecting to a Moodle site, run the `refresh_user_field_schema` tool once to
discover available standard and custom user fields. A minimal example shape is included
at `packages/server/data/user-field-schema.example.json`.
The `user-directory` plugin stores a normalized full-user cache with custom profile
fields flattened into top-level keys such as `school`. Once that cache exists,
`list_users` can filter cached users in memory, and `summarize_user_directory_field`
can return cached distinct values and counts. For example, "show unique schools" or
"show schools and number of users assigned to each one" summarizes the cached
`school` field without another Moodle fetch.
### Config identity
The core owns two different server identity fields:
- `server.id` — stable machine identity, for example `mcp_8f3k2q9x`
- `server.name` — human-facing display label
If `server.id` is missing, the core generates one once and persists it to the resolved config file before startup continues.
Environment overrides:
- `MOODLE_MCP_CONFIG` or `MOODLE_MCP_SERVER_CONFIG` — choose the config file path
- `SERVER_ID` — explicit `server.id` override
- `SERVER_NAME` — explicit `server.name` override
- `SERVER_VERSION` — explicit `server.version` override
If `server.id` is missing and the resolved config path is not writable, startup fails deliberately.
### Using the reference client
```bash
# From the project root
cp packages/client/.env.example packages/client/.env
npm run client:dev
# Open http://localhost:3000
```
The client will auto-detect your Moodle instance and present a chat interface where you can ask questions in plain English.
---
## Connecting an LLM
`moodle-mcp-server` needs an AI model to power the natural-language interface. You bring the model — the `moodle-mcp-server` core and reference client support any MCP-compatible provider.
### Option 1: Run Locally (Recommended for Speed & Privacy)
Running a local model keeps all data on your own hardware — nothing leaves your network. Modern quantized models run well on consumer GPUs and even CPU-only setups.
**Performance:** A quantized 24B model on a single RTX 3090 delivers ~1.5-second responses after the first query — faster than most cloud APIs once the system is initialized.
#### Via Ollama (easiest)
```bash
# Install Ollama: https://ollama.com
ollama pull gemma3:12b # Fast, reliable tool use (~200ms TTFT)
ollama pull qwen3:14b # Strong reasoning, good for complex queries
ollama pull deepseek-r1:14b # Excellent at multi-step chains
```
Then point the reference client at `http://localhost:11434` (Ollama's default).
#### Via llama.cpp (maximum control)
```bash
# Download a GGUF model (example: Devstral 24B Q4)
# Run the llama.cpp server:
llama-server -m devstral-24b-Q4_K_M.gguf --ctx-size 60000 --port 8080
```
Point the reference client at `http://localhost:8080/v1`.
#### Recommended local models
| Model | Size | Best For | Hardware |
|---|---|---|---|
| Gemma 3 12B | ~7 GB VRAM | Fast tool calls, straightforward queries | Single consumer GPU |
| Qwen 3 14B | ~8.5 GB VRAM | Complex reasoning, multi-tool chains | Single consumer GPU |
| Devstral 24B Q4 | ~14.5 GB VRAM | Maximum capability, 60K context | RTX 3090 / 4090 |
### Option 2: Cloud Providers
**Anthropic (Claude):**
```bash
export ANTHROPIC_API_KEY=sk-ant-...
```
Select "Anthropic" in the reference client's provider dropdown. Claude Sonnet offers the most reliable tool-calling behavior.
**OpenAI (GPT):**
```bash
export OPENAI_API_KEY=sk-...
```
Select "OpenAI" in the provider dropdown. GPT-4o performs well on structured queries.
**Ollama Cloud:**
Uses the same API as local Ollama, hosted at `https://ollama.com/v1`. Good middle ground — faster than local cold starts, more private than big cloud providers.
### Option 3: Claude Desktop (Direct MCP)
Claude Desktop connects to the `moodle-mcp-server` core directly over stdio — no reference client needed.
Add to your Claude Desktop config (`claude_desktop_config.json`):
```json
{
"mcpServers": {
"moodle-mcp-server": {
"command": "node",
"args": ["/path/to/moodle-mcp-server/packages/server/dist/index.js"],
"env": {
"MOODLE_URL": "https://your-moodle-instance.com",
"MOODLE_TOKEN": "your-api-token"
}
}
}
}
```
Restart Claude Desktop. The server's tools will appear in Claude's tool list — ask questions directly.
---
## Tools
### Core Tools (free, open source — AGPL)
| Tool | Description |
|---|---|
| `list_courses` | Full course catalog with category drill-down |
| `get_course` | Detail view for any course |
| `list_course_users` | Enrolled users with roles and access data (now supports course name search with interactive selection) |
| `list_assignments` | All assignments with due dates |
| `list_categories` | Full hierarchy with exact parent resolution |
| `get_site_info` | Instance overview — site name, version, course count |
| `get_user` | Detail view for a Moodle user |
| `list_user_courses` | Courses for a specific user |
| `search_users` | User search by standard Moodle identity fields |
| `search_courses_by_name` | Search for courses by name with partial matching and interactive selection |
### Premium Plugins (available separately)
- **Advanced Reporting** — gradebooks, cross-course comparison, custom report builder
- **User Analytics** — progress tracking, engagement scoring, risk flags
- **User Directory** — cached directory listing and structured filtering across standard and custom profile fields
- **Compliance Pack** — certification tracking, expiration alerts, audit exports
---
## Architecture
```
User (plain English question)
│
▼
AI Agent (Claude / GPT / Gemini / Ollama / local)
│
▼ MCP Protocol
`moodle-mcp-server`
├── Tool Registry (core + plugins)
├── Agent Runtime Config (core + plugin rules)
├── Optimized Data Layer (secure, efficient data handling)
└── Moodle Client (REST API calls)
│
▼
Moodle Web Services API
```
### Transport modes
- **Stdio** — `dist/index.js` — runs as a subprocess, used by Claude Desktop and similar clients
The OSS core intentionally ships with `stdio` only. Any network-facing wrapper, remote supervision, or premium plugin attachment belongs in a separate commercial node agent or wrapper.
### Plugin docs
- [Plugin Contract](./docs/plugins/CONTRACT.md)
- [Creating Plugins](./docs/plugins/CREATING-PLUGINS.md)
- [Hello Plugin Example](./examples/plugins/hello-plugin)
---
## License
AGPL v3 — see [LICENSE](LICENSE).
This means you can:
- ✅ Use the `moodle-mcp-server` core for free, in any environment
- ✅ Modify the source code for your needs
- ✅ Build and distribute derivative works
You cannot:
- ❌ Repackage the `moodle-mcp-server` core as a closed-source competing commercial product
- ❌ Offer it as a network service without sharing your modifications
## Trademark Notice
Moodle is a trademark of Moodle Pty Ltd. `moodle-mcp-server` is an independent CSMediaPro project and is not affiliated with, endorsed by, sponsored by, or officially connected to Moodle Pty Ltd or the Moodle project. The name is used descriptively to identify compatibility with Moodle LMS.
---
## Built by CSMediaPro
`moodle-mcp-server` is built and maWhat people ask about moodle-mcp-server
What is csmediapro/moodle-mcp-server?
+
csmediapro/moodle-mcp-server is mcp servers for the Claude AI ecosystem. Open-source MCP server that connects AI agents to Moodle LMS data through Moodle Web Services. It has 0 GitHub stars and its last recorded update is dated 2026-09-08.
How do I install moodle-mcp-server?
+
You can install moodle-mcp-server by cloning the repository (https://github.com/csmediapro/moodle-mcp-server) or following the README instructions on GitHub. ClaudeWave also provides quick install blocks on this page.
Is csmediapro/moodle-mcp-server safe to use?
+
Our security agent has analyzed csmediapro/moodle-mcp-server and assigned a Trust Score of 95/100 (tier: Verified). See the full breakdown of passed checks and flags on this page.
Who maintains csmediapro/moodle-mcp-server?
+
csmediapro/moodle-mcp-server is maintained by csmediapro. The last recorded GitHub activity is dated 2026-09-08, with 0 open issues.
Are there alternatives to moodle-mcp-server?
+
Yes. On ClaudeWave you can browse similar mcp servers at /categories/mcp, sorted by popularity or recent activity.
Deploy moodle-mcp-server to your cloud
Ship this repo to production in minutes. Each platform spins up its own environment with editable env vars.
Maintain this repo? Add a badge to your README
Drop the badge into your GitHub README to show it's tracked on ClaudeWave. Each badge links back to this page and reflects the live Trust Score.
[](https://claudewave.com/repo/csmediapro-moodle-mcp-server)<a href="https://claudewave.com/repo/csmediapro-moodle-mcp-server"><img src="https://claudewave.com/api/badge/csmediapro-moodle-mcp-server" alt="Featured on ClaudeWave: csmediapro/moodle-mcp-server" width="320" height="64" /></a>More MCP Servers
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
User-friendly AI Interface (Supports Ollama, OpenAI API, ...)
An open-source AI agent that brings the power of Gemini directly into your terminal.
Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface
The fastest path to AI-powered full stack observability, even for lean teams.
🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!