内容
# ABB RobotStudio MCP
[模型上下文协议](https://modelcontextprotocol.io) 服务器,用于 ABB RobotStudio 和 ABB 机器人控制器。
公开 **50 种工具**,跨越两种传输方式:
- **`rs_*`** — RobotStudio SDK 工具,通过一个小型 RobotStudio 加载项(`ClaudeBridge`)路由,该加载项在 RobotStudio 进程内运行一个 HTTP 监听器。用于检查/编辑工作站、目标、路径、模块、变量、IO 信号、控制器配置,以及驱动虚拟控制器仿真。
- **`rws_*`** — 机器人网络服务(REST)工具,直接与真实或虚拟的 ABB 控制器通信。用于电机开启/关闭、PP-to-main、程序启动/停止、IO 读取/写入、文件传输、主从控制、速度覆盖、事件日志等。
已针对 IRC5 和 OmniCore(CRB 15000 GoFa)进行测试。
## 安装
```bash
git clone https://github.com/eliasbitsch/abb-robotstudio-mcp.git
cd abb-robotstudio-mcp
npm install
npm run build
```
### 加载项(仅需用于 `rs_*` 工具)
针对 RobotStudio SDK(RobotStudio 2024+)编译 `addin/ClaudeBridge.csproj`,然后:
```powershell
./install-addin.ps1
```
这会将编译后的加载项复制到 RobotStudio 的加载项文件夹中。在下一次 RobotStudio 启动时,一个 HTTP 监听器将在 `http://localhost:58080` 处启动。
## 配置您的 MCP 客户端
Claude Code / Claude Desktop 示例(`mcp.json`):
```json
{
"mcpServers": {
"abb-robotstudio": {
"command": "node",
"args": ["C:/path/to/abb-robotstudio-mcp/dist/index.js"],
"env": {
"ABB_BRIDGE_URL": "http://localhost:58080",
"ABB_RWS_URL": "http://localhost:80",
"ABB_RWS_USER": "默认用户",
"ABB_RWS_PASS": "robotics"
}
}
}
}
```
| 环境变量 | 默认值 | 用途 |
|---|---|---|
| `ABB_BRIDGE_URL` | `http://localhost:58080` | RobotStudio 加载项 HTTP 监听器 |
| `ABB_RWS_URL` | `http://localhost:80` | 控制器 RWS 端点(对于真实机器人,请使用控制器的 IP 地址) |
| `ABB_RWS_USER` | `默认用户` | RWS 用户 |
| `ABB_RWS_PASS` | `robotics` | RWS 密码 |
对于真实的 GoFa,请将 `ABB_RWS_URL` 指向控制器(例如 `http://192.168.125.1`),并提供真实的凭证。
## 工具
### RobotStudio SDK (`rs_*`, 通过加载项)
`rs_ping`, `rs_get_station`, `rs_save_station`, `rs_get_station_objects`, `rs_get_tasks`,
`rs_get_paths`, `rs_get_path_targets`, `rs_create_target`, `rs_create_path`,
`rs_get_position`, `rs_check_collisions`,
`rs_get_modules`, `rs_read_module`, `rs_write_module`,
`rs_read_variable`, `rs_write_variable`,
`rs_read_config`, `rs_write_config`,
`rs_get_io_signals`, `rs_controller_status`,
`rs_start_simulation`, `rs_stop_simulation`, `rs_pause_simulation`,
`rs_reset_simulation`, `rs_simulation_status`, `rs_set_sim_speed`.
### 机器人网络服务 (`rws_*`, REST)
`rws_controller_status`, `rws_execution_state`, `rws_event_log`,
`rws_get_tasks`, `rws_get_modules`, `rws_read_module`, `rws_write_module`,
`rws_read_variable`, `rws_write_variable`, `rws_get_position`,
`rws_get_io_signals`, `rws_read_io`, `rws_write_io`,
`rws_set_motors`, `rws_reset_pp`, `rws_start_program`, `rws_stop_program`,
`rws_get_speed_override`, `rws_set_speed_override`,
`rws_request_mastership`, `rws_release_mastership`,
`rws_list_files`, `rws_read_file`, `rws_write_file`.
## 安全
这些工具可以移动真实的硬件(`rws_set_motors`, `rws_start_program`, `rws_write_*`)。只有在您了解这些工具可以执行的操作时,才将 `ABB_RWS_URL` 指向真实的控制器,并优先使用虚拟控制器进行开发。
## 许可证
MIT — 请参阅 [LICENSE](LICENSE)。