Query a hybrid graph (Neo4j) and vector (Qdrant) database for powerful semantic and graph-based document retrieval.
A Model Context Protocol server for querying a hybrid graph and vector database system, combining Neo4j (graph database) and Qdrant (vector database) for powerful semantic and graph-based document retrieval.
GraphRAG MCP provides a seamless integration between large language models and a hybrid retrieval system that leverages the strengths of both graph databases (Neo4j) and vector databases (Qdrant). This enables:
This project follows the Model Context Protocol specification, making it compatible with any MCP-enabled client.
Clone this 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
For a detailed guide on setting up the underlying hybrid database system, please refer to the companion repository: GraphRAG Hybrid Database
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
To index your documents in both databases, follow these steps:
Refer to the GraphRAG Hybrid Database repository for detailed indexing scripts and procedures.
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
fileContributions are welcome! Please feel free to submit a Pull Request.
MIT License
Copyright (c) 2025 Riley Lemm
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
If you use this MCP server or adapt it for your own purposes, please provide attribution to Riley Lemm and link back to this repository (https://github.com/rileylemm/graphrag_mcp).
Provides read-only access to Apache Iceberg tables via Apache Impala, allowing LLMs to inspect schemas and execute queries.
Universal database MCP server supporting mainstream databases.
A server for retrieving MySQL database schema information using the FastMCP framework.
A local server to query and interact with Markdown knowledge bases by tags, text, slug, or date.
Connects Claude Desktop to Tableau Server, enabling natural language interactions with your Tableau data and administrative capabilities.
Connect to and interact with an Elasticsearch cluster directly from any MCP client using environment variables for configuration.
Update various databases (PostgreSQL, MySQL, MongoDB, SQLite) using data from CSV and Excel files.
A production-ready MCP server for Customer Relationship Management (CRM) functionality, built with TypeScript and SQLite.
A read-only MCP server for CSV files from CData, requiring an external JDBC driver for connection.
Interact with the Neon serverless Postgres platform