This MCP server implementation provides tools for working with JSON Canvas files according to the official specification. It enables creating, modifying, and validating infinite canvas data structures, supporting all node types and edge connections. The server offers a RESTful API for canvas operations, includes example resources, and can export canvases to different formats. It's designed for applications requiring AI assistants to interact with and manipulate canvas-based data visualizations.
Nessuna recensione ancora. Sii il primo a recensire!
Accedi per unirti alla conversazione
Create a canvas from `nodes` (and optional `edges`) and write it to a date-prefixed `.canvas` file under `OUTPUT_PATH`. Input: `nodes` (array of JSON Canvas node objects), `filename` (string, no extension), `edges` (optional array of edge objects). Returns (structured): `{ path, node_count, edge_count }`.
Validate canvas data against the JSON Canvas 1.0 specification. Input: `canvas` (object with optional `nodes` and `edges`). Returns (structured): `{ valid, error }`.
Read a stored `.canvas` file and return its nodes and edges. Input: `filename` (string, with or without the `.canvas` extension). Returns (structured): `{ nodes, edges }` (also rendered by the canvas viewer; text fallback is the canvas JSON).
List the `.canvas` files available in `OUTPUT_PATH`. Returns: array of filenames.
Add, update, and/or remove nodes and edges on a stored canvas in one atomic write (a failed operation leaves the file unchanged). Input: `filename`, plus optional `add_nodes`, `update_nodes` (partial, must include `id`), `remove_node_ids` (cascades connected edges), `add_edges`, `update_edges`, `remove_edge_ids`. Returns (structured): `{ path, node_count, edge_count, canvas }` — the updated canvas, so UI-capable hosts re-render it inline.
Export a stored canvas to another format. Input: `filename`, `format` (`markdown` | `svg`). Returns (structured): `{ 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).
Case-insensitive substring search across stored canvases. Input: `query`, optional `filename` to scope to one canvas. Returns (structured): `{ matches: [{ filename, kind, id, field, snippet }] }`.