
neo4j-mcp
MCP server for Neo4j โ run Cypher queries, explore graph schema, and inspect database info over stdio.
Tools (8 total)
| Domain | Tools | Coverage |
|---|---|---|
| Query | run_query, run_read_query | Execute Cypher queries (write and read-only) |
| Schema | get_schema, get_labels, get_relationship_types, get_indexes, get_constraints | Inspect graph schema and metadata |
| Info | get_server_info | Neo4j server address and version |
Development
bun install
bun run dev # run with --watch
bun test # run test suite
bun run typecheck # tsc type check
bun run lint # biome lint
bun run build # bundle to dist/main.jsInspecting locally
bun run inspect launches the MCP Inspector against the local build:
bun run build && bun run inspectThis opens the Inspector UI in your browser where you can call any tool interactively and inspect request/response shapes.
Architecture
src/
โโโ config.ts # Effect Config โ NEO4J_URL, NEO4J_PASSWORD
โโโ main.ts # Entry point โ ManagedRuntime + StdioServerTransport
โโโ domain/
โ โโโ Neo4jClient.ts # Context.Tag service interface
โ โโโ errors.ts # Neo4jError, QueryError, NodeNotFoundError
โ โโโ models.ts # Schema.Class models (QueryResult, SchemaInfo, IndexInfo, โฆ)
โ โโโ query.test.ts # Domain query tests (uses Neo4jClientTest)
โ โโโ schema.test.ts # Domain schema tests (uses Neo4jClientTest)
โโโ infra/
โ โโโ Neo4jClientLive.ts # Layer.scoped โ neo4j-driver connection with acquireRelease
โ โโโ Neo4jClientTest.ts # In-memory Ref-based test adapter
โโโ mcp/
โโโ server.ts # McpServer wired to ManagedRuntime
โโโ utils.ts # formatSuccess, formatError
โโโ tools/ # query.ts, schema.ts, info.tsInstallation
bunx @daanrongen/neo4j-mcpConfiguration
| Variable | Required | Description |
|---|---|---|
NEO4J_URL | Yes | Bolt URL (e.g. bolt://localhost:7687 or neo4j://localhost:7687) |
NEO4J_PASSWORD | Yes | Neo4j password (username defaults to neo4j) |
Setup
Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"neo4j": {
"type": "stdio",
"command": "bunx",
"args": ["@daanrongen/neo4j-mcp"],
"env": {
"NEO4J_URL": "bolt://localhost:7687",
"NEO4J_PASSWORD": "your-password"
}
}
}
}Claude Code CLI
claude mcp add neo4j \
-e NEO4J_URL=bolt://localhost:7687 \
-e NEO4J_PASSWORD=your-password \
-- bunx @daanrongen/neo4j-mcpNo common issues documented yet. If you hit a problem, the repository's GitHub Issues page is the best place to look.
License
MIT