home / mcp / mcp neo4j server

MCP Neo4j Server

mcp-neo4j-server

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "da-okazaki-mcp-neo4j-server": {
      "command": "npx",
      "args": [
        "@alanse/mcp-neo4j-server"
      ],
      "env": {
        "NEO4J_URI": "bolt://localhost:7687",
        "NEO4J_DATABASE": "neo4j",
        "NEO4J_PASSWORD": "your-password",
        "NEO4J_USERNAME": "neo4j"
      }
    }
  }
}

You can run an MCP server that connects Claude Desktop to a Neo4j graph database, allowing you to perform graph operations using natural language. This server abstracts Cypher queries and graph manipulations behind simple, chat-like interactions, making it easy to explore, create, and relate nodes and relationships without writing code.

How to use

Use this MCP server with an MCP client in Claude Desktop. Start by launching the server with a single command, then configure Claude Desktop to point to the MCP server. You can ask questions like how to find people in a department, create nodes with specific labels and properties, or establish relationships between existing nodes. The server exposes tools to run Cypher queries, create nodes, and create relationships, returning structured results that you can review and iterate on.

How to install

Prerequisites: Node.js and npm installed on your machine.

Quick start using npx to run the MCP Neo4j Server directly.

npx @alanse/mcp-neo4j

Add the MCP Neo4j Server to Claude Desktop configuration to persistently connect.

{
  "mcpServers": {
    "neo4j": {
      "command": "npx",
      "args": ["@alanse/mcp-neo4j-server"],
      "env": {
        "NEO4J_URI": "bolt://localhost:7687",
        "NEO4J_USERNAME": "neo4j",
        "NEO4J_PASSWORD": "your-password",
        "NEO4J_DATABASE": "neo4j"
      }
    }
  }
}

Additional configuration and usage notes

Environment variables control how the server connects to Neo4j. You can override the defaults to point to your database, credentials, and the target database in Neo4j Enterprise.

Configuration

The MCP Neo4j Server requires the following environment variables when running in stdio mode via a client like Claude Desktop.

Examples

Connecting to a specific database in Neo4j Enterprise: set NEO4J_DATABASE to the database name you want to use. Example: myCustomDatabase.

Testing

Test interactions by asking Claude to run queries or create data, then review the returned structured results to verify correct behavior.

License

MIT license.

Available tools

execute_query

Execute Cypher queries against the connected Neo4j database. Supports READ, CREATE, UPDATE, and DELETE queries and returns structured results with parameter binding to prevent injection.

create_node

Create a new node with specified labels and properties in the graph database. Returns the created node and its internal ID. Supports all Neo4j data types for properties.

create_relationship

Create a relationship between two existing nodes by specifying source and target node identifiers, the relationship type, direction, and optional properties.