Back to MCP directory
publicPublicdnsLocal runtime

mcp_godot_rag

这是一个为Godot RAG模型提供文档支持的MCP服务器项目,包含文档下载、格式转换、分块处理和向量数据库构建等功能

article

README

🚀 为 Godot RAG 搭建 MCP 服务器

本 MCP 服务器的主要功能是为 Godot RAG 模型提供 Godot 文档,助力相关开发工作的高效开展。

🚀 快速开始

🔍 屏幕快照

使用前

before

使用后

after

📦 安装指南

⚙️ MCP 服务器配置

{
  "mcpServers": {
    "godot-rag": {
      "command": "python",
      "args": [
        "<your server script 'main.py' 的路径>",
        "-d",
        "<你在电脑上的 chroma_db 路径>",
        "-c",
        "<chroma_db 中的集合名称>"
      ]
    }
  }
}

💻 环境配置

uv venv --python 3.12
source ./.venv/bin/activate
uv sync
cp .env.example .env.local

💻 使用示例

🔛 初始化步骤

# 克隆 Godot 文档
python download_godot_docs.py
# 转换 rst 格式为 Markdown
python convert_rst2md.py
# 分割 Markdown 文件
python chunker.py -i artifacts
# 创建向量数据库
python vectorizer.py -i artifacts/chunks/artifacts_chunks_SZ_400_O_20.jsonl
# python vectorizer_api.py -i artifacts/chunks/artifacts_chunks_SZ_400_O_20_BAAI-bge-m3.jsonl -m BAAI/bge-m3
# 启动 MCP 服务器
python main.py -d artifacts/vector_stores/chroma_db -c artifacts_chunks_SZ_400_O_20_all-MiniLM-L6-v2
# python main_with_api.py -d artifacts/vector_stores/chroma_db -c artifacts_chunks_SZ_400_O_20_BAAI-bge-m3 -k <你的 OpenAI API 密钥>

🐞 调试

npx @modelcontextprotocol/inspector \
  uv \
  --directory . \
  run \
  main.py \
  --chromadb-path artifacts/vector_stores/chroma_db \
  --collection-name artifacts_chunks_SZ_400_O_20_all-MiniLM-L6-v2

🧪 使用其他模型

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client