← MCP server and skill grades

ros-mcp-server

robotmcp/ros-mcp-server

B
Type
MCP server
Scanned
Nov 12, 2026
Version
476591ac058f
Files read
163

This MCP server connects AI assistants to ROS 1 and ROS 2 robots over a rosbridge WebSocket so the assistant can inspect robot state, read sensor and camera streams, and send movement or service commands. Its biggest risks are that its optional HTTP server mode has no authentication—letting anyone who can reach the port or a documented ngrok tunnel control connected robots—and that prompt injection can abuse unvalidated tool inputs to read arbitrary image files from disk or redirect WebSocket connections.

What it can reach

Network
Connects over unencrypted WebSockets to rosbridge servers (default 127.0.0.1:9090, or any host and port chosen via connect_to_robot), resolves DNS and checks TCP ports via ping_robots, and optionally runs an HTTP server on port 9000 when HTTP transport is enabled.
Files
Writes camera frames received from ROS topics to ./camera/received_image.jpeg, reads YAML robot specification files, and opens image files from disk via view_saved_image.
Shell commands
Executes the system ping utility as a direct subprocess without a shell to test whether robot IP addresses respond.
Other
Controls physical or simulated ROS 1 and ROS 2 robots by publishing topic messages, calling services, sending or canceling action goals, and reading or changing ROS parameters.

Findings

3 medium1 low
  1. MediumHTTP transport runs without authentication while docs recommend network and public tunnel exposure

    ros_mcp/main.py:92

    When started with --transport http or --transport streamable-http (which launch/launch_mcp_server.sh also enables by default), the server exposes all MCP tools over HTTP with no password, token, or Origin check. The documentation recommends --host 0.0.0.0 for remote and production deployments and instructs ChatGPT users (and launch/launch_mcp_tunnel.sh) to expose port 9000 to the public internet via ngrok with authentication disabled. Anyone who can reach that port or public URL can directly move physical robots, view live camera feeds, scan local network ports, and read image files on the host without any AI or user approval.

    Fix: Require bearer-token or OAuth authentication whenever http or streamable-http transport is enabled, validate Origin and Host headers on localhost listeners, and remove instructions to expose unauthenticated servers over 0.0.0.0 or public tunnels.

  2. MediumArbitrary image file read via unvalidated path in view_saved_image

    ros_mcp/tools/images.py:88

    The view_saved_image tool is described as re-viewing camera frames saved during topic subscriptions (which are always written to ./camera/received_image.jpeg) and is marked readOnlyHint=True, so many MCP clients run it automatically without asking the user. Because image_path is passed straight to PIL.Image.open with no directory check, a prompt-injected agent can read any image file on the user's computer (such as desktop screenshots or scanned documents) and probe whether arbitrary file paths exist.

    Fix: Resolve image_path and verify that it stays within the dedicated ./camera directory before opening it, or remove the parameter and always read ./camera/received_image.jpeg.

  3. MediumUnvalidated robot IP allows WebSocket URL injection and external retargeting

    ros_mcp/utils/websocket.py:310

    The connect_to_robot tool (marked destructiveHint=False) saves the supplied ip string into WebSocketManager before testing connectivity and leaves it set even if the connectivity check fails, after which WebSocketManager.connect interpolates self.ip directly into a ws:// URL. A prompt-injected agent can supply a host with a custom port, path, query, and # fragment (for example 127.0.0.1:9222/devtools/page/id# or an attacker's domain) to connect to arbitrary local or internet WebSocket endpoints, exfiltrating conversation data via publish_once or redirecting robot commands away from a user-configured ROSBRIDGE_IP.

    Fix: Validate that ip is strictly a valid IP address or bare hostname containing no colons, slashes, query characters, or fragments, only update WebSocketManager after validation succeeds, mark connect_to_robot as state-changing, and allow locking the server to a configured robot host.

  4. LowPath traversal in load_robot_config escapes the robot_specifications folder

    ros_mcp/utils/config_utils.py:20

    The get_verified_robot_spec tool (marked readOnlyHint=True) is meant to load only curated YAML files inside the package's robot_specifications directory. Because robot_name is joined directly into a Path without rejecting .. segments or leading slashes, a prompt-injected agent can traverse outside robot_specifications to probe whether arbitrary .yaml files exist on disk, load prompt instructions from an untrusted .yaml file in another folder such as Downloads, or trigger YAML parser errors that reveal file snippets.

    Fix: Reject robot names containing path separators or .. and check that file_path.resolve() is relative to Path(specs_dir).resolve() before opening the file.