
A Model Context Protocol (MCP) server for working with JSON Canvas files — the open infinite-canvas
A Model Context Protocol (MCP) server for working with JSON Canvas files — the open infinite-canvas format used by Obsidian. It lets an MCP client create, validate, read, and list .canvas files.
·
A Model Context Protocol (MCP) server for working with
JSON Canvas files — the open infinite-canvas format used
by Obsidian. It lets an MCP client create, validate,
read, and list .canvas files.
Built on the official mcp Python SDK (>=1.27), which negotiates the 2025-11-25 MCP
protocol revision. Runs over stdio by default and optionally over the Streamable HTTP
transport.
Hosts that support the MCP Apps UI extension render an interactive canvas viewer inline when you read or create a canvas — a pan/zoom, Obsidian-style preview of the nodes and edges. Text-only clients are unaffected and keep receiving the canvas as text/structured output.
nodes (and optional edges) and write it to a
date-prefixed .canvas file under OUTPUT_PATH.
nodes (array of JSON Canvas node objects), filename (string, no extension),
edges (optional array of edge objects).{ path, node_count, edge_count }.canvas (object with optional nodes and edges).{ valid, error }..canvas file and return its nodes and edges.
filename (string, with or without the .canvas extension).{ nodes, edges } (also rendered by the canvas viewer; text
fallback is the canvas JSON)..canvas files available in OUTPUT_PATH.
filename, plus optional add_nodes, update_nodes (partial, must include id),
remove_node_ids (cascades connected edges), add_edges, update_edges, remove_edge_ids.{ path, node_count, edge_count, canvas } — the updated canvas, so
UI-capable hosts re-render it inline.filename, format (markdown | svg).{ format, mime_type, content }. Markdown is an edge-ordered outline;
SVG is a standalone vector image (node title lines only — plain SVG can't render Markdown).query, optional filename to scope to one canvas.{ matches: [{ filename, kind, id, field, snippet }] }.create_canvas, read_canvas, and edit_canvas are linked to the canvas viewer via
_meta.ui.resourceUri, so UI-capable hosts render the result inline.
Node objects use the JSON Canvas shape: id, type (text | file | link | group),
x, y, width, height, optional color, plus type-specific fields (text, file/subpath,
url, label/background/backgroundStyle). Edge objects use id, fromNode, toNode, and
optional fromSide/toSide/fromEnd/toEnd/color/label.
canvas://schema — JSON Schema for validating canvas files.canvas://examples/basic — A simple example canvas (two text nodes joined by an edge).ui://canvas/viewer.html — The interactive canvas viewer (MCP Apps UI), served with MIME
type text/html;profile=mcp-app. Referenced by create_canvas and read_canvas.The viewer is a single self-contained HTML bundle built from the ui/ source with Vite
and the official @modelcontextprotocol/ext-apps
client. It renders nodes (with markdown, colors, and groups) and edges (sides, arrows, labels)
in a pan/zoom view, themed via the host's CSS variables.
The built bundle is committed at jsoncanvas/_ui/viewer.html and ships in the package, so
running the server needs only Python. Rebuild it after changing ui/:
make build-ui # cd ui && npm install && npm run build (requires Node.js)To preview the renderer standalone (no MCP host), run cd ui && npm run dev and open
/preview.html.
docker build -t mcp/jsoncanvas .Add to your claude_desktop_config.json:
{
"mcpServers": {
"jsoncanvas": {
"command": "docker",
"args": ["run", "-i", "--rm", "-v", "canvas-data:/data", "mcp/jsoncanvas"],
"env": { "OUTPUT_PATH": "/data/output" }
}
}
}{
"mcpServers": {
"jsoncanvas": {
"command": "uv",
"args": ["--directory", "/path/to/jsoncanvas", "run", "mcp-server-jsoncanvas"],
"env": { "OUTPUT_PATH": "./output" }
}
}
}To serve over Streamable HTTP instead of stdio:
mcp-server-jsoncanvas --transport streamable-http --host 127.0.0.1 --port 8000The MCP endpoint is then http://127.0.0.1:8000/mcp. The transport binds to localhost and, per
the 2025-11-25 spec, validates the Origin header with DNS-rebinding protection enabled
(localhost Origins only by default). To accept connections from outside the host (e.g. when
running the container with HTTP), bind --host 0.0.0.0 and configure your allowed Origins
accordingly.
Browser-based MCP hosts (the kind that render the canvas viewer) connect cross-origin and must
read the mcp-session-id response header, so the Streamable HTTP transport serves permissive
CORS headers. Restrict the allowed origins with MCP_CORS_ORIGINS (comma-separated; default
*).
Security note. The HTTP transport is unauthenticated — anyone who can reach the port can read and write
.canvasfiles underOUTPUT_PATH. The server is intended for local use; keep it bound to127.0.0.1(the default). DNS-rebinding/Originprotection is fixed to localhost Origins and Hosts at startup, so binding--host 0.0.0.0exposes the port on the network but still rejects non-localhostHost/Originheaders — to safely expose it remotely, front it with an authenticating reverse proxy rather than publishing it directly, and setMCP_CORS_ORIGINSto the specific origins you trust (never*).
Environment variables:
OUTPUT_PATH — Directory where .canvas files are written/read (default ./output).MCP_TRANSPORT — stdio (default) or streamable-http.MCP_HOST / MCP_PORT — Host/port for the Streamable HTTP transport (default 127.0.0.1:8000).MCP_CORS_ORIGINS — Comma-separated allowed CORS origins for the HTTP transport (default *).# Install uv: https://docs.astral.sh/uv/getting-started/installation/
make setup # uv venv && uv sync --extra dev
make build-ui # rebuild the canvas viewer bundle (requires Node.js)
make test # run the test suite
make lint # ruff check + format check
make audit # scan dependencies for known vulnerabilities (pip-audit)
make run # run the server over stdioRun the bundled library example:
make example # writes example.canvas to OUTPUT_PATH (default ./output)The jsoncanvas package can also be used directly:
from jsoncanvas import Canvas, TextNode, Edge
title = TextNode(id="title", x=100, y=100, width=400, height=100,
text="# Hello Canvas", color="#4285F4")
info = TextNode(id="info", x=600, y=100, width=300, height=100,
text="More information here", color="2") # preset color
canvas = Canvas()
canvas.add_node(title)
canvas.add_node(info)
canvas.add_edge(Edge(id="edge1", from_node="title", to_node="info",
from_side="right", to_side="left", label="Connection"))
import json
print(json.dumps(canvas.to_dict(), indent=2))MIT. See LICENSE.
Pick your client and paste the snippet. Each one is the same server, written the way that client expects it.
claude mcp add jsoncanvas -- docker run -i --rm -v canvas-data:/data mcp/jsoncanvas{
"mcpServers": {
"jsoncanvas": {
"env": {
"OUTPUT_PATH": ""
},
"args": [
"run",
"-i",
"--rm",
"-v",
"canvas-data:/data",
"mcp/jsoncanvas"
],
"command": "docker"
}
}
}code --add-mcp '{"name":"jsoncanvas","env":{"OUTPUT_PATH":""},"args":["run","-i","--rm","-v","canvas-data:/data","mcp/jsoncanvas"],"command":"docker"}'[mcp_servers.jsoncanvas]
command = "docker"
args = ["run", "-i", "--rm", "-v", "canvas-data:/data", "mcp/jsoncanvas"]Runs locally on your device. Your client starts the server itself, so nothing has to be hosted.
Paste this prompt into your agent. It reads this page and does the setup for you.
Read https://aiagentslisting.com/mcp/json-canvas-mcp-server to learn what the "JSON Canvas MCP Server" MCP server does and how to install it. Add it to my coding agent's MCP configuration as documented on that page, then confirm the server connects and list the tools it exposes.Agents can also browse this directory over MCP at https://aiagentslisting.com/api/mcp
This server runs locally, so we can't read its tool list over the web yet.
We could not run this server: it ships no npx package for our sandbox and no public endpoint. The four checks that need a live server are left out, and the grade tops out at B until one exists.
Maintain this server? Claiming proves you own the listing and earns the last 4 points.
Claim this listingPaste this line near the top of your repository's README. The badge always renders the current score.
[](https://aiagentslisting.com/mcp/json-canvas-mcp-server)Nothing comparable is listed yet.
No tagged releases on record.
Connect to the AI Agents Listing MCP server at https://aiagentslisting.com/api/mcp using the HTTP transport and complete the sign-in when it asks. Then call the submit_review tool for the listing "json-canvas-mcp-server" with a rating from 1 to 5 and a short note on what worked and what did not.No reviews yet
Be the first to share your experience with this tool.
One email a week. New agents, MCP servers and skills, and what is actually getting traction.