百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
F

funplay-unity-mcp

> AI 编程
开源

Unity 编辑器中最先进的 MCP 服务器,支持执行代码、提示/资源、输入模拟、屏幕截图和播放模式自动化。

200 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

Unity 编辑器中最先进的 MCP 服务器,支持执行代码、提示/资源、输入模拟、屏幕截图和播放模式自动化。

Funplay MCP for Unity

The Most Advanced MCP Server for Unity Editor












中文 | English

If you find this project useful, please consider giving it a Star. It helps more Unity developers discover it and supports ongoing development.


Funplay MCP for Unity is an MIT-licensed Unity Editor MCP server that lets AI assistants like Claude Code, Cursor, Kimi Code, LM Studio, Windsurf, Codex, and VS Code Copilot operate directly inside your running Unity project.

Describe your game in one sentence — your AI assistant builds it in Unity through Funplay MCP for Unity's built-in tools for scene creation, script generation, runtime validation, input simulation, performance analysis, and editor automation.

"Build a snake game with a 10x10 grid, food spawning, score UI, and game-over screen"

Your AI assistant handles it through Funplay MCP for Unity: creates the scene, generates all scripts, sets up the UI, and configures the game logic — all from a single prompt.

16-second demo — AI generates a 3D model and integrates it into the scene end-to-end. Watch HD MP4.

Quick Start

If you just want to get connected fast, do these three things:

  • Install the Unity package from the Git URL
  • Start Funplay > MCP Server
  • Use the built-in one-click client configuration

1. Install via UPM (Git URL)

In Unity, go to Window → Package Manager → + → Add package from git URL:

https://github.com/FunplayAI/funplay-unity-mcp.git

Before you clone or install, a quick ⭐ on GitHub would be greatly appreciated.

Optional: Install via OpenUPM

If you want Unity Package Manager to show registry-backed package version history and allow version selection, install from OpenUPM instead of Git.

Using the OpenUPM CLI:

bash
openupm add com.gamebooom.unity.mcp

Or add the scoped registry manually in Packages/manifest.json:

json
{
  "scopedRegistries": [
    {
      "name": "OpenUPM",
      "url": "https://package.openupm.com",
      "scopes": [
        "com.gamebooom"
      ]
    }
  ],
  "dependencies": {
    "com.gamebooom.unity.mcp": "0.6.9"
  }
}

If you installed from a Git URL before, remove the Git dependency first, then install from OpenUPM. Git-installed packages only show the resolved Git version in Unity and do not get the registry-backed Version History list.

2. Start the MCP Server

Menu: Funplay → MCP Server to start the server.

