Skip to main content
Glama

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:

  1. 在浏览器登录 moodle.telt.unsw.edu.au

  2. F12 → Application → Cookies,复制 MoodleSession 和 AWSALB 两个值

  3. 配置里加 "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,选择器都集中在那一个文件里。

Related MCP server: Horizon

工具

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。

Available Tools

40 tools
ed_accept_answerA

在自己的问题帖上接受某个回答,标记为已解决。

Inputs: thread_id (required), comment_id (required).

ed_create_workspaceA

在 Ed 课程里新建 workspace(云 IDE),workspace_type 选环境镜像(general/c/cpp/python/java/nodejs/jupyter/rstudio)。

Inputs: title (required), course_id (required), workspace_type.

ed_delete_workspaceA
Destructive

永久删除自己的 Ed workspace,连里面的文件一起,不可恢复。只删自己建的。

Inputs: workspace_id (required).

ed_download_resourceA

下载 Ed 课程资源文件到本地。resource_id 从 ed_list_resources 拿;链接类资源没有文件可下。最大 50MB。

Inputs: resource_id (required), save_path.

ed_edit_threadA

编辑已有的 Ed 帖子(自己的帖,或需要教职工权限)。只改给出的字段,其余保留。

Inputs: thread_id (required), title, content, category, +1 more.

ed_get_lessonA
Read-only

单个 Ed lesson 的完整内容,含全部 slides(XML 自动转成文本)。

Inputs: lesson_id (required), response_format, include_slide_content.

ed_get_threadA
Read-only

单个 Ed 讨论的完整内容,含全部回答和评论。

Inputs: thread_id (required), response_format.

ed_get_user_infoA
Read-only

当前 Ed 用户信息,用来确认 token 有效。

Inputs: response_format.

ed_list_coursesA
Read-only

Ed 上选修的全部课程,返回课程名、代码和 Ed course ID。可按 year/session 过滤。

Inputs: year, session, response_format.

ed_list_lessonsA
Read-only

一门 Ed 课的 lesson 列表,按模块分组,含 slide 数、截止时间、状态。

Inputs: course_id (required), response_format.

ed_list_resourcesA
Read-only

一门 Ed 课的 Resources 页(讲义、链接、文件),按分类分组,带文件类型和大小。

Inputs: course_id (required), response_format.

ed_list_threadsA
Read-only

一门 Ed 课的讨论列表,可按未读/未回答/收藏过滤,按 new/old/top/hot 排序。

Inputs: course_id (required), sort, limit, offset, +3 more.

ed_list_workspacesA
Read-only

一门 Ed 课的 workspaces(云 IDE 实例),含自己的和教职工共享的公开实例。

Inputs: course_id (required), response_format.

ed_post_commentA

在 Ed 帖子下发评论或回答。comment_type 用 'answer' 回答问题帖(进 Answers 区),'comment' 是普通讨论。发出即上线。

Inputs: content (required), thread_id (required), is_private, comment_type, +1 more.

ed_post_threadA

在 Ed 课程论坛发新帖。content 用 markdown 写,自动转成 Ed XML。发出即上线,没有草稿阶段(is_private 为 true 时只有教职工和你可见)。

Inputs: title (required), content (required), category (required), course_id (required), +4 more.

ed_reply_to_commentA

回复 Ed 上已有的评论。发出即上线。

Inputs: content (required), comment_id (required), is_private, is_anonymous.

ed_search_threadsA
Read-only

在一门 Ed 课里按关键词搜讨论。

Inputs: query (required), course_id (required), limit, response_format.

ed_thread_actionA

切换 Ed 帖子状态。star/unstar 学生可用(私人收藏);pin/unpin/lock/unlock/endorse/unendorse 需要教职工角色。

Inputs: action (required), thread_id (required).

ed_update_workspaceA

改自己的 Ed workspace(改名或共享设置)。只改给出的字段,其余保留。

Inputs: workspace_id (required), title, is_public, public_write.

gradescope_list_assignmentsA
Read-onlyIdempotent

一门 Gradescope 课的作业表:名称、提交状态、分数、发布和截止时间。course_id 从 gradescope_list_courses 拿。

Inputs: course_id (required).

gradescope_list_coursesA
Read-onlyIdempotent

Gradescope 上的全部课程,按学期分组,带课程 id(拿去调 gradescope_list_assignments)。需要 GRADESCOPE_EMAIL / GRADESCOPE_PASSWORD 环境变量。

Inputs: no named parameters.

moodle_delete_forum_postA
DestructiveIdempotent

删掉自己在 Moodle 论坛发的帖子或回复。**删了就没了,Moodle 没有回收站。**删讨论的首楼会连整个讨论一起删掉。学生只有一段编辑窗口(通常 30 分钟),过期就删不了,工具会明确报错。

Inputs: postid (required).

moodle_download_fileA
Read-onlyIdempotent

下载 Moodle 上的文件。url 传 pluginfile.php 开头的完整链接(从其他工具的返回里拿),只接受 Moodle 站内地址。返回内容按文本解码。

Inputs: url (required).

moodle_get_assignmentA
Read-onlyIdempotent

单个作业的状态表:提交状态、评分状态、剩余时间、已交文件、评语。

Inputs: cmid (required).

