home / mcp / moodle mcp server
Enables LLMs to manage Moodle courses, students, assignments, and quizzes via MCP endpoints.
Configuration
View docs{
"mcpServers": {
"peancor-moodle-mcp-server": {
"command": "/path/to/node",
"args": [
"/path/to/moodle-mcp-server/build/index.js"
],
"env": {
"MOODLE_API_URL": "https://your-moodle.com/webservice/rest/server.php",
"MOODLE_API_TOKEN": "your_moodle_api_token",
"MOODLE_COURSE_ID": "your_course_id"
}
}
}
}This MCP server lets you connect LLMs to Moodle to manage courses, students, assignments, and quizzes. It exposes a set of practical tools that you can invoke through an MCP client to automate classroom administration and feedback workflows.
You connect your MCP client to the Moodle MCP Server via a local stdio configuration or by running the server as a local process. Once connected, you can perform actions such as listing students, retrieving assignments, examining quiz attempts, and providing feedback or grades. Use the server to automate routine tasks like enrolling students, reviewing submissions, and delivering instructor comments.
Prerequisites: Node.js version 14 or higher and a Moodle site with an API token that has the needed permissions.
1. Clone the Moodle MCP Server repository and open it in your terminal.
2. Install dependencies.
3. Create a .env file with the following configuration.
MOODLE_API_URL=https://your-moodle.com/webservice/rest/server.php MOODLE_API_TOKEN=your_api_token MOODLE_COURSE_ID=1 # Replace with your course ID
4. Build the server.
npm run build
Usage with Claude: to run the server locally and connect Claude Desktop, configure one or both of the following MCP entries depending on your operating system.
{
"mcpServers": {
"moodle-mcp-server": {
"command": "/path/to/node",
"args": [
"/path/to/moodle-mcp-server/build/index.js"
],
"env": {
"MOODLE_API_URL": "https://your-moodle.com/webservice/rest/server.php",
"MOODLE_API_TOKEN": "your_moodle_api_token",
"MOODLE_COURSE_ID": "your_course_id"
},
"disabled": false,
"autoApprove": []
}
}
}Never share your .env file or Moodle API token. Ensure the MCP server only accesses the courses it needs to manage and use the minimum permissions necessary.
Retrieves the list of students enrolled in the course and returns details like ID, name, email, and last access time.
Fetches all assignments in the course with details such as ID, name, description, due date, and maximum grade.
Examines a student’s submissions for a specific assignment, requiring assignment ID and optionally student ID.
Provides grades and comments for a student’s assignment submission, requiring student ID, assignment ID, grade, and feedback.
Retrieves all quizzes in the course with details like ID, name, description, opening/closing dates, and max grade.
Examines a student’s attempts on a specific quiz, requiring quiz ID and optionally student ID.
Provides comments for a quiz attempt, requiring the attempt ID and feedback.