Gradescope MCP Server

Gradescope MCP Server

An MCP server that enables AI assistants to interact with Gradescope for course management, grading workflows, and regrade reviews. It provides instructors and TAs with tools for assignment management, individual or batch grading, and rubric manipulation.

Category
访问服务器

README

Gradescope MCP Server

An MCP (Model Context Protocol) server for Gradescope that exposes course management, grading, regrade review, statistics, and AI-assisted grading workflows to MCP clients.

The server is designed for instructors and TAs who want to use AI agents with real Gradescope data while keeping write operations gated behind explicit confirmation.

This repository also includes a reusable local skill at skills/gradescope-assisted-grading/SKILL.md for human-approved grading workflows.

Current Status

  • 34 MCP tools
  • 3 MCP resources
  • 7 MCP prompts
  • 30 automated tests
  • Python 3.10+
  • Package manager: uv

What The Project Provides

Read-oriented workflows

  • Course discovery and assignment listing
  • Assignment outline parsing for online and scanned-PDF assignments
  • Roster inspection with a custom HTML parser
  • Submission listing for multiple assignment types
  • Grading progress, rubric context, answer groups, regrades, and statistics
  • Workflow helpers that cache grading artifacts and answer-key snapshots to /tmp

Write-oriented workflows

  • Uploading submissions
  • Setting student extensions
  • Modifying assignment dates
  • Renaming assignments
  • Applying grades
  • Creating, updating, and deleting rubric items
  • Batch grading answer groups

All write-capable tools are preview-first and require confirm_write=True before any mutation is executed.

Tool Inventory

Core

Tool Description Access
tool_list_courses List all courses grouped by role All
tool_get_assignments List assignments for a course All
tool_get_assignment_details Get one assignment's details All
tool_upload_submission Upload files to an assignment All

Instructor / TA Management

Tool Description
tool_get_course_roster Full roster grouped by role
tool_get_extensions View assignment extensions
tool_set_extension Add or update one student's extension
tool_modify_assignment_dates Change release / due / late-due dates
tool_rename_assignment Rename an assignment
tool_get_assignment_submissions List assignment submissions
tool_get_student_submission Read one student's submission content
tool_get_assignment_graders View graders for a question

Grading Read

Tool Description
tool_get_assignment_outline Question hierarchy, IDs, weights, prompt text
tool_export_assignment_scores Assignment score export and summary
tool_get_grading_progress Per-question grading dashboard
tool_get_submission_grading_context Full grading context for a question submission
tool_get_question_rubric Rubric inspection without a submission ID
tool_list_question_submissions List Question Submission IDs, filterable by grade state
tool_get_next_ungraded Navigate to the next ungraded question submission

Grading Write

Tool Description
tool_apply_grade Apply rubric items, comments, and point adjustments
tool_create_rubric_item Create a rubric item
tool_update_rubric_item Update a rubric item
tool_delete_rubric_item Delete a rubric item

AI-Assisted / Workflow Helpers

Tool Description
tool_prepare_grading_artifact Save a question-specific grading artifact to /tmp
tool_assess_submission_readiness Estimate whether auto-grading is safe enough to attempt
tool_cache_relevant_pages Download crop and nearby pages to /tmp
tool_prepare_answer_key Save assignment-wide answer-key notes to /tmp
tool_smart_read_submission Return a crop-first reading plan

Answer Groups

Tool Description
tool_get_answer_groups List AI-clustered answer groups
tool_get_answer_group_detail Inspect one answer group
tool_grade_answer_group Batch-grade one answer group

Regrades

Tool Description
tool_get_regrade_requests List regrade requests
tool_get_regrade_detail Inspect one regrade request

Statistics

Tool Description
tool_get_assignment_statistics Assignment-level and per-question statistics

Resources

URI Description
gradescope://courses Current course list
gradescope://courses/{course_id}/assignments Assignment list for a course
gradescope://courses/{course_id}/roster Roster for a course

Prompts

Prompt Description
summarize_course_progress Summarize assignment status in a course
manage_extensions_workflow Guide extension-management work
check_submission_stats Summarize assignment submission status
generate_rubric_from_outline Draft a rubric from assignment structure
grade_submission_with_rubric Walk through grading one student's work
review_regrade_requests Review pending regrade requests
auto_grade_question Run a confidence-gated grading workflow for one question

Architecture

Entry points

  • src/gradescope_mcp/__main__.py: loads .env, configures logging, runs the FastMCP server
  • src/gradescope_mcp/server.py: registers all tools, resources, and prompts

Authentication

  • src/gradescope_mcp/auth.py: maintains a singleton GSConnection
  • Credentials come from GRADESCOPE_EMAIL and GRADESCOPE_PASSWORD
  • .env is loaded automatically when starting with python -m gradescope_mcp

