Quick start¶
All clients use the same URL:
Cursor (or any client with OAuth discovery)¶
Add the server to the project or user MCP config:
The client gets a 401 whose WWW-Authenticate header carries a resource_metadata URL. From there it
reads the authorisation server metadata and opens the Moodle consent page. You sign in with your normal
Moodle account and approve read, write or admin.
With a pre-issued token¶
If you issued a token with the CLI, send it as a bearer header:
{
"mcpServers": {
"moodle": {
"url": "https://moodle.example.edu/local/mcp/server.php",
"headers": {
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
}
}
}
}
MCP Inspector (CLI)¶
List the tools:
npx @modelcontextprotocol/inspector --cli \
https://moodle.example.edu/local/mcp/server.php \
--transport http \
--header "Authorization: Bearer YOUR_ACCESS_TOKEN" \
--method tools/list
Call site_info using the current protocol revision:
npx @modelcontextprotocol/inspector --cli \
https://moodle.example.edu/local/mcp/server.php \
--transport http --protocol-era modern \
--header "Authorization: Bearer YOUR_ACCESS_TOKEN" \
--method tools/call --tool-name site_info
Protocol versions¶
- Session-based:
initialize,notifications/initialized,ping,tools/list,tools/call, optionalMcp-Session-Idheader,DELETEto end a session. Versions2025-03-26,2025-06-18and2025-11-25. - Stateless revision
2026-07-28:server/discover,tools/list,tools/call, per-request_meta, and theMCP-Protocol-Version,Mcp-MethodandMcp-Nameheaders.
Tip
Write tools do not appear in tools/list until an administrator enables write mode.