feat(mcp): 增加游戏内方块调试桥接

新增 stdio MCP server 和 mcp 子命令,通过调试会话状态文件连接内置 TCP bridge,并提供 place_block 工具。

Bridge 将请求投递到服务端 System 的游戏线程执行,限制请求大小与队列长度,并按会话端口安全清理状态文件和连接。
This commit is contained in:
2026-07-21 21:04:45 +08:00
parent 94b1b9a1f5
commit 1a7bc6aca1
15 changed files with 1375 additions and 11 deletions

View File

@@ -18,4 +18,11 @@ def GET_DEBUG_IPC_PORT():
port = os.getenv("MCDEV_DEBUG_IPC_PORT")
if port is None:
return None
return int(port)
return int(port)
def GET_MCP_BRIDGE_STATE_PATH():
import os
path = os.getenv("MCDEV_MCP_BRIDGE_STATE")
if not path:
return None
return path