Repository avatar
Databases
v0.1.0
active

mcp-graph-explorer

io.github.abergkvist/mcp-graph-explorer

Query graph databases with Cypher over BOLT and see the answer as an interactive graph (MCP Apps)

Documentation

mcp-graph-explorer

Ask questions about your graph database in a chat and see the answer as an interactive graph.

The model writes Cypher, and this MCP server runs it over BOLT. The answer is shown as a graph, a table or a single value in an MCP Apps view.

  • Databases: tested with Neo4j, Memgraph and ArcadeDB. Other databases that speak Cypher over BOLT may work.
  • Clients: tested with Claude Desktop, Codex desktop and GitHub Copilot in VS Code. The server runs locally (stdio); other clients with MCP Apps support that can run a local server should work.

The graph view showing the example railway network

Quick start

Requirements: Node 22 or later and an MCP client. No database? Start with the example data.

There is nothing to install: the client downloads and starts the server with npx.

Before you connect your database

  • The server is read-only by default and relies on the database to enforce it.
  • ArcadeDB does not fully: schema changes are kept even in read mode (tested: 26.10.2). Use it only with data you can restore.
  • Query results are sent to the language model.

Claude Desktop

Open Settings → Developer → Edit Config (claude_desktop_config.json) and add the server. If you already have mcpServers, add only graph-explorer to it.

{
  "mcpServers": {
    "graph-explorer": {
      "command": "npx",
      "args": ["-y", "mcp-graph-explorer"],
      "env": {
        "GRAPH_URI": "bolt://localhost:7687",
        "GRAPH_USER": "neo4j",
        "GRAPH_PASSWORD": "your-password",
        "GRAPH_DIALECT": "neo4j"
      }
    }
  }
}

Restart Claude Desktop and ask about your data.

Codex desktop

Add the server to ~/.codex/config.toml:

[mcp_servers.graph_explorer]
command = "npx"
args = ["-y", "mcp-graph-explorer"]

[mcp_servers.graph_explorer.env]
GRAPH_URI = "bolt://localhost:7687"
GRAPH_USER = "neo4j"
GRAPH_PASSWORD = "your-password"
GRAPH_DIALECT = "neo4j"

The graph view and the model context work there.

ChatGPT desktop in Work mode does not pass env to the server (tested 29 November 2026, macOS). Pass the variables as arguments instead:

[mcp_servers.graph_explorer]
command = "/usr/bin/env"
args = ["GRAPH_URI=bolt://localhost:7687", "GRAPH_USER=neo4j", "GRAPH_PASSWORD=your-password", "GRAPH_DIALECT=neo4j", "npx", "-y", "mcp-graph-explorer"]

The password is then visible in the process list.

GitHub Copilot in VS Code

Add the server to ~/.copilot/mcp-config.json:

{
  "mcpServers": {
    "graph-explorer": {
      "type": "local",
      "command": "npx",
      "args": ["-y", "mcp-graph-explorer"],
      "env": {
        "GRAPH_URI": "bolt://localhost:7687",
        "GRAPH_USER": "neo4j",
        "GRAPH_PASSWORD": "your-password",
        "GRAPH_DIALECT": "neo4j"
      },
      "tools": ["get_schema", "query_cypher", "show_result", "get_selection", "get_view_query"]
    }
  }
}

The graph view, Expand and your own Cypher queries worked in a short test. Asking about the selected node and the model context are not verified there.

If a client cannot find npx (common with nvm), use its absolute path as command (which npx).

Settings

VariableDefaultMeaning
GRAPH_URIbolt://localhost:7687Bolt address
GRAPH_USER, GRAPH_PASSWORDemptyLogin
GRAPH_DATABASEserver defaultDatabase name
GRAPH_DIALECTneo4jneo4j or memgraph
GRAPH_ACCESS_MODEreadread or write, see Security
GRAPH_STATE_DIRplatform data directoryWhere the selected node id and your last-run query, with its parameters, are kept

The dialect says how nodes are identified: neo4j uses elementId(), memgraph uses id(). ArcadeDB uses neo4j.

Try it with example data

Needs Docker. The data is a railway network: 82 operational points and 84 sections of line in Dalarna and Gävle, Sweden (data source).

mkdir graph-explorer-demo && cd graph-explorer-demo
curl -fsSLO https://raw.githubusercontent.com/abergkvist/mcp-graph-explorer/main/docker/compose.yaml
curl -fsSLO https://raw.githubusercontent.com/abergkvist/mcp-graph-explorer/main/docker/seed.cypher
docker compose up -d neo4j-seed
(:Station | :Junction)-[:CONNECTS]->(:TrackSection)-[:CONNECTS]->(:Station | :Junction)

Use the configuration above with "GRAPH_PASSWORD": "graphexplorer", then ask for example "Show the whole railway network". Stop the database with docker compose down.

docker compose up -d also starts the other two databases with the same data:

DatabaseSettings
Memgraph"GRAPH_URI": "bolt://localhost:7688", "GRAPH_DIALECT": "memgraph", no user or password
ArcadeDB"GRAPH_URI": "bolt://localhost:7692", "GRAPH_USER": "root", "GRAPH_PASSWORD": "graphexplorer", "GRAPH_DATABASE": "graph", "GRAPH_DIALECT": "neo4j"

