Labsco
daanrongen logo

Neo4j

from daanrongen

MCP server for Neo4j โ€” run Cypher queries, explore schema, and inspect database info over stdio

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedAccount requiredNeeds API keys

neo4j-mcp

MCP server for Neo4j โ€” run Cypher queries, explore graph schema, and inspect database info over stdio.

Tools (8 total)

DomainToolsCoverage
Queryrun_query, run_read_queryExecute Cypher queries (write and read-only)
Schemaget_schema, get_labels, get_relationship_types, get_indexes, get_constraintsInspect graph schema and metadata
Infoget_server_infoNeo4j 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.js

Inspecting locally

bun run inspect launches the MCP Inspector against the local build:

bun run build && bun run inspect

This 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.ts