canvas-teacher-mcp

canvas-teacher-mcp

An MCP server for Canvas LMS that enables assistants to read course content, create assignments and pages, set due dates, and post announcements via the Canvas REST API.

Category
访问服务器

README

canvas-teacher-mcp

An MCP server for Canvas LMS. Ask your assistant to read a course, build an assignment page, set due dates or post an announcement — it calls the Canvas REST API for you.

v0.1.0 — read and write course content. Grading is not in this release.

Install

Nothing to install. Point your MCP client at it and uvx fetches it on first run.

{
  "mcpServers": {
    "canvas-teacher": {
      "command": "uvx",
      "args": ["canvas-teacher-mcp"],
      "env": { "CANVAS_LMS_ROOT": "/path/to/your/teaching/tree" }
    }
  }
}

Then say "set up Canvas". CANVAS_LMS_ROOT is the one thing you choose — set it in env as above, or leave it out and answer when setup asks.

Setup — what the setup tool does

It runs in conversation: each call does one step and returns the next question. Nothing is overwritten, so running it again is safe.

Step What happens
1 Root. Reads CANVAS_LMS_ROOT, or asks. Creates the tree and Sqlite/.
2 Workflow. Copies the working rules to <ROOT>/.claude/CourseGlobalWorkflow/ — yours to edit.
3 Skills. Copies the page, quiz, announcement and notebook methods to <ROOT>/.claude/skills/.
4 Post-gate. Copies post-gate.py to ~/.claude/hooks/ (Claude Code), so no grade can be posted until you open the gate from a real terminal.
5 School. Writes Canvas-Auth/<school>.json from your Canvas URL, takes a token, or opens a browser login when your school issues none. Verifies the connection.
6 Course. Creates <SCHOOL>/<ORG>/<COURSE>/ and its course-config/<slug>.json from the course URL.

Steps 2 and 3 land in your tree, not in the package, so your edits survive an upgrade. Add another school or course by asking again — only steps 5 and 6 repeat.

<ROOT>/
├─ .claude/
│  └─ Canvas-Auth/                    credentials
│     ├─ <school>.json                {base_url, token}
│     └─ storageState/<school>/       cookie schools only
└─ <SCHOOL>/<ORG>/<COURSE>/
   └─ .claude/
      ├─ course-config/<slug>.json    the course's coordinates
      ├─ input/                       material you bring in
      └─ output/<kind>/               everything the server writes

One school means one school folder. The shape does not change.

Set up a course

Ask the assistant to add a course and give it the Canvas URL. It derives the rest, confirms once, and caches five keys:

{
  "canvas_url":   "https://school.instructure.com/courses/12345",
  "school":       "school",
  "db_path":      "$HOME/.../Sqlite/<COURSE>-<TERM>.db",
  "github_org":   "MY-ORG",
  "drive_folder": "1AbC..."
}

Only canvas_url is required. course_id, base_url, domain and the token env var are derived from it, never stored.

Authenticate

Two ways in, one REST API. The server picks whichever your school has.

Your school What you provide
issues API tokens <ROOT>/.claude/Canvas-Auth/<school>.json = {"base_url": "...", "token": "..."}, or $<SCHOOL>_CANVAS_TOKEN
SSO only, no tokens a one-time browser login; the session cookie is saved and refreshed automatically

chmod 600 the credential files, and keep Canvas-Auth/ out of git.

What it does

Read

  • courses, modules and module items
  • assignments, quizzes and their questions
  • pages
  • submissions, with attachments fetched and read (PDF, images, Office files, Colab notebooks)
  • students, by Canvas uid
  • every link and embed in a page, module, assignment or quiz

Write

  • create and update assignments and pages
  • add items to a module
  • set due dates
  • post an announcement — always previewed first, sent only when you say so

Everything is created unpublished. Publishing stays a manual instructor action.

What it does not do

  • Post grades. Grading needs safeguards this release does not ship. It is the next milestone.
  • Delete anything. No endpoint in this server removes a course, an assignment or a submission.
  • Store your grades. Canvas is the record.

Notes it will save you

The Canvas API returns HTTP 200 for several calls that change nothing. This server sends the forms Canvas actually accepts:

  • a grade must be form-encoded; as JSON it returns 200 and sets nothing
  • a quiz-question update needs the FULL payload, or it applies nothing
  • question_count stays cached until the quiz is touched again
  • seconds_late_override is ignored when sent with late_policy_status
  • submission comments render HTML in SpeedGrader, but the API returns them flattened — the API response is not proof of what the student sees

Requirements

Python 3.10+. uvx handles the rest. A cookie school also needs Playwright's Chrome, installed on first login.

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

官方
精选