Token导航 LogoToken导航

MCP Server · 数据服务

MCP RAG Server

一个基于FAISS向量数据库的MCP服务器,用于检索增强生成(RAG),支持GitHub Move文件提取和LLM集成。

stdio官方级别未说明来源级核验工具 0
向量数据库检索增强生成Python

快速开始

作者 / 组织
ProbonoBonobo
提供方
ProbonoBonobo
运行时
Python

工具数量

0

来源目录标注

资源数量

0

来源目录标注

提示词数量

0

来源目录标注

GitHub Star

7

仓库热度

收录来源

3 个

MCP World

选型结论

MCP RAG Server 属于数据服务类 MCP Server,公开资料标注 0 个工具,通过stdio 本地进程接入,客户端适配情况以官方文档为准,有可以直接复制的安装命令;接入前要先准备 API Key。

分类

数据服务

传输方式

stdio

认证方式

API Key

部署方式

仅本地运行

安装与配置

安装命令

python3 -m pip install --user pipx

公开命令不是通用的启动方式,拼不出可靠配置示例;请在客户端 MCP 配置里按官方文档填写 command 和 args。

上手步骤

  1. 1

    准备运行环境

    stdio 服务在本地起进程,需要先装好 Python,再按安装命令拉取依赖。

  2. 2

    安装服务

    复制下面的安装命令执行;命令里带占位符的位置换成自己的密钥或路径。

  3. 3

    写入客户端配置

    在客户端的 MCP 配置里填启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4

    验证是否可用

    连接成功后客户端会列出 0 个工具,随便调一个只读工具确认能返回结果。

接入前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

详细介绍

用于RAG的带FAISS的MCP服务器

该项目提供了一种机器对话协议(MCP)服务器的概念验证实现,该服务器允许AI代理查询向量数据库并检索相关文档,以用于检索增强生成(RAG)。

特性

  • 带MCP端点的FastAPI服务器
  • FAISS矢量数据库集成
  • 文档分块和嵌入
  • GitHub Move文件提取和处理
  • LLM集成,实现完整的RAG工作流程
  • 简单客户端示例
  • 样本文件

安装

使用pipx(推荐)

pipx 是一个帮助您在隔离环境中安装和运行Python应用程序的工具。

  1. 首先,如果你没有pipx,请安装它:
# On macOS
brew install pipx
pipx ensurepath

# On Ubuntu/Debian
sudo apt update
sudo apt install python3-pip python3-venv
python3 -m pip install --user pipx
python3 -m pipx ensurepath

# On Windows with pip
pip install pipx
pipx ensurepath
  1. 直接从项目目录安装MCP Server包:
# Navigate to the directory containing the mcp_server folder
cd /path/to/mcp-server-project

# Install in editable mode
pipx install -e .
  1. (可选)配置环境变量:

- 复制 .env.example 向 .env - 添加您的GitHub令牌以获得更高的速率限制: GITHUB_TOKEN=your_token_here - 为RAG集成添加您的OpenAI或其他LLM API密钥: OPENAI_API_KEY=your_key_here

手动安装

如果你不想使用pipx:

  1. 克隆存储库
  2. 安装依赖项:
cd mcp_server
pip install -r requirements.txt

使用pipx

使用pipx安装后,您将可以访问以下命令:

从GitHub下载Move文件

# Download Move files with default settings
mcp-download --query "use sui" --output-dir docs/move_files

# Download with more options
mcp-download --query "module sui::coin" --max-results 50 --new-index --verbose

改进GitHub搜索和索引(推荐)

# Search GitHub and index files with default settings
mcp-search-index --keywords "sui move"

# Search multiple keywords and customize options
mcp-search-index --keywords "sui move,move framework" --max-repos 30 --output-results --verbose

# Save search results and use a custom index location
mcp-search-index --keywords "sui coin,sui::transfer" --index-file custom/path/index.bin --output-results

这 mcp-search-index 命令提供了增强的GitHub存储库搜索功能:

  • 首先搜索存储库,然后递归提取Move文件
  • 支持多个搜索关键字(逗号分隔)
  • 智能过滤包含“use sui”引用的Move文件
  • 下载后始终重建矢量数据库

索引移动文件

# Index files in the default location
mcp-index

# Index with custom options
mcp-index --docs-dir path/to/files --index-file path/to/index.bin --verbose

查询矢量数据库

# Basic query
mcp-query "What is a module in Sui Move?"

# Advanced query with options
mcp-query "How do I define a struct in Sui Move?" -k 3 -f

将RAG与LLM集成使用

# Basic RAG query (will use simulated LLM if no API key is provided)
mcp-rag "What is a module in Sui Move?"

# Using with a specific LLM API
mcp-rag "How do I define a struct in Sui Move?" --api-key your_api_key --top-k 3

# Output as JSON for further processing
mcp-rag "What are the benefits of sui::coin?" --output-json > rag_response.json

运行服务器

# Start the server with default settings
mcp-server

# Start with custom settings
mcp-server --host 127.0.0.1 --port 8080 --index-file custom/path/index.bin

手动使用(无pipx)

启动服务器

cd mcp_server
python main.py

服务器将于启动http://localhost:8000

从GitHub下载Move文件

要从GitHub下载Move文件并填充矢量数据库,请执行以下操作:

# Download Move files with default query "use sui"
./run.sh --download-move

# Customize the search query
./run.sh --download-move --github-query "module sui::coin" --max-results 50

# Download, index, and start the server
./run.sh --download-move --index

你也可以直接使用Python脚本:

python download_move_files.py --query "use sui" --output-dir docs/move_files

索引文档

在查询之前,您需要为文档建立索引。您可以将文本文件(.txt)、Markdown文件(.md)或Move文件(.Move)放置在 docs 目录。

