Neo4j GraphRAG MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add -e "NEO4J_URI=${NEO4J_URI}" -e "NEO4J_USERNAME=${NEO4J_USERNAME}" -e "NEO4J_PASSWORD=${NEO4J_PASSWORD}" neo4j-graphrag -- uvx mcp-neo4j-graphrag
Required:NEO4J_URINEO4J_USERNAMENEO4J_PASSWORD+ 3 optional
README.md

Perform semantic and fulltext searches within Neo4j for GraphRAG applications.

Neo4j GraphRAG MCP Server

An MCP server that extends Neo4j with vector search, fulltext search, search-augmented Cypher queries, write operations, and multimodal image retrieval for GraphRAG applications.

Inspired by the Neo4j Labs `mcp-neo4j-cypher` server. This server adds vector search, fulltext search, and the innovative search_cypher_query tool for combining search with graph traversal.

Overview

This server enables LLMs to:

  • πŸ” Search Neo4j vector indexes using semantic similarity
  • πŸ“ Search fulltext indexes with Lucene syntax
  • ⚑ Combine search with Cypher queries via search_cypher_query
  • πŸ•ΈοΈ Execute read-only Cypher queries
  • ✏️ Execute write Cypher queries (CREATE, MERGE, SET, DELETE)
  • πŸ–ΌοΈ Retrieve images stored in Neo4j nodes (multimodal β€” returns the image directly to the LLM)

Built on LiteLLM for multi-provider embedding support (OpenAI, Azure, Bedrock, Cohere, etc.).

Related: For the official Neo4j MCP Server, see neo4j/mcp. For Neo4j Labs MCP Servers (Cypher, Memory, Data Modeling), see neo4j-contrib/mcp-neo4j.

Installation

# Using pip
pip install mcp-neo4j-graphrag

# Using uv (recommended)
uv pip install mcp-neo4j-graphrag

Configuration

Claude Desktop

Edit the configuration file:

  • macOS/Linux: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "neo4j-graphrag": {
      "command": "uvx",
      "args": ["mcp-neo4j-graphrag"],
      "env": {
        "NEO4J_URI": "neo4j+s://demo.neo4jlabs.com",
        "NEO4J_USERNAME": "recommendations",
        "NEO4J_PASSWORD": "recommendations",
        "NEO4J_DATABASE": "recommendations",
        "OPENAI_API_KEY": "sk-...",
        "EMBEDDING_MODEL": "text-embedding-ada-002"
      }
    }
  }
}

Note: uvx automatically downloads and runs the package from PyPI. No local installation needed!

Cursor

Edit ~/.cursor/mcp.json or .cursor/mcp.json in your project. Use the same configuration as above.

Reload Configuration

  • Claude Desktop: Quit and restart the application
  • Cursor: Reload the window (Cmd/Ctrl + Shift + P β†’ "Reload Window")

Tools

The examples below use the Neo4j demo `recommendations` database (movies, actors, directors), which is the same database referenced in the Configuration section above.

`get_neo4j_schema_and_indexes`

Discover the graph schema, vector indexes, and fulltext indexes.

πŸ’‘ The agent should automatically call this tool first before using other tools to understand the schema and indexes of the database.

Example prompt:

"What is inside the database?"

`vector_search`

Semantic similarity search using embeddings.

Parameters: text_query, vector_index, top_k, return_properties, pre_filter

Use pre_filter to restrict results to nodes matching exact property values (e.g. {"genre": "Drama"}).

Example prompt:

"What movies are about artificial intelligence?"

`fulltext_search`

Keyword search with Lucene syntax (AND, OR, wildcards, fuzzy).

Parameters: text_query, fulltext_index, top_k, return_properties

Example prompt:

"Find movies with 'space' or 'galaxy' in the title or plot"

`read_neo4j_cypher`

Execute read-only Cypher queries.

Parameters: query, params

Example prompt:

"Show me all genres and how many movies are in each"

`search_cypher_query`

Combine vector/fulltext search with Cypher queries. Use $vector_embedding and $fulltext_text placeholders.

Parameters: cypher_query, vector_query, fulltext_query, params

Example prompt:

"In one query, what are the directors and genres of the movies about 'time travel adventure'?"

`write_neo4j_cypher`

Execute write Cypher queries (CREATE, MERGE, SET, DELETE, etc.). Returns a summary of counters (nodes created, properties set, etc.).

Parameters: query, params

Example prompt:

"Add a user rating of 4.5 for the movie 'Inception'"

`read_node_image`

Retrieve a base64-encoded image stored on a Neo4j node and return it as an inline image. Useful for graph databases that store page scans, diagrams, or photos directly on nodes. The LLM receives both the image and selected node properties, enabling visual analysis of graph-stored content.

Parameters: node_element_id, image_property, mime_type, `r

Tools (7)

get_neo4j_schema_and_indexesDiscover the graph schema, vector indexes, and fulltext indexes.
vector_searchSemantic similarity search using embeddings.
fulltext_searchKeyword search with Lucene syntax.
read_neo4j_cypherExecute read-only Cypher queries.
search_cypher_queryCombine vector/fulltext search with Cypher queries.
write_neo4j_cypherExecute write Cypher queries (CREATE, MERGE, SET, DELETE, etc.).
read_node_imageRetrieve a base64-encoded image stored on a Neo4j node.

Environment Variables

NEO4J_URIrequiredThe URI for the Neo4j database connection.
NEO4J_USERNAMErequiredUsername for Neo4j authentication.
NEO4J_PASSWORDrequiredPassword for Neo4j authentication.
NEO4J_DATABASEThe specific database name to connect to.
OPENAI_API_KEYAPI key for embedding generation.
EMBEDDING_MODELThe specific embedding model to use.

Configuration

claude_desktop_config.json
{"mcpServers": {"neo4j-graphrag": {"command": "uvx", "args": ["mcp-neo4j-graphrag"], "env": {"NEO4J_URI": "neo4j+s://demo.neo4jlabs.com", "NEO4J_USERNAME": "recommendations", "NEO4J_PASSWORD": "recommendations", "NEO4J_DATABASE": "recommendations", "OPENAI_API_KEY": "sk-...", "EMBEDDING_MODEL": "text-embedding-ada-002"}}}}

Try it

β†’What is inside the database?
β†’What movies are about artificial intelligence?
β†’Find movies with 'space' or 'galaxy' in the title or plot
β†’Show me all genres and how many movies are in each
β†’Add a user rating of 4.5 for the movie 'Inception'

Frequently Asked Questions

What are the key features of Neo4j GraphRAG?

Semantic vector search using multi-provider embeddings. Fulltext search with Lucene syntax support. Search-augmented Cypher query execution. Read and write operations for graph data. Multimodal image retrieval from graph nodes.

What can I use Neo4j GraphRAG for?

Building GraphRAG applications that combine semantic search with graph traversal. Visualizing and analyzing images stored directly within graph nodes. Performing complex database schema discovery for LLM-driven data exploration. Executing automated write operations to update graph data based on LLM insights.

How do I install Neo4j GraphRAG?

Install Neo4j GraphRAG by running: pip install mcp-neo4j-graphrag

What MCP clients work with Neo4j GraphRAG?

Neo4j GraphRAG works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Neo4j GraphRAG docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare