EG

ee0pdt/godot-mcp

开发工具

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

622 stars 65 forks 质量 69 趋势 21MIT

一个适用于 Godot 的 MCP,允许你用 Claude 等工具在 Godot 游戏引擎中创建和编辑游戏

概览

Godot 引擎与 AI 助手之间的全面集成,采用模型上下文协议(MCP)。该插件允许 AI 助手与您的 Godot 项目交互,提供强大的代码辅助、场景操作和项目管理功能。 - : AI 助手可以访问和修改脚本、场景、节点和项目资源 - : 将项目数据发送给 AI,并直接在编辑器中应用建议更改 - : - : 创建、修改和管理场景中的节点 - : 编辑、分析和创建 GDScript 文件 - : 操作场景及其结构 - : 访问项目设置和资源 - : 控制各种编辑器功能 1. 编辑或创建 Claude Desktop 配置文件: 2. 添加以下配置(或使用附带的claude_desktop_config.json作为参考)::将PATH_TO_YOUR_PROJECT替换为你存储该仓库的绝对路径。 1. 打开 Godot Engine 2.选择“导入”并导航到克隆仓库 3.

概述(AI 翻译)

Godot 引擎与 AI 助手之间的全面集成,采用模型上下文协议(MCP)。该插件允许 AI 助手与您的 Godot 项目交互,提供强大的代码辅助、场景操作和项目管理功能。

特色

  • 完整的Godot项目访问:AI助手可以访问和修改脚本、场景、节点及项目资源
  • 双向通信:将项目数据发送给AI,并直接在编辑器中应用建议更改
  • 命令类别:
  • 节点命令:在场景中创建、修改和管理节点
  • 脚本命令:编辑、分析和创建GDScript文件
  • 场景命令:操作场景及其结构
  • 项目命令:访问项目设置和资源
  • 编辑器命令:控制各种编辑器功能

快速布置

1.克隆仓库

2.搭建MCP服务器

3.设置Claude桌面

  1. 编辑或创建 Claude Desktop 配置文件:

  2. 添加以下配置(或使用附带的 claude_desktop_config.json 作为参考):

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

README

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

Godot MCP (Model Context Protocol)

A comprehensive integration between Godot Engine and AI assistants using the Model Context Protocol (MCP). This plugin allows AI assistants to interact with your Godot projects, providing powerful capabilities for code assistance, scene manipulation, and project management.

Features

  • Full Godot Project Access: AI assistants can access and modify scripts, scenes, nodes, and project resources
  • Two-way Communication: Send project data to AI and apply suggested changes directly in the editor
  • Command Categories:
    • Node Commands: Create, modify, and manage nodes in your scenes
    • Script Commands: Edit, analyze, and create GDScript files
    • Scene Commands: Manipulate scenes and their structure
    • Project Commands: Access project settings and resources
    • Editor Commands: Control various editor functionality

Quick Setup

1. Clone the Repository

git clone https://github.com/ee0pdt/godot-mcp.git
cd godot-mcp

2. Set Up the MCP Server

cd server
npm install
npm run build
# Return to project root
cd ..

3. Set Up Claude Desktop

  1. Edit or create the Claude Desktop config file:

    # For macOS
    nano ~/Library/Application\ Support/Claude/claude_desktop_config.json
    
  2. Add the following configuration (or use the included claude_desktop_config.json as a reference):

    {
      "mcpServers": {
        "godot-mcp": {
     	 "command": "node",
     	 "args": [
     	   "PATH_TO_YOUR_PROJECT/server/dist/index.js"
     	 ],
     	 "env": {
     	   "MCP_TRANSPORT": "stdio"
     	 }
        }
      }
    }
    

    Note: Replace PATH_TO_YOUR_PROJECT with the absolute path to where you have this repository stored.

  3. Restart Claude Desktop

4. Open the Example Project in Godot

  1. Open Godot Engine
  2. Select “Import” and navigate to the cloned repository
  3. Open the project.godot file
  4. The MCP plugin is already enabled in this example project

Using MCP with Claude

After setup, you can work with your Godot project directly from Claude using natural language. Here are some examples:

Example Prompts

@mcp godot-mcp read godot://script/current

I need help optimizing my player movement code. Can you suggest improvements?
@mcp godot-mcp run get-scene-tree

Add a cube in the middle of the scene and then make a camera that is looking at the cube.
@mcp godot-mcp read godot://scene/current

Create an enemy AI that patrols between waypoints and attacks the player when in range.

Natural Language Tasks Claude Can Perform

  • “Create a main menu with play, options, and quit buttons”
  • “Add collision detection to the player character”
  • “Implement a day/night cycle system”
  • “Refactor this code to use signals instead of direct references”
  • “Debug why my player character falls through the floor sometimes”

Available Resources and Commands

Resource Endpoints:

在 GitHub 查看完整 README

安装

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

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

配置

{ "mcpServers": { "godot-mcp": { "command": "node", "args": [ "PATH_TO_YOUR_PROJECT/server/dist/index.js" ], "env": { "MCP_TRANSPORT": "stdio" } } } }