dsh-unity-debug-bridge
MCP server for debugging Unity Editor managed code, supporting attach, breakpoints, stepping, call stack inspection, and read-only evaluation.
README
dsh-unity-debug-bridge
DSH ↔ Unity Editor 断点调试桥:以 MCP server(stdio) 形式,把 Unity Editor 托管代码(Mono)的调试能力暴露给 DSH agent —— 附加到编辑器、下断点、单步、读调用栈、只读求值。
能力
| 工具 | 说明 |
|---|---|
unity_attach |
附加到 Unity Editor(读 Library/EditorInstance.json 自动发现进程与端口) |
unity_set_breakpoint / unity_continue |
断点;continue 阻塞到命中返回 stopped;resumeAfterStop=true 时命中后自动放行(AI 模式),默认停住(人看模式) |
unity_step / unity_step_in / unity_step_out / unity_pause |
单步与暂停 |
unity_stack / unity_scopes / unity_variables |
调用栈与变量 |
unity_evaluate |
只读求值(context=watch,禁止改状态) |
unity_status / unity_detach |
会话状态与清理 |
前置条件
- Node.js ≥ 18
- Unity Editor(已打开目标项目),脚本调试已启用(见下)
- DAP adapter:从 Unity-Technologies/vscode-unity-debug master 分支源码构建(2019 年的 Release 二进制不支持 Unity 2022.3),见 docs/adapter-contract.md
安装到 DSH
node install.mjs
# 然后重启 DSH,/mcp 面板出现 unity-debug-bridge(13 个 unity_* 工具)
或在 DSH 的 MCP 设置里手动添加 stdio 服务器:
- insert:
- id: mcp-unity-debug-bridge
name: "@deepseek-ai/dsh-mcp-client"
config:
serverName: unity-debug-bridge
transport: stdio
command: node
args: ["<本包路径>/server/mcp-server-stdio.mjs"]
cwd: "<本包路径>"
toolCallTimeoutMs: 120000
使用要点(踩坑实录,务必读)
- 会话必须干净结束、可反复 attach:Unity 2022.3 调试 agent 在会话被粗暴中断(kill adapter)后会拒绝后续 attach(连接后无握手,静默失败),只能重启编辑器恢复。只要通过
unity_detach(优雅断开)结束会话,同一编辑器可反复 attach,无需重启。 - 不要做 TCP 预检:任何多余连接(connect+close)都会破坏 agent 状态;查端口用 netstat。不要用 ping 类工具去连调试端口。
- EditorAttach 偏好:
EditorPrefs "EditorAttach"=true必须在编辑器启动前已持久化(运行时设置无效),否则调试 agent 不监听。可在编辑器内执行一次EditorPrefs.SetBool("EditorAttach", true)后重启编辑器。 - 调试端口:Editor 调试端口 =
56000 + process_id % 1000(process_id来自<project>/Library/EditorInstance.json),不是固定 56000。 - DAP 传输:Content-Length 帧(非逐行 JSON);该 adapter 不支持
configurationDone请求。
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.