A new project gets its own port, derived from the project path, so two editors opened on different projects never fight over one port. The MCP Server window shows the exact URL (http://127.0.0.1:/); the one-click configuration writes that URL for you. Type a port in Server Port to pin a fixed one (CI, a firewall rule) and Use Per-Project Port to derive one instead.

Upgrading from an earlier version changes nothing: the project keeps the port it was already using, recorded as a pin, so existing client configs keep working. Click Use Per-Project Port when you want that project to run beside another editor. See Running Several Unity Projects at Once for the full setup guide.

If the window reports a fallback port, do not use a client entry that still targets the occupied stable port; it could reach the process that owns that port. One-click configuration stays blocked until you click Use Per-Project Port or Pin Current Port and the server finishes restarting.

Direct in-process HTTP is the default transport. If you need stronger connection continuity across Unity script recompiles or Play Mode domain reloads, enable Experimental Broker Mode in the MCP Server window. It runs a tiny local broker with Unity's bundled Mono, keeps the same 127.0.0.1 port for MCP clients, and requires no client config change.

Open Funplay → Tool Exposure if you want to edit the exact tools exposed by core or full.

Open Funplay → MCP Settings if you need to adjust execute_code safety defaults or plugin debug logging.

3. Configure Your AI Client

Use the built-in One-Click MCP Configuration in the Funplay > MCP Server window first.

Select your target client, click Configure, and the package writes the recommended MCP config entry for you.

For Claude Code, Cursor, Codex, OpenCode, and DeepSeek Harness, click Configure + Skills to also install both built-in project skills.

If you want project-specific AI guidance for the current Unity project, open Funplay → Project Skills to choose supported platforms and install the built-in unity-mcp-workflow and unity-ui-composition skills. The UI skill covers responsive portrait and landscape uGUI work.

If you prefer to edit config files manually, use the examples below as fallback references. Replace with this project's entry name and with its port -- the MCP Server window shows both:

Claude Code / Claude Desktop

json
{
  "mcpServers": {
    "funplay-": {
      "type": "http",
      "url": "http://127.0.0.1:/"
    }
  }
}

Cursor

json
{
  "mcpServers": {
    "funplay-": {
      "url": "http://127.0.0.1:/"
    }
  }
}

LM Studio

LM Studio's mcp.json location can vary by version and platform. Prefer Program > Install > Edit mcp.json in LM Studio. Funplay's one-click Configure button opens LM Studio's lmstudio://add_mcp link and only updates an existing config file if one is already present, instead of creating a guessed path.

json
{
  "mcpServers": {
    "funplay-": {
      "url": "http://127.0.0.1:/"
    }
  }
}

VS Code

json
{
  "servers": {
    "funplay-": {
      "type": "http",
      "url": "http://127.0.0.1:/"
    }
  }
}

Trae

json
{
  "mcpServers": {
    "funplay-": {
      "url": "http://127.0.0.1:/"
    }
  }
}

Kiro

json
{
  "mcpServers": {
    "funplay-": {
      "type": "http",
      "url": "http://127.0.0.1:/"
    }
  }
}

Kimi / Kimi Code

Current Kimi Code releases load project-level MCP servers from .kimi-code/mcp.json (official MCP documentation). Funplay's one-click Configure target writes there so the current Unity server is only visible to Kimi sessions started in this project. If the machine only has the legacy Kimi CLI data directory, it writes the compatible user-level ~/.kimi/mcp.json instead. Start a new Kimi session from the Unity project root after configuring; on first use, review the loopback URL and trust the workspace. The generated project file contains this machine's local port, so normally keep it uncommitted unless the team deliberately shares one pinned port.

json
{
  "mcpServers": {
    "funplay-": {
      "url": "http://127.0.0.1:/"
    }
  }
}

Codex

toml
[mcp_servers.funplay-]
url = "http://127.0.0.1:/"

OpenCode

Written to the repository's own .opencode/opencode.json (not the global config), so only OpenCode sessions started inside this repo see this editor's tools.

json
{
  "mcp": {
    "funplay-": {
      "type": "remote",
      "url": "http://127.0.0.1:/",
      "enabled": true
    }
  }
}

DeepSeek Harness

Written as a delimited managed block into every DeepSeek Harness profile's ~/.dsh/profiles//cordis.patch.yml, because DSH composes its plugins per launch through --profile and exposes no single active profile to target from outside. Anything outside the block is preserved on reconfigure, and deleting the block by hand uninstalls the entry.

…

json { "mcpServers": { "funplay-": { "serverUrl": "http://127.0.0.1:/" } } }

…

csharp using UnityEngine; using UnityEditor; using Funplay.Editor.Tools.Helpers; using Funplay.Editor.Tools.Scripting;

public class CommandScript : IFunplayCommand { public void Execute(ExecutionContext ctx) { var go = GameObject.CreatePrimitive(PrimitiveType.Cube); ctx.RegisterObjectCreation(go); // auto-Undo + tracked ctx.Log("Created {0}", go.name); ctx.ReturnValue = GameObjectSerializer.Describe(go, includeComponents: false); } }

…

markdown

name: validate_activity description: Open and validate a project activity. arguments: activity_key(required), theme_id

Open activity {activity_key} with theme {theme_id}, then validate its runtime state.

…

csharp using System.ComponentModel;

[ToolProvider("MyTools")] public static class MyCustomTools { [Description("Spawns enemies at random positions in the scene")] public static string SpawnEnemies( [ToolParam("Number of enemies to spawn", Required = true)] int count, [ToolParam("Prefab path in Assets")] string prefabPath) { // Your implementation here return $"Spawned {count} enemies"; } }


Methods are automatically discovered, converted to snake_case (`spawn_enemies`), and exposed via MCP with JSON Schema definitions.

## Architecture

MCP Server (HTTP JSON-RPC 2.0) └─ MCPRequestHandler (protocol handling) └─ MCPExecutionBridge └─ FunctionInvokerController (reflection-based invocation) └─ Tool Functions (180 built-in tools across 42 modules)

External AI Client → HTTP Request → MCPRequestHandler → MCPExecutionBridge → FunctionInvokerController → tool method


## Requirements

- Unity 2022.3 or later
- .NET / Mono with `Newtonsoft.Json`

## Contributing

Contributions are welcome! Please read the [Contributing Guide](CONTRIBUTING.md) before submitting a PR.

## License

[MIT](LICENSE) — Free to use, modify, distribute, and integrate into commercial or open-source projects.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C#aiai-toolsclaude-codecodex

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类AI 编程
定价开源

> 相关工具

G
GitHub Copilot
GitHub 官方 AI 编程助手,覆盖补全、Chat 与 Agent 模式。
C
Cursor
AI 原生代码编辑器,对话改代码、多文件 Agent 与规则体系是其核心。
S
skills
Skills for Real Engineers. Straight from my .agents directory.