ROS MCP
Overview
OpenMowerNext can expose the running ROS graph to OpenCode through robotmcp/ros-mcp-server. The project configuration starts ros-mcp as an MCP stdio server, and ros-mcp talks to ROS through rosbridge on localhost:9090.
The default setup is localhost-only. Keep it that way for normal development on the machine running ROS.
Install dependencies
Install the ROS side:
make depsIf rosbridge_server is still missing, install it directly:
make rosbridge-depsInstall uv for the OpenCode MCP command if uvx is not already available:
curl -LsSf https://astral.sh/uv/install.sh | shRestart your shell after installing uv, or ensure the uvx binary directory is on PATH before starting OpenCode.
Run rosbridge
For foreground development:
make rosbridgeThis runs ros2 launch rosbridge_server rosbridge_websocket_launch.xml after sourcing ROS 2 Jazzy and the workspace install if it exists.
For a persistent user service:
make rosbridge-service-enableUseful service commands:
make rosbridge-service-status
make rosbridge-service-logs
make rosbridge-service-restart
make rosbridge-service-disableThe service binds to 127.0.0.1:9090 by default. Override the bind address only on a trusted network or over a VPN:
make ROSBRIDGE_ADDRESS=0.0.0.0 rosbridge-service-enableIf OpenCode runs on another machine, prefer an SSH tunnel instead of exposing rosbridge on the LAN:
ssh -L 9090:127.0.0.1:9090 <dev-host>OpenCode MCP
The project opencode.json configures:
{
"mcp": {
"ros-mcp": {
"type": "local",
"command": ["uvx", "ros-mcp", "--transport=stdio"]
}
}
}OpenCode reads this file only when it starts. Quit and restart OpenCode after changing the config or after installing uv.
Once OpenCode is restarted and rosbridge is running, ask it to connect to the robot on localhost and inspect topics or services.