RG

rileylemm/graphrag_mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

64 stars 15 forks 质量 67 趋势 0MIT

rileylemm/graphrag_mcp 是一个从 https://github.com/rileylemm/graphrag_mcp. 导入的 MCP 服务器候选

概览

rileylemm/graphrag_mcp 是一个从 https://github.com/rileylemm/graphrag_mcp. 导入的 MCP 服务器候选

概述(AI 翻译)

一个用于查询混合图与向量数据库系统的模型上下文协议服务器,结合了Neo4j(图数据库)和Qdrant(向量数据库),实现强大的语义和基于图的文档检索。

概述

GraphRAG MCP 实现了大型语言模型与混合检索系统的无缝集成,利用图数据库(Neo4j)和矢量数据库(Qdrant)的优势。这使:

  • 通过文档嵌入进行语义搜索
  • 基于图的上下文扩展,遵循关系
  • 结合向量相似性与图关系的混合搜索
  • 通过MCP与Claude及其他大型语言模型完全集成

该项目遵循模型上下文协议规范,使其兼容任何支持MCP的客户端。

特色

  • 使用句子嵌入和Qdrant的语义搜索
  • 基于图的上下文扩展 使用 Neo4j
  • 混合搜索结合两种方法
  • **MCP 工具和资源,用于大型语言模型集成
  • Neo4j 结构和 Qdrant 集合信息的完整文档

先修条件

  • Python 3.12+
  • 运行于 localhost:7687(默认配置)上的 Neo4j

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

GraphRAG MCP Server

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.

Overview

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:

  • Semantic search through document embeddings
  • Graph-based context expansion following relationships
  • Hybrid search combining vector similarity with graph relationships
  • Full integration with Claude and other LLMs through MCP

This project follows the Model Context Protocol specification, making it compatible with any MCP-enabled client.

Features

  • Semantic search using sentence embeddings and Qdrant
  • Graph-based context expansion using Neo4j
  • Hybrid search combining both approaches
  • MCP tools and resources for LLM integration
  • Full documentation of Neo4j schema and Qdrant collection information

Prerequisites

  • Python 3.12+
  • Neo4j running on localhost:7687 (default configuration)
  • Qdrant running on localhost:6333 (default configuration)
  • Document data indexed in both databases

Installation

Quick Start

  1. Clone this repository:

    git clone https://github.com/rileylemm/graphrag_mcp.git
    cd graphrag_mcp
    
  2. Install dependencies with uv:

    uv install
    
  3. 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
    
  4. Run the server:

    uv run main.py
    

Detailed Setup Guide

For a detailed guide on setting up the underlying hybrid database system, please refer to the companion repository: GraphRAG Hybrid Database

Setting up Neo4j and Qdrant

  1. 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
    
  2. Install and start Qdrant:

    # Using Docker
    docker run -p 6333:6333 -p 6334:6334 \
      -v $HOME/qdrant/storage:/qdrant/storage \
      qdrant/qdrant
    

Indexing Documents

To index your documents in both databases, follow these steps:

  1. Prepare your documents
  2. Create embeddings using sentence-transformers
  3. Store documents in Neo4j with relationship information
  4. Store document chunk embeddings in Qdrant
在 GitHub 查看完整 README

安装

docker run \
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "GraphRAG": { "command": "/path/to/graphrag_mcp/run_server.sh", "args": [] } } }