Neo4j MCP Server: Query Your Graph Database with AI
What it is: A set of MCP servers published under Neo4j's neo4j-contrib GitHub org, in the mcp-neo4j monorepo. It's not a single server but a small family — mcp-neo4j-cypher runs Cypher queries and introspects your graph's schema, mcp-neo4j-memory uses Neo4j as a persistent knowledge-graph memory for an agent, and a data-modeling server helps design a graph schema before you load data.
Quick answer: For querying an existing graph, run uvx mcp-neo4j-cypher with your connection URI, username, and password as environment variables — the agent gets schema introspection plus Cypher execution. Start with a read-only database user; Cypher's MERGE/DELETE/DETACH DELETE can restructure a graph just as destructively as SQL's DELETE can a table.
Why it matters for data work
Graph data — fraud rings, org charts, recommendation networks, dependency graphs — is exactly the shape LLMs are bad at reasoning about from a raw table dump but good at once they can traverse it. The MCP server lets the agent introspect node labels and relationship types, then write Cypher that follows the actual graph structure ("find all accounts within 2 hops of this flagged one") instead of you translating that into recursive SQL by hand.
Install & configure
Connection details are supplied as environment variables, matching the Neo4j driver convention:
# Claude Code
claude mcp add neo4j -e NEO4J_URI=bolt://localhost:7687 \
-e NEO4J_USERNAME=neo4j -e NEO4J_PASSWORD=<password> -- uvx mcp-neo4j-cypher
// Claude Desktop / Cursor config
{
"mcpServers": {
"neo4j": {
"command": "uvx",
"args": ["mcp-neo4j-cypher"],
"env": {
"NEO4J_URI": "bolt://localhost:7687",
"NEO4J_USERNAME": "neo4j",
"NEO4J_PASSWORD": "<password>"
}
}
}
}
For AuraDB (Neo4j's managed cloud), swap the URI for the neo4j+s:// connection string from your instance's console. Check the repo for the current package names and flags before deploying — this is an actively evolving multi-package project, and exact argument names have shifted across releases.
Cypher server or the memory server — which one do you want?
These solve different problems. mcp-neo4j-cypher is for querying a graph you already have — schema, sales relationships, a knowledge graph you built with dbt or a data pipeline. mcp-neo4j-memory instead uses Neo4j as the agent's own long-term memory store, letting it persist entities and relationships across conversations. Don't point both at the same database without thinking it through — you don't want an agent's self-generated memory nodes mixed into a graph you're using for analytics.
How do I keep it safe?
Unlike the Postgres reference server, this one does not wrap queries in a read-only transaction by default — a Cypher CREATE, MERGE, SET, or DETACH DELETE will execute if the connecting user has permission. Create a Neo4j role restricted to MATCH/read access for exploratory use (Neo4j 5's role-based access control supports this), and only connect with a write-capable user when you specifically want the agent modifying the graph, ideally against a non-production database.
Troubleshooting
Where setups typically go wrong:
- ServiceUnavailable / connection refused: confirm Neo4j's Bolt port (7687 by default) is reachable and the URI scheme matches —
bolt://for plain,neo4j+s://for AuraDB/TLS. - AuthenticationRateLimit or Unauthorized: wrong username/password, or the account needs a forced password change on first login via the Neo4j Browser first.
- uvx: command not found: install
uvfirst. - Queries return nothing the agent expects: ask it to run
CALL db.schema.visualization()or check labels first — Cypher is case-sensitive on labels and relationship types.
Author & links
Author: Neo4j, via the neo4j-contrib community org
Repo: github.com/neo4j-contrib/mcp-neo4j
License: MIT
Related skills
For document-shaped NoSQL data, see the MongoDB MCP server. For a relational alternative, see the Postgres MCP server. For search over unstructured text, see the Elasticsearch MCP server.
← Back to MCP Servers