mcpField
M
Moodle Student MCP

Moodle Student MCP

本地服务
github.com科研与教育02 天前更新

关于 Moodle Student MCP

Moodle Student MCP 为使用 Moodle 的学生提供只读 MCP 服务,供 AI 应用查询课程、成绩、截止日期和公告。它可汇总待办与未提交作业,但不能修改或提交任何内容。

主要功能

  1. 01查询课程与课程内容
  2. 02查看截止日期及逾期事项
  3. 03汇总待办和未交作业
  4. 04查询成绩与评分项目
  5. 05读取公告并获取课程文件
  6. 06所有工具均为只读

适用场景

  1. 01整理本周或近期要完成的作业
  2. 02检查逾期及尚未提交的任务
  3. 03查看各课程成绩和评分明细
  4. 04获取课程公告及文件文本

MCP 相关

它作为 MCP 服务向 AI 客户端提供 Moodle 查询工具。通过学校 Moodle 地址和移动 Web 服务密钥连接,所有工具均为只读。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"anonymousonyx22-moodle-student": {
"command": "npx",
"args": [
"-y",
"moodle-student-mcp"
],
"env": {
"MOODLE_BASE_URL": "<MOODLE_BASE_URL>",
"MOODLE_TOKEN": "<MOODLE_TOKEN>"
}
}
}
}
启动命令npx -y moodle-student-mcp
需要配置的环境变量
MOODLE_BASE_URLYour school's Moodle address, for example https://moodle.myschool.edu
MOODLE_TOKEN密钥Your Moodle mobile web service key, copied from Preferences > User account > Security keys

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npmmoodle-student-mcp0.1.7

工具

还没有获取到工具列表

本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。

详细介绍

学生版 Moodle MCP

使用 npx 将服务添加到你的 AI 应用。在下方对应应用的命令中填入学校的 Moodle 地址和你的密钥,然后运行。

通过 Moodle MCP 服务询问 AI:Moodle 中还有哪些事情没完成。

这是一个免费的开源 Moodle MCP 服务。它让 Claude Desktop、Claude Code、Cursor、VS Code 及其他可运行本地 MCP 服务的 AI 应用读取你的 Moodle 课程、截止日期、成绩和公告。它是只读的,绝不会提交、编辑或删除任何内容。

适用于已启用移动端 Web 服务的 Moodle 站点。与 Moodle Pty Ltd 无关。

永久免费。无需注册,也无需订阅。你的登录信息只会发送到你所在的学校。

安装

Claude Code

在终端中运行:

claude mcp add moodle --env MOODLE_BASE_URL=https://moodle.yourschool.edu --env MOODLE_TOKEN=your-key -- npx -y moodle-student-mcp

如果希望在每个项目中都使用此服务,请添加 --scope user。

Cursor

在终端中运行。Cursor 将服务配置保存在 mcp.json 中,因此这条命令会将服务写入 ~/.cursor/mcp.json,并保留已有服务。在 Windows 上,该文件路径为 %USERPROFILE%\.cursor\mcp.json。

node -e "const fs=require('fs'),os=require('os'),path=require('path'),file=path.join(os.homedir(),'.cursor','mcp.json');let config={};try{config=JSON.parse(fs.readFileSync(file,'utf8'))}catch(error){}config.mcpServers={...(config.mcpServers||{}),moodle:{type:'stdio',command:'npx',args:['-y','moodle-student-mcp'],env:{MOODLE_BASE_URL:'https://moodle.yourschool.edu',MOODLE_TOKEN:'your-key'}}};fs.mkdirSync(path.dirname(file),{recursive:true});fs.writeFileSync(file,JSON.stringify(config,null,2));"
VS Code

在终端中运行:

code --add-mcp "{\"name\":\"moodle\",\"type\":\"stdio\",\"command\":\"npx\",\"args\":[\"-y\",\"moodle-student-mcp\"],\"env\":{\"MOODLE_BASE_URL\":\"https://moodle.yourschool.edu\",\"MOODLE_TOKEN\":\"your-key\"}}"

JSON 中的引号已转义,因此该命令在 Mac 或 Linux 终端以及 Windows 命令提示符中都能以相同方式运行。在 Windows 的 PowerShell 中,请改用这条命令:

code --add-mcp '{\"name\":\"moodle\",\"type\":\"stdio\",\"command\":\"npx\",\"args\":[\"-y\",\"moodle-student-mcp\"],\"env\":{\"MOODLE_BASE_URL\":\"https://moodle.yourschool.edu\",\"MOODLE_TOKEN\":\"your-key\"}}'

这会将服务添加到你的用户配置文件中,因此每个项目都可以使用。

Claude Desktop

