A Neo4j MCP server that executes Cypher queries against Neo4j via the Model Context Protocol.
Configuration
View docs{
"mcpServers": {
"neo4j_mcp": {
"command": "npx",
"args": [
"neo4j-mcpserver"
],
"env": {
"NEO4J_CONNECTION": "neo4j+s://your-instance.databases.neo4j.io,neo4j,your-password",
"NEO4J_URI": "neo4j+s://your-instance.databases.neo4j.io",
"NEO4J_USER": "neo4j",
"NEO4J_PASSWORD": "your-password"
}
}
}
}The Neo4j MCP Server enables you to manage graph database operations through the Model Context Protocol, allowing you to connect an MCP client to a Neo4j instance and run Cypher queries and related actions. It is designed to work with MCP clients on both Cursor and Claude Desktop, giving you a flexible, scriptable way to integrate Neo4j into your automated workflows.
You connect your MCP client to the Neo4j MCP server using the standard MCP workflow. The server runs locally via a simple command and reads your Neo4j connection details from environment variables. Once running, you can issue graph queries and commands through the MCP client’s interface, and the server will execute them against your Neo4j database.
Prerequisites: you need Node.js and npm installed on your machine.
1) Install the MCP server package globally and make sure you have a compatible Node environment.
npm install -g neo4j-mcpserver
# Or use npx to run without a global install
NEO4J_CONNECTION=neo4j+s://your-instance.databases.neo4j.io,neo4j,your-password npx neo4j-mcpserver
# Or use separate environment variables with npx
NEO4J_URI=neo4j+s://your-instance.databases.neo4j.io NEO4J_USER=neo4j NEO4J_PASSWORD=your-password npx neo4j-mcpserverConfigure how the server reads your Neo4j credentials in one of two ways. Choose either a single connection string or separate environment variables.
Single connection string method: set NEO4J_CONNECTION to a value like <uri>,<user>,<password> and run the server with npx or a global install.
Separate variables method: set NEO4J_URI, NEO4J_USER, and NEO4J_PASSWORD individually and run the server with npx.
Environment file support: you can place the same variables in a .env file in your project root for convenience.
Example values you might use in your setup (replace with your actual credentials): - NEO4J_CONNECTION=neo4j+s://your-instance.databases.neo4j.io,neo4j,your-password - NEO4J_URI=neo4j+s://your-instance.databases.neo4j.io - NEO4J_USER=neo4j - NEO4J_PASSWORD=your-password
If you encounter problems, verify your credentials and the server is running. Common checks include ensuring the Neo4j URI, username, and password are correct and that the database is accessible from the machine running the MCP server.
Path and environment issues are also common: avoid spaces in installation paths and prefer forward slashes in file paths.
If the MCP client cannot detect the server, restart the client and confirm that the server process is running. Double-check that the environment variables are set correctly and accessible to the MCP server process.
This MCP server provides a tool that lets you execute Cypher queries against your Neo4j database from your MCP client.
Execute Cypher queries against your Neo4j database.