home / mcp / moodle mcp server

Moodle MCP Server

A Node.js MCP server that provides tools to manage Moodle courses, students, assignments, and quizzes via MCP clients.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "cfsandoval-mcp": {
      "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 LLMs interact with Moodle to manage courses, students, assignments, and quizzes. It exposes a set of tools that enable you to list students, retrieve and grade assignments, and review and comment on quizzes, all through a consistent programmatic interface.

How to use

Connect your MCP client to the Moodle MCP Server to perform course management tasks. You will access tools to view students, fetch assignments and quizzes, review submissions, and provide feedback or grades. Each tool is designed to be called with the appropriate identifiers (such as course IDs, assignment IDs, or quiz IDs) and optional student identifiers when needed. Use the client to request data, then supply grades or feedback when you want to record evaluations.

How to install

Prerequisites you need before starting: - Node.js (v14 or higher) - A Moodle API token with permissions to manage courses - The Moodle course ID you want to manage Follow these steps to install and run the server locally.

# 1) Clone the MCP server repository
git clone https://github.com/your-username/moodle-mcp-server.git
cd moodle-mcp-server

# 2) Install dependencies
npm install

# 3) Create a configuration file with your Moodle details
# Example values shown; replace with your actual values
MOODLE_API_URL=https://your-moodle.com/webservice/rest/server.php
MOODLE_API_TOKEN=your_api_token
MOODLE_COURSE_ID=1

Additional sections

Configuration, security, and troubleshooting details are provided to help you run the Moodle MCP Server safely and reliably.

Build and start the server with the commands shown in the example configuration used for client integration. Note that the exact start command is the runtime invocation shown in the setup example, and you should use the path you employ when running the server locally.

Available tools

list_students

Retrieves the list of students enrolled in the course and displays each student’s ID, name, email, and last access time.

get_assignments

Retrieves all assignments for the course, including ID, name, description, due date, and maximum grade.

get_student_submissions

Examines a student’s submissions for a specific assignment, requiring the assignment ID and optionally the student ID.

provide_assignment_feedback

Provides grades and comments for a student’s submission, requiring student ID, assignment ID, grade, and feedback.

get_quizzes

Retrieves all quizzes for the course, including ID, name, description, opening/closing dates, and maximum grade.

get_quiz_attempts

Examines a student’s quiz attempts for a specific quiz, requiring the quiz ID and optionally the student ID.

provide_quiz_feedback

Provides comments for a quiz attempt, requiring the attempt ID and feedback comment.

Moodle MCP Server - cfsandoval/mcp