Godot MCP Documentation Server

Godot MCP Documentation Server

Provides AI assistants with direct access to the complete Godot Engine documentation, including classes, tutorials, and features. It enables developers to retrieve and analyze official documentation through natural language interfaces using the Model Context Protocol.

Category
访问服务器

README

Godot MCP Documentation Server

中文文档 | English

A Model Context Protocol (MCP) server that provides AI assistants with access to the complete Godot Engine documentation, helping developers with Godot development by serving documentation directly to LLMs.

Purpose

This server bridges the gap between AI assistants and Godot documentation, allowing developers to get instant, accurate answers about Godot classes, tutorials, and features without leaving their AI chat interface.

Project Origin

This project is based on godot-mcp-docs by Nihilantropy, modified for local development on Windows without Docker.

Installation

  1. Install uv (if not already installed):

    # On Windows with PowerShell:
    Invoke-WebRequest -Uri https://astral.sh/uv/install.ps1 -UseBasicParsing | Invoke-Expression
    
  2. Clone the repository:

    git clone https://github.com/Nihilantropy/godot-mcp-docs.git
    cd godot-mcp-docs
    
  3. Install Python dependencies:

    uv sync
    

    This command reads from pyproject.toml and creates a virtual environment.

    Note: uv sync uses pyproject.toml as the source of truth, not requirements.txt. This is the modern Python packaging standard (PEP 517/518/621). The uv.lock file ensures consistent dependency versions across environments.

Setting Up Documentation

After installing dependencies, you need to download and process the Godot documentation:

  1. Generate documentation:

    uv run python .\docs_converter\godot_docs_converter.py
    
  2. Move docs folder to root: After conversion, move the generated docs folder to the project root directory.

  3. Generate documentation tree:

    cd docs
    tree /f > docs_tree.txt
    cd ..
    

    Note: If you encounter Chinese encoding issues, use:

    tree /f | Out-File -Encoding utf8 docs_tree.txt
    

Running the Server

Start the MCP server locally:

uv run python main.py

Configuring MCP Client

Claude Desktop Example

Add this to your Claude Desktop configuration file:

{
  "mcpServers": {
    "godot-mcp-docs": {
      "command": "uv",
      "args": [
        "run",
        "python",
        "main.py"
      ]
    }
  }
}

Available Tools

  • get_documentation_tree() - Get a tree-style overview of the entire documentation structure
  • get_documentation_file(file_path: str) - Retrieve the content of specific documentation files

Sample Usage

Explore documentation structure:

What documentation is available for Godot?

Get specific class documentation:

Show me the documentation for CharacterBody2D

Learn about tutorials:

What tutorials are available for 2D game development?

Get specific tutorial content:

Show me the first 2D game tutorial

Compare classes:

What's the difference between Node2D and CharacterBody2D?

Debugging

Option 1: FastMCP Dev UI (Recommended)

Start the server in dev mode:

uv run fastmcp dev main.py

Then open your browser to http://127.0.0.1:8000 to see all tools and test them interactively.

Option 2: MCP Inspector (Official Debugger)

Use Anthropic's official MCP Inspector:

npx @modelcontextprotocol/inspector uv run python main.py

This opens http://localhost:5173 in your browser, showing all tools, request/response logs, and allowing manual tool testing. No need to run uv run python main.py separately.

Option 3: HTTP API Debugging

Send JSON-RPC requests to the server:

Invoke-WebRequest -Uri http://localhost:8000/message `
    -Method POST `
    -ContentType "application/json" `
    -Body '{
        "jsonrpc": "2.0",
        "method": "tools/call",
        "params": {
            "name": "get_documentation_file",
            "arguments": {
                "file_path": "classes/class_characterbody2d.md"
            }
        },
        "id": 1
    }'

Or using curl:

