Skip to main content
Glama

MapNotes

A render engine for your own graphs. Model anything as nodes and edges (pull requests → issues → projects, services → dependencies, notes → topics…), attach key/value properties, style them, and save everything as a readable YAML file.

  • Web app: interactive canvas (drag, click to inspect, hover to preview), editing of nodes, edges, graph properties and styles (including full-color brand icons), automatic layouts, search, undo/redo, dark theme by default with a light theme toggle.

  • MCP server: lets an AI assistant (Claude Code, Claude Desktop, …) load, query and edit a graph file. Open the same file in the web app (Chrome/Edge) to see its edits live.

Quick start

npm install
npm run dev                          # dev server with hot reload at http://localhost:5173
npm run build                        # static site in dist/
npm test                             # regression tests (vitest)

The web app is a static site with no backend. How it saves depends on the browser:

  • Chrome, Edge and other Chromium browsers can edit files on disk directly (File System Access API). Open a YAML/JSON file, or Save to create one, and every change is written back to that file. The file is also checked every second, so edits made by the MCP server or a text editor show up live. After a page reload the browser remembers the file but asks for permission again: click Reconnect in the status pill. Close file in the ▾ menu unlinks it; New also unlinks it so they never overwrite your file.

  • Firefox and Safari don't support that API, so work is kept in the browser (localStorage). Open loads a file's contents, and Download saves a copy.

In every browser the current graph is also kept in localStorage, and the ▾ menu can download YAML/JSON or export a PNG.

Live site

Every push to master is built and published to GitHub Pages by .github/workflows/deploy.yml: https://joecabezas.github.io/mapnotes/

Using the app

Action

How

Add node

N, + Node, or double-click empty canvas

Connect nodes

E / Connect, click source, then target

Inspect / edit

Click a node or edge; edit label, id, style, properties on the right

Select several

Shift/Ctrl + click, or Shift + drag a box on empty canvas; Ctrl+A selects all. Drag any selected node, or press the arrow keys, to move them together (arrows step along a 10px grid); the inspector can restyle or delete them at once

Delete

Del / Backspace, or the button in the inspector

Clusters

Select a node and click Convert to cluster in the inspector: it is drawn as a zone around every node connected to it (in either direction), and its own edges are hidden. The zone bends around nodes that aren't in it, so it never covers them. Click the zone to select it, drag it to move its members, and Convert to node to bring the node and its edges back as they were. The node only gets cluster: true in the file; nothing else changes

Hide / show

H hides the selected nodes and their edges; Shift+H shows them all again (the status bar counts hidden nodes). Hiding only affects the view and isn't saved, but it can be undone

Arrange

Drag nodes, or click Layout and pick one (it applies immediately; ↻ runs it again). Smart (layered) puts parents above their children and minimises edge crossings; Force-directed spreads nodes out like springs. Evolved (genetic) starts from the other layouts and the current one and evolves them with a genetic algorithm towards fewer edge crossings, animating the best layout of each generation; besides crossings it keeps edges clear of the nodes they don't connect. It explores first: whenever it gets stuck it keeps the best layout of that try and starts over, so the whole layout changes; then the best of those breed and get refined. Its settings (time, explore, population, crossover, mutations, repair, spacing, edge clearance) show in the panel while it's picked, and Stop keeps the best so far. Grown (insertion) builds a layout from scratch, inserting the nodes one at a time (busiest first, then whichever has the most neighbours already in), each at the spot that adds the fewest crossings; where nothing fits, it pushes the nodes around a spot outwards to make room, and the nodes around each new one move to better spots if they can. Then it keeps taking out a patch of the layout around a crossing and inserting it again, keeping the result when it's no worse. You watch it grow, then improve; its settings (time, patch size, lookahead, crowding, spacing, edge clearance, make room) show in the panel while it's picked. The status bar shows the graph's edge crossings, edges drawn through or closer than the edge clearance to other nodes, and overlapping nodes. The Repel button next to it is a switch: while it is on, the selected nodes (or all of them, if fewer than two are selected) float apart until there is room between them, held together by their edges like the atoms of a molecule: dragging one pushes the others out of its way and pulls along the ones it is connected to. The rest of the graph fades meanwhile. F fits the selection in view, or the whole graph if nothing is selected

Styles

🎨 Styles: node color/border/shape/size/icon, edge color/width/line/arrow/curve

Views

Views opens a panel to switch between saved views, create one (+) or edit the current one (✎). While a view is active, × next to Views returns to the full graph. See "Filters and saved views" below

Search

/ — matches labels, ids and property values; Enter jumps to the first hit

Undo / redo

Ctrl+Z / Ctrl+Shift+Z

Open / save

