A server for accessing and interacting with a Neo4j graph database, configured via environment variables.
{{ message }}
cxt9 / neo4j-mcp Public
0 stars0 forksBranches Tags Activity
Star
Notifications
main
BranchesTags
Go to file
Code
Name | Name | Last commit message | Last commit date |
---|---|---|---|
4 Commits | |||
examples | examples | ||
src/neo4j_mcp | src/neo4j_mcp | ||
tests | tests | ||
.gitignore | .gitignore | ||
pyproject.toml | pyproject.toml | ||
readme.md | readme.md | ||
run.py | run.py | ||
setup_dev.py | setup_dev.py | ||
View all files |
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
No description, website, or topics provided.
Readme
Activity
0 stars
0 watching
0 forks
Report repository
No releases published
No packages published
Full Featured MCP Server for MongoDB Database.
A read-only MCP server for Reckon, enabling LLMs to query live data using the CData JDBC Driver.
Snowflake database integration with read/write capabilities and insight tracking
A Go implementation of a Model Context Protocol (MCP) server for Trino, enabling LLM models to query distributed SQL databases through standardized tools.
Server implementation for Google BigQuery integration that enables direct BigQuery database access and querying capabilities
A memory system for the Cursor code editor, providing persistent context awareness for Claude via a Turso database.
A lightweight server to connect AI assistants with Kintone applications and data.
Universal database MCP server supporting multiple database types including PostgreSQL, Redshift, CockroachDB, MySQL, RDS MySQL, Microsoft SQL Server, BigQuery, Oracle DB, and SQLite
A read-only MCP server by CData that enables LLMs to query live data from Dynamics 365. Requires the CData JDBC Driver for Dynamics 365.
A local server to query and interact with Markdown knowledge bases by tags, text, slug, or date.