Canvas LMS MCP Server

Canvas LMS MCP Server

Provides read-only access to Canvas LMS, enabling users to view active courses, grades, and upcoming assignments through natural language queries.

Category
访问服务器

README

Canvas LMS MCP Server

A Model Context Protocol server that gives an MCP client (Claude Desktop, Claude Code, or anything else that speaks MCP) read-only access to your Canvas LMS account.

It answers two questions:

  • "What am I taking and how am I doing?" — active courses with current grades.
  • "What do I still owe and when is it due?" — outstanding assignments with due dates.

Communication uses the standard stdio transport, so the client launches the server as a subprocess. Nothing is written to stdout except MCP traffic.

Requirements

  • Node.js 18.17 or newer (the server uses the built-in fetch)
  • A Canvas personal access token

Install

cd canvas-mcp-server
npm install

Configuration

Both variables are required; the server exits with a clear message if either is missing.

Variable Description Example
CANVAS_API_URL Your Canvas instance root. A trailing / or /api/v1 is fine — it gets normalized. https://asu.instructure.com
CANVAS_ACCESS_TOKEN A Canvas personal access token. 7~AbCdEf...

Getting a Canvas access token

  1. Log in to Canvas.
  2. Go to Account → Settings.
  3. Under Approved Integrations, click + New Access Token.
  4. Give it a purpose and (optionally) an expiry date, then click Generate Token.
  5. Copy the token immediately — Canvas shows it only once.

The token carries your full Canvas privileges. Keep it out of version control, and revoke it from the same settings page if it ever leaks.

Connecting a client

Add the server to your MCP client config, pointing at the absolute path of src/index.js:

{
  "mcpServers": {
    "canvas": {
      "command": "node",
      "args": ["/absolute/path/to/canvas-mcp-server/src/index.js"],
      "env": {
        "CANVAS_API_URL": "https://asu.instructure.com",
        "CANVAS_ACCESS_TOKEN": "your-token-here"
      }
    }
  }
}
  • Claude Desktop — claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\).
  • Claude Code — claude mcp add canvas --env CANVAS_API_URL=... --env CANVAS_ACCESS_TOKEN=... -- node /absolute/path/to/canvas-mcp-server/src/index.js

Restart the client after editing the config.

Tools

list_courses_and_grades

Every course you are actively enrolled in as a student, with its current grade.

Parameter Type Default Description
include_all_terms boolean false Also include active enrollments from terms that have already ended.

Canvas reports grades twice when your institution uses grading periods: once for the period in progress and once for the whole course. The grades.scope field says which one you are looking at:

  • current_grading_period — the score covers the grading period in progress, and course_total_score / course_total_grade carry the whole-course numbers.
  • course_total — the institution does not use grading periods, so the score is the course total.
  • unavailable — Canvas returned no enrollment with grade data.

Within either scope, current_* ignores work that has not been graded yet, while final_* counts ungraded work as a zero.

{
  "courses": [
    {
      "id": "101",
      "name": "Full Stack Web Development",
      "course_code": "GIT-411",
      "term": "Fall 2026",
      "term_start": "2026-08-20T00:00:00Z",
      "term_end": "2026-12-18T00:00:00Z",
      "enrollment_state": "active",
      "grades": {
        "current_score": 88.0,
        "current_grade": "B+",
        "final_score": 80.5,
        "final_grade": "B-",
        "scope": "current_grading_period",
        "grading_period_title": "Fall Term",
        "course_total_score": 91.4,
        "course_total_grade": "A-"
      },
      "html_url": "https://asu.instructure.com/courses/101"
    }
  ],
  "course_count": 1,
  "retrieved_at": "2026-09-01T12:00:00.000Z"
}

list_upcoming_assignments

Assignments across your active courses that are still outstanding, sorted by due date, soonest first.

Parameter Type Default Description
days_ahead integer 1–365, or null 14 How far ahead to look. null removes the upper bound.
include_overdue boolean true Include past-due work that was never turned in.
include_undated boolean false Include outstanding work with no due date.
course_ids string[] all active courses Restrict to specific Canvas course IDs.

An assignment counts as outstanding when it is published, gradable, and not submitted, graded, or excused. Concretely, these are filtered out:

  • anything with a submission timestamp
  • submissions in submitted, pending_review, or graded state
  • excused assignments
  • assignments that already carry a score or grade (manual or on-paper entry)
  • not_graded assignments (attendance placeholders and the like)
  • unpublished assignments
{
  "assignments": [
    {
      "id": "9004",
      "name": "Missed lab writeup",
      "course_id": "101",
      "course_name": "Full Stack Web Development",
      "due_at": "2026-08-28T06:59:00.000Z",
      "days_until_due": -4.2,
      "overdue": true,
      "points_possible": 25,
      "submission_types": ["online_upload"],
      "submission_state": "unsubmitted",
      "missing": true,
      "locked": false,
      "unlock_at": null,
      "lock_at": null,
      "html_url": "https://asu.instructure.com/courses/101/assignments/9004"
    }
  ],
  "assignment_count": 1,
  "courses_checked": 2,
  "window": {
    "from": "2026-09-01T12:00:00.000Z",
    "to": "2026-09-15T12:00:00.000Z",
    "include_overdue": true,
    "include_undated": false
  },
  "errors": [],
  "retrieved_at": "2026-09-01T12:00:00.000Z"
}

If one course cannot be read — concluded, restricted, or otherwise erroring — it is listed in errors and the remaining courses still return results.

Notes on behavior

  • Pagination. Canvas paginates every collection via the Link header. The client follows rel="next" at 100 records per page, capped at 20 pages per endpoint so a bad response cannot loop forever.
  • Concurrency. Assignments are fetched from at most 5 courses at a time to stay clear of Canvas rate limits.
  • Current term. By default only courses whose term has not ended are returned. Canvas's default term has no end date and is always included.
  • Errors. Canvas failures come back as MCP tool errors carrying the status code and Canvas's own message, with a hint for the common cases (401 → bad token, 404 → wrong URL).
  • Read-only. Both tools are annotated readOnlyHint. The server issues only GET requests and never modifies your Canvas data.

Development

npm test    # 36 tests: API client, grade logic, filtering, and an end-to-end MCP round trip

The suite uses a fetch stand-in with recorded Canvas payloads, so no network or real token is needed. All fixture dates are relative to the moment the tests run.

src/
  index.js        MCP server: tool definitions, schemas, stdio wiring
  canvas.js       Canvas REST client: auth, pagination, error mapping
  courses.js      Active-course and grade normalization
  assignments.js  Outstanding-assignment filtering and due-date windows

License

MIT

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选