Neo4j
Servidor MCP para Neo4j — executar consultas Cypher, explorar esquemas e inspecionar informações do banco de dados via stdio
GitHubExperimente este MCPPatrocinado
Documentação
neo4j-mcp
Servidor MCP para Neo4j — execute consultas Cypher, explore o esquema do grafo e inspecione informações do banco de dados via stdio.
Instalação
bunx @daanrongen/neo4j-mcp
Ferramentas (8 no total)
| Domínio | Ferramentas | Cobertura |
|---|---|---|
| Consulta | run_query, run_read_query | Executar consultas Cypher (gravação e somente leitura) |
| Esquema | get_schema, get_labels, get_relationship_types, get_indexes, get_constraints | Inspecionar esquema do grafo e metadados |
| Informações | get_server_info | Endereço e versão do servidor Neo4j |
Configuração
| Variável | Obrigatória | Descrição |
|---|---|---|
NEO4J_URL | Sim | URL Bolt (ex.: bolt://localhost:7687 ou neo4j://localhost:7687) |
NEO4J_PASSWORD | Sim | Senha do Neo4j (o nome de usuário padrão é neo4j) |
Configuração
Claude Desktop
Edite ~/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-mcp
Desenvolvimento
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
Inspeção local
bun run inspect inicia o MCP Inspector contra a build local:
bun run build && bun run inspect
Isso abre a interface do Inspector no seu navegador, onde você pode chamar qualquer ferramenta interativamente e inspecionar as formas de requisição/resposta.
Arquitetura
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
Licença
MIT