UniRoboSim MCP
UniRoboSim MCP
unirobosim-mcp 向兼容 MCP 的客户端暴露 UniRoboSim 证据、仿真状态、后端相机图像,以及显式启用的仿真控制。该服务器具有两种部署配置:
证据配置(默认): 对操作员选定的证据根目录提供有界、只读访问。
控制配置(显式): 在证据工具的基础上,为由此服务器创建并拥有的仿真器会话提供读取和控制工具。
该服务器不会附加到由其他应用程序创建的会话。
安装
支持 Python >=3.11,<3.13。请在同一个环境中安装 Core、本包以及所选后端所需的适配器。
conda create -n unirobosim-mcp python=3.12 pip -y
conda activate unirobosim-mcp
git clone https://github.com/GitHofee/UniRoboSim.git
git clone https://github.com/GitHofee/UniRoboSim-mcp.git
git clone https://github.com/GitHofee/UniRoboSim-mujoco.git # example backend
python -m pip install ./UniRoboSim ./UniRoboSim-mcp ./UniRoboSim-mujoco常规部署使用当前的 MCP 2.x 运行时。Isaac Lab 3.0 环境保留其经过验证的 Pydantic 和 Uvicorn 版本锁定,因此请在那里安装兼容性附加包:
python -m pip install './UniRoboSim-mcp[isaaclab]'该附加包选择 MCP 1.10.1;它暴露相同的 UniRoboSim 工具目录,并已通过 Isaac Sim 6.0.1 的真实 stdio 协议验证。
Related MCP server: gazebo-mcp
证据配置
unirobosim-mcp --root /absolute/path/to/approved/evidence可以使用 UNROBOSIM_EVIDENCE_ROOT 代替 --root:
export UNIROBOSIM_EVIDENCE_ROOT=/absolute/path/to/approved/evidence
unirobosim-mcp工具 | 契约 |
| 返回活动根目录、硬查询限制和控制状态。 |
| 使用有界的 POSIX 通配符列出白名单证据。 |
| 读取一个有界的 UTF-8 或 JSON 工件。 |
| 验证一个已关闭的跟踪并返回其紧凑清单。 |
| 查询发布、清除和重置事件,无需完整几何数据。 |
| 查询已接受、已过滤和已丢弃的发布决策。 |
| 在某个序列处重建选定的活动调试原语。 |
绝对路径、路径穿越、符号链接逃逸、未经批准的扩展名、过大的文件、过度的扫描以及过多的结果计数均被拒绝。
控制配置
控制必须显式启用。本地资源文件被拒绝,除非其父目录树通过 --asset-root 被列入白名单。
unirobosim-mcp \
--root /absolute/path/to/approved/evidence \
--enable-control \
--asset-root /absolute/path/to/approved/assets \
--max-sessions 2 \
--lease-timeout-seconds 300读取 API
读取工具需要会话 ID,但不需要写入租约。
工具 | 契约 |
| 发现并探测已安装的后端入口点。 |
| 列出由此服务器拥有的会话;租约值永远不会被返回。 |
| 返回可移植的场景图,用于实体和相机发现。 |
| 读取刚体、关节体、可变形体、粒子流体或相机的类型化状态。 |
| 返回一个 MCP 图像,其中包含从后端 RGB 相机缓冲区编码的 PNG 数据。 |
simulation_get_entity 报告规范路径、实体种类、原始 MCP 配置、仿真节拍、数组形状和数据类型,以及类型特定的数据。include_values=true 包含数值;include_contact=true 添加刚体接触状态。
simulation_capture_camera 不是桌面或浏览器截图。它通过 Camera.read("rgb") 调用所选后端,验证规范的 [environment,height,width,3] uint8 缓冲区,并将该缓冲区编码为 PNG。save_to_evidence=true 还会将图像写入 <root>/screenshots/ 下,并返回其 SHA-256 摘要和尺寸。
控制 API
所有变更操作都需要 simulation_create 返回的不透明 lease_id 以及唯一的 command_id。
工具 | 契约 |
| 返回所有权策略、白名单根目录和硬资源限制。 |
| 为显式后端创建一个拥有的 EasyAPI 会话。 |
| 在启动前添加一个盒子、刚体资产、关节体、相机或粒子流体。 |
| 编译场景并返回其后端构建指纹。 |
| 延长写入租约而不更改其值。 |
| 将仿真推进有界的步数。 |
| 重置全部或选定的环境。 |
| 应用关节、刚体 wrench、可变形体、流体、场景或调试清除命令。 |
| 关闭拥有的会话并释放后端资源。 |
重复使用带有相同输入的 command_id 会返回缓存结果,并带有 idempotent_replay=true。使用不同输入重复使用该标识符将被拒绝。过期的会话会自动关闭。每次应用或拒绝的变更操作都会写入 mcp-control-audit.jsonl;租约值被排除在审计记录之外。
代理操作规则
使用控制配置的代理必须遵循以下顺序:
调用
simulation_list_backends并显式选择一个可用的后端。调用
simulation_create;仅将返回的租约用于写入操作。使用唯一的命令标识符添加所有实体,然后调用
simulation_start。使用
simulation_scene_snapshot发现规范的实体和相机路径。使用
simulation_get_entity获取目标状态,使用simulation_capture_camera进行视觉验证。仅对相同的写入请求重复使用命令标识符。
对每个创建的会话调用
simulation_close,包括失败的流程。
代理不得根据工具可用性推断后端支持。不支持的仿真器能力由能力协商或所选适配器报告。
回环 HTTP
unirobosim-mcp \
--root /absolute/path/to/approved/evidence \
--transport streamable-http \
--host 127.0.0.1 \
--port 8766未经身份验证的 HTTP 仅限于 127.0.0.1、localhost 或 ::1。远程部署需要经过身份验证和授权的网关。控制模式不得直接暴露在不受信任的网络上。
程序化嵌入
from pathlib import Path
from unirobosim_mcp import ControlLimits, EvidenceLimits, SimulationControl, create_server
root = Path("/approved/evidence")
control = SimulationControl(
root,
asset_roots=(Path("/approved/assets"),),
limits=ControlLimits(max_sessions=1, lease_timeout_seconds=120),
)
server = create_server(
root,
limits=EvidenceLimits(max_results=50, max_query_items=100),
control=control,
)
server.run(transport="stdio")验证
python -m pip install -e '.[dev]'
ruff format --check src tests
ruff check src tests
mypy src
coverage run -m pytest
coverage report发布验收通过真实的进程内 MCP 客户端调用每个已发布的 MCP 工具。额外的契约测试涵盖所有受支持的实体类型和命令族、租约、幂等性、过期、白名单资产、资源限制、审计记录、PNG 编码以及已保存的截图证据。原生验收针对每个已安装的模拟器适配器单独执行;除非该原生运行成功,否则功能不会报告为后端已通过。
核心契约和适配器安装记录在 UniRoboSim Core 中。
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.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP server for controlling Universal Robots arms and Robotiq grippers via RTDE protocol, enabling motion, force, I/O, and gripper operations.1MIT
- AlicenseNot gradedqualityAmaintenanceMCP server for AI agents to drive Gazebo / gz-sim simulation, with offline mock mode for CI/demos.4MIT
- FlicenseAqualityAmaintenanceMCP server that exposes a deterministic force-on-force simulation of FPV sUAS vs counter-UAS RF direction finding as tools for AI agents to run engagements, sweep seeds, and compare configurations.5
- FlicenseNot gradedqualityCmaintenanceMCP server for controlling a simulated robot arm with vision-based pick-and-place, driven by LLM or manual control.1
Related MCP Connectors
An authenticated remote MCP server for user-owned devices and one-shot capability invocation.
MCP server exposing the Backtest360 engine API as tools for AI agents.
Remote MCP server for RunComfy Serverless API (ComfyUI): deployments and async inference.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/GitHofee/UniRoboSim-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server