J-Link RTT Viewer MCP
Enables AI assistants to interact with STM32 development boards via J-Link debugger using RTT communication, supporting connection, logging, memory operations, and firmware flashing through natural language.
README
J-Link RTT Viewer MCP Server
English
An MCP (Model Context Protocol) server that wraps J-Link RTT Viewer functionality, enabling AI assistants to interact with STM32 development boards through a standardized interface.
What is MCP?
MCP is like a USB-C port for AI applications. It provides a standardized way for AI assistants (Claude, ChatGPT, etc.) to connect to external systems like J-Link debuggers.
Quick Start
1. Install
git clone https://github.com/MisakaMikoto128/J-Link-RTT-Viewer-MCP.git
cd J-Link-RTT-Viewer-MCP
# Create virtual environment (recommended)
python -m venv .venv
.venv\Scripts\activate # Windows
# source .venv/bin/activate # Linux/Mac
# Option A: Simple install (recommended for users)
pip install -r requirements.txt
# Option B: Development install (for contributors)
pip install -e ".[dev]"
Prerequisites: Python 3.10+, J-Link drivers installed
2. Configure in Claude Desktop
Add to %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"jlink-rtt": {
"command": "python",
"args": ["-m", "src.server"],
"cwd": "C:\\path\\to\\J-Link-RTT-Viewer-MCP"
}
}
}
3. Restart Claude Desktop
4. Use natural language!
That's it! No code required. Just talk to Claude:
You: Connect to my STM32F103C8 board
Claude: [calls connect tool] Connected successfully!
You: Read the RTT logs
Claude: [calls read_rtt tool] Here are the logs...
You: Make the LED blink faster
Claude: [calls write_rtt tool with "freq 200"] Done!
You: Flash the new firmware
Claude: [calls flash_firmware tool] Firmware flashed successfully!
Available Tools
| Tool | What it does |
|---|---|
connect |
Connect to J-Link and target MCU |
disconnect |
Disconnect from J-Link |
read_rtt |
Read RTT log data |
write_rtt |
Write data to RTT channel |
set_rtt_channel |
Set default RTT channel (0-15) |
reset |
Reset MCU (normal/auto_reconnect/halt) |
get_device_info |
Get connected device info |
flash_firmware |
Flash .hex or .bin firmware |
read_memory |
Read MCU memory |
write_memory |
Write MCU memory |
start_log_recording |
Record RTT to file |
stop_log_recording |
Stop recording |
Test with MCP Inspector
npx @modelcontextprotocol/inspector -- python -m src.server
Supported Hardware
- Debugger: SEGGER J-Link (V7, V8, V9, V10)
- MCU: STM32F1xx, STM32F4xx, nRF52xxx
- Interface: SWD, JTAG
Development
# Run tests
pytest tests/ -v
# Lint
ruff check src/
# Type check
mypy src/ --ignore-missing-imports
License
MIT License
中文
一个封装 J-Link RTT Viewer 功能的 MCP 服务器,使 AI 助手能够通过标准化接口与 STM32 开发板进行交互。
什么是 MCP?
MCP 就像 AI 应用的 USB-C 接口。它为 AI 助手(Claude、ChatGPT 等)提供了一种标准化的方式来连接外部系统,如 J-Link 调试器。
快速开始
1. 安装
git clone https://github.com/MisakaMikoto128/J-Link-RTT-Viewer-MCP.git
cd J-Link-RTT-Viewer-MCP
# 创建虚拟环境(推荐)
python -m venv .venv
.venv\Scripts\activate # Windows
# source .venv/bin/activate # Linux/Mac
# 方式 A:简单安装(推荐用户使用)
pip install -r requirements.txt
# 方式 B:开发安装(贡献者使用)
pip install -e ".[dev]"
前置条件: Python 3.10+, 已安装 J-Link 驱动
2. 在 Claude Desktop 中配置
添加到 %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"jlink-rtt": {
"command": "python",
"args": ["-m", "src.server"],
"cwd": "C:\\path\\to\\J-Link-RTT-Viewer-MCP"
}
}
}
3. 重启 Claude Desktop
4. 用自然语言对话!
就这样!不需要写代码。直接和 Claude 对话:
你: 连接到我的 STM32F103C8 开发板
Claude: [调用 connect 工具] 连接成功!
你: 读取 RTT 日志
Claude: [调用 read_rtt 工具] 这是日志数据...
你: 让 LED 闪烁更快
Claude: [调用 write_rtt 工具,参数 "freq 200"] 完成!
你: 烧录新固件
Claude: [调用 flash_firmware 工具] 固件烧录成功!
可用工具
| 工具 | 功能 |
|---|---|
connect |
连接 J-Link 和目标 MCU |
disconnect |
断开 J-Link 连接 |
read_rtt |
读取 RTT 日志数据 |
write_rtt |
向 RTT 通道写入数据 |
set_rtt_channel |
设置默认 RTT 通道 (0-15) |
reset |
重置 MCU (normal/auto_reconnect/halt) |
get_device_info |
获取已连接设备信息 |
flash_firmware |
烧录 .hex 或 .bin 固件 |
read_memory |
读取 MCU 内存 |
write_memory |
写入 MCU 内存 |
start_log_recording |
录制 RTT 到文件 |
stop_log_recording |
停止录制 |
使用 MCP Inspector 测试
npx @modelcontextprotocol/inspector -- python -m src.server
支持的硬件
- 调试器: SEGGER J-Link (V7, V8, V9, V10)
- MCU: STM32F1xx, STM32F4xx, nRF52xxx
- 接口: SWD, JTAG
开发
# 运行测试
pytest tests/ -v
# 代码检查
ruff check src/
# 类型检查
mypy src/ --ignore-missing-imports
许可证
MIT 许可证
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。