Case study

Living Mindmap (MCP)

A local-first visual knowledge graph that people edit by hand and AI agents extend through 12 MCP tools, with duplicate protection and provenance on every AI-added node.

Proves Agents and MCP

Run locallyCode

Problem

A long conversation with an AI model produces good ideas. Then the chat scrolls away and the ideas go with it. Copying them into notes by hand is slow, so most people do not.

Letting an agent write straight into a notes tool has its own problems. It adds the same concept twice under slightly different names. Later nobody can tell which notes a person wrote and which an agent wrote.

I wanted one map that I can edit by hand and an agent can extend, without either one making a mess of the other.

Approach

Living Mindmap is a local app. A React Flow canvas shows the graph. An Express API serves it on loopback only. A separate stdio MCP server gives agents 12 tools over the same data: list and read maps, search, create and update nodes, connect them, attach sources, and export a branch as context.

Both processes open the same SQLite file. The UI polls, so a node an agent adds shows up in an open browser tab a few seconds later.

Two rules keep agent writes honest. create_node rejects near-duplicate titles and returns the candidates, unless the agent passes allow_duplicate: true. Every node written through MCP carries provenance: ai, and the canvas marks it.

Architecture

Living Mindmap architecture A person uses the React Flow UI, which calls the Express API over REST on loopback. An AI client calls the MCP server over stdio. The API and the MCP server both go through one Store, which writes one SQLite file in WAL mode. Person Web UI React + React Flow REST, loopback Express API AI client MCP over stdio MCP server 12 tools Store reads, writes, duplicate check SQLite file WAL mode
Two processes, one store, one file. Redrawn from the diagram in the project README.

Decisions

Results

  • 42 testsnpm test runs 42 Vitest tests across 6 files: store, graph layout, context export, REST API, seed data, and the MCP tool handlers through an in-memory MCP client.
  • 160 calls, 0 failuresscripts/bench.ts starts the real stdio server and runs a scripted 16-call task ten times: list, create ten nodes, read the map back five ways.
  • 0.5 msMedian round trip per call in that benchmark, about 1.2 ms at the 95th percentile, on Node 26 on one machine.
  • 12 toolsnpm run verify:mcp starts the server with a real MCP client and lists the tools. CI runs it on Node 20 and 22.

Benchmark numbers vary by machine. npm run bench reproduces them.

Screens

The sample map on the canvas: Transformers at the root with branches for attention, position, architecture and training.
The bundled sample map laid out as a tree. Every node is a row in one SQLite file.
The inspector open on the Self-Attention node with status, summary and notes fields.
The inspector. People edit here and agents edit the same record through MCP.
The search box with results for attention, each showing a title and a summary snippet.
Search across maps. The MCP tool search_nodes runs the same query.

What I'd do next