curl -X POST http://localhost:8000/message `
     -H "Content-Type: application/json" `
     -d '{
           "jsonrpc": "2.0",
           "method": "tools/call",
           "params": { "name": "search_godot_docs", "arguments": { "query": "DisplayServer" } },
           "id": 1
         }'

Understanding Path Resolution

The DOCS_DIR = Path("docs").resolve() in the code is relative to the current working directory (CWD) when you run Python, not the script location.

Example

Assume your directory structure:

D:\Codes\16_MCP\           <-- 根目录
├── main.py                <-- 启动脚本
├── docs\                  <-- 文档目录
└── srcs\
    └── util\
        └── docs_utils.py  <-- 工具代码 (里面写了 Path("docs"))

Case A: Running from root directory

cd D:\Codes\16_MCP
python main.py
  • Current Working Directory: D:\Codes\16_MCP
  • Path("docs") resolves to: D:\Codes\16_MCP\docs (Success)

Case B: Running from subdirectory (common error)

cd D:\Codes\16_MCP\srcs
python ../main.py
  • Current Working Directory: D:\Codes\16_MCP\srcs
  • Path("docs") resolves to: D:\Codes\16_MCP\srcs\docs (Fails - no docs folder)

Best Practice

To ensure paths work regardless of where you run from, use __file__-based absolute positioning:

from pathlib import Path

# Get current script directory
CURRENT_SCRIPT_DIR = Path(__file__).resolve().parent

# Navigate to project root
PROJECT_ROOT = CURRENT_SCRIPT_DIR.parent.parent

# Locate docs directory
DOCS_DIR = (PROJECT_ROOT / "docs").resolve()

PowerShell Output Redirection Tips

Save output to file:

  • Overwrite (clears existing content):

    ls > list.txt
    
  • Append (preserves existing content):

    ls >> list.txt
    
  • With UTF8 encoding (recommended for Chinese):

    ls | Out-File -FilePath output.txt -Encoding utf8
    
  • See on screen and save:

    ls | Tee-Object -FilePath log.txt
    

Documentation Structure

The server provides access to the complete official Godot documentation with this structure:

docs/
├── _styleguides
├── _tools
│   └── redirects
├── about
├── classes
├── community
│   └── asset_library
├── contributing
│   ├── development
│   │   ├── compiling
│   │   ├── configuring_an_ide
│   │   ├── core_and_modules
│   │   ├── debugging
│   │   │   └── vulkan
│   │   ├── editor
│   │   └── file_formats
│   ├── documentation
│   └── workflow
├── getting_started
│   ├── first_2d_game
│   ├── first_3d_game
│   ├── introduction
│   └── step_by_step
├── img
└── tutorials
    ├── 2d
    ├── 3d
    │   ├── global_illumination
    │   ├── particles
    │   └── procedural_geometry
    ├── animation
    ├── assets_pipeline
    │   ├── escn_exporter
    │   └── importing_3d_scenes
    ├── audio
    ├── best_practices
    ├── editor
    ├── export
    ├── i18n
    ├── inputs
    ├── io
    ├── math
    ├── migrating
    ├── navigation
    ├── networking
    ├── performance
    │   └── vertex_animation
    ├── physics
    │   └── interpolation
    ├── platform
    │   ├── android
    │   ├── ios
    │   └── web
    ├── plugins
    │   └── editor
    ├── rendering
    ├── scripting
    │   ├── c_sharp
    │   │   └── diagnostics
    │   ├── cpp
    │   ├── debug
    │   ├── gdextension
    │   └── gdscript
    ├── shaders
    │   ├── shader_reference
    │   └── your_first_shader
    ├── ui
    └── xr

Recommended System Prompt

For optimal results when working with Godot, use this system prompt:

"When working with Godot game development questions, always search for the latest available documentation using the godot-mcp-docs tools. Start with get_documentation_tree() to understand the documentation structure, then use get_documentation_file() to retrieve specific information about classes, tutorials, or features. Prioritize official Godot documentation over general knowledge when providing Godot-related assistance."

Updating Documentation

To update to a newer version of Godot documentation:

uv run python .\docs_converter\godot_docs_converter.py
cd docs
tree /f > docs_tree.txt

License

This project is licensed under the MIT License - see the LICENSE file for details.

The Godot documentation content follows the original Godot documentation licensing:

  • Documentation content (excluding classes/ folder): CC BY 3.0
  • Class reference files (classes/ folder): MIT License
  • Attribution: "Juan Linietsky, Ariel Manzur and the Godot community"

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选