Ctrl+O / Ctrl+S (saves to the open file; Download in Firefox/Safari); Save as, JSON and PNG in the ▾ menu

Help

?

Filters and saved views

A saved view shows part of the graph: the nodes that match its filter. Nodes, edges and properties stay shared, so an edit made in a view changes the same graph you see everywhere else.

  • Create: click Views, then +. Give the view a name and choose what it shows: entity types, node styles, text, exact property values, nodes within 1–3 connections of a node, and edge labels. Values within one list are alternatives; different filters must all match. None matches nothing, and All removes that restriction. A node's entity type is its type property, or its style if it has none (PR styles are grouped as pr).

  • Switch: pick a view from the dropdown in the Views panel. The Views button is highlighted while a view is active, and the panel shows how many nodes are visible (e.g. 12/40 nodes).

  • Back to the full graph: click × next to Views.

  • Edit: ✎ in the panel lets you rename the view, change its filter, reset the filter or delete the view.

Each view keeps its own layout: dragging nodes or running a layout in a view doesn't move them anywhere else. A view only stores positions for the nodes it shows, so a node that stops matching the filter, or is removed, loses its position in that view. Selection, search and layout act on the visible nodes. Saving or downloading YAML/JSON always keeps the full graph, while PNG exports what is on the canvas.

Views are stored under the optional top-level views field of the graph file and in the browser copy. They store the filter, not a list of nodes, so new nodes that match appear in the view automatically. Files without views still work. MCP server versions from before views were added drop this field when they save; restart your MCP client to update it.

views:
  - id: people-prs
    name: People & PRs
    filters:
      types: [person, pr]
      edgeLabels: [authors]
    positions:
      alice: { x: 0, y: 0 }

Icons

Node styles can show an icon inside the node, from two open icon sets. Both are fetched at runtime from jsDelivr, so nothing is stored in this repo. The canvas needs network access to show them; if an icon can't be loaded, the node is simply drawn without it.

  • Lucide (pinned to lucide-static 1.x): ~1,850 general-purpose line icons, written lucide:<name>, e.g. lucide:folder, lucide:bug. They're drawn in one color: black or white to suit the node's fill, or Icon color to choose.

  • svgl (pinned to svgl 5.0.0): full-color brand logos, written as the svgl file name, e.g. slack, linear, obsidian. Logos with light and dark variants have a suffix: github_light is the dark logo for light fills, github_dark is the white logo for dark fills.

In 🎨 Styles, Browse… next to Icon opens a picker with a tab per set and a search box (Lucide matches names and tags, e.g. "money" finds lucide:banknote). You can also type a name directly. Icon size (%) sets how much of the node the icon fills (default 70).

Icons are drawn over the node's shape and fill. A circle (ellipse) works best; pointed shapes such as diamond or star clip the icon. For brand logos, a white fill with the brand color as the border works for most.

The MCP set_style tool accepts the same icon, iconColor and iconSize fields.

Related MCP server: Neo4j MCP Server

MCP server

The MCP server lets an AI agent read and edit a graph file. The GitHub Pages site is static, so the server runs locally on your computer over stdio. There is no connection between the website and the MCP server: Chrome or Edge reads and writes a file you choose with its file picker, while the MCP server reads and writes a file by its path. If both use the same file, the browser notices changes made by the agent when it checks the file.

Install without cloning

Install Node.js 20.6 or newer and Git, then register the server in your MCP client. You do not need a graph file yet. npm downloads the repository and dependencies into its cache on first use; you do not need a local clone or an npm account.

For Claude Code:

claude mcp add --scope user mapnotes -- npm exec --yes --package=github:joecabezas/mapnotes -- mapnotes-mcp