将以下内容粘贴到你的 MCP 配置文件中(Claude Desktop 的配置文件为 claude_desktop_config.json):

{
  "mcpServers": {
    "moodle": {
      "command": "npx",
      "args": ["-y", "moodle-student-mcp"],
      "env": {
        "MOODLE_BASE_URL": "https://moodle.yourschool.edu",
        "MOODLE_TOKEN": "your-key"
      }
    }
  }
}

如果应用已在运行,请重启,然后询问:

  • “这周有哪些截止事项?”
  • “有什么逾期事项吗?”
  • “我还有哪些作业没完成?”
  • “我在 Networking 课程中的成绩是多少?”

演示

下面是从头到尾的完整对话。“服务的回答”下方的内容,是工具返回的原文,复制自使用测试附带的代码对测试 Moodle 站点运行所得的结果。课程、日期和公告均为虚构的示例数据,时间均为 UTC。将此代码块复制到任何聊天应用中,即可在安装前看看回答是什么样的。

You: What should I do today?

Tool call: get_todo
{"name":"get_todo","arguments":{}}

The server answers:
Overdue:
- Problem set 1 (Data Structures) was due Mon, Oct 19, 11:59 p.m. UTC, not submitted

Due soon:
- Quiz 1 closes (Networking Basics) is due Fri, Oct 23, 11:59 p.m. UTC
- Lab 3: routing table (Networking Basics) is due Wed, Oct 28, 11:59 p.m. UTC, not submitted
- Lab 4: report draft (Networking Basics) is due Mon, Nov 2, 11:59 p.m. UTC, draft, not submitted
- Problem set 3 (Data Structures) is due Mon, Nov 2, 11:59 p.m. UTC

New announcements:
- Lab 3 is due Friday (Networking Basics, Wed, Oct 21, 9:15 a.m. UTC)
- Week 6 reading (Networking Basics, Tue, Oct 20, 2:05 p.m. UTC)
- Room change for Thursday (Data Structures, Mon, Oct 19, 4:40 p.m. UTC)

The app replies: Start with Problem set 1 in Data Structures, which was due Monday. Quiz 1 closes Friday, the Lab 3 routing table is due Wednesday, and the Lab 4 report draft and Problem set 3 are due Nov 2. The latest announcements mention the Lab 3 deadline, the Week 6 reading and a room change for Data Structures.

You: What's due this week?

Tool call: get_upcoming_due_dates
{"name":"get_upcoming_due_dates","arguments":{}}

The server answers:
- Quiz 1 closes (Networking Basics) due Fri, Oct 23, 11:59 p.m. UTC
- Lab 4 report (Networking Basics) due Wed, Oct 28, 11:59 p.m. UTC
- Problem set 3 (Data Structures) due Mon, Nov 2, 11:59 p.m. UTC

The app replies: Three things are due soon. Quiz 1 closes on Friday, the Lab 4 report is due on Wednesday, and Problem set 3 in Data Structures is due on Monday.

You: What's due in Networking Basics?

Tool call: get_my_courses
{"name":"get_my_courses","arguments":{}}

The server answers:
- Networking Basics [id 11]
- Data Structures [id 12]

Tool call: get_upcoming_due_dates
{"name":"get_upcoming_due_dates","arguments":{"course_ids":[11]}}

The server answers:
- Quiz 1 closes (Networking Basics) due Fri, Oct 23, 11:59 p.m. UTC
- Lab 4 report (Networking Basics) due Wed, Oct 28, 11:59 p.m. UTC

The app replies: Networking Basics has two things due soon: Quiz 1 closes on Friday and the Lab 4 report is due on Wednesday.

You: Is anything overdue?

Tool call: get_overdue
{"name":"get_overdue","arguments":{}}

The server answers:
- Problem set 1 (Data Structures) was due Mon, Oct 19, 11:59 p.m. UTC

The app replies: One thing is overdue: Problem set 1 in Data Structures, which was due on Monday, Oct 19.

You: Which assignments have I not submitted in Networking Basics?

Tool call: get_my_courses
{"name":"get_my_courses","arguments":{}}

The server answers:
- Networking Basics [id 11]
- Data Structures [id 12]

Tool call: get_assignments
{"name":"get_assignments","arguments":{"course_id":11}}

The server answers:
- Lab 1: LAN cabling due Fri, Oct 9, 11:59 p.m. UTC graded 8.00 / 10.00
- Lab 2: subnetting worksheet due Fri, Oct 16, 11:59 p.m. UTC submitted
- Lab 3: routing table due Wed, Oct 28, 11:59 p.m. UTC not submitted
- Lab 4: report draft due Mon, Nov 2, 11:59 p.m. UTC draft, not submitted

The app replies: Networking Basics is course 11. Lab 3 routing table has not been submitted, and Lab 4 report draft is still a draft, so it is saved but not handed in. Lab 2 was submitted and Lab 1 is graded 8.00 out of 10.

You: What work am I still missing?

Tool call: get_missing_work
{"name":"get_missing_work","arguments":{}}

The server answers:
- Problem set 1 (Data Structures) was due Mon, Oct 19, 11:59 p.m. UTC, not submitted
- Lab 3: routing table (Networking Basics) is due Wed, Oct 28, 11:59 p.m. UTC, not submitted
- Lab 4: report draft (Networking Basics) is due Mon, Nov 2, 11:59 p.m. UTC, draft, not submitted
- Problem set 2 (Data Structures) is due Fri, Nov 6, 11:59 p.m. UTC, not submitted

The app replies: Four assignments are still not handed in. Problem set 1 in Data Structures was due on Oct 19, Lab 3 routing table in Networking Basics is due on Oct 28, the Lab 4 report draft in Networking Basics is due on Nov 2 and is still only a draft, and Problem set 2 in Data Structures is due on Nov 6.

You: How am I doing in Networking Basics?

Tool call: get_my_courses
{"name":"get_my_courses","arguments":{}}

The server answers:
- Networking Basics [id 11]
- Data Structures [id 12]

Tool call: get_my_grades
{"name":"get_my_grades","arguments":{}}

The server answers:
- Networking Basics 88.50
- Data Structures no grade posted yet

Tool call: get_course_grade_items
{"name":"get_course_grade_items","arguments":{"course_id":11}}

The server answers:
- Lab 1: LAN cabling 8.00 (80.00 %)
- Lab 2: subnetting worksheet 9.00 (90.00 %)
- Course total 88.50 (88.50 %)

The app replies: Networking Basics has a course total of 88.50, which is 88.50 percent. Lab 1 is 8.00 (80.00 percent) and Lab 2 is 9.00 (90.00 percent). Data Structures has no grade posted yet.

You: Any new announcements?

Tool call: get_announcements
{"name":"get_announcements","arguments":{}}

The server answers:
- Lab 3 is due Friday (Networking Basics, Wed, Oct 21, 9:15 a.m. UTC)
  Bring your laptop and the patched topology sheet.
- Week 6 reading (Networking Basics, Tue, Oct 20, 2:05 p.m. UTC)
  Read chapters 4 and 5 before the quiz.
- Room change for Thursday (Data Structures, Mon, Oct 19, 4:40 p.m. UTC)
  Data Structures meets in room B12 this week.

The app replies: Three announcements. Lab 3 is due Friday, so bring your laptop and the patched topology sheet. Week 6 reading says to read chapters 4 and 5 before the quiz. Data Structures has a room change for Thursday.

快速开始

  1. 在 Moodle 中,打开个人资料菜单,然后前往 偏好设置 > 用户账户 > 安全密钥。复制 Moodle 移动端 Web 服务的密钥。获取 Moodle 移动端 Web 服务密钥指南列出了每个步骤,并说明了找不到页面或密钥时该怎么办。
  2. 将学校的 Moodle 地址和密钥填入上方的命令或配置块。
  3. 重启 AI 应用,然后询问上面的问题之一。

如需先检查设置,请在设置好两个环境变量后运行 npx moodle-student-mcp doctor。

如果找不到“安全密钥”页面,可能是学校关闭了移动端 Web 服务,或者通过单点登录验证身份而未提供密钥。在这种情况下,此服务无法连接到你的账户。

你可以询问的问题

  • “这周有哪些截止事项?”
  • “Networking Basics 课程有哪些截止事项?”
  • “未来两周有哪些截止事项?”
  • “我今天应该做什么?”
  • “有什么逾期事项吗?”
  • “Networking Basics 课程中有逾期事项吗?”
  • “我还有哪些作业没完成?”
  • “每门课程的成绩是多少?Networking 课程的成绩册里有哪些内容?”
  • “有新公告吗?”
  • “哪些作业我还没有提交?”

工具

所有工具均为只读。

