canvaskeep-mcp
OfficialCanvasKeep MCP Server
An MCP (Model Context Protocol) server that lets AI tools like Claude Code and Codex generate Excalidraw diagrams and save them directly into your CanvasKeep workspace.
Setup
1. Get an API key
Log in to CanvasKeep
Click your profile menu (top right) and select API Keys
Generate a new key and copy it immediately (you won't see it again)
2. Install and register
Claude Code:
claude mcp add canvaskeep \
-e CANVASKEEP_API_KEY=ck_your_key_here \
-- npx canvaskeep-mcpCodex / other MCP clients:
{
"mcpServers": {
"canvaskeep": {
"command": "npx",
"args": ["canvaskeep-mcp"],
"env": {
"CANVASKEEP_API_KEY": "ck_your_key_here"
}
}
}
}3. Environment variables
Variable | Required | Default | Description |
| Yes | - | Your API key from the CanvasKeep dashboard |
| No | - | Needed to read or edit encrypted diagrams. Copy it from canvaskeep.com/dashboard/encryption (Key for the MCP server) |
| No |
| API base URL (override for local dev) |
Related MCP server: Excalidraw MCP Server
Available tools
Tool | Description |
| List all your workspaces |
| Create a new workspace |
| List folders in a workspace |
| Create a new folder, optionally nested |
| List diagrams in a workspace |
| Create a diagram, optionally inside a folder |
| Rename a diagram |
| Permanently delete a diagram |
| Get diagram metadata and element count |
| Read the full Excalidraw scene of a diagram |
| Write a full Excalidraw scene back to a diagram |
| Generate a diagram from nodes and edges with auto-layout |
Encryption
Diagrams you encrypt in CanvasKeep stay encrypted when an AI tool works with them. When get_diagram_scene or save_diagram_scene touches an encrypted diagram, this server decrypts and re-encrypts it locally (AES-GCM, see src/encryption.ts) using CANVASKEEP_MASTER_KEY. The master key never leaves your machine.
generate_diagram sends the nodes and edges you give it to CanvasKeep, which lays them out on the server, so diagrams generated this way are stored unencrypted.
Example usage
Ask Claude Code something like:
"Draw an architecture diagram of a web app with a React frontend, Node API, PostgreSQL database, and Redis cache"
Claude will use the MCP tools to create a diagram in your CanvasKeep workspace with properly laid-out boxes and labeled arrows.
Development
git clone https://github.com/CanvasKeep/canvaskeep-mcp.git
cd canvaskeep-mcp
npm install
npm run build
CANVASKEEP_API_KEY=ck_... CANVASKEEP_API_URL=http://localhost:3000 node dist/index.jsTo run your local build from Claude Code:
claude mcp add canvaskeep \
-e CANVASKEEP_API_KEY=ck_your_key_here \
-- node /path/to/canvaskeep-mcp/dist/index.jsLicense
Available Tools
12 toolscreate_diagramA
Create a new empty diagram in a workspace, optionally inside a folder. Returns the new diagram's id. Use generate_diagram afterward to populate it with content. Use list_folders first to find the folder_id if you want to place it in a specific folder.
Inputs: title (required), workspace_id (required), folder_id.
create_folderA
Create a new folder in a workspace. Returns the new folder's id and name. Optionally nest it inside an existing folder.
Inputs: name (required), workspace_id (required), parent_folder_id.
create_workspaceB
Create a new workspace. Returns the new workspace's id and name.
Inputs: name (required).
delete_diagramA
Permanently delete a diagram and its content. This cannot be undone.
Inputs: diagram_id (required).
generate_diagramA
Generate a visual diagram from a structured graph of nodes and edges, and save it to an existing CanvasKeep diagram.
You provide the logical structure (what components exist and how they connect), and CanvasKeep handles all visual layout automatically - do NOT try to compute x/y positions.
NODES: Create one node for every distinct component, actor, system, service, or data store mentioned in the user's request. Give each a short, clear label (under 30 chars). Choose the right type for visual distinction.
EDGES: Create one edge for every meaningful interaction, data flow, API call, or dependency between nodes. Label edges with the nature of the interaction (e.g. 'REST API', 'SQL query', 'WebSocket', 'publishes'). Every important relationship should be an edge.
MODE: Use 'replace' (default) to create a fresh diagram. Use 'append' to add new elements alongside existing content in the diagram.
Inputs: edges (required), nodes (required), diagram_id (required), mode, +1 more.
get_diagram_sceneA
Read the raw Excalidraw scene of a diagram: the full elements array (with ids, x/y, width/height, styles, text, arrow bindings) and appState.
Use this before save_diagram_scene to make precise edits: read the scene, modify the elements you need, then write the complete array back.
Embedded image data (files) is omitted by default because it can be very large; set include_files to true only if you need it.
Inputs: diagram_id (required), include_files.
get_diagram_summaryA
Get a summary of an existing diagram: its title, workspace, element count, and when it was last updated. Does NOT return the raw scene data.
Inputs: diagram_id (required).
list_diagramsA
List all diagrams in a workspace. Returns each diagram's id, title, and last updated timestamp.
Inputs: workspace_id (required).
list_foldersA
List all folders in a workspace. Returns each folder's id, name, and parent_folder_id. Use folder ids when creating diagrams inside a specific folder.
Inputs: workspace_id (required).
list_workspacesA
List all workspaces in your CanvasKeep account. Returns each workspace's id and name. Use this first to find the workspace_id needed by other tools.
Inputs: no named parameters.
save_diagram_sceneA
Overwrite a diagram's scene with a full Excalidraw elements array. Use this for manual layout and precise edits (moving, restyling, relabeling, adding or removing specific elements).
IMPORTANT: this REPLACES the entire scene. Always call get_diagram_scene first, modify that array, and send back EVERY element you want to keep. Any element missing from the array is deleted. To remove an element you may also set "isDeleted": true on it.
When changing an element, bump its "version" and set a new random "versionNonce" so open editors pick up the change. Text inside a shape is a separate text element with "containerId" set to the shape id; arrows reference shapes via startBinding/endBinding and shapes list them in boundElements.
Existing embedded images (files) and appState are kept unless you pass new ones. If the diagram is open in a browser tab, unsaved edits there may overwrite this save.
Inputs: elements (required), diagram_id (required), files, appState.
update_diagramB
Update a diagram's title (rename it).
Inputs: title (required), diagram_id (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Most tools have clearly distinct purposes (list/create/update/delete per resource, summary vs raw scene reads). The only mild overlap is between generate_diagram and save_diagram_scene, since both write diagram content, but their descriptions clearly separate auto-layout from manual element editing.
Every tool follows a predictable snake_case verb_noun pattern (list_folders, create_diagram, update_diagram, get_diagram_scene, save_diagram_scene, generate_diagram). No mixed conventions or vague verbs.
12 tools is well-scoped for a workspace/folder/diagram management server, with reads and writes balanced across the three resources. Each tool earns its place without redundancy.
Diagrams have strong lifecycle coverage (create, list, update, delete, get scene/summary, save, generate), but folders and workspaces can only be created and listed — no delete, rename, update, or move operations exist. These asymmetric gaps will cause agent dead ends when cleaning up or reorganizing workspaces/folders.
Maintenance
Related MCP Connectors
Create, read and live-edit visual boards, Kanban plans, Gantt timelines and diagrams with AI agents.
Create, edit and organize hand-drawn diagrams (flowcharts, ER, architecture) from any AI agent.
Create and edit architecture diagrams from your AI agent; get an SVG and a live editable canvas.
Create, validate, edit, export (markdown/svg/png/mermaid), and search JSON Canvas files.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables creation, management, and export of Excalidraw drawings through natural language. Supports CRUD operations on drawings and export to SVG, PNG, and JSON formats with file-based storage.83,455 npm-
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to programmatically control a live Excalidraw canvas with element-level CRUD operations and real-time synchronization. It supports iterative diagramming through scene descriptions, screenshots, and advanced layout tools for collaborative AI-human workflows.3,181 npm2MIT
- AlicenseNot gradedqualityDmaintenanceProvides tools for creating, deleting, and querying nodes and edges in Excalidraw diagrams, enabling diagram editing via LLM interfaces.902 npm5MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to build, edit, organize, and export Excalidraw diagrams (architecture, flowcharts, etc.) entirely headless, producing .excalidraw files, SVG, and PNG renders.3,455 npmMIT