Godot Forge

io.github.gregario由 GitHub 账号 gregario 发布v0.1.2更新于 Oct 28, 2026

Godot 4 MCP server — test runner, API docs, script analysis, scene parsing, LSP.

已验证STDIO仅桌面知识与记忆开发者工具

概览

AI 生成的概览

Godot 4 的 MCP 服务器,让 AI 助手运行 GUT/GdUnit4 测试、查询 Godot 4 API 文档与 3→4 迁移映射、分析 GDScript 与场景,并可启动项目或截图。

可以做什么
  • 运行 GUT/GdUnit4 测试,返回结构化的通过/失败结果与失败位置
  • 检索 Godot 4 API 文档,并提供 Godot 3→4 的弃用 API 迁移映射
  • 分析 GDScript 脚本中的十类常见陷阱,解析 .tscn/.tres 场景文件并检查反模式与格式错误
  • 查看项目结构概览,并从 Godot 语言服务器获取 LSP 诊断信息
  • 启动或停止项目并捕获调试输出,以及把视口截图保存为 PNG
适用场景
适合在 AI 助手编写或审查 Godot 4 项目的 GDScript、容易写出 Godot 3 弃用 API 时使用;也适合希望在对话中直接跑测试、检查场景和截图,而不必手动操作编辑器的人。
运行要求
通过 npx 在本机运行,需要 Node.js 18+。Godot 4.x 会被自动检测(可用 GODOT_PATH 覆盖),仅运行测试、启动项目和截图时需要;LSP 诊断需在 Godot 编辑器打开项目时使用。项目目录通过向上查找 project.godot 自动定位,也可用 --project 参数指定。未声明任何认证。
安装前请注意
启动项目和截图会在你的机器上执行 Godot 二进制文件,LSP 诊断会连接正在运行的编辑器。服务器会读取并解析项目文件与脚本,请留意其发送给助手的内容。未要求任何凭据或付费。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Godot Forge,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Godot Forge

The MCP server for Godot 4. Test runner, API docs, script analysis, and more.

[npm version] [npm downloads] [MIT License] [Node.js 18+] [MCP Compatible] [godot-forge MCP server]


AI coding assistants are structurally bad at GDScript. Models trained on data skewed towards Godot 3 hallucinate deprecated APIs (yield instead of await, KinematicBody instead of CharacterBody3D, export var instead of @export var). Godot Forge fixes this.

8 tools. Zero config. Works with every MCP-compatible IDE.

[godot-forge MCP server]

Install

bash
npx -y godot-forge

That's it. Godot Forge auto-detects your Godot binary (Steam, Homebrew, direct download) and finds your project.godot automatically.

Add to your IDE

Claude Code
bash
claude mcp add godot-forge -- npx -y godot-forge
Cursor

Add to .cursor/mcp.json:

json
{  "mcpServers": {    "godot-forge": {      "command": "npx",      "args": ["-y", "godot-forge"]    }  }}
VS Code (Copilot)

Add to .vscode/mcp.json:

json
{  "servers": {    "godot-forge": {      "command": "npx",      "args": ["-y", "godot-forge"]    }  }}
Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

json
{  "mcpServers": {    "godot-forge": {      "command": "npx",      "args": ["-y", "godot-forge"]    }  }}
Zed

Add to settings.json:

json
{  "context_servers": {    "godot-forge": {      "command": {        "path": "npx",        "args": ["-y", "godot-forge"]      }    }  }}
Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%/Claude/claude_desktop_config.json (Windows):

json
{  "mcpServers": {    "godot-forge": {      "command": "npx",      "args": ["-y", "godot-forge"]    }  }}
More IDEs (Codex, Gemini CLI, JetBrains, Continue, Cline, Roo Code, Neovim, OpenCode, Kiro)

See IDE Setup Guide for configuration snippets for all supported IDEs.

Tools

ToolDescriptionNeeds GodotNeeds Editor
godot_run_testsRun GUT/GdUnit4 tests, get structured pass/fail resultsYesNo
godot_search_docsSearch Godot 4 API docs with 3→4 migration mappingNoNo
godot_analyze_scriptDetect 10 GDScript pitfalls (deprecated API, coupling, re-entrancy)NoNo
godot_analyze_sceneParse .tscn/.tres, detect antipatterns and format errorsNoNo
godot_get_project_infoProject structure overview with progressive disclosureNoNo
godot_get_diagnosticsLSP diagnostics from Godot's language serverNoYes
godot_run_projectLaunch/stop project, capture debug outputYesNo
godot_screenshotCapture viewport screenshot as base64 PNGYesNo