工具功能
get_my_courses你当前的课程及其 ID
get_upcoming_due_dates未来 60 天内仍需处理的事项,按截止时间从近到远排列。不包括“课程开始”等普通课程事件。可选参数 course_ids 为课程 ID 列表
get_overdue已逾期但仍需处理的事项。可选参数 course_ids 为课程 ID 列表
get_todo汇总下一步要做的事项:逾期任务、即将到期的任务、没有截止日期的作业,以及最新公告标题;每项均附课程名称和截止日期。可选参数包括 course_ids 列表,以及用于设置时间范围的 days_ahead 和 overdue_days
get_assignments某门课程的作业,附截止日期和提交状态。参数 course_id 取自 get_my_courses
get_missing_work你尚未提交的作业,包括草稿,并附课程名称和截止日期。可选参数 course_ids 为课程 ID 列表
get_my_grades每门课程的当前成绩
get_course_grade_items某门课程中的所有评分项目,附分数和百分比。参数 course_id 取自 get_my_courses
get_course_content某门课程的章节和活动,附文件名和链接,且不会泄露你的密钥。参数 course_id 取自 get_my_courses
get_file从学校的 Moodle 网站下载课程文件并返回其文本。PDF 或其他非文本文件会返回文件名、链接和提示,告知你在 Moodle 中打开。参数 file_url 取自 get_course_content
get_announcements最近的公告,每条附课程名称和日期;无法打开 Moodle 的课程会被排除。可选参数 course_ids 为课程 ID 列表

隐私与安全

  • 你的密钥保存在自己的电脑上,只会发送到你所在学校的 Moodle 地址。
  • 本项目不会向任何其他服务器发送数据。
  • get_file 只会下载指向学校 Moodle 地址的链接。指向其他位置的链接会被拒绝,因此课程页面或公告中的链接绝不会获取你的密钥。
  • 所有工具都标记为只读。你可以随时在“安全密钥”页面重置密钥。

故障排除

设置不正确时,每个工具都会返回以下消息,并附上相应的解决方法。

消息解决方法
未登录你的密钥已过期或已重置。请从 Preferences > User account > Security keys 复制新密钥,并更新 MOODLE_TOKEN。
拒绝访问学校已为学生关闭该功能。如果密钥是你自己复制的,请确认它是 Preferences > User account > Security keys 中的 Moodle 移动端 Web 服务密钥。
未启用 Web 服务学校尚未启用移动端 Web 服务,因此 Preferences > User account > Security keys 中没有 Moodle 移动端 Web 服务密钥。请联系学校启用该服务。
未找到使用 get_my_courses 检查课程 ID。
学校的服务器返回了本服务器无法读取的响应检查 MOODLE_BASE_URL 是否指向你的 Moodle 网站地址。

开发

npm install
npm run build
npm test

开发需要 Node 22.12 或更新版本,因为测试运行器需要该版本。服务器本身可在 Node 20 或更新版本上运行。

测试会使用模拟的 Moodle 服务器运行,因此不需要账户或网络。

上方的演示记录由同一份代码生成。修改工具后,运行 npm run demo 可再次打印演示记录;运行 npm test 可检查 README 是否仍与工具的响应一致。

如果这个项目帮你省下了在 Moodle 中查找信息的时间,请给仓库点个星。目前它只有 0 颗星,点亮一颗星就能帮助下一位学生找到它。

Moodle 与 Brightspace

两者都是供学生使用的免费开源只读 MCP 服务。请根据学校使用的学习平台选择。如果学校两种平台都在使用,或者你要转学,也可以在 MCP 配置中使用不同的服务名称,同时运行两者。

Moodle MCPBrightspace MCP
学习平台MoodleD2L Brightspace
登录从 Moodle 的 Security keys 页面获取移动 Web 服务密钥浏览器登录,支持 Microsoft、Duo、Okta 和 Shibboleth
学校需进行的设置必须启用移动 Web 服务无
课程、截止日期、成绩是是
每项作业的提交状态是是
课程文件是是
公告是是
讨论、名册、日历、成绩展望否是
目标成绩计算器否是
费用免费免费

更多免费的学生 MCP 服务

这些服务均免费、开源,并且在访问你的账户时均为只读。请在 brightspacemcp.com/more-mcps 浏览完整列表。

服务功能
Brightspace MCP面向 AI 的 D2L Brightspace。包含截止日期、实际提交状态、成绩、目标成绩计算器和课程文件。
Canvas MCP面向 AI 的 Canvas LMS,只读。包含截止日期、未完成作业、成绩和公告。
Google Classroom MCP面向 AI 的 Google Classroom,只读。包含待办事项、截止日期、未完成作业和成绩。
GPA Calculator MCP面向 AI 的 GPA、成绩换算以及期末考试所需成绩计算器。可离线使用,无需账户。
Citations MCP根据 DOI、ISBN 或输入的详细信息生成 APA、MLA 和 Chicago 格式的引文。无需账户。
Study Planner MCP考试学习计划、间隔重复日期、番茄钟计划和作业里程碑。可离线使用。
Paper Finder MCP通过 OpenAlex 搜索学术论文、查找开放获取版本和相关研究。无需密钥。

许可证

MIT

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。