For another stdio MCP client, use this configuration (adjust it to your client's configuration format):

{
  "mcpServers": {
    "mapnotes": {
      "command": "npm",
      "args": ["exec", "--yes", "--package=github:joecabezas/mapnotes", "--", "mapnotes-mcp"]
    }
  }
}

Restart or reload your MCP client and call get_graph to check the connection. Without a file, the server starts with an empty graph in memory. To see edits on the web app, ask the agent to call save_graph with an absolute .yaml or .json path, then use Open in Chrome or Edge to choose that file. Or save a graph in the web app first and ask the agent to call load_graph with its path. The website's file picker does not pass the file path to the MCP server; you must give the agent that path separately. Once both use the same file, the browser checks it for changes and the MCP server re-reads it before operations. Save before restarting the MCP client: unsaved in-memory changes are lost when it stops. You can also pass the file path after mapnotes-mcp in the command above to open it at startup.

Each time the client starts the server, npm checks the latest commit on the repository's default branch and downloads it if it changed, so new tools and fixes arrive after you restart or reload the MCP client. A running server keeps its current version until then. Starting the server needs access to GitHub.

Ask your agent to install it

Paste this into Claude Code, Codex, Cursor or any agent that can run commands:

Install the MapNotes MCP server for me:
1. Register a stdio MCP server named "mapnotes" with command "npm" and arguments:
   exec --yes --package=github:joecabezas/mapnotes -- mapnotes-mcp
   In Claude Code: claude mcp add --scope user mapnotes -- npm exec --yes --package=github:joecabezas/mapnotes -- mapnotes-mcp
2. Tell me how to reload MCP servers in this client, then call mapnotes get_graph to check it works.
3. When I want to see edits in https://joecabezas.github.io/mapnotes/, ask me where to save the graph, call save_graph with that absolute path, and tell me to open the same file in Chrome or Edge. If I already have a graph file, call load_graph with its path instead.

Run from a local clone

If you are developing MapNotes, you can also run the server from this repository:

git clone https://github.com/joecabezas/mapnotes && cd mapnotes && npm install
npx tsx mcp/server.ts                  # optionally add an absolute graph file path

Tool

Purpose

load_graph

Open a YAML/JSON file; it becomes the current file

save_graph

Save to the current file, or "save as" to a new path (.json → JSON)

get_graph, get_node

Read the graph, or one node with its edges

find_nodes

Search nodes by id, label, property or style; paged id/label summaries for large graphs

add_node, edit_node, remove_node

Node CRUD (rename via newId updates edges; removing a node removes its edges)

add_edge, edit_edge, remove_edge

Edge CRUD (label, endpoints, style, properties)

edit_graph_properties

Set/remove/replace graph-level key/value properties

set_style, remove_style

Create/replace/remove reusable node and edge styles (including icon / iconSize)

When a file is open, every change is written to it immediately, and the file is re-read before each operation, so edits made to the file by other tools are not overwritten.

File format

properties:            # GraphProperty[]
  - key: title         # shown as the graph's name
    value: My graph
  - key: subtitle      # optional line shown under the title
    value: What this graph is about
styles:                # reusable looks, referenced by id
  - id: pr
    target: node       # node | edge
    color: "#7aa2f7"
    borderColor: "#c9d8ff"
    borderWidth: 2     # optional, outline width in px, 0-20 (default 2)
    textColor: "#ffffff"
    shape: ellipse     # ellipse, rectangle, round-rectangle, triangle, diamond, pentagon, hexagon, octagon, star, tag, barrel
    size: 34
    icon: github_dark  # optional, svgl logo name or lucide:<name> (see "Icons" above)
    iconColor: "#ffffff"  # optional, color of Lucide icons
    iconSize: 70       # optional, icon size as % of the node (default 70)
  - id: fixes
    target: edge
    color: "#7dcfff"
    width: 2
    lineStyle: dashed  # solid | dashed | dotted
    arrow: triangle    # triangle, vee, circle, square, diamond, tee, none
    curve: bezier      # bezier | straight | taxi
nodes:
  - id: pr-101
    label: PR 101
    style: pr                    # optional
    position: { x: 0, y: 120 }   # optional; saved when you drag
    cluster: true                # optional; draw it as a zone around the nodes connected to it
    properties:
      - key: author
        value: sam
edges:
  - id: e1
    source: pr-101
    target: issue-12
    label: fixes                 # optional
    style: fixes                 # optional
    properties: []
views:                           # optional saved views (see "Filters and saved views")
  - id: open-prs
    name: Open PRs
    filters:                     # every filter is optional
      types: [pr]                # `type` property, or style when there is none
      styles: [pr]
      query: login               # text in ids, labels and properties
      properties:                # exact key/value matches, all required
        - key: author
          value: sam
      relatedTo: [issue-12]      # only nodes within `depth` connections of these
      depth: 2                   # 1-3, default 2
      edgeLabels: [fixes]        # only edges with these labels
    positions:                   # this view's layout, only for the nodes it shows
      pr-101: { x: 0, y: 0 }

For hand-written files, properties may also be a plain mapping (properties: { author: sam }), and edge ids may be left out (they're generated). JSON with the same structure is accepted too. See examples/layering-100.yaml.

Project layout

shared/   data model, graph operations, YAML/JSON (used by everything)
mcp/      MCP server (stdio)
web/      React + Cytoscape.js frontend
examples/ sample graphs

Contributing

See CONTRIBUTING.md. Commits in pull requests must be signed off (git commit -s) under the Developer Certificate of Origin.

License

MIT

Available Tools

14 tools
add_edgeAdd edgeB

Connect two existing nodes. The id is generated if omitted.

Inputs: source (required), target (required), id, label, +2 more. Returns: edge, file

add_nodeAdd nodeB

Add a node. The id is generated if omitted; the label defaults to the id.

Inputs: id, label, style, position, +1 more. Returns: file, node

edit_edgeEdit edgeB

Edit an edge: endpoints, label, style, id or properties. Only the given fields change; "" clears label/style.

Inputs: id (required), label, newId, style, +5 more. Returns: edge, file

edit_graph_propertiesEdit graph propertiesA

Edit the key/value properties of the graph itself. set adds/overwrites keys, remove deletes keys, properties replaces the whole list. "title" names the graph (keep it short) and "subtitle" is shown under it.

Inputs: set, remove, properties. Returns: file, properties

edit_nodeEdit nodeA

Edit a node. Only the given fields change. setProperties adds/overwrites keys, removeProperties deletes keys, properties replaces the whole list. Renaming (newId) updates connected edges. style "" clears the style.

Inputs: id (required), label, newId, style, +4 more. Returns: file, node

find_nodesFind nodesA
Read-only

Search or list nodes without fetching the whole graph. Returns ids with brief summaries (label, style, property and edge counts, matched fields), sorted by id; call get_node for details. All filters are optional and combine with AND; with none, lists every node. If nextCursor is returned, pass it as cursor to get the next page.

Inputs: limit, query, style, cursor, +2 more. Returns: nodes, total, nextCursor

get_graphGet graphA
Read-only

Return the whole current graph (properties, styles, nodes, edges). YAML output starts with a comment naming the current file; JSON output is plain JSON.

Inputs: format. Returns: file, graph, issues

get_nodeGet nodeB
Read-only

Return one node with its properties and all edges connected to it.

Inputs: id (required). Returns: node, edges

load_graphLoad graphA

Open a graph file (YAML, or JSON if it ends in .json). It becomes the current file: all later changes are saved to it automatically. A missing file starts an empty graph.

Inputs: path (required). Returns: file, counts, issues

remove_edgeRemove edgeC
Destructive

Remove an edge by id.

Inputs: id (required). Returns: file, removedEdge

remove_nodeRemove nodeB
Destructive

Remove a node and every edge connected to it.

Inputs: id (required). Returns: file, removedNode, removedEdges

remove_styleRemove styleA
Destructive

Remove a style; nodes/edges using it fall back to the default look.

Inputs: id (required). Returns: file, removedStyle

save_graphSave graphA

Save the current graph. With a path, saves a copy there (format from the extension: .json → JSON, otherwise YAML) and makes it the current file.

Inputs: path. Returns: file, counts, format, dropped

set_styleCreate or replace styleA

Create or replace (by id) a reusable style in the graph styles. Assign it via the "style" field of nodes/edges. Colors are CSS colors, e.g. "#7aa2f7". Fields marked "Nodes only" / "Edges only" are rejected for the other target.

Inputs: id (required), target (required), icon, name, +12 more. Returns: file, style

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

    TDQS

    A3.7/5.0

    Scored across 14 tools

    Disambiguation5/5

    Each tool targets a distinct resource/action pair: graph file I/O (load/save), whole-graph retrieval, node/edge CRUD, graph property editing, and style management. get_node vs find_nodes are clearly differentiated (detail vs search), and edit_node/edit_edge/edit_graph_properties have non-overlapping targets.

    Naming Consistency5/5

    All tool names use a consistent snake_case verb_noun pattern (load_graph, save_graph, get_node, add_edge, edit_node, remove_style, etc.). There are no deviations into camelCase or vague single-word names.

    Tool Count5/5

    The 14 tools precisely cover the graph-notes domain without redundancy. Each tool earns its place by handling a specific operation on nodes, edges, graph properties, or styles.

    Completeness4/5

    Core lifecycle coverage is strong: nodes have add/get/list/edit/remove, edges have add/edit/remove, and graph properties/styles are editable. Minor gaps exist: no direct get_edge or list_styles/get_style, though these can be inferred from get_graph or get_node.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to interact with Gremlin-compatible graph databases through natural language, supporting schema discovery, complex graph queries, relationship analysis, and data import/export operations.
      12 npm
      9
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to interact with Neo4j graph databases through natural language, supporting Cypher queries, schema management, data manipulation, and graph algorithms.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to create, edit, and export flowcharts through a local web-based editor with visual drag-and-drop, real-time sync, and 14 MCP tools for full node/edge CRUD.
      2
      Apache 2.0
    • A
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to interact with LightRAG knowledge graphs, supporting smart upsert for Obsidian vaults, semantic queries, and document/graph management.
      18
      16 PyPI
      8
      Apache 2.0