# Neo4j — MCP Server

> Ask questions of a graph database in Cypher, generated for you.

**Source:** https://mcpplaygroundonline.com/mcp-servers/neo4j  
**Transport:** stdio  
**Requires auth:** Yes

---

## What it does

mcp-neo4j-cypher is the one most people mean. It reads your database schema — node labels, relationship types, properties — and uses it to generate Cypher for a question asked in plain language, then executes it and returns the result. Schema inspection depends on the APOC plugin being installed, which is worth checking before you assume the server is broken. The reason graph queries suit this pattern well is that the hard part of Cypher is usually the traversal, not the syntax: expressing "customers who bought something also bought by people who churned" is tedious by hand and natural to ask. Three sibling servers round out the set. mcp-neo4j-memory persists entities and relationships as a knowledge graph in Neo4j, which is the same idea as the reference memory server but backed by a real database and queryable with Cypher. mcp-neo4j-data-modeling builds and validates graph data models with Arrows.app import and export. mcp-neo4j-cloud-aura-api manages Aura instances — create, scale, pause, destroy. All of them run over stdio by default and can be switched to SSE or HTTP.

## Tools exposed

- get_neo4j_schema — read node labels, relationship types and properties
- read_neo4j_cypher — run a read query generated from a natural-language question
- write_neo4j_cypher — create or update nodes and relationships
- mcp-neo4j-memory — entity and relationship memory persisted in the graph
- mcp-neo4j-data-modeling — build and validate models, with Arrows.app import and export
- mcp-neo4j-cloud-aura-api — create, scale, pause and destroy Aura instances

## Example queries you can run

- "Which customers are connected to more than three flagged accounts within two hops?"
- "Show me the shortest path between these two people and what connects them."
- "What does the schema look like, and which relationship types are most common?"
- "Find clusters of products frequently bought together and describe each one."

## Details

- **Recommended model:** anthropic/claude-sonnet-4.5 — Cypher traversals are where weaker models produce syntactically valid queries with the wrong direction or depth. Sonnet 4.5 reads the schema first and gets the pattern right.
- **Transport:** stdio
- **Authentication:** Required — A Neo4j connection URI with username and password. Create a read-only user for query work rather than using neo4j.
- **Official source:** [neo4j-contrib/mcp-neo4j — official repository](https://github.com/neo4j-contrib/mcp-neo4j)

## Connecting to Neo4j

URL format:

```
neo4j://host:7687  ·  neo4j+s://host:7687 for an encrypted Aura connection
```

### Connection examples

**Local instance**

```
bolt://localhost:7687
```

The default Bolt port on a local install.

**Neo4j Aura**

```
neo4j+s://xxxxxxxx.databases.neo4j.io
```

The +s scheme is encrypted with certificate verification. Use it for anything managed or remote.

### Environment variables

- `NEO4J_URI` (required) — Connection URI for the database.
- `NEO4J_USERNAME` (required) — Username. Prefer a dedicated read-only user over neo4j.
- `NEO4J_PASSWORD` (required) — Password for that user.
- `NEO4J_DATABASE` — Database to query. Defaults to neo4j.
- `NEO4J_TRANSPORT` — stdio, sse or http. Defaults to stdio.

### Client configuration

**uvx — the Cypher server**

Schema inspection needs the APOC plugin installed on the database.

```
{
  "mcpServers": {
    "neo4j": {
      "command": "uvx",
      "args": ["mcp-neo4j-cypher@latest"],
      "env": {
        "NEO4J_URI": "neo4j+s://xxxxxxxx.databases.neo4j.io",
        "NEO4J_USERNAME": "readonly_agent",
        "NEO4J_PASSWORD": "YOUR_PASSWORD",
        "NEO4J_DATABASE": "neo4j"
      }
    }
  }
}
```

## Frequently asked questions

### What is the Neo4j MCP server?

It is a family of MCP servers maintained under neo4j-contrib. mcp-neo4j-cypher generates and runs Cypher from natural language; mcp-neo4j-memory stores a knowledge graph in Neo4j; mcp-neo4j-data-modeling builds graph models; mcp-neo4j-cloud-aura-api manages Aura instances.

### Do I need the APOC plugin?

For schema inspection, yes. get_neo4j_schema relies on APOC, and without it the agent has to guess at labels and relationship types — which produces exactly the confident, wrong Cypher you installed the server to avoid. Aura includes APOC by default.

### Can an agent delete data through it?

write_neo4j_cypher accepts any write query, so yes, unless you stop it. Connect with a user granted only read privileges for query work, and keep the write path on a separate connection you enable deliberately. Neo4j role-based access control is the boundary that actually holds.

### How does this compare to the memory MCP server?

The reference memory server keeps a knowledge graph in a local JSON file — simple, portable, no infrastructure. mcp-neo4j-memory keeps the same shape in a real graph database, so the memory is queryable with Cypher, shareable across agents and able to grow past what fits in a file.

### Why use a graph database with an AI agent at all?

Because relationship questions are where SQL gets painful and Cypher does not. Multi-hop traversals, shortest paths and cluster detection are one-line patterns in Cypher, which makes them a good fit for exactly the open-ended questions people ask an agent.

---

_Test this server across 40+ models on MCP Playground: https://mcpplaygroundonline.com/mcp-servers/neo4j — free, no install._
