CU

codeturion/unity-api-mcp

开发工具

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

65 stars 6 forks 质量 85 趋势 14MIT

codeturion/unity-api-mcp 是从 https://github.com/codeturion/unity-api-mcp. 导入的 MCP 服务器候选

概览

codeturion/unity-api-mcp 是从 https://github.com/codeturion/unity-api-mcp. 导入的 MCP 服务器候选

概述(AI 翻译)

MCP 服务器,为 AI 代理提供准确的 Unity API 文档。防止误导签名、错误命名空间和弃用 API 使用。

支持 Unity 6(每个小数据流一个数据库)、Unity 2023 和 Unity 2022 LTS。支持 Claude Code、光标、Windsurf 或任何兼容 MCP 的 AI 工具。无需安装 Unity。查看支持版本。每周自动检测并构建新的 Unity 版本。

快速启动

在你的MCP配置中添加(.mcp.json、mcp.json,或工具的MCP设置),设置UNITY_VERSION以匹配你的项目:

有效的数值:Unity 6 流,如 "6000.3",或 "6"、"2023"、"2022"。

首次运行时,服务器会下载正确的数据库(~20-30 MB)到 ~/.unity-api-mcp/。

工作原理

  1. 版本检测。 服务器决定要服务哪个 Unity 版本:
优先级 来源 示例
1 UNITY_VERSION env var "2022", "6", "6000.3" 或 "6000.3.8f1"
2 UNITY_PROJECT_PATH 读取ProjectSettings/ProjectVersion.txt,映射2022.3.62f1到"2022",6000.3.8f1映射到"6000.3"
3 默认 "6"
  1. **数据库下载。

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

README

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

unity-api-mcp

MCP server that gives AI agents accurate Unity API documentation. Prevents hallucinated signatures, wrong namespaces, and deprecated API usage.

Supports Unity 6 (one database per minor stream), Unity 2023, and Unity 2022 LTS. Works with Claude Code, Cursor, Windsurf, or any MCP-compatible AI tool. No Unity installation required. See the supported versions. New Unity releases are detected and built automatically every week.

Quick Start

Add to your MCP config (.mcp.json, mcp.json, or your tool’s MCP settings), setting UNITY_VERSION to match your project:

{
  "mcpServers": {
    "unity-api": {
      "command": "uvx",
      "args": ["unity-api-mcp"],
      "env": {
        "UNITY_VERSION": "6000.3"
      }
    }
  }
}

Valid values: a Unity 6 stream like "6000.3", or "6", "2023", "2022".

On first run the server downloads the correct database (~20-30 MB) to ~/.unity-api-mcp/.

How It Works

  1. Version detection. The server figures out which Unity version to serve:
Priority Source Example
1 UNITY_VERSION env var "2022", "6", "6000.3", or "6000.3.8f1"
2 UNITY_PROJECT_PATH Reads ProjectSettings/ProjectVersion.txt, maps 2022.3.62f1 to "2022", 6000.3.8f1 to "6000.3"
3 Default "6"
  1. Database download. If the database for that version isn’t cached locally, it downloads from GitHub. Unity 6 minor streams (6000.0, 6000.3, 6000.5, …) get their own per-stream database, falling back to the generic 6 database when a stream database isn’t published. Cached databases are freshness-checked against the release on startup, so weekly rebuilds reach existing installs automatically.
在 GitHub 查看完整 README

安装

uvx unity-api-mcp
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "unity-api": { "command": "uvx", "args": ["unity-api-mcp"], "env": { "UNITY_VERSION": "6000.3" } } } }