RegenNexus MCP服务器
MCP(模型上下文协议)服务器适配器 UAP RegenNexus -实现AI控制的硬件。
该软件包将RegenNexus硬件功能作为MCP工具公开,允许Claude Code、Claude Desktop和其他兼容MCP的AI客户端控制物理设备。
特性
- 硬件控制:GPIO、PWM、机械臂、传感器、摄像头
- 网状网络:通过局域网发现节点并与节点通信(UDP/WebSocket)
- 串行/I2C:与微控制器和传感器通信
- 两种连接模式:本地(直接导入)或远程(HTTP API)
- 自动发现:自动检测已安装的RegenNexus和网格节点
- MCP兼容:与Claude、Codex、Gemini和任何MCP客户合作
安装
# MCP server only (for remote UAP connection)
pip install regennexus-mcp
# With local UAP support
pip install regennexus-mcp[local]
# With remote API support
pip install regennexus-mcp[remote]
# Everything
pip install regennexus-mcp[all]快速开始
1.配置克劳德代码
添加到您的Claude Code MCP设置中:
{
"mcpServers": {
"regennexus": {
"command": "regennexus-mcp"
}
}
}2.与Claude一起使用
配置后,Claude可以控制硬件:
User: "List all connected devices"
Claude: [calls list_devices tool]
User: "Turn on GPIO pin 18"
Claude: [calls gpio_write with pin=18, value=1]
User: "Move the robot arm to position [0, 45, -30, 0, 60, 0, 0]"
Claude: [calls robot_arm_move with positions]配置
通过环境变量进行配置:
# Connection mode: auto, local, or remote
REGENNEXUS_MODE=auto
# Remote mode settings
REGENNEXUS_ENDPOINT=https://your-uap-server.com
REGENNEXUS_API_KEY=your-api-key
# Local mode settings
REGENNEXUS_CONFIG=/path/to/regennexus-config.yaml
# Logging
REGENNEXUS_LOG_LEVEL=INFO带环境的Claude代码配置
{
"mcpServers": {
"regennexus": {
"command": "regennexus-mcp",
"env": {
"REGENNEXUS_MODE": "local",
"REGENNEXUS_LOG_LEVEL": "DEBUG"
}
}
}
}可用工具(免费版)
这些工具由 regennexus 软件包(开源):
GPIO和基本I/O
| 工具 | 说明 |
|---|---|
gpio_write | 将GPIO引脚设置为高(1)或低(0) |
gpio_read | 读取GPIO引脚的当前状态 |
pwm_write | 为电机、LED、伺服系统设置PWM占空比(0-100%) |
传感器和I2C
| 工具 | 说明 |
|---|---|
read_sensor | 从传感器读取值(温度、湿度等) |
i2c_scan | 扫描I2C总线以查找连接的设备 |
串行通信
| 工具 | 说明 |
|---|---|
serial_send | 通过串行端口(UART)发送数据 |
serial_read | 从串行端口读取数据 |
机器人学
| 工具 | 说明 |
|---|---|
robot_arm_move | 将机器人手臂移动到指定的关节位置 |
gripper_control | 打开或关闭机器人夹持器 |
设备管理
| 工具 | 说明 |
|---|---|
list_devices | 列出所有连接的硬件设备 |
device_info | 获取设备详细信息(CPU、内存、IP、温度) |
相机
| 工具 | 说明 |
|---|---|
camera_capture | 从相机中捕获单张图像 |
网状网络
| 工具 | 说明 |
|---|---|
list_nodes | 列出网状网络中的所有节点 |
ping_node | Ping节点并测量网络延迟 |
send_to_node | 向特定节点发送消息/命令 |
broadcast_message | 向所有节点广播消息 |
find_by_capability | 查找具有特定功能的节点 |
具有额外功能的高级工具可单独购买。
连接模式
本地模式(推荐)
需要 regennexus 安装在同一台机器上的软件包。直接导入UAP模块以实现最小延迟。 不需要API服务器。
pip install regennexus-mcp[local]
REGENNEXUS_MODE=local regennexus-mcp这是大多数用户的推荐模式。
远程模式(高级)
通过HTTP API连接到作为服务运行的UAP实例。需要运行UAP API服务器(regen server).
# On the UAP server machine:
regen server --port 8080
# On the Claude Code machine:
pip install regennexus-mcp[remote]
REGENNEXUS_MODE=remote \
REGENNEXUS_ENDPOINT=http://uap-server:8080 \
regennexus-mcp自动模式(默认)
先尝试本地,如果未安装UAP,则回退到远程。
regennexus-mcp # Auto-detects best mode独立运行
# Run MCP server
regennexus-mcp
# Or via Python
python -m regennexus_mcp建筑
Claude Code (MCP Client)
│
▼
regennexus-mcp (This Package)
│
├── Local Mode: Direct import
│ │
│ ▼
│ regennexus (UAP)
│
└── Remote Mode: HTTP API
│
▼
UAP Service发展
# Clone
git clone https://github.com/regennow/regennexus-mcp
cd regennexus-mcp
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Format code
black src/
ruff check src/相关项目
- UAP RegenNexus -通用适配器协议
- MCP规范 -模型上下文协议
许可证
MIT许可证
