
Moodle MCP Server
Enables interaction with Moodle learning management systems through the Moodle REST API. Supports course management, user enrollment, assignments, forums, quizzes, and file operations through natural language.
README
moodle-mcp
Servidor MCP (Model Context Protocol) para exponer tools que permiten a un LLM interactuar con Moodle mediante su API REST.
Estado: baseline listo para producción ligera (TypeScript + Fastify). Incluye validación con Zod, logging con Pino, estructura de acciones y cliente REST con backoff.
Requisitos
- Node.js 20+
- Token de servicio en Moodle (REST)
- URL base de Moodle (p. ej.
https://elearning.org
)
Configuración
- Copia
.env.example
a.env
y ajusta valores:
MOODLE_BASE_URL=https://elearning.example.org
MOODLE_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
MOODLE_FORMAT=json
PORT=7410
LOG_LEVEL=info
- Instala dependencias:
npm install
- Arranca en modo desarrollo:
npm run dev
El servidor expone:
GET /health
→ okPOST /mcp/tools
→ invocar tools MCP con payload{ tool, arguments }
GET /mcp/resources/:type/:id
→ recursos cacheables (course, user, assignment)
Ejemplos de uso
Listar cursos:
curl -X POST http://localhost:7410/mcp/tools -H "content-type: application/json" -d '{"tool":"list_courses","arguments":{"search":"prospectiva","limit":10}}'
Buscar usuario por email:
curl -X POST http://localhost:7410/mcp/tools -H "content-type: application/json" -d '{"tool":"get_user_by_email","arguments":{"email":"alguien@org.org"}}'
Matricular usuario:
curl -X POST http://localhost:7410/mcp/tools -H "content-type: application/json" -d '{"tool":"enroll_user","arguments":{"userid":123,"courseid":456,"roleid":5}}'
Estructura
src/
index.ts # bootstrap Fastify
mcpServer.ts # registro y ruteo de tools/resources
moodleClient.ts # wrapper REST Moodle con backoff
config.ts # carga de env
utils/
validators.ts # esquemas Zod
error.ts # tipos/ayudantes de error
logging.ts # logger Pino
actions/ # handlers MCP
courses.ts
users.ts
enrollments.ts
assignments.ts
forums.ts
files.ts
quizzes.ts
schemas/ # (espacio para JSON Schemas si los separas)
test/
params.test.ts # tests de flatten/validación
mcp.json # manifest MCP
Notas sobre Moodle REST
- Endpoint:
{MOODLE_BASE_URL}/webservice/rest/server.php
- Parámetros obligatorios:
wstoken
,wsfunction
,moodlewsrestformat
- Codificación de arrays:
courseids[0]=123&courseids[1]=456
(ya soportado porflattenParams
). - Errores: el cliente normaliza errores HTTP/REST y texto de Moodle.
Docker
docker build -t moodle-mcp .
docker run --env-file .env -p 7410:7410 moodle-mcp
Licencia
MIT © 2025
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.