unsw-mcp
MCP server for UNSW students to read Moodle, Ed, and official course outlines, including courses, assignments, grades, forums, and AI use policies, with some write capabilities.
README
unsw-mcp
给 UNSW 学生用的 MCP server,让 Claude 直接读你的 Moodle、Ed 和官方课程大纲:课程、作业、成绩、日历、论坛、讨论、lesson,以及每项作业允许怎么用 AI。
状态:开发中,还没发布到 npm。共 40 个工具。Moodle 的 14 个只读工具和 3 个论坛写工具、Ed 的 14 个读工具、Course Outline 的 2 个(公开接口不用登录)都用真实账号验证过。Ed 的 5 个发帖类工具和 Gradescope 的 2 个没有对服务端验证过,Moodle 的交作业功能决定不做。细节见下面各节。
安装
还没发到 npm,直接从 GitHub 装。把下面这段加进 Claude Code 的 MCP 配置就行,不用 clone、不用自己编译:
{
"mcpServers": {
"unsw": {
"command": "npx",
"args": ["-y", "github:r1ckyIn/unsw-mcp"],
"env": {
"ED_API_TOKEN": "你的 Ed token",
"GRADESCOPE_EMAIL": "你的邮箱",
"GRADESCOPE_PASSWORD": "你的 Gradescope 密码"
}
}
}
}
三个来源互相独立,只用其中一个的话,其余的配置删掉就行。
首次运行会 clone 仓库并编译一次(几十秒),之后走缓存就快了。想锁版本就在后面加 tag 或 commit:github:r1ckyIn/unsw-mcp#v0.1.0。
需要 Node 18 以上和 git。
Moodle 认证
macOS 上会自动读你 Chrome 里已登录 Moodle 的 cookie,首次运行会弹一次 Keychain 授权(这是系统在问你要不要让它解密 Chrome 的 cookie,点「始终允许」以后就不再弹)。
Windows,或者不想让它读 Chrome 的话,手动贴 cookie:
- 在浏览器登录
moodle.telt.unsw.edu.au - F12 → Application → Cookies,复制
MoodleSession和AWSALB两个值 - 配置里加
"env": {"MOODLE_SESSION_COOKIE": "MoodleSession=xxx; AWSALB=yyy"}
UNSW 的 session 只有 2 小时,过期后在浏览器重新登录一次即可(自动读 cookie 的话你不用管)。
Ed 认证
去 edstem.org 的 API 设置页 生成一个 token,填进上面配置的 ED_API_TOKEN。token 不会过期,但它等于你的 Ed 账号,别贴给别人、别提交进 git。
Gradescope 认证(注意)
Gradescope 没有官方 API 也没有 token 机制,只能拿邮箱密码模拟登录。如果你平时是点「Log in with your school credentials」用 UNSW SSO 进去的,那你没有原生密码,要先去 reset_password 用学校邮箱设一个。
这两个工具没有用真实账号验证过。 页面解析的选择器是照着 Python 的 gradescopeapi 包写的,只有登录页的 CSRF 提取拿真实页面对过。如果 Gradescope 改过版,解析会失败——失败时会明确告诉你解析不出东西、可能是选择器过时了,不会假装你没有课。碰到了请提 issue 或自己改 src/gradescope/scrape.ts,选择器都集中在那一个文件里。
工具
Moodle(读)
课程与内容:moodle_list_courses、moodle_get_course_contents、moodle_download_file
作业与成绩:moodle_list_assignments、moodle_get_assignment、moodle_get_grades、moodle_get_overview_grades
日程:moodle_get_upcoming、moodle_get_calendar、moodle_get_notifications
论坛:moodle_list_forums、moodle_get_forum_discussions、moodle_get_discussion_posts、moodle_list_announcements
Moodle(写,会改动真实课程)
moodle_post_forum_discussion、moodle_reply_forum_post、moodle_delete_forum_post
发帖和回帖发出即全班可见,没有草稿也没有预览;删帖是永久删除,Moodle 没有回收站,删一个讨论的首楼会连整个讨论一起没掉。学生通常只有 30 分钟编辑窗口,过期连自己也删不掉。这三个工具在 MCP 里标了 readOnlyHint: false(删帖还标了 destructiveHint: true),别把 Moodle 整组加进自动放行名单。
交作业没有做,也不打算做:交出去不可逆、直接影响成绩,且没有发帖那种删掉重来的退路。要交作业请自己去 Moodle 网页点。
Ed
课程与讨论:ed_get_user_info、ed_list_courses、ed_list_threads、ed_get_thread、ed_search_threads
Lessons 与资源:ed_list_lessons、ed_get_lesson、ed_list_resources、ed_download_resource
发帖(会真的发出去,没有草稿阶段):ed_post_thread、ed_edit_thread、ed_post_comment、ed_reply_to_comment、ed_accept_answer、ed_thread_action
其中 ed_thread_action(收藏/取消收藏)和 workspace 的增删改用真实账号验过;ed_post_thread、ed_edit_thread、ed_post_comment、ed_reply_to_comment、ed_accept_answer 这 5 个没有对真实 Ed 服务端跑过——它们的请求体由离线测试断言,只能证明「发出去的是想发的」,不能证明 Ed 认这个 payload。第一次用请拿一条无关紧要的内容试。
Workspaces:ed_list_workspaces、ed_create_workspace、ed_update_workspace、ed_delete_workspace
Gradescope(只读,未验证)
gradescope_list_courses、gradescope_list_assignments
UNSW 课程大纲(只读,不需要登录)
unsw_find_course_outline、unsw_fetch_course_outline
查的是官方发布的 course outline,任何人都能用,不需要任何凭据。除了权重和截止,还会列出每项作业的 AI 使用政策("No Assistance" / "Simple Editing Assistance" 之类),以及每项作业对应哪些学习目标。权重会自动加总,不等于 100% 会提示你自己核对。
Ed 的读工具支持 response_format: "json",想要原始字段而不是排版好的 markdown 时用得上。发帖类工具的正文写 markdown 就行,会自动转成 Ed 的 XML 格式(标题、粗斜体、代码块、列表、链接、数学公式、callout 都支持)。
注意
Ed 的发帖类工具是真的发出去,没有草稿、没有预览,is_private 也只是「仅教职工可见」而不是只有自己可见。让 Claude 代你发帖之前,先想清楚发的是什么、发给谁看。ed_delete_workspace 会连里面的文件一起删掉,不可恢复。
UNSW Moodle 对学生不开放官方 API(登录走 SAML SSO,拿不到 web service token),所以 Moodle 这半边是带着你自己浏览器的 cookie 去调 Moodle 网页前端自己在用的接口,以及解析页面。只访问你自己的数据,不碰别人的。教育用途,用之前想清楚。
开发
npm install
npm test # vitest,纯函数单测,不碰网络
npm run typecheck
npm run build
MIT。
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.