Logo van JSON Canvas MCP Server

JSON Canvas MCP Server

Community
Cam10001110101

A Model Context Protocol (MCP) server for working with

UitgeverCam10001110101
Repositoryobsidian-jsoncanvas
TaalHTML
Forks
10
Sterren
14
Beschikbare tools
0
Transporttypestdio
Categorieën
LicentieMIT
Links
  • Koppel tools aan AI-workflows

    JSON Canvas MCP Server biedt MCP-functionaliteit die compatibele AI-clients en agenten kunnen gebruiken.

  • 0 beschikbare tools

    Bekijk hieronder de aanroepbare acties, inclusief namen en beschrijvingen als de server die beschikbaar stelt.

  • Configuratie om direct te kopiëren

    Gebruik de installatievoorbeelden om deze server in je favoriete MCP-client te configureren.

  • Indicatoren van opensource-interesse

    14 sterren en 10 forks in de gekoppelde repository.

JSON Canvas MCP Server

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.

Components

Tools

  • create_canvas — 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 — Validate canvas data against the JSON Canvas 1.0 specification.
    • Input: canvas (object with optional nodes and edges).
    • Returns (structured): { valid, error }.
  • read_canvas — 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_canvases — List the .canvas files available in OUTPUT_PATH.
    • Returns: array of filenames.
  • edit_canvas — 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_canvas — 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).
  • search_canvases — Case-insensitive substring search across stored canvases.
    • Input: query, optional filename to scope to one canvas.
    • Returns (structured): { 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.

Resources

  • 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.

Interactive canvas viewer (MCP Apps UI)

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/:

bash
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.

Usage with Claude Desktop

Docker (stdio)

bash
docker build -t mcp/jsoncanvas .

Add to your claude_desktop_config.json:

json
{
  "mcpServers": {
    "jsoncanvas": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "-v", "canvas-data:/data", "mcp/jsoncanvas"],
      "env": { "OUTPUT_PATH": "/data/output" }
    }
  }
}

uv (stdio)

json
{
  "mcpServers": {
    "jsoncanvas": {
      "command": "uv",
      "args": ["--directory", "/path/to/jsoncanvas", "run", "mcp-server-jsoncanvas"],
      "env": { "OUTPUT_PATH": "./output" }
    }
  }
}

Streamable HTTP transport

To serve over Streamable HTTP instead of stdio:

bash
mcp-server-jsoncanvas --transport streamable-http --host 127.0.0.1 --port 8000

The 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 .canvas files under OUTPUT_PATH. The server is intended for local use; keep it bound to 127.0.0.1 (the default). DNS-rebinding/Origin protection is fixed to localhost Origins and Hosts at startup, so binding --host 0.0.0.0 exposes the port on the network but still rejects non-localhost Host/Origin headers — to safely expose it remotely, front it with an authenticating reverse proxy rather than publishing it directly, and set MCP_CORS_ORIGINS to the specific origins you trust (never *).

Configuration

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 *).

Development

bash
# 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 stdio

Run the bundled library example:

bash
make example      # writes example.canvas to OUTPUT_PATH (default ./output)

Library example

The jsoncanvas package can also be used directly:

python
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))

License

MIT. See LICENSE.

Installatie

TypingMind
Vereisten:

Node.js 18+

{
  "mcpServers": {
    "yourusername-mcp-server-jsoncanvas": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-server-jsoncanvas"
      ]
    }
  }
}

Gebruik JSON Canvas MCP Server MCP met meerdere AI-modellen

TypingMind koppelt MCP-tools aan de werkruimte. Zodra JSON Canvas MCP Server is verbonden, kun je deze dus met verschillende AI-modellen in TypingMind gebruiken, zonder de verbinding voor elk model apart in te stellen. Deze MCP-integratie draait lokaal via de TypingMind MCP-connector op je apparaat.

Installatiehandleiding voor de lokale connector

Gebruik dit als de MCP-server toegang nodig heeft tot lokale bestanden, apps of privébronnen op je computer.

1

Open de MCP-instellingen

Ga in TypingMind naar Instellingen, Geavanceerde instellingen en vervolgens Model Context Protocol. Kies daar Connector instellen.

  1. Open TypingMind in je browser.
  2. Klik op het pictogram Instellingen.
  3. Ga naar Geavanceerde instellingen.
  4. Open het gedeelte Model Context Protocol.
  5. Klik op Connector instellen en kies Dit apparaat.
Instelscherm voor de TypingMind MCP-connector met Dit apparaat geselecteerd
2

Voer de connectoropdracht uit

Kies Dit apparaat, kopieer de opdracht uit TypingMind en voer deze uit in Terminal. Laat het proces draaien zolang je MCP gebruikt.

  1. Kopieer de installatieopdracht die TypingMind toont.
  2. Open Terminal op macOS of Windows Terminal op Windows.
  3. Plak de opdracht en voer deze uit.
  4. Keur de pakketinstallatie goed als Terminal vraagt of je wilt doorgaan.
  5. Laat het proces in het Terminal-venster draaien zolang je MCP-tools gebruikt.
3

Voeg JSON Canvas MCP Server toe als server

Klik op Servers bewerken zodra de connectorstatus Gereed is en plak de MCP-serverconfiguratie.

  1. Wacht tot de connectorstatus Gereed aangeeft.
  2. Klik op Servers bewerken.
  3. Plak de MCP-serverconfiguratie van JSON Canvas MCP Server.
  4. Sla de serverlijst op.
  5. Vernieuw om te controleren of de connector nog steeds klaar is voor gebruik.
MCP-instellingen van TypingMind met een actieve server en de knop Servers bewerken
{
  "mcpServers": {
    "yourusername-mcp-server-jsoncanvas": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-server-jsoncanvas"
      ]
    }
  }
}
4

Gebruik de verbinding met verschillende modellen

Sla de serverlijst op, open Plug-ins en schakel de MCP-tools van JSON Canvas MCP Server in. Selecteer vervolgens een ondersteund AI-model in TypingMind en gebruik de tools in de chat of wijs ze toe aan een AI-agent.

  1. Open de pagina Plug-ins in TypingMind.
  2. Schakel de MCP-tools van JSON Canvas MCP Server in.
  3. Start een chat en kies het AI-model dat je wilt gebruiken.
  4. Gebruik de MCP-tools in een chat of wijs ze toe aan een AI-agent.
  5. Schakel wanneer nodig over naar een ander AI-model zonder opnieuw verbinding te maken met MCP.
TypingMind-chat met ingeschakelde MCP-tools en een geselecteerd AI-model
Kun je JSON Canvas MCP Server gebruiken om me hiermee te helpen?
JSON Canvas MCP Server
Zeker. Ik heb het gelezen.
Dit vond ik met JSON Canvas MCP Server.

Veelgestelde vragen

Waarvoor wordt de MCP-server JSON Canvas MCP Server gebruikt?

JSON Canvas MCP Server is een MCP-server waarmee compatibele AI-clients verbinding kunnen maken met externe tools en context. In TypingMind hoef je deze MCP-server maar één keer toe te voegen om de tools beschikbaar te maken in je AI-werkruimte.

Kan ik JSON Canvas MCP Server MCP met meerdere AI-modellen in TypingMind gebruiken?

Ja. TypingMind verbindt MCP-tools op werkruimteniveau. Daardoor kun je JSON Canvas MCP Server gebruiken met verschillende AI-modellen, zoals Claude, ChatGPT, Gemini of andere modellen die je in TypingMind hebt ingesteld, zonder de MCP-server voor elk model afzonderlijk in te stellen.

Waarom JSON Canvas MCP Server MCP gebruiken met TypingMind?

TypingMind is een van de beste interfaces voor chats met LLM's, omdat het meerdere AI-modellen, prompts, plug-ins, AI-agenten, API-sleutels en MCP-tools samenbrengt in één werkruimte. Als JSON Canvas MCP Server verbonden is, kun je de MCP-tools ervan gebruiken met je favoriete modellen en je chatworkflow overzichtelijk houden in TypingMind.

Hoe verbind ik JSON Canvas MCP Server MCP met TypingMind?

JSON Canvas MCP Server werkt via de lokale MCP-connector van TypingMind. Dit is de beste optie als de MCP-server toegang nodig heeft tot lokale bestanden, desktopapps, opdrachtregeltools of privébronnen op je computer.

Welke tools biedt JSON Canvas MCP Server MCP in TypingMind?

JSON Canvas MCP Server biedt MCP-functies die je kunt inschakelen via de pagina Plug-ins in TypingMind. Je kunt ze gebruiken in chats of toewijzen aan AI-agenten.

Moet ik mijn API-sleutels delen met TypingMind om JSON Canvas MCP Server MCP te gebruiken?

Nee. TypingMind werkt in de eerste plaats lokaal en laat je de controle houden over je modelaanbieders, API-sleutels, prompts en MCP-configuratie. Als JSON Canvas MCP Server authenticatie vereist, voeg je bij het maken van de verbinding de vereiste headers, OAuth-instellingen of lokale configuratie voor die MCP-server toe.

Gerelateerde MCP-servers

Toon alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