Skip to content
Back to search

Unity-Pipeline-MCP

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
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/lfpu--unity-pipeline-mcp/badge.svg)](/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
  1. # Unity-Pipeline-MCP
  2. 一个 stdio MCP 服务,通过 Unity 官方 `com.unity.pipeline` 包在 Editor 里启动的本地 HTTP API 来操作正在运行的 Unity Editor。
  3. 搭配[AntCode](https://github.com/lfpu/AntCode)食用更美好!!!
  4. ## 工具
  5. | 工具 | 说明 |
  6. |---|---|
  7. | `unity_status` | 只读。Editor 是否在运行、项目名、Unity 版本、端口、心跳、命令数量、警告。不返回 token |
  8. | `unity_commands` | 只读。检索可用命令。无参数列出分组;`group` / `keyword` 过滤;`command` 返回完整参数 schema |
  9. | `unity_exec` | 执行一个命令。支持 dry-run 的写操作必须先用 `dryRun=true` 试运行一次 |
  10. ## 运行前提
  11. - Unity 6.0 及以上,项目里已安装 Unity Pipeline 包(`unity pipeline install`),Editor 已打开该项目。
  12. - Python 3.10+,`pip install -r requirements.txt`。
  13. ## 配置(AntCode / Claude Code 等)
  14. 参考 `.mcp.json.example`:
  15. ```json
  16. {
  17. "mcpServers": {
  18. "unity-pipeline": {
  19. "command": "python",
  20. "args": ["C:/path/to/Unity-Pipeline-MCP/main.py", "--project", "C:/path/to/YourUnityProject"]
  21. }
  22. }
  23. }
  24. ```
  25. ## 启动参数
  26. | 参数 | 默认 | 说明 |
  27. |---|---|---|
  28. | `--project <路径>` | 必填 | Unity 项目根目录,用来定位 `Library/Pipeline/.unity-pipeline-port` |
  29. | `--allow-eval` / `--no-allow-eval` | 关 | 是否开放 Eval 类命令(能执行任意 C#,默认禁用) |
  30. | `--require-dry-run` / `--no-require-dry-run` | 开 | 写操作是否必须先 dry-run |
  31. | `--timeout-ms` | 60000 | 默认执行超时 |
  32. | `--max-chars` | 8000 | 单次返回给模型的最大字符数 |
  33. | `--deny <通配符>` | 空 | 禁用的命令名,可重复或用逗号分隔 |
  34. | `--readonly-pattern <通配符>` | 空 | 视为只读的命令名,不要求 dry-run |
  35. 对应环境变量:`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`。
  36. ## 工作方式
  37. - 每次调用都重新读取 `Library/Pipeline/.unity-pipeline-port`,取端口和 token,不缓存 token,也不写日志、不返回给模型。
  38. - 先检查端口文件里的 `pid` 进程是否存活,避免用旧的端口文件。
  39. - 请求头 `Authorization: Bearer <evalToken>`,只连 `127.0.0.1`,不带 `Origin` 头,不走代理。
  40. - 收到 401 时重新读文件并重试一次(Editor 重启后 token 会变)。
  41. - `unity_exec` 同一时刻只发一个请求(服务端本来就串行执行)。
  42. - 命令列表缓存 60 秒,Editor 重启后自动失效。

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.