A server for accessing and interacting with a Neo4j graph database, configured via environment variables.
A robust Model Context Protocol (MCP) implementation that enables LLMs to interact with Neo4j graph databases using natural language.
This server uses a stable, synchronous Neo4j driver wrapped for asynchronous use, ensuring reliable connections and compatibility with modern MCP clients.
.env
file.pip
for installing packages.neo4j-mcp-server
command directly to your source code.Configuration is managed via a .env
file in the project root.
.env
file.Create a .env
file with the following content. Leave NEO4J_USERNAME
and NEO4J_PASSWORD
blank.
NEO4J_HOST=localhost NEO4J_PORT=7687 NEO4J_USERNAME= NEO4J_PASSWORD= NEO4J_DATABASE=neo4j
NEO4J_HOST=localhost NEO4J_PORT=7687 NEO4J_USERNAME=neo4j NEO4J_PASSWORD=your-secret-password NEO4J_DATABASE=neo4j
For cloud services like Neo4j Aura, use the neo4j+s
scheme and set NEO4J_ENCRYPTED
to true
.
NEO4J_HOST=xxx.databases.neo4j.io NEO4J_PORT=7687 NEO4J_USERNAME=neo4j NEO4J_PASSWORD=your-aura-password NEO4J_DATABASE=neo4j NEO4J_URI_SCHEME=neo4j+s NEO4J_ENCRYPTED=true
With your .env
file configured and dependencies installed, you can start the server.
neo4j-mcp-server
The server will start and listen for connections over stdio. If you see INFO:neo4j_mcp.server:Starting Neo4j MCP Server (stdio)
, it's working!
You can also start it with an SSE transport for web-based clients:
neo4j-mcp-server --transport sse --port 3000
.env
file is configured.~/.cursor/mcp.json
or via the @
symbol > Tools > Settings icon)..env
file from its own directory, so you don't need to specify credentials here.{ "mcp.servers": { "neo4j": { "command": "neo4j-mcp-server", "transport": "stdio" } } }
@neo4j
tool should now be available and connected.read_cypher_query(query, [parameters], [database])
: Execute a read-only query.write_cypher_query(query, [parameters], [database])
: Execute a write query.get_database_schema([database])
: Get database labels and relationship types.test_database_connection()
: Verify the connection and get server info.run_cypher_query(query, [parameters], [database], [read_only])
: Run a query with explicit read/write mode.AttributeError: type object 'SessionConfig' has no attribute 'AccessMode'
: Your neo4j
library version might be incompatible. The project is tested with neo4j>=5.15.0
.ConnectionError: Neo4j authentication failed
: Check your NEO4J_USERNAME
and NEO4J_PASSWORD
in the .env
file. If your database has no auth, ensure these are blank.ConnectionError: Neo4j service unavailable
: Make sure your Neo4j database is running and accessible at the specified NEO4J_HOST
and NEO4J_PORT
.Made with ❤️ for the Neo4j and MCP communities
Access geologic data from the Macrostrat API, including units, columns, minerals, and timescales.
Provides access to Azure Data Explorer (ADX) clusters, requiring Azure credentials for configuration.
Provides natural language access to Brazilian treasury bond data from the Tesouro Direto API, allowing users to query market data and bond details.
Provides tools for querying and managing a MySQL database.
Immutable ledger database with live synchronization
A read-only MCP server for querying live Snapchat Ads data using the CData JDBC Driver.
An AI-powered gateway for managing over 40 data sources like Alibaba Cloud and mainstream databases, featuring NL2SQL, code generation, and data migration.
A memory system for the Cursor code editor, providing persistent context awareness for Claude via a Turso database.
Provides on-chain tools to interact with the Polygon PoS blockchain.
Token Metrics integration for fetching real-time crypto market data, trading signals, price predictions, and advanced analytics.