t32-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@t32-mcp start a TRACE32 session and show the target status"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
t32-mcp
An MCP server for Lauterbach TRACE32, enabling AI agents to inspect embedded targets, run PRACTICE scripts, and control execution.
面向 Windows 的 MCP 服务端。Agent 可以启动或连接 Lauterbach TRACE32 PowerView,执行调试命令、运行 PRACTICE 脚本并读取窗口输出。
能解决什么
命令batch和脚本可返回失败位置、PowerView 的诊断,以及从本机手册查到的语法提示。
view通过 PowerView 的打印接口导出窗口。超过回包长度时会给出本地结果路径。长操作返回操作编号,供后续查询。同步调用超过期限时,服务可终止自己启动的 PowerView 并报告会话状态。
Related MCP server: trace32-mcp
安装
下载源码,在项目目录运行,Python版本要求为3.12或更高。
python --version
python -m venv .venv
.\.venv\Scripts\python.exe -m pip install -e .
.\.venv\Scripts\python.exe -m t32_mcp --help使用
在 MCP 客户端中添加 t32 的 stdio 服务。如果客户端使用 mcpServers,示例如下。见配置模板。
{
"mcpServers": {
"t32": {
"command": "C:/path/to/t32-mcp/.venv/Scripts/python.exe",
"args": ["-m", "t32_mcp", "--sys", "C:/T32"]
}
}
}command 指向.venv安装的 python.exe。路径可在根目录执行指令获得。
(Resolve-Path .\.venv\Scripts\python.exe).Path.Replace('\', '/')C:/T32 改为实际的 TRACE32 安装目录,无参数默认值为 C:\T32,可由T32SYS环境变量覆盖。
工具
工具 | 用途 |
| 启动 PowerView,或Attach到当前已运行实例 |
| 版本、探头、License、目标状态、各目录路径 |
| 关闭,或把 PowerView 留给用户 |
| 执行 PRACTICE 命令 |
| 批量求值 PRACTICE 函数 |
| 运行 |
| 读 T32 窗口 |
| 运行控制,等到目标停下 |
| 查手册:给名字返回语法,给几个词返回候选,不需要会话 |
| 继续等待未结束的操作 |
| 取消等待或中止操作 |
三种连接
usb:在探头上启动一台 PowerView,窗口可见,你可以旁观。sim:启动指令集模拟器,有空闲探头时用探头授权。attach:连上你已经开着的 PowerView,默认只读。
Attach时如果 PowerView 没开 API,在命令行输入:
SETUP.API.RCL.Enable /PRotocol TCP /Port AUTO /RemoteHost DENY不用重启,也不影响已经连着的目标。端口由服务端自己查找。
运行记录
从源码安装时,会话文件放在本仓库的 tmp/sessions/。安装 wheel 时,目录在虚拟环境的 t32_mcp/tmp/sessions/ 下。MCP 和 PowerView 都需要能读写这个位置。每个会话一个子目录,保留最近 20 个:
journal.jsonl记录操作开始、参数和已取得的结果。进程意外退出时,最后一次操作可能只有开始记录。view-<op>.txt保存 PowerView 导出的窗口内容。script-<op>.cmm、script-<op>.log:脚本和它的输出。
测试
.venv\Scripts\python -m pip install "pytest>=8"
.venv\Scripts\python -m pytest # 默认离线,包含模拟的板级与 Trace 场景
.venv\Scripts\python -m pytest -m hw # 运行需要 PowerView 和探头的集成测试
.venv\Scripts\python tools\mutation_check.py # 离线变异检查
.venv\Scripts\python tools\mutation_check.py --live # 也运行需要 PowerView 的变异检查板级与 Trace 场景在 RAPI 边界提供模拟响应,用实际的服务代码验证运行控制、错误传播和结果交付。默认测试可在没有探头或实验固件的环境中运行。
hw集成测试用于配有一台空闲 PowerDebug 的独占测试台。它们会启动真实 PowerView,部分用例会终止测试进程并验证探头恢复。检查特定版本的窗口导出时,使用自己的匹配 ELF 和 Trace 归档。运行
python tools/window_sweep.py --help可查看参数。
许可证
本项目采用 MIT 许可证。运行实机调试需要另行安装并授权 Lauterbach TRACE32。
Available Tools
11 toolscommandADestructive
Run PRACTICE commands in order. Stops at the first failure and reports what ran.
OK means TRACE32 accepted the command, so read settings back with evaluate. Use script for DO, session_close for QUIT, and run for Go when you need to wait for the target to stop. Commands can execute host programs through OS.Command. Wait for this reply before calling run: calls sent together run even if the setup failed.
Inputs: lines (required), wait_s, deadline_s, stop_on_error.
evaluateARead-only
Evaluate PRACTICE functions, for example Register(PC), Data.Long(D:0x20000000), Var.VALUE(counter), Trace.RECORDS(). Each expression succeeds or fails on its own, so pass everything you need in one call. An expression that calls a target function runs it on the target.
Inputs: expressions (required).
manualARead-only
Look something up in the TRACE32 manuals installed here. Give a name for its syntax, options and subcommands, or a few English words for candidates: Break.Set, Data.Long, PERF, flash programming. Add the target when a page differs by target: SYStem.MemAccess cortexm. An RTOS name alone lists its commands and setup: freertos. Needs no session. The manuals cover every target, so a name found here may not exist on yours: PRACTICE.CoMmanD.AVAILable() and PRACTICE.FUNCtion.AVAILable() tell.
Inputs: query (required).
operation_cancelA
Cancel an operation. A queued one is dropped, a script is stopped, a run stops waiting and leaves the target running. A blocked command can only be ended with kill=true, which kills PowerView and loses target state.
Inputs: operation (required), kill.
operation_getARead-only
Wait for an operation that replied Running, and return its final reply. Finished operations return the same reply again.
Inputs: operation (required), wait_s.
runA
Control the target: go, step, step_over, go_up, go_return, break. go waits until the target stops, also when it is already running. break stops the target now, wherever it is, so to wait for a breakpoint use go, not break. With until, go runs to that address and the reply says whether it got there. Reaching the deadline leaves the target running: nothing stops it for you.
Inputs: action (required), until, wait_s, deadline_s.
scriptADestructive
Run a PRACTICE script from a file or from text and wait for it to end. Output from PRINT is returned. If it stops on an error the reply gives the failing command, and commands before it have already taken effect. A script that opens a dialog cannot continue, because nobody can click it.
Inputs: args, path, text, wait_s, +1 more.
session_closeA
End the session. A PowerView started here quits, unless leave_running is true, which hands it to the user. An attached PowerView is only disconnected.
Inputs: leave_running.
session_openA
Start or join a TRACE32 PowerView. Connects only: it does not reset, download or run.
connection:
usb: start a PowerView on the probe.
sim: start the instruction set simulator, licensed by the probe when one is free.
attach: join a PowerView the user already opened. Read-only unless access="control". Open it read-only and look first. Stopping the target or writing to it changes what the user is debugging, so ask the user before asking for control.
Installed targets: none found. TRACE32 directory: C:\T32.
Inputs: port, access, serial, target, +2 more.
session_statusARead-only
Report the session: PowerView version, probe, license, CPU, target state, script depth, and the demo, manual and session directories. Works while an operation is blocked.
Inputs: no named parameters.
viewARead-only
Read a TRACE32 window as text, for example Register.view, Frame.view /Locals /Caller, Data.dump D:0x20000000++0xFF, Break.List, Trace.STATistic.Func, TASK.List.tasks, PER.view. Output past max_chars stays in a file, and its path is in the reply.
Use full command names. Only display windows are accepted; for anything else use command with PRinTer.FILE and WinPrint.
Give Trace.List a record range such as Trace.List (-1000.)--(-1.): a full list can be gigabytes. Reading PER windows can touch registers that have read side effects.
Inputs: window (required), format, max_chars, deadline_s.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
The tools have mostly distinct purposes: session lifecycle, command execution, expression evaluation, script running, window reading, target control, manual lookup, and async operation management. There is some conceptual overlap between command, script, evaluate, and run since all interact with the debugger, but the descriptions draw clear boundaries (e.g. use script for DO, read settings back with evaluate, use go not break to wait). An agent can reliably pick the right tool.
There are recognizable prefix groups (session_status/session_open/session_close, operation_get/operation_cancel), but the remaining tools are bare verbs or nouns (command, evaluate, script, view, run, manual) with no consistent verb_noun pattern. The conventions are mixed, though all names are readable and unambiguous in context.
Eleven tools is well within the ideal 3-15 range and each tool earns its place: session management, core execution primitives, manual lookup, and async operation handling. The surface is neither bloated nor thin for a debugger-control server.
The surface covers the full session lifecycle (open/status/close), command and script execution, expression evaluation, window reading, target control (go/step/break), manual lookup, and async operation get/cancel. Minor gaps exist in dedicated breakpoint, memory-write, and register tools, but these are largely reachable through command, evaluate, and view, so no major dead ends remain.
Related MCP Connectors
Connect ChatGPT, Claude, Cursor or VS Code to your Windows PC: files, terminal, browser, apps.
Live browser debugging for AI assistants — DOM, console, network via MCP.
Build, run, inspect, and continue AgentScript workflows on connected Super Chrome and Mac clients.
Protocol-native energy infrastructure orchestration for AI data centers. Provides 46 MCP tools across 8 grid protocols (IEC-61850, DNP3, Modbus, OCPP, OpenADR, IEEE 2030.5, IEC 60870-5-104, ICCP) with 5 core API primitives: connect, dispatch, settle, comply, and intel. Enables AI agents to programmatically interact with substations, grid interfaces, and energy assets for real-time workload-grid coordination.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables AI agents to debug embedded systems by providing a comprehensive interface for GDB operations across multiple architectures like ARM and x86. It supports remote debugging via gdbserver or QEMU, allowing for detailed inspection of memory, registers, stack frames, and variables.31-
- AlicenseNot gradedqualityDmaintenanceAI-driven interface for Lauterbach TRACE32 PowerView debugging, inspection, and scripting via remote API.MIT
- AlicenseAqualityCmaintenanceMCP server bridging Lauterbach TRACE32 debuggers to AI agents for autonomous debugging, providing 47 tools for execution control, breakpoints, memory, registers, variables, and symbol inspection.1010014MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to control TriCore/AURIX debug sessions, including workspace loading, target connection, flashing, run control, breakpoints, and reading variables, registers, memory, and call stacks via the UDE Object Model.1MIT