codex_canvas_mcp
A portable local MCP server enabling Canvas reads and safely gated content authoring (pages, modules, assignments, discussions, quizzes) with multi-layer safety checks.
README
Codex Canvas MCP
A portable local MCP server that lets compatible clients read Canvas and, only after several independent safety checks, author common course content.
Safety model
- Canvas reads are available by default after local credential setup.
- Writing is disabled by default.
- Every content write requires an enabled local policy, an exact per-course allowlist match, exact confirmation text, and approval in the MCP client.
- There is no generic Canvas write tool.
- Credentials stay in 1Password and, optionally, macOS Keychain. They do not belong in this repository or client configuration.
Every content tool is marked as mutating and destructive so compatible clients can require approval. The local server also rejects a call unless its exact confirmation matches the requested action, for example APPROVE CANVAS MODULE WRITE course <course_id>.
What is included
| Tool | Capability | Default |
|---|---|---|
canvas_get_current_user |
Read the authenticated profile | Available |
canvas_list_modules |
Read modules and items for one course | Available |
canvas_read_api |
GET a normalized Canvas API v1 path | Available |
canvas_get_write_policy |
Inspect local policy state | Available |
canvas_write_page |
Create or update one page | Blocked |
canvas_create_module |
Create one module | Blocked |
canvas_create_module_item |
Place one content item in a module | Blocked |
canvas_create_assignment |
Create one assignment | Blocked |
canvas_create_discussion |
Create one discussion | Blocked |
canvas_create_classic_quiz |
Create one Classic Quiz | Blocked |
canvas_create_classic_quiz_question |
Add one question to a Classic Quiz | Blocked |
Set up a new Mac
Prerequisites: Python 3.11 or newer, the 1Password CLI, a 1Password service account that can read only the intended Canvas credential item, and a Canvas API token with the least privileges practical for your work.
-
Clone and install into an isolated environment:
git clone https://github.com/mrchris-ai/codex_canvas_mcp.git cd codex_canvas_mcp python3 -m venv .venv . .venv/bin/activate python -m pip install --upgrade pip python -m pip install -e . -
Create a 1Password item whose concealed field contains the Canvas API token. Give the service account read access only to the containing vault/item. Record the vault name, item name or ID, and concealed field label; do not put their values in this repository.
-
Choose one service-account-token delivery method:
-
For a short-lived shell session, provide
OP_SERVICE_ACCOUNT_TOKENto the MCP server process through your local secret launcher. -
On macOS, store that token in Keychain and configure non-secret lookup labels. Example command (it prompts securely; do not put the token on the command line):
security add-generic-password -U -s "your-service-label" -a "your-account-label" -w
-
-
Configure the server process with these non-secret values:
Variable Purpose CANVAS_BASE_URLCanvas HTTPS origin, such as https://school.instructure.comCANVAS_OP_VAULT1Password vault name or ID CANVAS_OP_ITEMCanvas credential item name or ID CANVAS_OP_FIELDConcealed token field label; defaults to credentialCANVAS_KEYCHAIN_SERVICEmacOS Keychain service label when not using OP_SERVICE_ACCOUNT_TOKENCANVAS_KEYCHAIN_ACCOUNTmacOS Keychain account label when not using OP_SERVICE_ACCOUNT_TOKEN -
Test only the protocol and security gates, without contacting Canvas or reading credentials:
python -m unittest discover -s tests -v printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | python -m canvas_mcp -
Add the stdio server to Codex. The project-level form is:
[mcp_servers.canvas] command = "/absolute/path/to/codex_canvas_mcp/.venv/bin/python" args = ["-m", "canvas_mcp"] [mcp_servers.canvas.env] CANVAS_BASE_URL = "https://school.instructure.com" CANVAS_OP_VAULT = "your-vault" CANVAS_OP_ITEM = "your-item" CANVAS_OP_FIELD = "credential" CANVAS_KEYCHAIN_SERVICE = "your-service-label" CANVAS_KEYCHAIN_ACCOUNT = "your-account-label"Put this in the trusted project's
.codex/config.tomlor your personal Codex configuration. Do not add secret values. Restart or open a new task after changing MCP configuration, then verify the listed tools before requesting Canvas data.
ChatGPT compatibility
This repository implements a local stdio MCP server for Codex and other clients that support local stdio MCP. Current ChatGPT custom apps do not connect directly to a local stdio server. OpenAI's current guidance is to expose a private local MCP through Secure MCP Tunnel (or deploy a reviewed remote MCP endpoint), subject to plan and workspace-admin availability. Do not expose this process directly to the public internet.
See Developer mode and MCP apps in ChatGPT before attempting ChatGPT setup; availability and approval behavior can change.
Enabling content-authoring tools
Keep writing off unless a specific task requires it.
-
Copy
config/write-policy.example.jsonto a location outside the repository. -
Add only the exact Canvas course IDs approved for content authoring.
-
Set
enabledtotrueand restrict the file:chmod 600 /absolute/private/path/write-policy.json -
Add
CANVAS_WRITE_POLICY=/absolute/private/path/write-policy.jsonto the MCP server environment. -
Restart the client and call
canvas_get_write_policyto verify the effective policy. -
For each content write, review the exact target and payload. Supply the action-specific confirmation phrase and approve the mutating action in the client.
-
Disable the policy again when the task is complete.
If the variable is absent, the file is missing, permissions are broader than 0600, writing is disabled, or the course is not allowlisted, the server refuses the write.
Current authoring boundary
This project is the source of truth for the shared local Canvas MCP used by supported chats on this Mac. It can author Pages, Modules and module items, Assignments, Discussions, and Classic Quizzes with questions after the normal policy and approval gates. It does not yet upload local files, create New Quizzes, or perform account/course administration. File upload requires a separate payload-specific approval design so the MCP never sends an unintended local file to Canvas.
See docs/2026-08-06-content-authoring-extension.md for the implementation and end-to-end validation record.
Development
python -m pip install -e .
python -m unittest discover -s tests -v
python -m compileall -q src tests
Tests mock network and credential boundaries. See AGENTS.md for invariants contributors must preserve and ROADMAP.md for intentionally deferred administrative features.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。