mcp_godot_rag

MCP.Pizza Chef: weekitmo

The mcp_godot_rag MCP server provides structured access to Godot engine documentation, enabling retrieval-augmented generation (RAG) for Godot-focused language models. It processes Godot docs, converts them into vectorized chunks, and serves them to the Godot RAG model for enhanced contextual understanding and accurate responses related to Godot development.

Use This MCP server To

Serve Godot engine documentation to RAG language models Enable contextual code assistance for Godot developers Provide real-time Godot API references within AI workflows Support vector search over Godot docs for precise info retrieval Integrate Godot documentation into AI-powered coding copilots

README

A MCP server for Godot RAG

This MCP server is used to provide Godot documentation to the Godot RAG model.

Screenshot

Before using

before

After using

after

MCP server config

{
  "mcpServers": {
    "godot-rag": {
      "command": "python",
      "args": [
        "<path to the server script 'main.py'>",
        "-d",
        "<path to the chroma_db on your computer>",
        "-c",
        "<name of the collection in the chroma_db>"
      ]
    }
  }
}

Setup

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

Initiation steps

# clone godot docs
python download_godot_docs.py
# convert rst to markdown
python convert_rst2md.py
# chunk markdown files
python chunker.py -i artifacts
# create vector database
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.jsonl -m BAAI/bge-m3
# start mcp server
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 <your openai api key>

Debug

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

Use Another Model

  • all-MiniLM-L6-v2

  • bge-m3

  • bge-large-zh-v1.5

mcp_godot_rag FAQ

How do I set up the mcp_godot_rag server?
Clone the Godot docs, convert RST to markdown, chunk files, create a vector database, then run the server with the specified command and arguments.
What is the purpose of the vector database in this server?
The vector database stores chunked Godot documentation for efficient similarity search and retrieval by the RAG model.
Can I customize the document collection used by the server?
Yes, you specify the collection name in the server config to target different document sets within the vector database.
What programming language is used to run the server?
The server runs as a Python script, typically executed with Python 3.12 or later.
Does this server support real-time updates to the documentation?
The current setup requires manual reprocessing of docs to update the vector database; real-time updates are not automatic.
How does this server improve Godot model responses?
By providing relevant, indexed Godot documentation context, it enables the RAG model to generate accurate, informed answers.
Is this server compatible with multiple LLM providers?
Yes, it can be integrated with models from OpenAI, Anthropic Claude, and Google Gemini for enhanced Godot development assistance.