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.

已驗證STDIO僅桌面知識與記憶資料與分析

概覽

AI 產生的概覽

讓助理以自然語言查詢 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 用戶端或模型供應方。僅支援桌面端。
安裝前請注意
需要 MOODLE_TOKEN 密鑰與 MOODLE_URL;該權杖可存取你的 LMS 資料,應將其限定為唯讀服務帳號,並避免放入共用設定。此伺服器聲明為唯讀,不會修改 Moodle 資料,但它會把查詢與回傳的 LMS 資料傳送給你所連接的 AI 模型或供應方,使用本機模型可讓資料留在你的網路內。選用的付費外掛需另行安裝,可能會在本機快取使用者目錄資料。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Moodle Mcp Server Aql,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

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:

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 repogit clone https://github.com/csmediapro/moodle-mcp-servercd moodle-mcp-server
# Install dependenciesnpm install
# Configurecp packages/server/.env.example packages/server/.env# Edit .env: add your MOODLE_URL and MOODLE_TOKEN
# Run (stdio mode)npm run server:buildnode 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.

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 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 rootcp packages/client/.env.example packages/client/.envnpm 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.comollama pull gemma3:12b      # Fast, reliable tool use (~200ms TTFT)ollama pull qwen3:14b       # Strong reasoning, good for complex queriesollama 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
ModelSizeBest ForHardware
Gemma 3 12B~7 GB VRAMFast tool calls, straightforward queriesSingle consumer GPU
Qwen 3 14B~8.5 GB VRAMComplex reasoning, multi-tool chainsSingle consumer GPU
Devstral 24B Q4~14.5 GB VRAMMaximum capability, 60K contextRTX 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)

ToolDescription
list_coursesFull course catalog with category drill-down
get_courseDetail view for any course
list_course_usersEnrolled users with roles and access data (now supports course name search with interactive selection)
list_assignmentsAll assignments with due dates
list_categoriesFull hierarchy with exact parent resolution
get_site_infoInstance overview — site name, version, course count
get_userDetail view for a Moodle user
list_user_coursesCourses for a specific user
search_usersUser search by standard Moodle identity fields
search_courses_by_nameSearch 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

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.

User (plain English question)    │    ▼AI Agent (Claude / GPT / Gemini / Ollama / local)    │    ▼  MCP Protocol`moodle-mcp-server`  ← AQL connector for Moodle    ├── 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


License

AGPL v3 — see 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 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.

來源:README.md,提交 9d7e300

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

3
  1. v0.1.6最新Sep 26, 2026
  2. v0.1.5Sep 26, 2026
  3. v0.1.4Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分