DG

derfirm/godot-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

55 stars 9 forks 质量 84 趋势 8MIT

一个用于与Godot游戏引擎交互的模型上下文协议(MCP)服务器。

概览

一个用于与Godot游戏引擎交互的模型上下文协议(MCP)服务器。 Godot MCP 使 AI 助手能够启动 Godot 编辑器、运行项目、捕获调试输出,并通过标准化接口控制项目执行。 这种直接反馈循环帮助AI助手了解Godot项目中哪些有效、哪些无效,从而获得更好的代码生成和调试辅助。 - : 为特定项目打开 Godot 编辑器 - : 以调试模式执行 Godot 项目 - : 检索控制台输出和错误信息 - : 程序启动和停止 Godot 项目 - : 检索已安装的 Godot 版本 - : 在指定目录中查找 Godot 项目 - : 获取关于项目结构的详细信息 - 创建指定根节点类型的新场景 - 添加、删除、修改和复制节点 - 查询节点信息和属性 - 将精灵和纹理加载到Sprite2D节点 - 将3D场景导出为GridMap的MeshLibrary资源 - 保存场景......

概述(AI 翻译)

一个用于与Godot游戏引擎交互的模型上下文协议(MCP)服务器。

引言

Godot MCP 使 AI 助手能够启动 Godot 编辑器、运行项目、捕获调试输出,并通过标准化接口控制项目执行。

这种直接反馈循环帮助AI助手了解Godot项目中哪些有效、哪些无效,从而获得更好的代码生成和调试辅助。

当前版本: 0.1.0 需要Godot版本: 4.5.0或更高版本 状态: 正在开发中

特色

  • 启动 Godot 编辑器:为特定项目打开 Godot 编辑器
  • 运行 Godot 项目:在调试模式下执行 Godot 项目
  • 捕获调试输出:检索控制台输出和错误信息
  • 控制执行:程序化启动和停止Godot项目
  • 获取Godot版本:检索已安装的Godot版本
  • 列表 Godot 项目:在指定目录中查找 Godot 项目
  • 项目分析:获取项目结构的详细信息

场景管理

  • 创建具有指定根节点类型的新场景
  • 添加、删除、修改和复制节点
  • 查询节点信息和属性

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Godot MCP

A Model Context Protocol (MCP) server for interacting with the Godot game engine.

Introduction

Godot MCP enables AI assistants to launch the Godot editor, run projects, capture debug output, and control project execution through a standardized interface.

This direct feedback loop helps AI assistants understand what works and what doesn’t in Godot projects, leading to better code generation and debugging assistance.

Current Version: 0.1.0
Godot Version Required: 4.5.0 or later
Status: Active Development

Features

  • Launch Godot Editor: Open the Godot editor for a specific project
  • Run Godot Projects: Execute Godot projects in debug mode
  • Capture Debug Output: Retrieve console output and error messages
  • Control Execution: Start and stop Godot projects programmatically
  • Get Godot Version: Retrieve the installed Godot version
  • List Godot Projects: Find Godot projects in a specified directory
  • Project Analysis: Get detailed information about project structure

Scene Management

  • Create new scenes with specified root node types
  • Add, remove, modify, and duplicate nodes
  • Query node information and properties
  • Load sprites and textures into Sprite2D nodes
  • Export 3D scenes as MeshLibrary resources for GridMap
  • Save scenes with options for creating variants

Script Management

  • Create GDScript files with templates (node, resource, custom)
  • Attach scripts to nodes
  • Validate script syntax with detailed error reporting
  • Get node methods and properties

Resource Management

  • Import assets with custom settings
  • Create resources (materials, shaders, etc.)
  • List project assets with metadata
  • Configure import settings

Signal System

  • Create custom signals in scripts
  • Connect signals between nodes with validation
  • List available signals on nodes
  • Disconnect signal connections

Physics System (Godot 4.5+)

  • Add physics bodies (CharacterBody2D/3D, RigidBody2D/3D, etc.)
  • Configure physics properties and materials
  • Setup collision layers and masks
  • Create Area2D/Area3D with signal connections

UI System

  • Create UI elements (Button, Label, TextEdit, Panel, etc.)
  • Apply themes to UI elements
  • Setup container layouts
  • Create menus with buttons and navigation

Animation System

  • Create AnimationPlayer nodes with animations
  • Add keyframes to animation tracks
  • Setup AnimationTree with state machines
  • Add particle systems (GPUParticles2D/3D)

Project Management

  • Update project settings
  • Configure input action mappings
  • Setup autoload singletons
  • Manage editor plugins (list, enable, disable)

Debug Module

  • Run projects with full debug output capture
  • Get error context with stack traces
  • Intelligent error analysis with solutions
  • Integration with documentation for contextual help

Documentation Module (Godot 4.5+)

  • Get detailed class information from official Godot documentation
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "godot": { "command": "node", "args": ["/absolute/path/to/godot-mcp/build/index.js"], "env": { "DEBUG": "true" // Optional: Enable detailed logging }, "disabled": false, "autoApprove": [ "launch_editor", "run_project", "get_debug_output", "stop_project", "get_godot_version", "list_projects", "get_project_info", "create_scene", "add_node", "remove_node", "modify_node", "duplicate_node", "query_node", "load_sprite", "export_mesh_library", "save_scene", "create_script", "attach_script", "validate_script", "get_node_methods", "import_asset", "create_resource", "list_assets", "configure_import", "create_signal", "connect_signal", "list_signals", "disconnect_signal", "add_physics_body", "configure_physics", "setup_collision_layers", "create_area", "create_ui_element", "apply_theme", "setup_layout", "create_menu", "create_animation_player", "add_keyframes", "setup_animation_tree", "add_particles", "get_uid", "update_project_uids", "get_class_info", "get_method_info", "search_docs", "get_best_practices", "run_with_debug", " …