HLORO-AI
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., "@HLORO-AI Move the arm to x=10, y=20, z=30"
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.
HLORO-AI控制助手 — 项目说明
版本: v0.3.0
一、项目概述
HLORO-AI控制助手 是一套基于 MCP (Model Context Protocol) 的工业机器人控制系统。通过 DeepSeek 大语言模型把自然语言翻译为机器人控制指令,控制 HRB400 三轴 SCARA 工业机械臂。
核心能力:
自然语言 → 机器人运动指令(DeepSeek V4 驱动)
PySide6 桌面 GUI(微信风格聊天界面)+ CLI 客户端
安全边界校验 + 急停锁机制
MCP Server:STDIO / HTTP / OAuth 2.1 三种传输模式
⚠️ 当前状态:
src/server.py目前固定运行 仿真模式(SimRobotArm)。仓库内含远程桥接(robot_bridge.py)与硬件适配器(robot_remote.py/robot_hardware.py),但尚未接入 server.py。下文的"远程控制"为目标架构,接线后生效。
Related MCP server: RobotArm MCP P340
二、系统架构
目标架构(远程控制,待接线)
Windows PC (192.168.1.100) Raspberry Pi (192.168.1.101)
┌────────────────────────────┐ HTTP ┌──────────────────────────┐
│ robot-assistant.exe │◄────────►│ robot_bridge.py │
│ ├─ GUI (PySide6) │ :3000 │ ├─ HTTPServer :3000 │
│ ├─ MCP Server (FastMCP) │ │ ├─ robot_lib 翻译层 │
│ ├─ RemoteRobotArm ⚠️未接入 │ │ └─ numpy→JSON 安全转换 │
│ └─ DeepSeek API (云端) │ │ ↓ │
└────────────────────────────┘ │ pi_share → CAN → HRB400│
└──────────────────────────┘当前实际链路(仿真)
GUI / CLI → STDIO → server.py (FastMCP) → SimRobotArm(内存状态)
↓
SafetyChecker 边界校验三、运行模式
模式 | 适配器 | 接线状态 |
sim(默认) |
| ✅ 已接入 server.py |
remote |
| ⚠️ 模块已开发,未接入 |
hardware |
| ⚠️ 模块已开发,未接入 |
三个适配器方法签名完全一致,接入 server.py 时按 ROBOT_MODE 选择即可,其余代码零改动。
四、项目文件结构
D:\mcp-robot-server\
├── main.py MCP Server 入口
├── robot_bridge.py ★ Pi 端桥接服务(零依赖 stdlib)⚠️ 未接入
├── build.spec PyInstaller 打包配置
├── config.yaml HRB400 工作范围 / 速度 / 硬件参数
├── .env 环境变量(ROBOT_MODE / BRIDGE_URL / DEEPSEEK_API_KEY)
├── .mcp.json Claude Code MCP 连接配置
│
├── src/
│ ├── server.py ★ FastMCP Server: 11 tools + 4 resources + 3 prompts
│ ├── robot.py SimRobotArm(仿真模式,当前唯一接入)
│ ├── robot_remote.py RemoteRobotArm(HTTP 远程桥接)⚠️ 未接入
│ ├── robot_hardware.py HRB400RobotArm(Pi 本地直连)⚠️ 未接入
│ ├── safety.py SafetyChecker 安全边界校验
│ ├── types.py Position / RobotStatus / ActionResult
│ ├── config.py AppConfig(config.yaml 驱动)
│ ├── logging.py 日志输出(stderr)
│ └── auth/ OAuth 2.1 授权(LocalJWT / Introspection)
│
├── gui/ PySide6 桌面端(聊天 + 状态面板)
├── client/ CLI 客户端(DeepSeek 驱动)
├── tests/ 单元测试(103 passed, 4 skipped)
├── dist/ robot-assistant.exe + HLORO-AI 部署包(未跟踪)
└── offline_mcp/ 离线安装 wheels(未跟踪)五、MCP 工具列表(11)
工具 | 参数 | 说明 |
| x, y, z, speed? | 绝对移动 (mm) |
| dx, dy, dz, speed? | 相对移动 (mm) |
| joint_id, angle | 单关节旋转 (°) |
| - | 回零 |
| - | 减速停止 |
| - | 急停 + 锁定 |
| - | 解除锁定 |
| - | 张开夹爪 |
| - | 夹紧夹爪 |
| - | 连接检测(只读) |
| - | 完整状态(只读) |
资源(4):robot-arm://status / //position / //config / //dashboard(HTML 仪表盘,3 秒自动刷新)
Prompt(3):robot-home / robot-status / robot-emergency
六、安全机制
层级 | 机制 |
坐标校验 | SafetyChecker(服务器端预检) |
速度校验 | 10 ~ 200 mm/s 范围限制 |
急停锁 | 软件 |
工具注解 |
|
错误码 | 标准 JSON-RPC 错误码(-32602 参数 / -32603 内部 / -32000 急停锁) |
OAuth | HTTP 模式可选 Bearer token 验证(Local JWT / RFC 7662 Introspection) |
七、测试
cd D:\mcp-robot-server
uv run pytest tests/ -v # 103 passed, 4 skipped测试覆盖:仿真机械臂(test_robot.py)、安全边界(test_safety.py)、MCP 集成(test_server.py)、OAuth(test_auth.py)、HTTP+OAuth 端到端(test_http_server.py)、客户端(test_client.py)、硬件适配器(test_robot_hardware.py,需 pi_share 环境)。
八、Pi 端部署(目标架构,待接线)
robot_bridge.py
位置:Pi 上 /home/hr400/robot_bridge.py
依赖:仅 pi_share 项目的 .venv(无需额外安装)
功能:监听 0.0.0.0:3000,接收 JSON-RPC 调用,翻译为 robot_lib API 调用,自动转换坐标单位(m ↔ mm),numpy 数组安全转 JSON。
启动:
/home/hr400/HRobotStudiov1.0-rc.2/.venv/bin/python3 /home/hr400/robot_bridge.py启动成功输出:
Robot Bridge -> 0.0.0.0:3000
pi_share: /home/hr400/HRobotStudiov1.0-rc.2
robot online: True开机自启(可选)
sudo nano /etc/systemd/system/robot-bridge.service[Unit]
Description=HLORO Robot Bridge
After=network.target
[Service]
Type=simple
User=hr400
ExecStart=/home/hr400/HRobotStudiov1.0-rc.2/.venv/bin/python3 /home/hr400/robot_bridge.py
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.targetsudo systemctl enable robot-bridge
sudo systemctl start robot-bridge九、Windows 端启动
方式一:直接运行 exe
双击 dist\robot-assistant.exe
方式二:源码运行
cd D:\mcp-robot-server
uv run python gui/main.py # GUI 桌面端
uv run python main.py # MCP Server(STDIO)
uv run robot-client # CLI 客户端注意:源码运行时 server 为仿真模式,
get_status返回内存中的模拟位置。接入真实机械臂需先完成"运行模式"接线。
十、常见问题
问题 | 解决 |
GUI 无法连接服务端 | 检查服务端是否能启动: |
位置数据全为 0 | 仿真模式正常现象;接真机需接线远程适配器 |
DeepSeek API 错误 | 检查 |
打包 exe |
|
测试失败 | 确认 |
十一、依赖清单
Windows 端(uv):httpx, mcp[cli], openai, pyjwt, python-dotenv, pyyaml, pyside6, pyinstaller, numpy
Pi 端(robot_bridge.py):仅需 pi_share 项目已有的 .venv,无需额外安装。
Available Tools
14 toolsemergency_stop紧急停止ADestructiveIdempotent
紧急停止 — 立即切断动力并锁定所有运动。返回确认信息。
此操作不可逆地锁定机械臂(destructiveHint=true)。锁定后所有运动指令被拒绝,直到调用 unlock 解除。与 stop 不同: stop 只是减速,不锁定,之后可以直接移动。用户说「停下!」「急停!」「STOP!」时应使用此工具。
Inputs: no named parameters. Returns: result
get_status获取状态ARead-onlyIdempotent
获取机械臂完整状态快照: 位置 (X/Y/Z)、速度、运动状态、错误码。
这是只读操作 (readOnlyHint=true),不产生任何移动。用于移动前确认起始位置、移动后验证目标位置、或计算可用行程。如果只需确认连接,用 ping(更轻量)。
Inputs: no named parameters. Returns: result
gripper_close夹紧夹爪AIdempotent
夹紧夹爪。返回确认信息。
急停锁定状态下会被拒绝。夹爪操作前建议确认机械臂已停止移动。气动夹爪,M62.0 张开 / M62.1 夹紧,互斥控制。
Inputs: no named parameters. Returns: result
gripper_open张开夹爪AIdempotent
张开夹爪。返回确认信息。
急停锁定状态下会被拒绝。夹爪操作前建议确认机械臂已停止移动。气动夹爪,M62.0 张开 / M62.1 夹紧,互斥控制。
Inputs: no named parameters. Returns: result
home回零AIdempotent
所有轴回到原点 (0, 0, 0),然后自动移动到 Y=-180 安全位置。
回零是瞬间操作(仿真模式),不需要 unlock(与急停不同)。如需平滑减速而不回零,用 stop。
Inputs: no named parameters. Returns: result
move_joint关节旋转AIdempotent
控制单个关节旋转到指定角度 (°)。joint_id 范围 0~2。返回关节 ID 和目标角度的确认信息。
此工具仅改变关节角度,不影响末端笛卡尔坐标的其他轴。如需移动末端到指定空间位置,用 move_to 或 move_relative。
Inputs: angle (required), joint_id (required). Returns: result
move_relative相对移动A
相对当前位置偏移移动机械臂末端 (mm)。返回目标坐标和速度的确认信息。
dx: +右 −左 | dy: +前 −后 | dz: +上 −下 这是最常用的移动工具。用户说「向右 100mm」→ dx=100。 speed 范围 [10, 200] mm/s,不传则用默认 100
如果要移动到固定坐标,用 move_to。如果只是查询位置,用 get_status(只读)。
Inputs: dx (required), dy (required), dz (required), speed. Returns: result
move_to绝对移动AIdempotent
将机械臂末端移动到指定笛卡尔绝对坐标 (mm)。返回目标坐标和速度的确认信息。
X: +右 −左 | Y: +前 −后 | Z: +上 −下 X 范围 [-300, 300] Y 范围 [-300, 300] Z 范围 [50, 200] speed 范围 [10, 200] mm/s,不传则用默认 100
如果要基于当前位置偏移,用 move_relative。如果只是查询位置,用 get_status(只读)。
Inputs: x (required), y (required), z (required), speed. Returns: result
ping连接检测ARead-onlyIdempotent
检查机械臂是否在线。返回 pong 和当前位置。
这是只读操作 (readOnlyHint=true),无任何副作用。用于快速确认连接状态。如需完整状态(速度/运动/错误码),用 get_status。
Inputs: no named parameters. Returns: result
read_position_data读取视觉定位数据ARead-onlyIdempotent
读取外部视觉系统输出的物料定位文件,返回最新一次扫描检测到的物体。
文件格式: 时间戳(颜色:X;Y);(颜色:X;Y);...,一行可有多个物体,每次扫描追加一行。始终只返回最新时间戳的数据。
参数: color: 可选,过滤指定颜色 (如 "红色"/"蓝色"/"绿色"),不传则返回全部
返回每个物体的颜色、世界坐标 (X/Y mm)、检测时间戳。 典型用法 — 配合 move_to 完成抓取:
read_position_data() → 获取最新物料坐标
move_to(x=202, y=-19, z=50) → 移动到物料上方
move_relative(dz=-30) → 下降 → gripper_close → move_relative(dz=50) → 抓起
Inputs: color. Returns: result
send_calibration发送标定参数A
向海康视觉主机发送衍射标定参数 (B;x;y;r)。
x, y: 标定点坐标 (mm),r: 标定角度。用于校正视觉检测的坐标映射关系。
Inputs: r (required), x (required), y (required). Returns: result
stop减速停止AIdempotent
减速停止 — 保持动力,平滑停止。不锁定机械臂。返回确认信息。
与 emergency_stop 的区别: stop 不锁定,之后可以直接移动。紧急情况下用 emergency_stop,正常停车用 stop。
Inputs: no named parameters. Returns: result
trigger_vision触发视觉检测A
向海康视觉主机发送触发指令(默认 'yanshe' 衍射检测模式)。海康收到后拍照分析,结果写入 position_info_23_0.txt。
触发后等待 1-2 秒再调用 read_position_data 读取最新结果。如需发送标定参数,用 send_calibration。
Inputs: no named parameters. Returns: result
unlock解除锁定AIdempotent
解除 emergency_stop 造成的锁定,恢复运动能力。返回解锁确认。
仅对急停锁定有效。如果未锁定则无操作(幂等)。解除后可以正常使用所有运动工具。
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Each tool has a clear, distinct purpose: absolute/relative/joint movement, safety stop variants, gripper control, vision trigger/read, and status queries. Potentially overlapping tools like stop vs. emergency_stop and ping vs. get_status are explicitly differentiated with detailed descriptions.
Most tools follow a verb_noun pattern (move_to, read_position_data, get_status), but there are deviations like single-word verbs (ping, stop, home), noun-verb compounds (gripper_open, gripper_close), and the compound emergency_stop. The naming is readable but not perfectly uniform.
14 tools is well-scoped for a robot arm control server, covering movement, safety, gripper, status, and vision integration. Each tool serves a distinct function without unnecessary redundancy.
The tool surface covers the full lifecycle: absolute and relative motion, joint control, emergency and normal stops, unlocking, gripper open/close, status monitoring, and vision triggering/reading. The workflow for vision-guided pick-and-place is well supported with no obvious dead ends.
Maintenance
Related MCP Connectors
MCP server for generating rough-draft project plans from natural-language prompts.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
MCP server that lets your AI assistant build and deploy apps, hosting each one at a live URL.
Related MCP Servers
- FlicenseCqualityCmaintenanceA Model Context Protocol server that enables natural language interactive control of Universal Robots collaborative robots, allowing users to control robot motion, monitor status, and execute programs through direct commands to large language models.398-
- AlicenseNot gradedqualityDmaintenanceEnables natural language control of ElephantRobotics MyCobot series robotic arms (especially ultraArmP340) through MCP protocol, with simulation mode and safety features.38MIT

Robonine MCP Serverofficial
AlicenseAqualityDmaintenanceA local MCP server that connects Claude Code or any MCP-compatible AI assistant to a Robonine robot arm.1MIT- AlicenseAqualityBmaintenanceDrive open-source Gearotons M17 servomotors from natural language via an MCP server with safety rails and a mock backend.57MIT