What you can do

  • Graph, table or value, depending on what the query returns.
  • Cypher shows the query behind the result. Edit it and press Run (⌘↵ / Ctrl↵) to update the view; Reset brings back the model's query and result. The editor only reads, also in write mode. Ask about your result and the model looks the query up with get_view_query.
  • Click a node to see its properties, and Expand to add its neighbors.
  • Click a relationship to see its type, ends and properties. No tool looks up a selected relationship; the model learns of it only through the model context.
  • Refer to the selection in the chat ("what connects to this one?"). The model looks it up with get_selection.
  • Drag nodes to rearrange them.
  • Choose a layout: force-directed (default), circular, or geographic when nodes have lat/lon, latitude/longitude or a WGS 84 point property. Geographic draws no background map, and places nodes without coordinates between their neighbors.
  • Search nodes and filter by label.
  • Earlier results stay in the chat and can be opened in the panel again.
ToolForDoes
get_schemathe modelLabels, relationship types and properties with example values
query_cypherthe modelRuns a query and returns the data; shows nothing
show_resultthe modelRuns answer_query, optionally context_query, and shows the result
get_selectionthe modelThe node you last clicked, with its neighbors
get_view_querythe modelThe query you last ran in the view, with a summary of its result
select_node, expand_node, run_view_query, reset_view_querythe viewNot visible to the model

What the model knows about the view

The view shares your selection and your own queries through MCP Apps' updateModelContext, and the model can also look them up with get_selection and get_view_query. Some hosts accept the update without passing it on (seen in Claude Desktop, ext-apps#852). If so, say "the selected node" or "my query".

Security

Read-only by default

The queries are written by a language model. It can misunderstand you, and text stored in your data can influence what it does. Therefore the server is read-only unless you say otherwise: it runs every query in a read-mode transaction that is always rolled back, so the database itself rejects writes. ArcadeDB is an exception, see below.

Memgraph ignores read mode for auto-commit queries. The server never uses them.

ArcadeDB

ArcadeDB (tested: 26.10.2) does not reject writes in read mode. Changes to data are rolled back, but without an error, so the answer can look as if something was written. Schema changes are kept, such as indexes, constraints and new empty types.

Write mode

Setting GRAPH_ACCESS_MODE=write is your decision. Know what it means:

  • The model's query_cypher can create, change and delete data, and it is committed immediately. There is no undo.
  • If you have chosen "Always allow" for query_cypher in Claude Desktop, you are not asked before a write.
  • show_result, the Cypher editor, get_view_query, schema reading, expanding and selection stay read-only.
  • The view does not say that something was written; only the model is told what changed.
  • Use it against data you can restore.

What read mode does not stop

  • LOAD CSV only reads, but it reads from the database server: files in Memgraph, network addresses in Neo4j.
  • Procedures installed in your database may have side effects outside the transaction.
  • Neo4j administration commands that are not writes: with an administrator login, SHOW TRANSACTIONS shows other users' query text and parameters, and TERMINATE TRANSACTIONS stops their queries. Neo4j Community Edition has no restricted users, so do not point the server at a shared instance there.

If your database edition supports users with limited rights, connect with one that can only read.

What is sent to the model

Schema example values, the data returned by query_cypher (up to 100 nodes, 100 relationships and 20,000 characters per call), show_result summaries (including up to 50 table rows), the selected node with its neighbors, and, when the model calls get_view_query, the query you ran with its parameters and a summary of its result are sent to the model. The view also puts the selected node or relationship with its properties, and your own query with its parameters, in the model context (long values are cut). The complete graph of a shown result is part of the tool result, which the client may keep with the conversation (Claude Desktop does).

Limits

At most 1,000 rows, 500 nodes and 2,000 relationships per result, a 30 second query timeout, and a size limit on what the view receives. Cuts are reported to the model and shown in the view.

  • The graph view is untested in clients other than Claude Desktop, Codex desktop and GitHub Copilot in VS Code.
  • In Claude Desktop, the side panel is not available to every organization; the view also works inside the chat.
  • The selected node and your last-run query are shared between chats: the last click or run wins.
  • Expanded nodes, dragged positions, the chosen layout and your edited query are gone if the view is reloaded. The model can still read the query you ran until it shows a new result.
  • Results shown by earlier versions have no Cypher button.

Development

Building from source needs pnpm:

git clone https://github.com/abergkvist/mcp-graph-explorer.git
cd mcp-graph-explorer
docker compose -f docker/compose.yaml up -d
pnpm install
pnpm build

To run your build, use these in the configuration, with absolute paths:

"command": "/absolute/path/to/node",
"args": ["/absolute/path/to/mcp-graph-explorer/packages/server/dist/index.js"]
pnpm test               # builds and runs the unit tests
pnpm smoke              # packs, installs and starts the package
pnpm test:integration   # needs the databases from docker compose
pnpm --filter @mcp-graph-explorer/view dev   # the view with example data
PackageContents
packages/normalizerDriver results to a JSON-safe graph and table; no MCP dependencies
packages/serverMCP server, dialects, limits
packages/viewThe view, built into one HTML file (React, shadcn/ui, Sigma, CodeMirror)

Releasing

  1. Set the new version in packages/server/package.json and twice in server.json, and merge.
  2. Tag it and push the tag: git tag vX.Y.Z && git push origin vX.Y.Z. The release.yml workflow checks the versions, builds, tests, stages the package on npm and creates the GitHub release.
  3. Approve the staged version with 2FA, on npmjs.com or with npm stage approve.
  4. When it is live on npm, start the publish-registry.yml workflow.

Design notes are in docs/ (the first version's design and plan are in Swedish).

Data

The example network is a subset of the Register of Infrastructure (RINF) published as open data by the European Union Agency for Railways. It is regenerated with node docker/make-seed.mjs <directory with the RINF CSV exports>. The direction of CONNECTS follows the start and end of each section in RINF and does not restrict traffic. The data is example content: it may be outdated and must not be used for operations.

License

Apache-2.0 for the code. The RINF data in docker/seed.cypher is not covered by it; the publisher's terms apply.

NPM
mcp-graph-explorer
Install Command
npm install mcp-graph-explorer