Get the FREE Ultimate OpenClaw Setup Guide →

moodle

MCP server from peancor/moodle-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio peancor-moodle-mcp-server node build/index.js \
  --env MOODLE_API_URL="https://your-moodle-site/webservice/rest/server.php" \
  --env MOODLE_API_TOKEN="your_moodle_api_token" \
  --env MOODLE_COURSE_ID="your_course_id"

How to use

This Moodle MCP server exposes a set of MCP tools that let AI copilots interact with a Moodle course. It provides course management (get_courses), student management (list_students), assignment operations (get_assignments, get_student_submissions, provide_assignment_feedback), and quiz operations (get_quizzes, get_quiz_attempts, provide_quiz_feedback). Each tool is designed to fetch structured data from Moodle or submit feedback and grades back to the platform. To use these capabilities, configure the MCP server in your environment (including the Moodle API URL, a valid API token, and the target course ID) and run the Node.js server. Once running, you can query the tool endpoints to retrieve course rosters, assignment lists with metadata, and quiz attempts, or to provide feedback for specific submissions and attempts. The server is designed to work with LLMs and other MCP clients that expect a uniform command interface for rich Moodle data interactions.

How to install

Prerequisites:

  • Node.js v14 or higher
  • npm (comes with Node.js)
  • Access to a Moodle site with REST web services enabled and a token with appropriate permissions

Installation steps:

  1. Clone the repository:
git clone https://github.com/your-username/moodle-mcp-server.git
cd moodle-mcp-server
  1. Install dependencies:
npm install
  1. Create a .env file (or configure environment variables) with Moodle connection details:
MOODLE_API_URL=https://your-moodle-site/webservice/rest/server.php
MOODLE_API_TOKEN=your_api_token
MOODLE_COURSE_ID=your_course_id
  1. Build the server:
npm run build
  1. Run the MCP server (as defined in mcp_config):
node build/index.js
  1. Optionally, set up Claude or another MCP client by copying the example configuration from the README and replacing paths and environment values with your own.

Additional notes

Tips and notes:

  • Keep the Moodle API token secure; do not commit it to source control.
  • The MOODLE_COURSE_ID must correspond to a Moodle course you want the MCP to manage.
  • If you encounter authentication errors, verify the token permissions in Moodle and that the API URL is correct.
  • The tools support pagination for large course rosters (get_courses accepts page and limit parameters).
  • For debugging, use the MCP Inspector as described in the repository's development section to inspect stdio communication.
  • If you need to integrate with Claude, ensure the CLI client configuration uses the correct paths for your environment, as shown in the usage examples.
  • Environment variables can be overridden by your deployment platform; ensure they are loaded at runtime.

Related MCP Servers

Sponsor this space

Reach thousands of developers