GraphRAG MCP is a server that implements the Model Context Protocol, combining Neo4j (graph database) and Qdrant (vector database) to enable powerful document retrieval through semantic search and graph relationships. It integrates with large language models to provide enhanced context retrieval capabilities.
Clone the repository:
git clone https://github.com/rileylemm/graphrag_mcp.git
cd graphrag_mcp
Install dependencies with uv:
uv install
Configure your database connections in the .env
file:
# Neo4j Configuration
NEO4J_URI=bolt://localhost:7687
NEO4J_USER=neo4j
NEO4J_PASSWORD=password
# Qdrant Configuration
QDRANT_HOST=localhost
QDRANT_PORT=6333
QDRANT_COLLECTION=document_chunks
Run the server:
uv run main.py
Install and start Neo4j:
# Using Docker
docker run \
--name neo4j \
-p 7474:7474 -p 7687:7687 \
-e NEO4J_AUTH=neo4j/password \
-v $HOME/neo4j/data:/data \
-v $HOME/neo4j/logs:/logs \
-v $HOME/neo4j/import:/import \
-v $HOME/neo4j/plugins:/plugins \
neo4j:latest
Install and start Qdrant:
# Using Docker
docker run -p 6333:6333 -p 6334:6334 \
-v $HOME/qdrant/storage:/qdrant/storage \
qdrant/qdrant
Make the run script executable:
chmod +x run_server.sh
Add the server to your MCP configuration file (~/.cursor/mcp.json
or Claude Desktop equivalent):
{
"mcpServers": {
"GraphRAG": {
"command": "/path/to/graphrag_mcp/run_server.sh",
"args": []
}
}
}
Restart your MCP client (Cursor, Claude Desktop, etc.)
This server provides the following tools for LLM use:
search_documentation
- Search for information using semantic search
# Example usage in MCP context
result = search_documentation(
query="How does graph context expansion work?",
limit=5,
category="technical"
)
hybrid_search
- Search using both semantic and graph-based approaches
# Example usage in MCP context
result = hybrid_search(
query="Vector similarity with graph relationships",
limit=10,
category=None,
expand_context=True
)
The server provides the following resources:
https://graphrag.db/schema/neo4j
- Information about the Neo4j graph schemahttps://graphrag.db/collection/qdrant
- Information about the Qdrant vector collectionuv install
to ensure all packages are installed.env
fileThere are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.