Back to search
Unity-Pipeline-MCP
MCP serverGitHub
stdio MCP server for operating a running Unity Editor via the Unity Pipeline package
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Checked today
Badge for your README
Markdown
[](/listings/lfpu--unity-pipeline-mcp)HTML
<a href="/listings/lfpu--unity-pipeline-mcp"><img src="/api/listings/lfpu--unity-pipeline-mcp/badge.svg" alt="findsafeskills safety rating" /></a>Install
i
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
README.md · README · 55 lines
- # Unity-Pipeline-MCP
- 一个 stdio MCP 服务,通过 Unity 官方 `com.unity.pipeline` 包在 Editor 里启动的本地 HTTP API 来操作正在运行的 Unity Editor。
- 搭配[AntCode](https://github.com/lfpu/AntCode)食用更美好!!!
- ## 工具
- | 工具 | 说明 |
- |---|---|
- | `unity_status` | 只读。Editor 是否在运行、项目名、Unity 版本、端口、心跳、命令数量、警告。不返回 token |
- | `unity_commands` | 只读。检索可用命令。无参数列出分组;`group` / `keyword` 过滤;`command` 返回完整参数 schema |
- | `unity_exec` | 执行一个命令。支持 dry-run 的写操作必须先用 `dryRun=true` 试运行一次 |
- ## 运行前提
- - Unity 6.0 及以上,项目里已安装 Unity Pipeline 包(`unity pipeline install`),Editor 已打开该项目。
- - Python 3.10+,`pip install -r requirements.txt`。
- ## 配置(AntCode / Claude Code 等)
- 参考 `.mcp.json.example`:
- ```json
- {
- "mcpServers": {
- "unity-pipeline": {
- "command": "python",
- "args": ["C:/path/to/Unity-Pipeline-MCP/main.py", "--project", "C:/path/to/YourUnityProject"]
- }
- }
- }
- ```
- ## 启动参数
- | 参数 | 默认 | 说明 |
- |---|---|---|
- | `--project <路径>` | 必填 | Unity 项目根目录,用来定位 `Library/Pipeline/.unity-pipeline-port` |
- | `--allow-eval` / `--no-allow-eval` | 关 | 是否开放 Eval 类命令(能执行任意 C#,默认禁用) |
- | `--require-dry-run` / `--no-require-dry-run` | 开 | 写操作是否必须先 dry-run |
- | `--timeout-ms` | 60000 | 默认执行超时 |
- | `--max-chars` | 8000 | 单次返回给模型的最大字符数 |
- | `--deny <通配符>` | 空 | 禁用的命令名,可重复或用逗号分隔 |
- | `--readonly-pattern <通配符>` | 空 | 视为只读的命令名,不要求 dry-run |
- 对应环境变量:`UNITY_MCP_PROJECT`、`UNITY_MCP_ALLOW_EVAL`、`UNITY_MCP_REQUIRE_DRY_RUN`、`UNITY_MCP_TIMEOUT_MS`、`UNITY_MCP_MAX_CHARS`、`UNITY_MCP_DENY`、`UNITY_MCP_READONLY`。
- ## 工作方式
- - 每次调用都重新读取 `Library/Pipeline/.unity-pipeline-port`,取端口和 token,不缓存 token,也不写日志、不返回给模型。
- - 先检查端口文件里的 `pid` 进程是否存活,避免用旧的端口文件。
- - 请求头 `Authorization: Bearer <evalToken>`,只连 `127.0.0.1`,不带 `Origin` 头,不走代理。
- - 收到 401 时重新读文件并重试一次(Editor 重启后 token 会变)。
- - `unity_exec` 同一时刻只发一个请求(服务端本来就串行执行)。
- - 命令列表缓存 60 秒,Editor 重启后自动失效。
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.