neo4j-mcp
Provides tools for interacting with Neo4j graph databases, enabling Cypher queries, node and relationship management, path finding, and schema introspection.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@neo4j-mcpfind all nodes labelled 'Movie' directed by Christopher Nolan"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Neo4j MCP Server
MCP server for Neo4j graph database operations.
Version: 0.2.0 Status: Internal Bodai integration component
Quick Links
Related MCP server: Neo4j GraphRAG MCP Server
Quality & CI
Crackerjack is the standard quality-control and CI/CD gate for Neo4j MCP changes. Local verification should mirror the Crackerjack workflow used across the Bodai ecosystem.
Overview
Neo4j MCP exposes graph database workflows through a FastMCP server. It gives agents a typed interface for Cypher execution, node and relationship management, path discovery, and schema inspection while preserving a narrow database client boundary.
Use this server when an agent needs to query or mutate graph data directly. Keep domain-specific graph policies in the calling system or a higher-level service layer rather than embedding them in generic Neo4j tools.
Capabilities
Implemented tool surface:
Cypher execution: run parameterized Cypher queries
Node management: create, retrieve, delete, and search nodes
Relationship management: create and delete relationships between nodes
Path discovery: find bounded paths between two nodes
Schema inspection: retrieve labels, relationship types, indexes, and constraints
Mock mode: exercise tool behavior without a live Neo4j connection
HTTP health routes:
/healthand/healthzfor MCP client and process supervision checks
Quick Start
Prerequisites
Python 3.13+
UV package manager
Neo4j server for live access
Local Setup
git clone https://github.com/lesleslie/neo4j-mcp.git
cd neo4j-mcp
uv sync --group devRun In Mock Mode
export NEO4J_MCP_MOCK_MODE=true
uv run neo4j-mcp start
uv run neo4j-mcp healthRun With Neo4j
export NEO4J_MCP_URI="bolt://localhost:7687"
export NEO4J_MCP_USER="neo4j"
export NEO4J_MCP_PASSWORD="your-password"
export NEO4J_MCP_DATABASE="neo4j"
uv run neo4j-mcp startThe default HTTP bind is 127.0.0.1:3045.
CLI Commands
The CLI is built with mcp-common and provides the standard lifecycle command surface used by Bodai MCP servers.
uv run neo4j-mcp start # Start the HTTP MCP server
uv run neo4j-mcp stop # Stop the managed server process
uv run neo4j-mcp restart # Restart the managed server process
uv run neo4j-mcp status # Show process status
uv run neo4j-mcp health # Run the local health probeMCP Server Configuration
Claude / Codex Style Configuration
Add the server to an MCP client configuration:
{
"mcpServers": {
"neo4j": {
"command": "uv",
"args": ["run", "neo4j-mcp", "start"],
"cwd": "<absolute-path-to-cloned-neo4j-mcp>",
"env": {
"NEO4J_MCP_URI": "bolt://localhost:7687",
"NEO4J_MCP_USER": "neo4j",
"NEO4J_MCP_PASSWORD": "your-password",
"NEO4J_MCP_DATABASE": "neo4j"
}
}
}
}For tests or local client wiring, replace live connection values with NEO4J_MCP_MOCK_MODE=true.
Health Checks
curl http://127.0.0.1:3045/health
curl http://127.0.0.1:3045/healthzInstallation via Bodai Marketplace
This repo ships a Bodai Claude Code plugin manifest (.claude-plugin/plugin.json) plus a colocated .mcp.json and three slash commands in commands/. To install via the Bodai marketplace, first register the marketplace with Claude Code, then install the plugin by name. Once installed, the slash commands /neo4j-cypher, /neo4j-schema, and /neo4j-find-nodes become available alongside the mcp__neo4j__* tools.
Tool Reference
Tool | Purpose | Required Inputs |
| Execute a Cypher query |
|
| Create a node with labels and properties |
|
| Retrieve a node by ID |
|
| Delete a node by ID |
|
| Search nodes by labels and properties | none |
| Create a typed relationship between nodes |
|
| Delete a relationship by ID |
|
| Find paths between two nodes |
|
| Retrieve database schema details | none |
Tool responses follow a consistent ToolResponse shape:
{
"success": true,
"message": "Query returned 3 records",
"data": {},
"error": null,
"next_steps": []
}Configuration
Committed defaults live in settings/neo4j.yaml. Runtime overrides should come from environment variables or a local .env file that is not committed.
Setting | Environment Variable | Default |
Neo4j URI |
|
|
User |
|
|
Password |
| empty |
Database |
|
|
Max connection lifetime |
|
|
Max pool size |
|
|
Connection timeout |
|
|
Mock mode |
|
|
Enable HTTP transport |
|
|
HTTP host |
|
|
HTTP port |
|
|
Log level |
|
|
JSON logs |
|
|
Project Structure
neo4j_mcp/
__init__.py # Package surface (__version__, model re-exports)
__main__.py # Module entry point (`python -m neo4j_mcp`)
cli.py # mcp-common lifecycle CLI
client.py # Neo4j driver boundary
config.py # Pydantic settings and logging
models.py # Typed graph request and response models
server.py # FastMCP application factory
tools/
__init__.py # Re-exports register_graph_tools
graph_tools.py # Registered MCP tools
settings/
neo4j.yaml # Committed defaults (documentation; see note below)
tests/Note:
settings/neo4j.yamldocuments the operator-facing defaults but is not loaded by pydantic-settings at runtime —Neo4jSettingsreads from theNEO4J_MCP_*environment variables and the.envfile only. Usesettings/neo4j.yamlas a reference when authoring your local.env.
Development
uv sync --group dev
uv run pytest
uv run ruff check neo4j_mcp tests
uv run ruff format neo4j_mcp tests
uv run mypy neo4j_mcpUse targeted tests when isolating graph behavior:
uv run pytest tests -k graph -vSecurity Notes
Do not commit Neo4j passwords or connection strings containing credentials.
Prefer parameterized Cypher through
paramswhen passing user-controlled values.Treat
run_cypheras a privileged tool because it can mutate data.Use database permissions and separate users to constrain agent-accessible operations.
This server cannot be deployed
Maintenance
Related MCP Connectors
Repository knowledge graph MCP server for codebase understanding and debugging.
MCP server for querying BrainKB, a knowledge base for neuroscience knowledge graphs.
MCP server for Product Management
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAn MCP server that enables graph database interactions with Neo4j, allowing users to access and manipulate graph data through natural language commands.-
- AlicenseAqualityCmaintenanceAn MCP server that enables LLMs to perform semantic and fulltext searches within Neo4j while executing complex, search-augmented Cypher queries for GraphRAG applications. It provides tools for database schema discovery and supports multi-provider embeddings to facilitate advanced graph traversals.52MIT
- AlicenseNot gradedqualityCmaintenanceProduction-ready MCP server for Neo4j graph databases, enabling natural language to Cypher query translation with enterprise security and async performance.MIT
- FlicenseNot gradedqualityBmaintenanceMCP server for indexing source code from repositories into a Neo4j graph database and enabling Graph RAG-based search and traversal of functions via natural language queries.-