feat(mcp): 实现 transpyc_mcp 服务器——stdio JSON-RPC 驱动 TPC/TPV

- transpyc_mcp/server.py:零依赖 MCP 服务器(initialize/tools/list/tools/call)
- 14 个工具按协议实现:tpc_build/tpc_build_file/tpc_run_test/tpc_run_regression/
  tpc_clean_project/tpc_clear_cache/tpc_rebuild_includes/tpv_build/tpv_bootstrap/
  tpv_compile_project/tpv_run_test/tp_read_ast/tp_read_log/tp_sha1_map
- 安全:路径白名单/命令白名单/工程串行锁/TPV 内存保护(>=1GiB)
- 输出统一 {ok, exit_code, stdout, stderr, artifacts, elapsed_ms},日志末尾 50 行
- 冒烟测试通过:init/tools-list/AST 解析/日志/越界拒绝/未知工具/锁
- 修正协议:--clean 为清理后继续完整编译(非独立清理)
This commit is contained in:
TermiNexus committed 2026-08-21 14:05:36 +08:00
1 parent e412885a3e
commit 004121de40
5 files changed
+595 -4

No files matched your search

+2 -2
View File
@@ -220,9 +220,9 @@ python Test/regression_test.py
- 说明:默认全量耗时较长;客户端应按需使用 `name` 过滤或分片调用。
### 6.5 tpc_clean_project — 清理工程产物
### 6.5 tpc_clean_project — 清理并编译工程
- description:清理工程 `output/` 与 `temp/`(`Projectrans.py --clean`)。
- description:执行 `Projectrans.py --clean`——先清理 `output/` 与 `temp/`,**随后仍继续完整编译流程**(`--clean` 是编译前置步骤,非独立清理命令)。等价 `tpc_build(clean=true)`,仅不含运行。
- inputSchema:`{ "project": {"type":"string"} }`,required: ["project"]。
- command:`python Projectrans.py --project <project> --clean`