# moodle-mcp-server-aql

Open-source MCP server for querying Moodle LMS data through natural language. Attach your agent to your LMS data.

This package provides the stdio MCP server from the `moodle-mcp-server` repository.

Project page: https://csmediapro.com/products/moodle-mcp-server

## Use With An MCP Client

Most users launch the server through an MCP client such as Claude Desktop:

```json
{
  "mcpServers": {
    "moodle-mcp-server": {
      "command": "npx",
      "args": ["-y", "moodle-mcp-server-aql"],
      "env": {
        "MOODLE_URL": "https://your-moodle-instance.example",
        "MOODLE_TOKEN": "your-moodle-web-services-token"
      }
    }
  }
}
```

## Install Globally

```bash
npm install -g moodle-mcp-server-aql
```

Then run:

```bash
moodle-mcp-server
```

## Install From Source

```bash
git clone https://github.com/csmediapro/moodle-mcp-server
cd moodle-mcp-server
npm install
npm run server:build
```

## Configure

```bash
cp packages/server/.env.example packages/server/.env
cp packages/server/config.example.json packages/server/config.json
```

Set:

```bash
MOODLE_URL=https://your-moodle-instance.example
MOODLE_TOKEN=your-moodle-web-services-token
```

## Run From Source

```bash
node packages/server/dist/index.js
```

## Claude Desktop From Source

```json
{
  "mcpServers": {
    "moodle-mcp-server": {
      "command": "node",
      "args": ["/absolute/path/to/moodle-mcp-server/packages/server/dist/index.js"],
      "env": {
        "MOODLE_URL": "https://your-moodle-instance.example",
        "MOODLE_TOKEN": "your-moodle-web-services-token"
      }
    }
  }
}
```

## Plugin SDK

This package also exports a Plugin SDK for writing plugins that extend the
server with custom tools. Plugins import shared utilities and types from the
SDK instead of reaching into server internals:

```ts
import {
  buildToolResponse,
  hasCapability,
  type MCPServerPlugin,
} from "moodle-mcp-server-aql/sdk";
```

See:
- [Creating Plugins](../../docs/plugins/CREATING-PLUGINS.md)
- [Plugin Contract](../../docs/plugins/CONTRACT.md)

## License

AGPL-3.0.

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.
