Back to Blog
Guide
5 min read
April 15, 2026

How to Use Neo4j MCP with Claude Code

Run Cypher queries, explore graph schemas, and analyze relationships in Neo4j directly from Claude Code — perfect for recommendation engines, fraud detection, and knowledge graphs.

neo4jgraph-databasecypherknowledge-graphclaude-code

What is the Neo4j MCP?

The Neo4j MCP connects Claude Code to your Neo4j graph database instance, enabling it to execute Cypher queries, traverse relationships, inspect graph schemas, and reason about highly connected data. It is especially valuable for domains where relationships between entities are as important as the entities themselves — social networks, fraud detection, supply chains, and knowledge graphs.

Installation

mcpizy install neo4j

Provide your Neo4j Bolt URI (e.g., bolt://localhost:7687 or neo4j+s://xxxx.databases.neo4j.io), username, and password during setup.

Key Capabilities

  • Execute Cypher queries — run any Cypher statement and receive structured results.
  • Explore the schema — list node labels, relationship types, and property keys.
  • Traverse relationships — find shortest paths, neighbors, and subgraphs.
  • Write and validate graph algorithms — test Graph Data Science (GDS) procedures.
  • Import and export data — bulk-load CSV data or export query results.

Example Usage

Find all users who purchased the same product as a given user (collaborative filtering seed):

MATCH (u:User {id: "user_123"})-[:PURCHASED]->(p:Product)
      <-[:PURCHASED]-(other:User)
WHERE other <> u
RETURN other.id, count(p) AS shared_products
ORDER BY shared_products DESC
LIMIT 10;

Tips and Best Practices

  • Always add indexes on high-cardinality lookup properties (e.g., :User(id)) — ask Claude to verify your index plan before querying large graphs.
  • Use PROFILE before EXPLAIN for detailed operator-level query plans on slow queries.
  • Combine with MongoDB MCP if your source-of-truth documents live in MongoDB but relationships are analyzed in Neo4j.
  • For large-scale graph analytics, ask Claude to use GDS procedures like gds.pageRank or gds.louvain.

View on MCPizy Marketplace

Found this useful? Share it.

MCP Servers Mentioned

Neo4jMongodbElasticsearch
All ArticlesBrowse Marketplace