
Moodle Mcp Server Aql
io.github.csmediapro由 GitHub 账号 csmediapro 发布v0.1.6更新于 Oct 24, 2026
Query Moodle LMS data through natural language. Attach your agent to your LMS data.
概览
让助手用自然语言查询 Moodle LMS 数据,包括课程、选课、作业、分类和用户,通过 Moodle Web Services API 获取。
- 可以做什么
- 将 AI 代理连接到 Moodle 实例的 Web Services API,并提供只读查询工具。核心工具涵盖课程目录与分类下钻、课程详情、已选课用户及其角色、作业与截止日期、分类层级、站点元数据、用户详情、某用户的课程、用户搜索以及按名称搜索课程。另有刷新工具用于发现标准与自定义用户资料字段。可选付费插件可增加报表、分析、目录与合规工具。
- 适用场景
- 适合需要询问 Moodle 站点情况时使用,例如课程列表、选课人员、有哪些作业、站点信息,而无需构建报表、编写 SQL 或导出 CSV。适用于已具备 Moodle Web Services 访问权限并拥有兼容 MCP 客户端的管理员、教师或支持人员。
- 运行要求
- 通过 npm 包 moodle-mcp-server-aql 以 stdio 方式在本地运行,需要 Node.js 20+。需要一个已启用 Web Services 的 Moodle 实例,以及 Moodle Web Services API 令牌,通过 MOODLE_TOKEN 密钥和 MOODLE_URL 基础地址提供。自然语言界面需要兼容 MCP 的 AI 客户端或模型提供方。仅支持桌面端。
安装
在 SourceWeft 中
- 打开 控制台中的 Moodle Mcp Server Aql,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
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 first reference implementation of the Agentic Query Layer (AQL) pattern — a software design pattern for giving large language models safe, permission-aware, read-only access to structured data.
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.
AQL pattern: https://csmediapro.com/notes/agentic-query-layer
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:
Setup From Source
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.
Separately installed plugins can use this schema to flatten custom profile fields
into stable keys such as school. The premium user-directory plugin, for example,
uses it to cache and summarize full-user directory fields outside the OSS core.
Config identity
The core owns two different server identity fields:
server.id— stable machine identity, for examplemcp_8f3k2q9xserver.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_CONFIGorMOODLE_MCP_SERVER_CONFIG— choose the config file pathSERVER_ID— explicitserver.idoverrideSERVER_NAME— explicitserver.nameoverrideSERVER_VERSION— explicitserver.versionoverride
If server.id is missing and the resolved config path is not writable, startup fails deliberately.
Using the reference client
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)
Then point the reference client at http://localhost:11434 (Ollama's default).
Via llama.cpp (maximum control)
Point the reference client at http://localhost:8080/v1.
Recommended local models
Option 2: Cloud Providers
Anthropic (Claude):
Select "Anthropic" in the reference client's provider dropdown. Claude Sonnet offers the most reliable tool-calling behavior.
OpenAI (GPT):
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):
Restart Claude Desktop. The server's tools will appear in Claude's tool list — ask questions directly.
Tools
Core Tools (free, open source — AGPL)
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
This project is a reference implementation of the Agentic Query Layer (AQL) pattern — a layer that sits between an AI agent and your data, providing permission-aware, read-only, plain-language access without exposing the underlying data to the model.
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
License
AGPL v3 — see LICENSE.
This means you can:
- ✅ Use the
moodle-mcp-servercore for free, in any environment - ✅ Modify the source code for your needs
- ✅ Build and distribute derivative works
You cannot:
- ❌ Repackage the
moodle-mcp-servercore 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 maintained by CSMediaPro, a software development company specializing in AI integration, systems engineering, and workflow automation. It is the first reference implementation of the Agentic Query Layer (AQL) pattern.
- AQL pattern: https://csmediapro.com/notes/agentic-query-layer
- Contact: [email protected]
来源:README.md,提交 9d7e300
工具
0版本历史
3- v0.1.6最新Sep 26, 2026
- v0.1.5Sep 26, 2026
- v0.1.4Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分