- Installation of Cursor Desktop. Download here.
- Installation of WSL on Windows
- Installation of Ubuntu or WSL (Windows Subsystem for Linux) on Windows.
- Installation of ROS or ROS2. Test if ROS is installed by running Turtlesim. If you are not sure, follow, this tutorial. See here.
- Install dependencies:
curl -LsSf https://astral.sh/uv/install.sh | sh - Clone repository:
cd ~ && git clone https://github.com/robotmcp/ros-mcp-server.git && cd ros-mcp-server - Configure Cursor: Add stdio transport to
mcp.json(see Option 2 below) - Start ROS:
ros2 launch rosbridge_server rosbridge_websocket_launch.xml & ros2 run turtlesim turtlesim_node - Test: Ask Cursor to "List ROS topics"
-
Install
uvusing one of the following methods:Option A: PowerShell (Windows)
winget install --id=astral-sh.uv -e
or
pip install uv
Option B: WSL (Linux)
curl -LsSf https://astral.sh/uv/install.sh | shor (not recommended)
pip install uv
or (not recommended)
sudo snap install --classic astral-uv
- On your Host Machine, clone the repository and navigate to the ROS-MCP Server folder.
cd ~
git clone https://github.com/robotmcp/ros-mcp-server.git
cd ros-mcp-server
⚠️ WSL Users: Clone the repository in your WSL home directory (e.g.,/home/username/) instead of the Windows filesystem mount (e.g.,/mnt/c/Users/username/). Using the native Linux filesystem provides better performance and avoids potential permission issues.
- Open Cursor Desktop
- Navigate to Settings (gear icon top right)
- Open MCP > New MCP Server
- Modify the
mcp.jsonas follows:
Note: For HTTP transport, you need to manually start the MCP server first.
- Start the MCP server in WSL:
wsl
cd ros-mcp-server
uv run server.py --transport http- Configure Cursor with the following:
{
"mcpServers": {
"ros-mcp-server-http": {
"name": "ROS-MCP Server (http)",
"transport": "http",
"url": "http://127.0.0.1:9000/mcp"
}
}
}
Benefits of stdio transport:
- No need to manually start the server
- Direct communication with WSL
- More reliable and faster
- Automatic server management
Important Configuration Notes:
- Make sure to clone the ros-mcp-server folder to your
/home/<YOUR_USER>directory (note: ~ for home directory may not work in JSON files)
"/home/<YOUR_USER>/ros-mcp-server" # Recommended: WSL/Linux home directory
-
Avoid using
/mnt/c/Users/<YOUR_USER>/paths - these point to the Windows filesystem which can cause performance issues and permission problems -
Use the correct WSL distribution name (e.g., "Ubuntu" or "Ubuntu-22.04")
-
Make sure to replace
<YOUR_USER>with your actual WSL username -
Ensure uv is installed at
/home/<YOUR_USER>/.local/bin/uv, if not modify the installation directory (which uvcan help locate.)
{
"mcpServers": {
"ros-mcp-server": {
"name": "ROS-MCP Server (stdio)",
"transport": "stdio",
"command": "wsl",
"args": [
"-d", "Ubuntu",
"/home/<YOUR_USER>/.local/bin/uv",
"--directory",
"/home/<YOUR_USER>/ros-mcp-server",
"run",
"server.py"
]
}
}
You can copy-paste the mcp.json in this folder and modify <YOUR_USER> accordingly:
{
"mcpServers": {
"ros-mcp-server-http": {
"name": "ROS-MCP Server (http)",
"transport": "http",
"url": "http://127.0.0.1:9000/mcp"
},
"ros-mcp-server-stdio": {
"name": "ROS-MCP Server (stdio)",
"transport": "stdio",
"command": "wsl",
"args": [
"-d", "Ubuntu",
"/home/<YOUR_USER>/.local/bin/uv",
"--directory",
"/home/<YOUR_USER>/ros-mcp-server",
"run",
"server.py"
]
}
}
}
In WSL, launch rosbridge and turtlesim
source /opt/ros/jazzy/setup.bash
ros2 launch rosbridge_server rosbridge_websocket_launch.xml & ros2 run turtlesim turtlesim_nodeor
launch_ros.shOnce everything is configured, test your connection:
-
Start a new chat in Cursor
-
Try a simple ROS command like:
- "List all available ROS topics"
- "Show me the current ROS node information"
- "What robots are available in the specifications?"
-
Verify the connection - you should see ROS-related responses from the MCP server
MCP Server not connecting:
- Verify WSL is running:
wsl --list --verbose - Check if uv is installed:
wsl -- which uv - Ensure the ros-mcp-server directory exists in WSL
ROS Bridge connection failed:
- Make sure ROS is running:
ros2 node list - Verify rosbridge is active:
ros2 launch rosbridge_server rosbridge_websocket_launch.xml - Check if port 9090 is available
Stdio transport not working:
- Verify the WSL distribution name is correct
- Check if the uv path is accurate:
/home/<YOUR_USER>/.local/bin/uv - Ensure the ros-mcp-server directory is in the correct location
/home/<YOUR_USER>/ros-mcp-server
# Test WSL connection
wsl --list --verbose
# Test uv installation
wsl -- which uv
# Test ROS installation
wsl -- ros2 node list
# Test rosbridge
wsl -- ros2 topic listOnce connected, you can use natural language to interact with your ROS system:
- "Move the turtle forward" - Controls turtlesim
- "What topics are currently publishing?" - Lists active topics
- "Show me the robot specifications" - Displays available robot configs
- "Connect to robot at IP 192.168.1.100" - Connects to remote robot
- "Take a picture with the camera" - Captures camera data
You can customize the MCP server behavior with these environment variables:
# ROS Bridge settings
export ROSBRIDGE_IP="127.0.0.1" # Default: localhost
export ROSBRIDGE_PORT="9090" # Default: 9090
# MCP Transport settings
export MCP_TRANSPORT="streamable-http" # For ChatGPT: streamable-http
export MCP_TRANSPORT="stdio" # For Cursor: stdio (recommended)
export MCP_HOST="127.0.0.1" # For HTTP transport
export MCP_PORT="9000" # For HTTP transportAdd your own robot configurations in utils/robot_specifications/:
# utils/robot_specifications/my_robot.yaml
name: "My Custom Robot"
ip: "192.168.1.100"
port: 9090
description: "My custom robot configuration"You can connect to multiple robots by switching configurations:
# Connect to different robots
export ROSBRIDGE_IP="192.168.1.100" # Robot 1
export ROSBRIDGE_IP="192.168.1.101" # Robot 2Q: Can I run multiple MCP servers? A: Yes, you can configure multiple servers in your mcp.json file.
Q: Is stdio transport faster than HTTP? A: Yes, stdio transport is generally faster and more reliable as it eliminates network overhead.
Q: Can I use this without WSL? A: The current setup requires WSL for ROS compatibility on Windows. Linux and macOS users can run directly.
- Windows 11
- WSL with Ubuntu 22.04
- Cursor Desktop
- WSL with Ubuntu 22.04
- ROS 2 Jazzy
- Issues: Report bugs and request features on GitHub Issues
- Documentation: Check the main README.md for additional information
- Community: Join discussions in the project's GitHub Discussions
We welcome contributions! Please see our Contributing Guide for details on:
- Setting up a development environment
- Code style guidelines
- Submitting pull requests
- Testing procedures