Tool modules

  • tools/courses.py: course listing and roster parsing
  • tools/assignments.py: assignment listing and assignment write operations
  • tools/submissions.py: uploads, submission listing, grader discovery
  • tools/extensions.py: extension reads and writes
  • tools/grading.py: outline parsing, score exports, grading progress
  • tools/grading_ops.py: grading context, writes, rubric CRUD, navigation
  • tools/grading_workflow.py: /tmp artifacts, answer keys, readiness, page caching, smart reading
  • tools/answer_groups.py: AI-assisted answer-group inspection and batch writes
  • tools/regrades.py: regrade listing and detail inspection
  • tools/statistics.py: assignment statistics
  • tools/safety.py: preview-first confirmation helpers for mutations

Important Behavior And Constraints

Write safety

  • Mutating tools return a preview when confirm_write=False
  • The actual change only happens with confirm_write=True
  • Rubric edits and deletions can cascade to existing grades
  • tool_grade_answer_group can affect many submissions at once and needs extra care

Submission IDs

  • tool_get_assignment_submissions returns assignment-level Global Submission IDs
  • Grading tools require Question Submission IDs
  • Use tool_list_question_submissions, tool_get_next_ungraded, or grading context tools to get the correct IDs

Scoring direction

  • Gradescope questions may be positive or negative scoring
  • Rubric weights are stored as positive numbers in both modes
  • The scoring mode determines whether a checked rubric item adds or deducts points

Scanned / handwritten assignments

  • Structured reference answers are often unavailable
  • This is expected, not necessarily a parsing failure
  • The workflow helpers are built to use crop regions, full pages, adjacent pages, rubric text, and user-provided reference notes

Quick Start

1. Prerequisites

  • Python 3.10+
  • uv

2. Install

git clone https://github.com/Yuanpeng-Li/gradescope-mcp.git
cd gradescope-mcp
cp .env.example .env

Then edit .env with your Gradescope credentials.

3. Run locally

uv run python -m gradescope_mcp

4. Configure an MCP client

Example client configuration:

{
  "mcpServers": {
    "gradescope": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/path/to/gradescope-mcp",
        "python",
        "-m",
        "gradescope_mcp"
      ],
      "env": {
        "GRADESCOPE_EMAIL": "your_email@example.com",
        "GRADESCOPE_PASSWORD": "your_password"
      }
    }
  }
}

5. Debug with MCP Inspector

npx @modelcontextprotocol/inspector uv run python -m gradescope_mcp

6. Run tests

uv run pytest -q

Assisted Grading Skill

The repository includes one project-local skill:

  • gradescope-assisted-grading

It is intended for:

  • preview-first grading
  • rubric review before mutation
  • scanned exam grading
  • answer-group triage
  • explicit human approval before any grade write

Install the skill locally

mkdir -p .agent/skills
ln -s "$(pwd)/skills/gradescope-assisted-grading" .agent/skills/gradescope-assisted-grading

If you prefer copying:

mkdir -p .agent/skills
cp -R skills/gradescope-assisted-grading .agent/skills/

Verify installation

ls .agent/skills/gradescope-assisted-grading
cat .agent/skills/gradescope-assisted-grading/SKILL.md

Invoke it from a client with:

  • Use the gradescope-assisted-grading skill
  • $gradescope-assisted-grading

Project Structure

gradescope-mcp/
├── .env.example
├── AGENT.md
├── DEVLOG.md
├── OPERATIONS_LOGS/
│   └── RECORDS.md
├── README.md
├── pyproject.toml
├── skills/
│   └── gradescope-assisted-grading/
│       └── SKILL.md
├── src/
│   └── gradescope_mcp/
│       ├── __init__.py
│       ├── __main__.py
│       ├── auth.py
│       ├── server.py
│       └── tools/
│           ├── __init__.py
│           ├── answer_groups.py
│           ├── assignments.py
│           ├── courses.py
│           ├── extensions.py
│           ├── grading.py
│           ├── grading_ops.py
│           ├── grading_workflow.py
│           ├── regrades.py
│           ├── safety.py
│           ├── statistics.py
│           └── submissions.py
└── tests/
    ├── test_answer_groups.py
    ├── test_assignments_and_grading_ops.py
    ├── test_extensions_and_answer_key.py
    ├── test_grading_workflow.py
    └── test_write_safety.py

Development Notes

  • AGENT.md summarizes the current architecture and maintenance expectations
  • DEVLOG.md records the implementation history
  • OPERATIONS_LOGS/RECORDS.md is the mutation log template for real-account testing

Known Caveats

  1. Gradescope behavior differs across assignment types; several tools rely on HTML parsing or reverse-engineered endpoints.
  2. Roster parsing uses a custom parser because the upstream library parser is unreliable when sections are present.
  3. Some assignment types do not support the extensions API even for staff users.
  4. Scanned assignments usually do not provide a structured answer key.
  5. Question grading requires Question Submission IDs, not assignment-level Global Submission IDs.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选