MCP Server for Segger RTT via J-Link
Click on "Install 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., "@MCP Server for Segger RTT via J-Linkread the RTT data from the target device"
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.
MCP Server for Segger RTT via J-Link
An MCP server that provides access to Segger RTT (Real Time Transfer) through a J-Link debugger. This allows an LLM (like Claude) to interact with embedded devices by reading and writing RTT data.
Features
RTT Read: Read output from embedded devices through RTT up-buffer
RTT Write: Send commands to embedded devices through RTT down-buffer
J-Link Management: Connect/disconnect J-Link debuggers, list available devices
Real-time Display: RTT data is continuously printed to terminal while monitoring
Ring Buffer: Recent RTT data is accumulated for reading by the LLM
Related MCP server: MCP Serial Port Tool
Prerequisites
Python 3.10+
SEGGER J-Link Software installed (provides
JLinkARM.dll/libjlinkarm.so)A J-Link compatible debugger
Target device running SEGGER RTT
Installation
# Clone or navigate to this directory
cd mcp-rtt-server
# Install dependencies
pip install -e .Usage
Step 1: 安装
cd mcp-rtt-server
pip install -e .Step 2: 启动 MCP Inspector(调试/测试用)
终端 A — 启动 MCP 服务器:
npx @modelcontextprotocol/inspector python -m mcp_rtt_server.server启动后会输出一个本地网址(如 http://localhost:6274/?...),在浏览器打开。
终端 B — 实时查看 RTT 数据:
# PowerShell
Get-Content .\rtt_output.log -Wait# Git Bash / WSL
tail -f ./rtt_output.logStep 3: 使用工具
在浏览器 Inspector 中按顺序调用:
jlink_connect— 连接 J-Link 和目标设备,启动 RTT 监控rtt_read— 读取设备发送的 RTT 数据rtt_write— 向设备发送数据(需固件支持接收)jlink_status— 查看连接状态和缓冲区信息jlink_disconnect— 断开连接
Claude Code 集成
在项目 .claude/settings.json 中添加:
{
"mcpServers": {
"rtt": {
"command": "python",
"args": ["-m", "mcp_rtt_server.server"],
"cwd": "."
}
}
}注意:将
python替换为你的 Python 解释器实际路径(如C:\Python313\python.exe)。
重启 Claude Code 会话后,可直接用自然语言与设备交互,例如:
"连接 RTT 读取设备数据"
"查看设备状态"
Claude Desktop 集成
编辑 %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"rtt": {
"command": "python",
"args": ["-m", "mcp_rtt_server.server"],
"cwd": "."
}
}
}注意:
cwd需要改为本项目的实际绝对路径,因为 Claude Desktop 不会自动定位到项目目录。
Available Tools
Tool | Description |
| Connect to J-Link and start RTT monitoring |
| Disconnect from J-Link |
| Get connection status and buffer info |
| List available J-Link devices |
| Read accumulated RTT data |
| Write data to RTT down-buffer |
| Clear the RTT ring buffer |
Example Session
> jlink_connect(device="HC32L19x")
Connected to J-Link device 'HC32L19x' (serial: 12345678, speed: 4000 kHz)
RTT monitoring started on channel 0
> rtt_read()
[OSAL] HC32L19x OSAL starting...
[RTT] SEGGER RTT initialized
[OSAL] Registering tasks...
[OSAL] Starting scheduler...
> rtt_write(channel=0, data="status\r\n")
Wrote 7 bytes to RTT channel 0Architecture
┌─────────────────┐ stdio (JSON-RPC) ┌─────────────────┐
│ Claude / │ ◄──────────────────────► │ MCP RTT Server │
│ MCP Client │ │ (Python) │
└─────────────────┘ └────────┬────────┘
│
pylink │
▼
┌─────────────────┐
│ JLinkARM.dll │
└────────┬────────┘
│ USB
▼
┌─────────────────┐
│ J-Link Probe │
└────────┬────────┘
│ SWD/JTAG
▼
┌─────────────────┐
│ Target Device │
│ (HC32L19x) │
│ SEGGER RTT │
└─────────────────┘Environment Variables
Variable | Default | Description |
| (none) | J-Link serial number |
|
| Target device name |
|
| SWD speed in kHz |
|
| Default RTT channel |
|
| Ring buffer entries |
|
| Poll interval in ms |
Troubleshooting
"J-Link not found"
Make sure J-Link software is installed
Check that J-Link is connected via USB
Try running as administrator/root
"Device not supported"
Check if the device name is correct
Try using
rtt_list_devicesto see available probesVerify the target is connected and powered
"RTT not initialized"
Make sure the target firmware calls
SEGGER_RTT_Init()Check that RTT buffers are configured in
SEGGER_RTT_Conf.h
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ForeverJin/rtt_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server