[!TIP] 6 of 8 tools work without Godot installed. Only test running, project launching, and screenshots need the binary.

Features

Test Runner

Auto-detects GUT and GdUnit4. Returns structured JSON with pass/fail counts, failure details with file paths and line numbers. Supports filtering by script, method, or inner class.

Ask your AI: "Run the water profile tests"→ { total: 5, passed: 5, failed: 0, duration_ms: 462 }

Godot 3→4 Migration Mapping

The #1 reason AI writes broken GDScript. When your AI queries a deprecated API, it gets the correct Godot 4 equivalent instantly (30+ mappings covering classes, methods, syntax, and constants).

Query: "KinematicBody"  →  "Renamed to CharacterBody3D in Godot 4"Query: "yield"          →  "yield(obj, 'signal') → await obj.signal"Query: "instance()"     →  "instance() → instantiate()"

Script Analysis: 10 Pitfalls

Every pitfall detected from real game development:

#PitfallWhat It Catches
1Godot 3→4 APIyield, connect("signal"), export var, instance()
2Giant scriptsOver 300 lines. Should be split
3:= on VariantType inference on Dictionary.get() causes parse errors
4Tight couplingExcessive get_node("../../...") references
5Signal re-entrancySignal emitted between state changes
6Autoload misuseToo many autoloads, static func on autoloads
7Missing disconnectconnect() without _exit_tree() cleanup
8_init() timingNode tree access before node is in tree
9Python-ismsList comprehensions, len(), Python imports
10.tres type fieldCustom class name instead of type="Resource"

Scene Analysis

Parses .tscn and .tres files. Detects deep nesting (>8 levels), oversized scenes (>100 nodes), missing script references, preload() in .tres, integer resource IDs, and more.

LSP Diagnostics

Connects to Godot's built-in language server (runs automatically when the editor is open). Returns real compiler errors and warnings (no guesswork).

[!NOTE] Requires the Godot editor to be running with your project open. All other tools work without the editor.

Screenshot Capture

Captures the game viewport as a PNG image. Loads the project's main scene (or a specified scene), waits for rendering, and returns the screenshot as base64 for the AI to see.

Configuration

Godot Binary

Auto-detected in this order:

  1. GODOT_PATH environment variable
  2. godot / godot4 in PATH
  3. Steam installation (macOS, Windows, Linux)
  4. Platform defaults (/Applications/Godot.app, Homebrew, Scoop, Flatpak, Snap, etc.)

Override manually:

bash
export GODOT_PATH="/path/to/godot"

See Godot Detection for the full list of searched paths.

Project Directory

Auto-detected by walking up from the current directory to find project.godot. Override:

bash
npx godot-forge --project /path/to/godot/project

Requirements

  • Node.js 18+: for npx execution
  • Godot 4.x: auto-detected (optional for 6 of 8 tools)
  • Any MCP-compatible IDE: Claude Code, Cursor, VS Code, Windsurf, Zed, and more

Design Principles

  • Outcomes, not operations: Each tool delivers a complete result, not raw API wrapping
  • 8 curated tools: No 93-tool context bloat (why this matters)
  • Progressive disclosure: Summaries first, details on demand
  • spawn() not exec(): No command injection, no Windows quoting bugs
  • Actionable errors: Every error includes a suggestion the AI can act on
  • Cross-platform: macOS, Windows, Linux. Steam and non-Steam installs.

Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.

Development

bash
git clone https://github.com/gregario/godot-forge.gitcd godot-forgenpm installnpm run buildnpm test        # 74 tests across 12 test files

Running locally

bash
# Point your IDE at the local buildclaude mcp add godot-forge-dev -- node /path/to/godot-forge/dist/index.js

Roadmap

See ROADMAP.md for planned features.

Phase 2: Input simulation, runtime scene tree inspection, performance profiling, shader validation, export/CI pipeline.

Licence

MIT

来源:README.md,提交 401f414

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.2最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分