Godot MCP

Godot MCP

Enables AI agents to create, edit, and run Godot 4.5+ games by providing tools for project scaffolding, scene manipulation, and engine interaction. It supports full game development workflows including node editing, script attachment, and project execution with debugging capabilities.

Category
访问服务器

README

Godot MCP

godot-mcp is a dependency-free MCP server for Godot 4.5+. It lets AI agents create, edit, and run full Godot games entirely through MCP tool calls.

Tested with Codex and Claude. Should also work with LMStudio, OpenCode, and any other MCP-compatible client.

<!-- Screenshots -->

Screenshot 1

Screenshot 2

Features

  • Detect Godot (godot_detect_executable) : Locates and validates the Godot executable so every subsequent tool knows which engine binary to use.

  • Create Project (godot_create_project) : Scaffolds a brand-new Godot project with the chosen name and parent directory, delegating to Godot itself so the output stays compatible with newer 4.x releases.

  • Create Folder (godot_create_folder) : Creates project-relative folders with safe snake_case naming for organizing assets, scenes, and scripts.

  • Inspect Project Structure (godot_get_project_structure) : Returns both nested structured entries and a human-readable tree string of all files and folders in the project.

  • List Resources (godot_list_resources) : Provides a fast grouped overview of scripts, shaders, scenes, and textures with counts, without manually globbing the project.

  • Start Editor (godot_start_project) : Opens the Godot editor for the project and returns a PID plus a log file path.

  • Create Scene (godot_create_scene) : Creates and saves a new scene with a Godot-style snake_case.tscn filename and PascalCase root node name.

  • Create Shader (godot_create_shader) : Generates a .gdshader file from a starter template or explicit shader source code.

  • Update Project Settings (godot_update_project_settings) : Edits one or more ProjectSettings parameters (app name, window size, etc.) through Godot itself. Accepts JSON-compatible values plus optional raw Godot expressions via value_godot.

  • Attach Script (godot_attach_script) : Attaches an existing .gd file or creates a starter script that extends the target node's type before attaching it.

  • Get Scene Tree (godot_get_scene_tree) : Inspects a saved scene's node tree and parent/child structure using Godot's own PackedScene.get_state().

  • Validate Scene (godot_validate_scene) : Dry-run parses a scene resource with a lightweight headless load so problems surface before a full run.

  • Add Node (godot_add_node) : Adds a new node of any instantiable Godot node type to an existing scene.

  • Add Primitive Mesh (godot_add_primitive_mesh) : Drops in a BoxMesh, CylinderMesh, SphereMesh, or other built-in primitive on a MeshInstance3D node for fast level blockout.

  • Edit Primitive Mesh (godot_edit_primitive_mesh) : Swaps the primitive type or changes parameters like size, height, radius, and segment counts.

  • Edit Scene (godot_edit_scene) : Renames a node, reparents it, deletes it, or combines those edits with transform changes in one save. Uses Godot to repack the scene.

  • Get Node Properties (godot_get_node_properties) : Returns the property list with serialized current values so object and vector values stay JSON-friendly.

  • Get Node Transform (godot_get_node_transform) : Inspects the root or a child node's transform section for Node2D, Node3D, and Control nodes.

  • Update Node Transform (godot_update_node_transform) : Adjusts position, rotation, scale, or other supported transform fields using JSON-friendly vector objects like { "x": 10, "y": 20 }.

  • Run Project (godot_run_project) : Launches the project's main scene as a detached process, returning a PID plus a log file path.

  • Run Scene (godot_run_scene) : Launches a specific scene directly as a detached process.

  • Run with Capture (godot_run_with_capture) : Runs for a short capture window, then returns stdout, stderr, the Godot log file excerpt, and parsed debug lines for warnings and errors.

  • Screenshot (godot_screenshot) : Uses Godot's built-in movie writer to capture the last rendered PNG frame after running for a short duration.

  • Search Docs (godot_search_docs) : Searches a cached API dump generated from the selected Godot executable, so results stay aligned with the installed engine version.

The server also exposes MCP resource discovery over stdio, so clients can inspect a static tool catalog resource and a per-tool detail template without needing to call the tools first.

Requirements

  • Python 3.10+
  • Godot 4.5 or newer

Godot can be supplied either:

  • per tool call with godot_executable
  • globally with the GODOT_EXECUTABLE environment variable

Examples:

  • /Applications/Godot.app/Contents/MacOS/Godot
  • /Applications/Godot_mono.app/Contents/MacOS/Godot
  • /usr/local/bin/godot4

Run It

From this repository:

PYTHONPATH=src python3 -m godot_mcp

Or install it:

python3 -m pip install -e .
godot-mcp

MCP Config Example

{
  "mcpServers": {
    "godot": {
      "command": "python3",
      "args": ["-m", "godot_mcp"],
      "env": {
        "PYTHONPATH": "/path/to/godot-mcp/src",
        "GODOT_EXECUTABLE": "/path/to/godot"
      }
    }
  }
}

Notes

  • Scene filenames are normalized to snake_case.tscn.
  • Project-relative folder inputs are normalized to safe snake_case directory segments.
  • Scene root node names are normalized to PascalCase.
  • Shader filenames are normalized to snake_case.gdshader.
  • Script filenames are normalized to snake_case.gd when the MCP creates them.
  • godot_get_project_structure returns both nested structured entries and a human-readable tree string.
  • godot_list_resources returns grouped project resources with counts for scripts, shaders, scenes, and textures.
  • Scene tree inspection uses Godot's own PackedScene.get_state() rather than hand-parsing .tscn files.
  • godot_validate_scene uses a lightweight headless load of the scene resource so parse problems surface before a full run.
  • godot_add_primitive_mesh and godot_edit_primitive_mesh work through Godot itself, so primitive resources stay valid and level greyboxing can be driven through MCP with mesh-specific parameters.
  • MCP resource discovery is available through resources/list, resources/templates/list, and resources/read, including godot://server/tools, godot://server/guide, and godot://tool/{name}.
  • godot_get_node_properties returns the property list with serialized current values so object and vector values stay JSON-friendly.
  • godot_edit_scene uses Godot to repack the scene after node edits instead of rewriting .tscn text directly.
  • Local doc search uses a cached API dump generated from the selected Godot executable, so the results stay aligned with the installed engine version.
  • Transform inspection and editing currently support Node2D, Node3D, and Control nodes, using JSON-friendly vector objects like { "x": 10, "y": 20 }.
  • godot_attach_script can either attach an existing .gd file or create a starter script that extends the target node's type before attaching it.
  • godot_run_project and godot_run_scene start detached processes and return a PID plus a log file path.
  • godot_run_with_capture runs for a short capture window, then returns stdout, stderr, the Godot log file excerpt, and parsed debug lines for warnings and errors.
  • godot_screenshot uses Godot's built-in movie writer, then keeps the last rendered PNG frame as the screenshot and cleans up the intermediate frames.
  • The run tools are non-headless by default, so a normal game window appears unless you explicitly pass headless=true.
  • godot_start_project opens the editor and returns a PID plus a log file path.
  • Logs are written into the target project under .godot-mcp/logs/.

Local Verification

This repository includes unit tests that use a fake Godot executable so the MCP server can be validated even when Godot is not installed in the current environment.

Run them with:

python3 -m unittest discover -s tests

Contributing

Contributions are welcome! Feel free to open issues, submit pull requests, or suggest new features. All contributions are appreciated.

License

This project is licensed under the MIT License.

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选