moodle_get_calendarA
Read-onlyIdempotent

取某月的日历事件。month 是 1-12。

Inputs: year (required), month (required).

moodle_get_course_contentsA
Read-onlyIdempotent

一门课的完整结构:按周次列出全部活动和资源,带 cmid 和模块类型。external 为 true 的是外链,拿不到内容。

Inputs: courseId (required).

moodle_get_discussion_postsA
Read-onlyIdempotent

取一个论坛讨论的完整楼层树,含作者、附件、字数。discussionid 从 moodle_get_forum_discussions 拿。

Inputs: discussionid (required).

moodle_get_forum_discussionsA
Read-onlyIdempotent

一个论坛里的讨论列表。讨论行 url 里 d= 后面的数字就是 discussionid,传给 moodle_get_discussion_posts 看内容。

Inputs: cmid (required).

moodle_get_gradesA
Read-onlyIdempotent

一门课的成绩明细表:每个评分项的分数、区间、反馈。

Inputs: courseId (required).

moodle_get_notificationsC
Read-onlyIdempotent

取站内通知。

Inputs: limit.

moodle_get_overview_gradesB
Read-onlyIdempotent

所有课程的总成绩一览。

Inputs: no named parameters.

moodle_get_upcomingA
Read-onlyIdempotent

接下来要交的东西:待办、临近截止、已逾期三合一。返回里 overdue 标已逾期,action.name 是该做的动作(如 Add submission)。

Inputs: daysAhead.

moodle_list_announcementsA
Read-onlyIdempotent

一门课的公告。公告就是课程里名为 Announcements 的论坛,会自动找到它再取讨论列表。

Inputs: courseId (required).

moodle_list_assignmentsA
Read-onlyIdempotent

一门课的全部作业总表:周次、名称、截止时间、提交状态、分数,一页拿全。

Inputs: courseId (required).

moodle_list_coursesA
Read-onlyIdempotent

列出选修的课程。classification 取 inprogress(当前学期)/past/future/all。

Inputs: classification.

moodle_list_forumsA
Read-onlyIdempotent

一门课的论坛列表,含未读数和订阅状态。注意:行里 url 的 f= 是论坛实例 id,不是 cmid;moodle_get_forum_discussions 要的 cmid 从 moodle_get_course_contents 里 modtype 为 forum 的活动拿。

Inputs: courseId (required).

moodle_post_forum_discussionA

在 Moodle 论坛发一个新讨论帖。cmid 从 moodle_get_course_contents 里 modtype 为 forum 的活动拿。发出即全班可见,没有草稿也没有撤回,发之前请确认内容。学生没有发帖权限的论坛(如只读的公告栏)会直接报错。

Inputs: cmid (required), message (required), subject (required).

moodle_reply_forum_postA

回复 Moodle 论坛里的某个帖子。postid 是被回复那条帖子的 id(从 moodle_get_discussion_posts 的返回里拿)。不给 subject 就沿用 Moodle 预填的「Re: 原标题」。回复立即全班可见。

Inputs: postid (required), message (required), subject.

unsw_fetch_course_outlineA
Read-onlyIdempotent

取一门课的完整官方大纲:评估任务(权重、截止、个人还是小组、每项作业允许怎么用 AI)、学习目标和对应的评估、周程、学术诚信要求。给 coid 直接取;只给课程代码的话会先搜一次,多个学期版本时取第一个。

Inputs: coid, year, course_code.

unsw_find_course_outlineA
Read-onlyIdempotent

按课程代码搜 UNSW 官方课程大纲,返回匹配的学期版本和各自的 coid。同一门课不同学期、不同校区是不同的 outline。这个接口公开、不需要登录。

Inputs: course_code (required), year, limit.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 40 tools

    Disambiguation4/5

    The platform prefixes (ed_, moodle_, gradescope_, unsw_) clearly separate tool clusters, and within each cluster the verbs denote distinct actions. Minor potential confusion exists between tools like ed_thread_action vs ed_edit_thread and moodle_list_announcements vs moodle_list_forums, but descriptions clarify these boundaries.

    Naming Consistency4/5

    Most tools follow a consistent verb_noun pattern with lowercase snake_case and platform prefixes. However, ed_thread_action breaks the verb-first convention (it is noun_action), and a few tools like moodle_get_upcoming use an adjective as the object. Overall the pattern is strong, just imperfect.

    Tool Count2/5

    With 40 tools, this server is far above the 25+ threshold that indicates an excessive count. Although each platform's tools seem justified, the sheer number burdens an agent with selection overhead and makes the server feel bloated rather than focused.

    Completeness4/5

    The server provides comprehensive coverage for the UNSW student domain: Ed threads, lessons, resources, and workspaces; Moodle courses, forums, assignments, grades, and calendar; Gradescope course/assignment lookup; and course outlines. Minor gaps exist (e.g., no Ed thread deletion, no Gradescope grade viewing), but core student workflows are well covered.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      An MCP server that connects AI assistants to university D2L Brightspace and Piazza, enabling query of courses, grades, assignments, deadlines, files, and Piazza posts.
      7
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      An unofficial, local, read-only MCP server that integrates Waseda University's Moodle, class cancellation info, syllabus, and academic calendar, enabling users to query their classes, deadlines, changes, and syllabi with source citations.
      MIT