# mcp-neo4j-cypher

MCP server that lets an agent run Cypher queries against Neo4j and pull the graph schema.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 989
- Author: neo4j-contrib
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/neo4j-contrib/mcp-neo4j/tree/HEAD/servers/mcp-neo4j-cypher
- Updated: 2026-09-09
- HTML: https://affpapa.org/en/nevibecode/mcp/mcp-neo4j-cypher

## What it does

Three tools come with this server. `read_neo4j_cypher` runs read queries and hands results back as a JSON array; `write_neo4j_cypher` handles updates and answers with counters for touched nodes and created relationships. The third one, `get_neo4j_schema`, lists node labels with their attributes and the relationships between them.

Schema inspection needs the APOC plugin enabled on the instance. Without it `get_neo4j_schema` fails. You also need a live Neo4j database, Aura or self-managed. Read queries carry a 30 second timeout by default, changed with `--read-timeout` or `NEO4J_READ_TIMEOUT`. Response size is capped by `--token-limit` and `NEO4J_RESPONSE_TOKEN_LIMIT`, and `tiktoken` cuts anything longer.

Running against more than one database? Set a namespace and every tool name gets a prefix such as `mydb-read_neo4j_cypher`. The `--read-only` flag, or `NEO4J_READ_ONLY=true`, removes the write tool from what the agent sees. On a large graph keep schema sampling low: 1000 nodes per label is the default, `-1` scans everything.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `NEO4J_URI`, `NEO4J_USERNAME`, `NEO4J_PASSWORD`, `NEO4J_DATABASE`, `NEO4J_NAMESPACE`, `NEO4J_RESPONSE_TOKEN_LIMIT`, `NEO4J_READ_TIMEOUT`, `NEO4J_READ_ONLY`, `NEO4J_SCHEMA_SAMPLE_SIZE` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env NEO4J_URI=<NEO4J_URI> --env NEO4J_USERNAME=<NEO4J_USERNAME> --env NEO4J_PASSWORD=<NEO4J_PASSWORD> --env NEO4J_DATABASE=<NEO4J_DATABASE> --env NEO4J_NAMESPACE=<NEO4J_NAMESPACE> --transport stdio mcp-neo4j-cypher -- uvx mcp-neo4j-cypher
```
Replace <…> with your own values. 4 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from mcp-neo4j-cypher <command>

### Codex

**Platform CLI**
```bash
codex mcp add mcp-neo4j-cypher --env NEO4J_URI=<NEO4J_URI> --env NEO4J_USERNAME=<NEO4J_USERNAME> --env NEO4J_PASSWORD=<NEO4J_PASSWORD> --env NEO4J_DATABASE=<NEO4J_DATABASE> --env NEO4J_NAMESPACE=<NEO4J_NAMESPACE> -- uvx mcp-neo4j-cypher
```
Replace <…> with your own values. 4 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from mcp-neo4j-cypher <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mcp-neo4j-cypher": {
            "command": "uvx",
            "args": [
                "mcp-neo4j-cypher"
            ],
            "env": {
                "NEO4J_URI": "<NEO4J_URI>",
                "NEO4J_USERNAME": "<NEO4J_USERNAME>",
                "NEO4J_PASSWORD": "<NEO4J_PASSWORD>",
                "NEO4J_DATABASE": "<NEO4J_DATABASE>",
                "NEO4J_NAMESPACE": "<NEO4J_NAMESPACE>"
            }
        }
    }
}
```
Replace <…> with your own values. 4 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from mcp-neo4j-cypher <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mcp-neo4j-cypher": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "mcp-neo4j-cypher"
            ],
            "env": {
                "NEO4J_URI": "<NEO4J_URI>",
                "NEO4J_USERNAME": "<NEO4J_USERNAME>",
                "NEO4J_PASSWORD": "<NEO4J_PASSWORD>",
                "NEO4J_DATABASE": "<NEO4J_DATABASE>",
                "NEO4J_NAMESPACE": "<NEO4J_NAMESPACE>"
            }
        }
    }
}
```
Replace <…> with your own values. 4 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from mcp-neo4j-cypher <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e NEO4J_URI=<NEO4J_URI> -e NEO4J_USERNAME=<NEO4J_USERNAME> -e NEO4J_PASSWORD=<NEO4J_PASSWORD> -e NEO4J_DATABASE=<NEO4J_DATABASE> -e NEO4J_NAMESPACE=<NEO4J_NAMESPACE> mcp-neo4j-cypher uvx mcp-neo4j-cypher
```
Replace <…> with your own values. 4 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from mcp-neo4j-cypher <command>

## When to use it
- pull a subset of the graph with a Cypher query
- patch nodes and relationships from the chat window
- read the labels and edges before writing a query
- keep a huge result inside the model token budget
- talk to two Neo4j instances in one session

## Example prompts
- Run a Cypher query in Neo4j: which `Customer` nodes link to order 42?
- Describe the schema of the `mydb` database
- Create a `Project` node called “NeVibe” and connect it to its owner

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89433
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16717
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 40409
- [dbx](https://affpapa.org/en/nevibecode/mcp/dbx.md) — MCP server · ★ 27669
- [Metabase](https://affpapa.org/en/nevibecode/mcp/metabase.md) — MCP server · ★ 49845

From the same set: [neo4j-contrib/mcp-neo4j](https://affpapa.org/en/nevibecode/by/neo4j-contrib/mcp-neo4j.md) — 3 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