要为文档编制索引,您可以:

  1. 将运行脚本与 --index 标志:
./run.sh --index
  1. 直接使用索引脚本:
python index_move_files.py --docs-dir docs/move_files --index-file data/faiss_index.bin

查询文档

您可以使用本地查询脚本:

python local_query.py "What is RAG?"

# With more options
python local_query.py -k 3 -f "How to define a struct in Sui Move?"

将RAG与LLM集成使用

# Direct RAG query with an LLM
python rag_integration.py "What is a module in Sui Move?" --index-file data/faiss_index.bin

# With API key (if you have one)
OPENAI_API_KEY=your_key_here python rag_integration.py "How do coins work in Sui?"

MCP API终点

MCP API端点位于 /mcp/action。您可以使用它执行不同的操作:

  • retrieve_documents:检索查询的相关文档
  • index_documents:从目录中索引文档

例子:

curl -X POST "http://localhost:8000/mcp/action" -H "Content-Type: application/json" -d '{"action_type": "retrieve_documents", "payload": {"query": "What is RAG?", "top_k": 3}}'

完整的RAG管道

完整的RAG(检索增强生成)流程如下:

  1. 搜索查询:用户提交问题
  2. 检索:系统在矢量数据库中搜索相关文件
  3. 语境形成:检索到的文档将格式化为提示
  4. LLM生成:提示将与检索到的上下文一起发送到LLM
  5. 增强响应:LLM根据检索到的信息提供答案

此工作流程在 rag_integration.py 模块,既可以通过命令行使用,也可以作为自己应用程序中的库使用。

GitHub移动文件提取

该系统可以根据搜索查询从GitHub提取Move文件。它实现了两种方法:

  1. GitHub API (首选):需要GitHub令牌才能获得更高的速率限制
  2. Web抓取回退:当API方法失败或未提供令牌时使用

要配置您的GitHub令牌,请在 .env 文件或作为环境变量:

GITHUB_TOKEN=your_github_token_here

项目结构

mcp_server/
├── __init__.py             # Package initialization
├── main.py                # Main server file
├── mcp_api.py             # MCP API implementation
├── index_move_files.py    # File indexing utility
├── local_query.py         # Local query utility
├── download_move_files.py # GitHub Move file extractor
├── rag_integration.py     # LLM integration for RAG
├── pyproject.toml         # Package configuration
├── requirements.txt       # Dependencies
├── .env.example           # Example environment variables
├── README.md              # This file
├── data/                  # Storage for the FAISS index
├── docs/                  # Sample documents
│   └── move_files/        # Downloaded Move files
├── models/                # Model implementations
│   └── vector_store.py    # FAISS vector store implementation
└── utils/
    ├── document_processor.py  # Document processing utilities
    └── github_extractor.py    # GitHub file extraction utilities

扩展项目

要扩展此概念证明:

  1. 添加身份验证和安全功能
  2. 实施更复杂的文档处理
  3. 添加对更多文档类型的支持
  4. 与其他LLM提供商集成
  5. 添加监控和日志记录
  6. 改进Move语言解析,以实现更结构化的数据提取

许可证

麻省理工学院

工具与能力

工具数量

0

资源数量

0

提示词数量

0

能力标签

向量数据库Python本地部署检索增强生成GitHub文件处理LLM集成FAISS

数量来自来源目录的标注,具体工具清单以官方文档为准。

典型使用场景

用自然语言查库

不用手写 SQL,直接问数据,让模型组织查询语句。

数据巡检

定期拉指标、做对比,把异常项整理成一段说明。

打通业务数据

把数据库、数仓和接口接进同一个上下文,减少导出再上传。

选择建议

值得选的地方

  • 只提供 0 个工具,职责集中,接入后不容易误操作。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 3 个目录同时收录,信息可以交叉核对。

先想清楚的地方

  • stdio 方式要求本地装好 Python,换机器要重新装一遍。
  • 需要自备API Key,没有凭据没法直接试。
  • 第三方目录整理,版本更新和行为细节以官方仓库为准。

更适合

  • 需要在数据服务场景里让模型直接调用外部能力的人。
  • 想先快速试一下、能接受在本地跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 暂时拿不到API Key的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

5 个同类
MCP Server工具数传输方式安装命令收录来源最后核验
MCP RAG Server

MCP World · 本页

0stdio有3 个2026-05-17
Memory 9d25f64e

MCP World

9未说明未标注1 个2026-05-17
Prisma MCP Server

MCP World

0stdio有3 个2026-05-17
Astr Bot

MCP World

0stdio有1 个2026-05-17
Getzep MCP

MCP World

9stdio有1 个2026-05-17

按同分类和工具数量挑出最接近的几条,字段以各自详情页为准。

常见问题

5 条

MCP RAG Server 怎么安装?

公开资料给出的安装命令是 python3 -m pip install --user pipx,运行环境为 Python。装完后按客户端要求写进 MCP 配置,重启客户端生效。

MCP RAG Server 怎么在 Claude Desktop、Cursor 里配置?

它是stdio 本地进程,客户端配置里要写启动命令和参数,运行环境是 Python;保存后完全退出客户端再打开,配置才会生效。

MCP RAG Server 收费吗?

本站只整理公开资料,不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

MCP RAG Server 需要 API Key 吗?

公开资料标注的认证方式是API Key,也就是要先拿到凭据才能连上;凭据只填在自己本地的配置里,不要写进公开仓库。

MCP RAG Server 支持哪些客户端?

公开资料没有标注具体客户端;能配置本地 MCP 命令的客户端都能接,配置方式参照官方文档。

来源信息

继续浏览同类 MCP