Skip to content

refactor(mcp): remove canvas tool and resource write endpoints#1111

Merged
phernandez merged 1 commit into
mainfrom
refactor/1106-remove-canvas-resource-writes
Jul 20, 2026
Merged

refactor(mcp): remove canvas tool and resource write endpoints#1111
phernandez merged 1 commit into
mainfrom
refactor/1106-remove-canvas-resource-writes

Conversation

@phernandez

Copy link
Copy Markdown
Member

Summary

From the 2026-07 architecture review (#1106). The canvas MCP tool was the only writer of the v2 resource POST/PUT endpoints — the last file-first write fork inside an API request (on cloud, a synchronous Tigris write). With canvas removed, the resource surface becomes read-only and the write invariant holds: markdown notes = DB-first accepted writes through the knowledge router; everything else = file-first through the storage-event indexing pipeline.

  • Delete mcp/tools/canvas.py and its registration in mcp/tools/__init__.py
  • Drop POST /resource and PUT /resource/{entity_id} from the v2 resource router; GET /resource/{entity_id} remains (used by read_content/read_note)
  • Delete now-dead schemas/v2/resource.py (CreateResourceRequest, UpdateResourceRequest, ResourceResponse) and re-exports
  • ResourceClient already had no write methods — no client changes needed
  • Rework resource router read tests to seed entities directly (file on disk + entity row) instead of using the removed POST; add test_resource_write_methods_removed locking in the read-only surface
  • Update docs/skills that referenced the canvas tool; .canvas file format handling (file_service, bm format) is unchanged

Not covered here (cross-repo): documenting the invariant in basic-memory-cloud docs/ARCHITECTURE.md — tracked in #1106.

Test plan

  • uv run pytest tests/mcp tests/api/v2 — 1050 passed
  • uv run pytest test-int/mcp/test_string_params_integration.py test-int/mcp/test_param_aliases_integration.py — 23 passed
  • just typecheck — clean (9 pre-existing uvloop deprecation warnings only)
  • just package-check-skills — 15 skills validated

Part of #1106

🤖 Generated with Claude Code

The canvas MCP tool was the only writer of the v2 resource POST/PUT
endpoints - the remaining file-first write fork inside an API request.
Remove the tool and the write endpoints so the resource surface is
read-only: markdown notes flow through the knowledge router's DB-first
accepted-write pipeline, and every other file kind arrives file-first
through the storage-event indexing pipeline.

- delete mcp/tools/canvas.py and its registration
- drop POST/PUT from api/v2/routers/resource_router.py (GET remains)
- delete now-dead schemas/v2/resource.py request/response models
- rework resource router read tests to seed entities directly; add a
  regression test locking in the read-only surface
- update docs/skills that referenced the canvas tool (.canvas file
  format handling is unchanged)

Part of #1106

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: phernandez <paul@basicmachines.co>
@phernandez
phernandez merged commit 7a4d3dd into main Jul 20, 2026
26 checks passed
@phernandez
phernandez deleted the refactor/1106-remove-canvas-resource-writes branch July 20, 2026 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant