This server implements the Model Context Protocol (MCP) to connect large language models like Claude Desktop with Neo4j databases, allowing natural language interactions with graph databases. Use it to perform Cypher queries, store knowledge graph memory, or manage graph-based memory through simple conversational commands.
The mcp-neo4j-cypher
server converts natural language into Cypher queries that can be executed against your Neo4j database. This allows you to query your graph database using plain English commands like "What is in this graph?"
The mcp-neo4j-memory
server provides knowledge graph memory capabilities using Neo4j as the storage backend. It helps maintain context between interactions by storing information in a structured graph format.
The mcp-json-memory
server offers knowledge graph memory storage using a simple JSON file instead of Neo4j. This is a reference implementation that demonstrates memory modeling as a knowledge graph.
npm install mcp-neo4j-server
git clone https://github.com/neo4j/mcp-server.git
cd mcp-server
npm install
Create a configuration file (config.json
) with your Neo4j credentials:
{
"neo4j": {
"uri": "neo4j+s://your-instance-id.databases.neo4j.io",
"username": "neo4j",
"password": "your-password"
},
"memory": {
"type": "neo4j", // or "json" for file-based storage
"filePath": "./memory.json" // only needed for JSON memory type
}
}
npx mcp-neo4j-server --config ./config.json
Or if installed manually:
node server.js --config ./config.json
By default, the server runs on port 8080. You can specify a different port:
npx mcp-neo4j-server --port 3000 --config ./config.json
http://localhost:8080
Here are some examples of natural language queries you can use:
The server exposes standard MCP endpoints:
/mcp/describe
: Returns information about the server capabilities/mcp/execute
: Processes natural language commands and returns results/mcp/health
: Health check endpointIf you encounter connection issues:
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.