canvas-mcp

canvas-mcp

Connects Canvas LMS to Claude Desktop, enabling natural-language queries about courses, assignments, grades, and more.

Category
访问服务器

README

canvas-mcp

A Model Context Protocol (MCP) server that connects your Canvas LMS account to Claude Desktop. Ask Claude natural-language questions about your courses, assignments, grades, files, and more -- all powered by the Canvas REST API.

Features

canvas-mcp exposes 15 tools to Claude Desktop:

Tool Description
get_courses List all active enrolled courses
get_assignments Assignments for a specific course with submission status
get_all_assignments Every assignment across all courses, sorted by due date
get_upcoming_assignments Assignments due in the next N days (default 7)
get_calendar_events Upcoming calendar events (next 30 days)
get_submission_status Per-assignment submission state (submitted / graded / unsubmitted)
get_grades Current and final grade plus per-assignment scores
get_course_modules Modules with item completion status
get_announcements Recent announcements across all courses
get_todo_items Your Canvas to-do list
get_course_files List files uploaded to a course (PDFs, slides, etc.)
get_course_pages List wiki/content pages in a course
get_page_content Read the full text of a specific course page
read_course_file Download and parse a file -- full PDF text extraction
get_module_item_content Read content of all items in a module (lectures, notes, PDFs)

Project Structure

canvas-mcp/
├── src/
│   ├── index.ts          # MCP server entry point, tool definitions, and dispatch
│   ├── tools.ts          # Tool implementation functions
│   └── canvas-client.ts  # Canvas API client: HTTP helpers, pagination, type definitions
├── dist/                 # Compiled JavaScript (generated by build)
├── .env                  # Your credentials (not committed)
├── .gitignore
├── package.json
├── tsconfig.json
└── README.md

Prerequisites

  • Node.js >= 18
  • A Canvas LMS API access token

Getting a Canvas API Token

  1. Log in to your Canvas instance (e.g. https://yourschool.instructure.com)
  2. Go to Account > Settings
  3. Scroll to Approved Integrations
  4. Click + New Access Token
  5. Give it a name (e.g. "Claude MCP") and optionally set an expiry
  6. Copy the token -- you will not be able to see it again

Setup

1. Clone the repository

git clone https://github.com/YOUR_USERNAME/canvas-mcp.git
cd canvas-mcp

2. Install dependencies

npm install

3. Configure environment variables

Create a .env file in the project root:

CANVAS_TOKEN=your_canvas_api_token_here
CANVAS_DOMAIN=yourschool.instructure.com

CANVAS_DOMAIN should be just the hostname (no https:// prefix).

4. Build

npm run build

This compiles the TypeScript source to dist/.

5. Verify (optional)

node dist/index.js

The server communicates over stdio using the MCP protocol. It will start and wait for input. Press Ctrl+C to exit. If environment variables are missing, you will see a clear error immediately.

Connecting to Claude Desktop

Add the server to your Claude Desktop configuration file.

macOS

Edit ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "canvas": {
      "command": "node",
      "args": ["/absolute/path/to/canvas-mcp/dist/index.js"],
      "env": {
        "CANVAS_TOKEN": "your_canvas_token_here",
        "CANVAS_DOMAIN": "yourschool.instructure.com"
      }
    }
  }
}

Windows

Edit %APPDATA%\Claude\claude_desktop_config.json:

{
  "mcpServers": {
    "canvas": {
      "command": "node",
      "args": ["C:\\Users\\YOU\\path\\to\\canvas-mcp\\dist\\index.js"],
      "env": {
        "CANVAS_TOKEN": "your_canvas_token_here",
        "CANVAS_DOMAIN": "yourschool.instructure.com"
      }
    }
  }
}

Replace the path with the absolute path to your compiled dist/index.js. After saving, restart Claude Desktop.

Example Prompts

Once connected, try these in Claude Desktop:

Assignment planning

  • "What assignments do I have due this week?"
  • "Show me everything due in the next 14 days."
  • "Build me a study schedule for the next two weeks based on my due dates."

Submission tracking

  • "Am I missing any submissions?"
  • "Which assignments haven't I submitted yet in course 12345?"
  • "Show me all overdue assignments."

Grades

  • "What's my current grade in my Biology course?"
  • "Show me all my graded assignments and scores."
  • "Which course am I doing worst in?"

Course content

  • "What courses am I enrolled in this semester?"
  • "What was covered in this week's lectures for course 12345?"
  • "Read the syllabus PDF from my math course."
  • "What modules have I completed in course 12345?"

Comprehensive

  • "Give me a full academic status report -- courses, grades, upcoming work, and missing submissions."
  • "I have a free weekend. What should I prioritize based on upcoming deadlines and my current grades?"

Development

# Run in dev mode without building (uses ts-node)
npm run dev

# Rebuild after making changes
npm run build

Troubleshooting

Problem Solution
Missing required environment variables Check your .env file or the env block in claude_desktop_config.json
Canvas API error 401 Your token is invalid or expired -- generate a new one
Canvas API error 403 You do not have permission to access that resource
No active courses found Your enrollment state may differ -- verify in Canvas directly
Claude does not see the server Verify the absolute path in your config and restart Claude Desktop

License

This project does not currently include a license file.

推荐服务器

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

官方
精选