The Moodle MCP Server allows Large Language Models (LLMs) to interact with your Moodle platform, letting them manage courses, students, assignments, and quizzes through the Model Context Protocol.
list_students
- Retrieves the list of students enrolled in the course
get_assignments
- Retrieves all available assignments in the course
get_student_submissions
- Examines a student's submissions for a specific assignment
provide_assignment_feedback
- Provides grades and comments for a student's submission
get_quizzes
- Retrieves all available quizzes in the course
get_quiz_attempts
- Examines a student's attempts on a specific quiz
provide_quiz_feedback
- Provides comments for a quiz attempt
git clone https://github.com/your-username/moodle-mcp-server.git
cd moodle-mcp-server
npm install
.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
npm run build
To use with Claude Desktop, add the server configuration:
Add to: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"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": []
}
}
}
Add to: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"moodle-mcp-server": {
"command": "C:\\path\\to\\node.exe",
"args": [
"C:\\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": []
}
}
}
.env
fileOnce configured, Claude can interact with your Moodle course using the following tools:
Claude can list all students enrolled in the course, showing their IDs, names, emails, and last access times.
Claude can:
Claude can:
.env
file and Moodle API token privateThere are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.