# moodle-mcp-server-aql [Health: Active]

**Category:** 🎓 Education  
**Repository:** https://github.com/csmediapro/moodle-mcp-server  
**GitHub Stars:** 1  
**npm Downloads (last month):** 630  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/moodle-mcp-server-aql

## Description
Query Moodle LMS data through natural language. Attach your agent to your LMS data.

## Tools
Capabilities this server exposes over MCP:

- **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

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "moodle-mcp-server-aql": {
    "command": "npx",
    "args": ["-y","moodle-mcp-server-aql"],
    "env": {
      "MOODLE_URL": "",
      "MOODLE_TOKEN": ""
    }
  }
}
```

**Requires environment variables:** `MOODLE_URL`, `MOODLE_TOKEN` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What moodle-mcp-server-aql does

moodle-mcp-server-aql provides an MCP interface to a Moodle instance's Web Services API. It is designed for natural-language questions that need structured LMS data, such as finding courses, checking enrollments, locating assignments, or inspecting site metadata. The core is read-only, so its tools retrieve information without modifying Moodle records.

The server follows an Agentic Query Layer design: an AI agent communicates through MCP, while the server handles the Moodle API access and exposes a defined set of query operations. Moodle remains the system of record, and the server does not require a Moodle plugin installation.

Optional plugin modules can add capabilities such as course completion reporting, recent activity, gradebook access, user analytics, directory filtering, or compliance reporting. These are separate from the open-source core and are loaded through the plugin runtime when available.

## How it works

An MCP-compatible client sends tool requests to the server after a user asks a question in natural language. The server uses the configured Moodle URL and API token to query the LMS, then returns structured results to the agent. The core tools are read-only and intended to respect the access available through the Moodle API token.

The server uses stdio for direct MCP connections. A reference web client is also included in the project; it can provide a chat interface and connect to providers including Anthropic, OpenAI, Ollama, or other MCP-compatible model setups. The model itself is supplied by the client or reference application rather than by the MCP server.

## Setup and configuration

Running the server requires Node.js 20 or newer, a Moodle installation with Web Services enabled, and a Moodle API token. The token is created in Moodle under Site administration, Plugins, Web services, and Manage tokens.

The simplest client configuration launches the package with `npx` and supplies these environment variables:

- `MOODLE_URL`: URL of the Moodle instance.
- `MOODLE_TOKEN`: Moodle Web Services API token.

From source, install the project dependencies, copy the server environment template, set the Moodle values, build the server, and run the generated Node entry point. Claude Desktop can connect directly over stdio using either the package command or a locally built server path.

The server also supports configuration identity overrides. `MOODLE_MCP_CONFIG` and `MOODLE_MCP_SERVER_CONFIG` select the configuration file, while `SERVER_ID`, `SERVER_NAME`, and `SERVER_VERSION` override identity fields. After connecting to a Moodle site, `refresh_user_field_schema` can discover standard and custom user fields and store the resulting schema locally.

## Tools and capabilities

Core tools include:

- `list_courses` for the course catalog and category drill-down.
- `get_course` for details about a specific course.
- `list_course_users` for enrolled users, roles, and access data; course-name search can lead to interactive selection.
- `list_assignments` for assignments and due dates.
- `list_categories` for the category hierarchy and parent relationships.
- `get_site_info` for the site name, Moodle version, and course count.
- `get_user` for Moodle user details.
- `list_user_courses` for courses associated with a user.
- `search_users` for standard Moodle identity-field searches.
- `search_courses_by_name` for partial course-name matching and selection.

Plugin support allows additional tool modules to be placed in a plugin directory and registered at runtime. Separate plugins cover reporting, analytics, directory, and compliance scenarios.

## Limitations and notes

The core only reads Moodle data; it is not an authoring or administration interface for changing courses, users, assignments, or other LMS records. Access depends on the permissions associated with the Moodle API token. Optional premium plugins are separate from the core tool set, and a model or MCP client must be provided to turn natural-language questions into tool calls.

_Full upstream README: https://allmcps.com/mcp/moodle-mcp-server-aql/readme_

