canvas-mcp
CLAUDE.md276 starsChanged 3 months agoMITView on GitHub
Guidance for developing the Canvas MCP server. Agents using the server: see AGENTS.md. Design: internal/architecture.md. Long-form rules and the reasons behind them: internal/dev-reference.md. Completed work: internal/project-history.md, CHANGELOG.md. Codex reads AGENTS.md, not this file; its "Developing this server" section points here, so keep development rules in this file only. Paths, flags, symbols and issue states below were checked on 2026-09-30.
- Reads credentials
- Installs packages
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/llms.txtllms.txt
- canvas-accessibility-auditorSkill
- canvas-bulk-gradingSkill
- canvas-course-builderSkill
- canvas-course-qcSkill
- canvas-discussion-facilitatorSkill
- canvas-morning-checkSkill
- canvas-peer-review-managerSkill
- canvas-week-planSkill
The file
We split this CLAUDE.md into the rules it gives an agent
10 rules. About 0 are common, 5 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 9
Before committing: uv run python -m pytest tests/ -v -rf.
- Very specific: line 12
Before a feature or significant change, ask: feature branch or main?
- Very specific: line 14
After a sibling PR merges, rebase surviving worktree branches and rerun tests.
- Very specific: line 16
Run ./scripts/install-hooks.sh once per clone.
- Very specific: line 22
All Canvas calls are async and go through make_canvas_request().
- Distinctive: line 33
Use a real client with controlled HTTP transport when the risk is serialization, retries, pagination or error classification.
- Distinctive: line 34
Never send live Canvas writes to verify a patch.
- Distinctive: line 51
Never print a PyPI download count.
- Distinctive: line 52
Do not repeat "over 18,000 clones" or "UMich selected it as sole candidate" without a primary source.
- Distinctive: line 53
Do not imply a campus security review: the only Illinois artifact is Adam King's LRA, and the public hosted server is retired.
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
Guidance for developing the Canvas MCP server. Agents using the server: see AGENTS.md.
Design: internal/architecture.md. Long-form rules and the reasons behind them: internal/dev-reference.md. Completed work: internal/project-history.md, CHANGELOG.md.
Codex reads AGENTS.md, not this file; its "Developing this server" section points here, so keep development rules in this file only. Paths, flags, symbols and issue states below were checked on 2026-09-30.
Commands
- Install
uv pip install -e .; runcanvas-mcp-server(--test,--config);.envholdsCANVAS_API_TOKENandCANVAS_API_URL. - Before committing:
uv run python -m pytest tests/ -v -rf. TypeScript changes:npm testandnpm run build.
Git Workflow - ASK FIRST
- Before a feature or significant change, ask: feature branch or
main? Defaults: new toolfeature/, bugfix/, docs or typo may go straight tomain. Prefixes:feature/,fix/,docs/,refactor/. - The primary checkout stays on
main, clean and read-only. One PR = one sibling worktreecanvas-mcp-<slug>fromorigin/main; never reuse it for another issue; remove it and the branch (local and remote) after merge. - After a sibling PR merges, rebase surviving worktree branches and rerun tests. Before tagging, run the suite in the primary checkout on the merged commit (its
.envsets a token that worktrees and CI lack). mainrequires a PR plustest-enhancementsandlint; the admin can bypass the review requirement.- Run
./scripts/install-hooks.shonce per clone.fixes|closes|resolves #Nmid-sentence in a commit or PR body closes the issue on merge: rephrase (closed [issue 172]) or setALLOW_CLOSING_KEYWORD=1. A trailer that opens a line (Closes #173) is allowed. - Release steps and publish-race fixes: internal/release-checklist.md. Breaking changes need a minor bump.
Coding Standards
- Type hints on every function; PEP 604 unions (
X | Y), enforced by ruff UP. - Tools use
@mcp.tool()with@validate_params, and every tool carries annotations (tests/test_tool_metadata.pyfails a bare decorator). - All Canvas calls are async and go through
make_canvas_request(); paginate every list endpoint. - Course identifiers are
str | intresolved withget_course_id(); dates go out throughformat_date(). - Canvas POST/PUT needs
use_form_data=True,/conversationsincluded. - Errors: dict tools return an
"error"key; string tools return"Error ...".modules.pyandaccessibility.pyreturn JSON-stringified errors; keep the local convention. - Privacy: student IDs preserved, names anonymized at the client layer (
_should_anonymize_endpoint()); a new endpoint must be checked against the tier rules. - Show course codes, not IDs, in user-facing output; handle published and unpublished states.
Testing and behavioral evidence
- New tools need meaningful automated coverage: success, failure, boundary and safety behavior.
- A reproducible bug gets a failing regression first; watch it fail for the intended reason.
- Assert outgoing request contracts and forbidden side effects, from an independent requirement, not from the implementation's own output.
- Use a real client with controlled HTTP transport when the risk is serialization, retries, pagination or error classification.
- Never send live Canvas writes to verify a patch. Never weaken an assertion to get a green run.
- Lean/TLA+ (
verify/) only for consequential state, ownership or termination invariants; pair with implementation regressions. - Report what was verified, what failed and what was skipped.
Documentation Maintenance
- Source of truth: agents
AGENTS.md; humanstools/README.md; machinetools/TOOL_MANIFEST.json;README.mdis the entry point. - New tool: update
tools/README.md, thenAGENTS.md, thenTOOL_MANIFEST.json. TouchREADME.mdonly for a major feature. No tool usage docs in this file. docs/is the public Cloudflare Pages root and deploys manually (wrangler pages deploy docs/); nothing internal goes there.internal/is deny-by-default in.gitignore; un-ignore only a file meant to be public.internal/session-history.mdstays untracked.- Triage briefs are tracked: never record a collaborator's affiliation, evaluation status, timeline or competing products. Name the person and the technical issue only.
Hosted Deployment
- A private, Entra-gated Azure instance serves Gies course staff. Its URL, app IDs, deploy details and key holders stay out of this repo; they live in the gitignored
internal/ops-hosted.local.md. - HTTP mode: each caller sends
X-Canvas-Token;CANVAS_API_TOKENmust never be set (startup guard); read-only unlessALLOWED_WRITE_TOOLSis set. - Merging to
maindoes not deploy production. It deploys on av*tag orgh workflow run deploy-prod.yml --ref main;stagingdeploys on push.
Adoption numbers
- Never print a PyPI download count. Quote stars, forks and contributors, re-pulled from the GitHub API that day, with the date.
- Do not repeat "over 18,000 clones" or "UMich selected it as sole candidate" without a primary source.
- Do not imply a campus security review: the only Illinois artifact is Adam King's LRA, and the public hosted server is retired.
Current Focus
- #157 sandbox egress is mitigated, not closed (self-hosted only;
execute_typescriptis disabled on hosted). Needs an egress proxy or network namespace. - #236 OAuth2 developer-key flow: additive only, blocked on admin access to pilot a scoped key.
- #172 Canvas Quizzes tools: blocked on a New-Quizzes-enabled sandbox (PR #191 was closed as unverifiable).
- #418 to #420 shipped to
main2026-10-01 (#438, #437, #436); #421 part 1 shipped (#435), still open for part 2 (GraphQL read path) and anupdate_discussion_topicrefusal on anonymous topics. - Release v1.14.0 (minor):
CHANGELOG.mdUnreleased covers #433, #435, #436, #437, #438.assign_peer_reviewnow requires a numericreviewee_id; guarded edits are mock-verified only, so try one on a real page first. - GHSA-hmr8: publish and request a CVE. GHSA-7pp5: decide (in triage since 07-04).
- Watch, no owner: Agent Plugins packaging (blocked on credential delivery; triggers in project-history).
Roadmap
- Grok/xAI integration research and pilot.
Backlog
- Module templates; bulk module creation from JSON/YAML; module duplication across courses.
- Page templates; bulk page creation from markdown; page versioning tools.
- 2026-09-06 security review follow-ups: check
docs/superpowers/plans/2026-09-06-security-review-followups.mdfor items PR #360 did not cover.
Session Log
Full history:
internal/session-history.md, local-only and untracked since 2026-08-20. Do not re-add it to git.
2026-09-30 06:44 → 2026-10-01 22:49 CDT — six PRs merged, CLAUDE.md trimmed, issue agents
- Merged: #432 (
pyjwt2.15.1) and #434 (urllib32.8.0), both lockfile-only after new advisories turned the dependency scan red; #423 (@lindsay-cheng,missingflag); Dependabot #427 to #429; #433 (@papatistos, group discussions, plus a numericgroup_idcheck); and agent PRs #435 (#421 part 1), #436 (#420), #437 (#419), #438 (#418). Codex gated #436 (2 rounds) and #437 (3 rounds); 7 real defects fixed before merge. - Mistake: #435 merged with red tests (merge not gated on checks); fixed on
mainin8c3ff15. Run the suite as CI does:CANVAS_API_URL= CANVAS_API_TOKEN= uv run --all-extras pytest tests/ -q(barepytest, no credentials). - Docs: CLAUDE.md 497 → 78 lines (
internal/dev-reference.md,internal/project-history.md); AGENTS.md "Developing this server" pointer for Codex; reference claims checked and dated. - Housekeeping: 74 stale remote branches deleted (10 with local backups under
refs/backup/); fleet hooks hidden locally (info/exclude+ skip-worktree on.githooks/commit-msg); closed #374, #375, #384. MCP events assessment ininternal/research/2026-09-30-openai-mcp-events.md(recommendation: wait). - Next: review #439 (@papatistos, #421 part 2 via GraphQL, opened 10-01 evening, fork CI needs approval); release v1.14.0; publish GHSA-hmr8 + CVE; decide GHSA-7pp5; #421 part 2;
fastmcp4.0.3 → 4.0.10 patch and themcp2.2.0 review (#416); #391 Windowsuvdesign.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

