GraphRAG Toolkit
Python toolkit for building graph-enhanced GenAI applications
What is GraphRAG Toolkit?
GraphRAG Toolkit is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to python toolkit for building graph-enhanced genai applications
Python toolkit for building graph-enhanced GenAI applications
This server falls under the Data Science & ML category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Python toolkit for building graph-enhanced GenAI application
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx graphrag-toolkitConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use GraphRAG Toolkit
The GraphRAG Toolkit is an AWS Labs Python library for building graph-enhanced Generative AI (GenAI) applications that combine knowledge graphs with LLM-based question answering. It provides two main components: a Lexical Graph framework that automatically builds hierarchical graphs from unstructured documents, and a BYOKG-RAG (Bring Your Own Knowledge Graph) system for graph-traversal-based retrieval. The toolkit integrates with Amazon Neptune, Amazon OpenSearch Serverless, Neo4j, FalkorDB, and PostgreSQL as storage backends, and is compatible with LlamaIndex.
Prerequisites
- Python 3.9+ installed
- AWS account with Amazon Neptune or Amazon OpenSearch Serverless configured (for AWS-hosted storage backends)
- Alternatively, a self-hosted graph database such as Neo4j or FalkorDB
- pip for installing the Python packages
- An LLM provider API key (e.g., AWS Bedrock, OpenAI) for the GenAI components
Install the Lexical Graph Package
Install the core GraphRAG toolkit package from PyPI. Choose the appropriate package for your use case — lexical-graph for document ingestion pipelines, or byokg-rag for querying existing knowledge graphs.
# For document ingestion and lexical graph construction:
pip install graphrag-lexical-graph
# For querying existing knowledge graphs:
pip install graphrag-toolkit-byokg-ragConfigure Your Graph Store Connection
Initialize graph and vector store connections using the factory methods. The toolkit supports Neptune, Neo4j, FalkorDB for graph storage and Neptune, OpenSearch, Postgres, S3 for vector storage.
from graphrag_toolkit.storage import GraphStoreFactory, VectorStoreFactory
# Amazon Neptune example:
graph_store = GraphStoreFactory.for_graph_store(
'neptune-db://your-cluster.cluster-xxxx.us-east-1.neptune.amazonaws.com:8182'
)
# Amazon OpenSearch Serverless example:
vector_store = VectorStoreFactory.for_vector_store(
'aoss://your-collection.us-east-1.aoss.amazonaws.com'
)Build a Lexical Graph from Documents
Use LexicalGraphIndex to ingest documents and automatically construct a hierarchical knowledge graph.
from graphrag_toolkit.indexing import LexicalGraphIndex
from llama_index.core import SimpleDirectoryReader
# Load your documents
documents = SimpleDirectoryReader('./docs').load_data()
# Build the graph
index = LexicalGraphIndex(
graph_store=graph_store,
vector_store=vector_store
)
index.extract_and_build(documents, show_progress=True)Query with Graph-Enhanced RAG
Query the constructed graph using semantic-guided or traversal-based retrieval strategies.
from graphrag_toolkit.retrieval import GraphRAGQueryEngine
query_engine = GraphRAGQueryEngine(
graph_store=graph_store,
vector_store=vector_store
)
response = query_engine.query(
"What are the key relationships between the entities in these documents?"
)
print(response)Configure MCP Server Access
To expose GraphRAG capabilities via MCP, configure Claude Desktop to run the toolkit's MCP server script with your database connection details passed as environment variables.
{
"mcpServers": {
"graphrag-toolkit": {
"command": "python",
"args": ["-m", "graphrag_toolkit.mcp"],
"env": {
"NEPTUNE_ENDPOINT": "neptune-db://your-cluster.cluster-xxxx.us-east-1.neptune.amazonaws.com:8182",
"AOSS_ENDPOINT": "aoss://your-collection.us-east-1.aoss.amazonaws.com",
"AWS_DEFAULT_REGION": "us-east-1"
}
}
}
}GraphRAG Toolkit Examples
Client configuration
Claude Desktop configuration for graphrag-toolkit pointing to an Amazon Neptune graph store and OpenSearch vector store.
{
"mcpServers": {
"graphrag-toolkit": {
"command": "python",
"args": ["-m", "graphrag_toolkit.mcp"],
"env": {
"NEPTUNE_ENDPOINT": "neptune-db://my-cluster.cluster-abc123.us-east-1.neptune.amazonaws.com:8182",
"AOSS_ENDPOINT": "aoss://my-vectors.us-east-1.aoss.amazonaws.com",
"AWS_DEFAULT_REGION": "us-east-1"
}
}
}
}Prompts to try
Example queries that leverage graph-enhanced retrieval for richer, more connected answers.
- "What entities are mentioned in my documents and how are they related?"
- "Compare the GraphRAG approach to standard vector similarity search for this query"
- "Find all documents connected to the concept of 'data ingestion' in the knowledge graph"
- "Summarize the key themes and their relationships from the ingested document set"Troubleshooting GraphRAG Toolkit
Connection timeout when connecting to Amazon Neptune
Neptune requires VPC access. Ensure your Lambda or EC2 instance is in the same VPC as your Neptune cluster, or set up a VPC endpoint. Local development typically requires an SSH tunnel or VPN connection.
ImportError when importing graphrag_toolkit modules
Make sure you installed the correct package for your use case. 'graphrag-lexical-graph' and 'graphrag-toolkit-byokg-rag' are separate packages. Check with 'pip list | grep graphrag' and install the missing one.
LLM extraction produces empty or malformed graph nodes
The toolkit relies on an LLM for entity/relationship extraction during ingestion. Ensure your LLM provider is configured correctly and that the model has sufficient context window size for your documents. Try chunking large documents into smaller pieces.
Frequently Asked Questions about GraphRAG Toolkit
What is GraphRAG Toolkit?
GraphRAG Toolkit is a Model Context Protocol (MCP) server that python toolkit for building graph-enhanced genai applications It connects AI assistants to external tools and data sources through a standardized interface.
How do I install GraphRAG Toolkit?
Follow the installation instructions on the GraphRAG Toolkit GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with GraphRAG Toolkit?
GraphRAG Toolkit works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is GraphRAG Toolkit free to use?
Yes, GraphRAG Toolkit is open source and available under the Apache-2.0 license. You can use it freely in both personal and commercial projects.
GraphRAG Toolkit Alternatives — Similar Data Science & ML Servers
Looking for alternatives to GraphRAG Toolkit? Here are other popular data science & ml servers you can use with Claude, Cursor, and VS Code.
Ultrarag
★ 5.6kA Low-Code MCP Framework for Building Complex and Innovative RAG Pipelines
RocketRide
★ 3.1k📇 🏠 - MCP server that exposes RocketRide AI pipelines as t
Aix Db
★ 2.1kAix-DB 基于 LangChain/LangGraph 框架,结合 MCP Skills 多智能体协作架构,实现自然语言到数据洞察的端到端转换。
NeMo Data Designer
★ 1.9k🎨 NeMo Data Designer: Generate high-quality synthetic data from scratch or from seed data.
PaperBanana
★ 1.7kOpen source implementation and extension of Google Research’s PaperBanana for automated academic figures, diagrams, and research visuals, expanded to new domains like slide generation.
MiniMax
★ 1.5kBridges MiniMax AI capabilities to the Model Context Protocol, enabling AI agents to perform image understanding, text-to-image generation, and speech synthesis. It provides a standardized interface for accessing MiniMax's core tools via JSON-RPC.
Browse More Data Science & ML MCP Servers
Explore all data science & ml servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up GraphRAG Toolkit in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use GraphRAG Toolkit?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.