Files
TransPyC/MCP/tools/tools.json
T
TermiNexus e412885a3e docs(mcp): 新增 MCP 协议规范——规定如何通过 MCP 操作 TPV 与 TPC
- MCP/README.md:总览、目录、快速接入与命令速查
- MCP/protocol.md:14 个工具定义(tpc_/tpv_/tp_ 前缀)、执行约定、
  输出格式、安全约束、错误码
- MCP/tools/tools.json:可被客户端直接加载的工具 schema 集合
2026-08-21 14:00:43 +08:00

351 lines
7.6 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
[
{
"name": "tpc_build",
"description": "用 TransPyC 编译任意 Viper 工程(Projectrans.py --project,两阶段)",
"inputSchema": {
"type": "object",
"properties": {
"type": "string",
"description": "project.json 路径(相对根),如 Test/CoroTest/project.json",
"clean": {
"type": "boolean",
"default": false
},
"run": {
"type": "boolean",
"default": false
},
"phase": {
"type": "string",
"enum": [
"1",
"2",
"all"
],
"default": "all"
},
"rebuild_includes": {
"type": "boolean",
"default": false
},
"clear_cache": {
"type": "boolean",
"default": false
},
"asan": {
"type": "boolean",
"default": false
},
"nowarn_register": {
"type": "boolean",
"default": false
},
"src": {
"type": "string"
},
"temp": {
"type": "string"
},
"output": {
"type": "string"
},
"cc": {
"type": "string"
}
},
"required": [
"project"
]
}
},
{
"name": "tpc_build_file",
"description": "单文件 .vp → LLVM IR(TransPyC.py -f),可选链接运行",
"inputSchema": {
"type": "object",
"properties": {
"input": {
"type": "string",
"description": "输入 .vp 路径(相对根)"
},
"output": {
"type": "string",
"description": "输出 .ll 路径"
},
"run": {
"type": "boolean",
"default": false
},
"args": {
"type": "string"
},
"level": {
"type": "string"
},
"encoding": {
"type": "string",
"default": "utf-8"
},
"cc": {
"type": "string"
},
"cflags": {
"type": "string"
}
},
"required": [
"input",
"output"
]
}
},
{
"name": "tpc_run_test",
"description": "编译并运行单个 Test/<Name>(--clean --run)",
"inputSchema": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Test/ 下子目录名,如 CoroTest"
},
"rebuild_includes": {
"type": "boolean",
"default": false
},
"clear_cache": {
"type": "boolean",
"default": false
},
"asan": {
"type": "boolean",
"default": false
}
},
"required": [
"name"
]
}
},
{
"name": "tpc_run_regression",
"description": "全量回归(Test/regression_test.py)",
"inputSchema": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "可选过滤测试名"
},
"timeout": {
"type": "integer",
"default": 300
}
},
"required": []
}
},
{
"name": "tpc_clean_project",
"description": "清理工程 output/temp(--clean)",
"inputSchema": {
"type": "object",
"properties": {
"type": "string",
"description": "project.json 路径(相对根),如 Test/CoroTest/project.json"
},
"required": [
"project"
]
}
},
{
"name": "tpc_clear_cache",
"description": "清除全局 .transpyc_cache(--clear-cache)",
"inputSchema": {
"type": "object",
"properties": {
"type": "string",
"description": "project.json 路径(相对根),如 Test/CoroTest/project.json"
},
"required": [
"project"
]
}
},
{
"name": "tpc_rebuild_includes",
"description": "重建 includes.binary 预编译缓存(--rebuild-includes)",
"inputSchema": {
"type": "object",
"properties": {
"type": "string",
"description": "project.json 路径(相对根),如 Test/CoroTest/project.json"
},
"required": [
"project"
]
}
},
{
"name": "tpv_build",
"description": "TPC 编译 TransPyV → TransPyV/output/TransPyV.exe(Phase A)",
"inputSchema": {
"type": "object",
"properties": {
"clean": {
"type": "boolean",
"default": true
},
"rebuild_includes": {
"type": "boolean",
"default": true
},
"clear_cache": {
"type": "boolean",
"default": true
}
},
"required": []
}
},
{
"name": "tpv_bootstrap",
"description": "自举链 Phase A/B/C 验证并对比产物",
"inputSchema": {
"type": "object",
"properties": {
"phases": {
"type": "array",
"items": {
"type": "string",
"enum": [
"A",
"B",
"C"
]
},
"default": [
"A",
"B",
"C"
]
},
"compare": {
"type": "boolean",
"default": true
}
},
"required": []
}
},
{
"name": "tpv_compile_project",
"description": "用 TransPyV/output/TransPyV.exe 编译工程(参数同 tpc_build)",
"inputSchema": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "可选过滤测试名"
},
"timeout": {
"type": "integer",
"default": 300
}
},
"required": [
"project"
]
}
},
{
"name": "tpv_run_test",
"description": "运行 TransPyV/Test 自测(App/NegativeTest/Sha1Test)",
"inputSchema": {
"type": "object",
"properties": {
"suite": {
"type": "string",
"enum": [
"App",
"NegativeTest",
"Sha1Test",
"all"
],
"default": "all"
},
"filter": {
"type": "string"
}
},
"required": []
}
},
{
"name": "tp_read_ast",
"description": "解析 .vp 源码输出 vast AST dump",
"inputSchema": {
"type": "object",
"properties": {
"file": {
"type": "string",
"description": ".vp 源文件路径(相对根)"
},
"dump": {
"type": "string",
"enum": [
"compact",
"full"
],
"default": "compact"
}
},
"required": [
"file"
]
}
},
{
"name": "tp_read_log",
"description": "读取项目内文本文件末尾 N 行或正则过滤",
"inputSchema": {
"type": "object",
"properties": {
"file": {
"type": "string",
"description": "文件路径(相对根),如 1.log"
},
"lines": {
"type": "integer",
"default": 50
},
"pattern": {
"type": "string"
}
},
"required": [
"file"
]
}
},
{
"name": "tp_sha1_map",
"description": "读取工程 temp/_sha1_map.txt(诊断缓存命中)",
"inputSchema": {
"type": "object",
"properties": {
"project": {
"type": "string",
"description": "工程目录(相对根),如 Test/CoroTest"
},
"filter": {
"type": "string"
}
},
"required": [
"project"
]
}
}
]