FCPC-lms-mcp-server
FCPC LMS MCP 服务器
一个 MCP 服务器,让 AI 助手能够回答关于学生自己 Moodle 账户的问题——即将到期的作业、未读消息、待完成的测验和已注册的课程。
学生只需注册一个 URL,即可从网页版、手机版或桌面版 Claude 连接。无需安装软件,无需手动复制令牌。
专为 First City Providential College 构建,但适用于任何启用了 Web 服务的 Moodle 站点。
它能回答什么
作业何时到期
来自老师和同学未读的消息
尚未完成的测验
已注册的课程
"Do I have any new messages?"
"What is due this week?"Related MCP server: Moodle MCP Server
两种运行方式
远程服务器 | 本地服务器 | |
适用对象 | 一个班级或整个机构 | 个人,在自己的机器上 |
客户端 | Claude(网页、iOS、Android、桌面) | 该机器上的任何 MCP 客户端 |
学生配置 | 一个 URL | 无需配置,但需要安装仓库 |
登录方式 | OAuth,由 Claude 处理 |
|
入口点 |
|
|
大多数部署场景推荐使用远程服务器。
远程服务器(推荐)
要求
Python 3.11 或更高版本
cloudflared (
brew install cloudflared)或任何其他暴露 HTTPS 地址的方式站点上的一个 Moodle 账户,在设置过程中仅使用一次以记录站点地址
管理员操作
运行一次
setup.command(macOS)或setup.bat(Windows)并登录。 这会将您的 Moodle 站点地址写入.env。运行
start-server.command。它会打印出需要分发的 URL:
https://xxxx.trycloudflare.com/mcp关闭该窗口会停止服务器,因此在服务使用期间请保持窗口打开。免费的 trycloudflare.com 地址在每次重启后都会变化;如需固定地址,请使用
命名隧道。
学生操作
在任何浏览器(包括手机)中打开 claude.ai。
前往 设置 → 连接器 → 添加自定义连接器。
为其命名任意名称,然后粘贴您获得的 URL。
Claude 会打开 Moodle 登录页面。使用您常用的 Moodle 用户名和密码登录。
这就是全部设置。之后在 Claude 移动应用中也同样可用。
连接器只能从 Claude 网站添加,但手机浏览器也可以正常操作。添加后,它们会同步到各个应用中。
登录机制
Student's Claude ──HTTPS──▶ MCP server ──▶ Moodle
(OAuth)每个用户通过 OAuth 登录进行身份识别。学生登录时,其 Moodle 令牌会被加密到访问令牌本身中,并交还给 Claude。
服务器不存储任何 Moodle 令牌,也不存储任何密码
密码仅使用一次以获取令牌,然后即被丢弃
任何用户都无法看到其他用户的数据
.oauth_key(加密密钥)和 .oauth_clients.json 是机密文件。两者均已被 git 排除。删除 .oauth_key 会使所有用户退出登录。
本地服务器
用于在您自己的机器上通过 stdio 运行 MCP 服务器。
运行
setup.command/setup.bat,或者:
python -m venv venv
source venv/bin/activate # macOS/Linux
.\venv\Scripts\activate # Windows PowerShell
pip install -r requirements.txt
python setup_gui.py将您的 MCP 客户端指向
server.py。例如,在 Claude Desktop 的claude_desktop_config.json中:
{
"mcpServers": {
"moodle": {
"command": "/path/to/venv/bin/python",
"args": ["/path/to/server.py"]
}
}
}要查看 AI 实际接收到的内容:
python list_tools.py还有两个独立的聊天客户端:client.py(OpenAI)和
client_localLLM.py(ollama)。两者都将服务器脚本作为参数:
python client.py server.py测试
selftest.py 检查所有无需浏览器即可验证的内容:Moodle 连接、两个服务器、完整的 OAuth 流程直至真实的工具调用,以及用户之间无法看到彼此的数据。
python selftest.py # all checks
python selftest.py --offline # skip anything needing the network当所有测试通过时,它退出并返回 0,并打印剩余的手动步骤:在 Claude 中注册连接器、登录、提问,以及在手机上重复操作。
请在安装后、修改代码后以及托管服务器的机器上运行它。
关于 Moodle 的说明
某些 Moodle 站点位于 Cloudflare 之后,会以 HTTP 403 拒绝普通的 HTTPS 客户端。因此,请求通过带有浏览器 TLS 指纹的 curl_cffi 发送。这就是为什么该服务器无法用 Apps Script 等工具重新实现,也是为什么它应该运行在具有正常网络路径的环境中。
通过 SSO(Google 等)登录 Moodle 的用户无法使用 login/token.php。decode_token.py 覆盖了这种情况。
文件
文件 | 用途 |
| 带 OAuth 的远程 MCP 服务器,用于 Claude 连接器 |
| OAuth 授权服务器;不存储令牌 |
| Claude 打开的 Moodle 登录页面 |
| 基于 stdio 的本地 MCP 服务器 |
| Moodle API 客户端,每个实例一个令牌 |
| 令牌获取和 |
| 设置向导 |
| 双击设置(macOS / Windows) |
| 发布远程服务器(macOS) |
| 端到端检查安装 |
| 打印 AI 可见的工具 |
| 从命令行获取令牌 |
| 为 SSO 用户提取令牌 |
| 独立聊天客户端 |
致谢
MCP 服务器本身(server.py、client.py、client_localLLM.py)由 Jiseong JEONG(jeongjisung690) 编写。
原始仓库:https://github.com/jeongjisung690/Moodle---MCP-server
本仓库新增了:
对位于 Cloudflare 之后的 Moodle 站点的支持
通过用户名和密码自动获取令牌
为 SSO 用户提取令牌
面向非技术用户的设置向导
带 OAuth 的远程 MCP 服务器,使学生只需一个 URL 即可连接
许可证
尚未设置许可证。在使用或重新分发此代码之前,请联系作者。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Moodle learning management systems through the Moodle REST API. Supports course management, user enrollment, assignments, forums, quizzes, and file operations through natural language.18MIT
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Moodle learning management systems through the REST API. Supports course management, user enrollment, assignment handling, and forum operations through natural language.18MIT
- AlicenseAqualityBmaintenanceEnables AI assistants to interact with Moodle via web services, allowing tasks like listing courses, assignments, events, and downloading files.104MIT
- FlicenseNot gradedqualityBmaintenanceEnables AI assistants to read your Moodle courses, list materials, quizzes, and search content to plan exam preparation through natural language.1
Related MCP Connectors
Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analy…
Let ChatGPT, Claude & Cursor use your Mac: email, calendar, iMessage, Teams, files. Local, free.
Connect AI assistants to ITM Platform projects, tasks, budgets, risks, and team workload.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Ogaaawa/FCPC-lms-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server