Skip to main content
Glama

Moodle MCP 服务器

MCP(模型上下文协议)服务器使 LLM 能够与 Moodle 平台交互来管理课程、学生、作业和测验。

特征

学生管理工具

  • list_students - 检索参加该课程的学生名单

    • 显示每个学生的 ID、姓名、电子邮件和上次访问时间

作业管理工具

  • get_assignments - 检索课程中所有可用的作业

    • 包括 ID、姓名、描述、截止日期和最高成绩等信息

  • get_student_submissions - 检查学生提交的特定作业

    • 需要作业 ID 和可选的学生 ID

  • provide_assignment_feedback - 为学生的提交提供成绩和评论

    • 需要学生 ID、作业 ID、成绩和反馈意见

测验管理工具

  • get_quizzes - 检索课程中所有可用的测验

    • 包括 ID、名称、描述、开始/结束日期和最高等级等信息

  • get_quiz_attempts - 检查学生在特定测验中的尝试情况

    • 需要测验 ID 和可选的学生 ID

  • provide_quiz_feedback - 为测验尝试提供评论

    • 需要尝试 ID 和反馈意见

Related MCP server: Moodle MCP

要求

  • Node.js(v14 或更高版本)

  • 具有适当权限的 Moodle API 令牌

  • Moodle 课程 ID

安装

  1. 克隆此存储库:

git clone https://github.com/your-username/moodle-mcp-server.git
cd moodle-mcp-server
  1. 安装依赖项:

npm install
  1. 创建具有以下配置的.env文件:

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
  1. 构建服务器:

npm run build

与 Claude 一起使用

要与 Claude Desktop 一起使用,请添加服务器配置:

在 MacOS 上: ~/Library/Application Support/Claude/claude_desktop_config.json
在 Windows 上: %APPDATA%/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": []
    }
  }
}

对于 Windows 用户,路径将使用反斜杠:

{
  "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": []
    }
  }
}

配置完成后,Claude 将能够与您的 Moodle 课程进行交互:

  • 查看学生名单及其提交的内容

  • 提供作业评论和成绩

  • 检查测验尝试并提供反馈

发展

对于使用自动重建的开发:

npm run watch

调试

MCP 服务器通过 stdio 进行通信,这会增加调试难度。我们建议使用MCP 检查器:

npm run inspector

检查器将提供一个 URL 来访问浏览器中的调试工具。

获取 Moodle API 令牌

  1. 以管理员身份登录您的 Moodle 站点

  2. 前往“站点管理”>“插件”>“Web 服务”>“管理令牌”

  3. 创建具有管理课程所需权限的新令牌

  4. 复制生成的令牌并将其添加到您的.env文件中

安全

  • 切勿分享您的.env文件或 Moodle API 令牌

  • 确保 MCP 服务器只能访问其需要管理的课程

  • 使用具有最低必要权限的令牌

执照

麻省理工学院

Available Tools

7 tools
get_assignmentsB

Obtiene la lista de tareas asignadas en el curso configurado

Inputs: no named parameters.

get_quiz_gradeB

Obtiene la calificación de un estudiante en un quiz específico

Inputs: studentId (required), quizId (required).

get_quizzesB

Obtiene la lista de quizzes en el curso configurado

Inputs: no named parameters.

get_studentsB

Obtiene la lista de estudiantes inscritos en el curso configurado

Inputs: no named parameters.

get_submission_contentC

Obtiene el contenido detallado de una entrega específica, incluyendo texto y archivos adjuntos

Inputs: studentId (required), assignmentId (required).

get_submissionsC

Obtiene las entregas de tareas en el curso configurado

Inputs: studentId, assignmentId.

provide_feedbackC

Proporciona feedback sobre una tarea entregada por un estudiante

Inputs: studentId (required), assignmentId (required), feedback (required), grade.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 7 tools

    Disambiguation4/5

    The tools are mostly distinct with clear purposes: get_assignments, get_quizzes, get_students, get_submissions, and get_submission_content target different resources, while get_quiz_grade and provide_feedback focus on specific actions. However, get_submissions and get_submission_content could be slightly confusing as they both relate to submissions, though their descriptions clarify the difference between listing submissions and getting detailed content.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern using snake_case, starting with 'get_' for retrieval operations and 'provide_' for the feedback action. This uniformity makes the tool set predictable and easy to understand, with no deviations in naming conventions.

    Tool Count4/5

    With 7 tools, the count is reasonable for a Moodle server focused on course management. It covers key areas like assignments, quizzes, students, and submissions, though it might be slightly thin for broader educational workflows, such as missing tools for creating or updating resources.

    Completeness3/5

    The tool set provides good read-only coverage for retrieving course data (assignments, quizzes, students, submissions) and includes a feedback action. However, there are notable gaps in CRUD operations: no tools for creating, updating, or deleting resources (e.g., assignments or quizzes), which limits agent functionality for full lifecycle management in the Moodle domain.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers