Skip to main content

MCP server (FastMCP) exposing ROS 2 image topics to VLM agents

Project description

ros2-image-mcp

MCP server (FastMCP) that exposes ROS 2 sensor_msgs/Image topics to VLMs and agents.

Tools: get_latest_ros_image · get_recent_ros_image_frames

Requirements

  • ROS 2 sourced (source /opt/ros/<distro>/setup.bash)
  • Python 3.10+

Install

source /opt/ros/humble/setup.bash   # or your distro
cd /path/to/ros2_img_mcp
pip install -U pip setuptools
pip install -e .

Optional demo extras: pip install -e ".[langgraph-demo]"

Quick start

  1. Publish images on a topic (synthetic test pattern, or a real camera):

    python3 scripts/publish_test_image.py --topic /test/camera/image
    # webcam example: add --device 4   (for /dev/video4)
    
  2. Run the MCP server (separate terminal, ROS sourced):

    ros2-image-mcp --default-topic /test/camera/image
    
  3. Point your MCP client at the server — stdio (default above) or HTTP:

    ros2-image-mcp --default-topic /test/camera/image --transport http --port 8012
    

    HTTP endpoint: http://127.0.0.1:8012/mcp (path /mcp by default).

Cursor (stdio) — ROS must be sourced inside the command:

{
  "mcpServers": {
    "ros2-camera": {
      "command": "bash",
      "args": [
        "-lc",
        "source /opt/ros/humble/setup.bash && ros2-image-mcp --default-topic /test/camera/image"
      ]
    }
  }
}

LangGraph-style HTTPtransport: "http" and url: "http://127.0.0.1:8012/mcp" (or streamable_http if your client expects that name; URL unchanged).

Limitations

  • Depth / float formats (e.g. 32FC1) are not converted; use an RGB topic or encode to png/jpeg on the ROS side.
  • Very large images are heavy on MCP payloads; consider downscaling in ROS if needed.

More detail : DEVELOPERS.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ros2_image_mcp-0.1.0.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ros2_image_mcp-0.1.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file ros2_image_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: ros2_image_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ros2_image_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8fd8bb64c1a071ffa2c7b1230f61b1f8cacc72dbf7b9c7cd8f4565f30e5b4f1c
MD5 a41042f82d6b92b49030dfe1778e86e4
BLAKE2b-256 89c677fbc38d1631a17663cbbb5be306fac5e8e3d8b915c07529f407339e5627

See more details on using hashes here.

Provenance

The following attestation bundles were made for ros2_image_mcp-0.1.0.tar.gz:

Publisher: pypi-publish.yml on madhawap/ros2_image_mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ros2_image_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ros2_image_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ros2_image_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e32206f39d2c315509a2f8e5063b7a8986f173377204aebba18b90bd4aaef367
MD5 1ecbbbe6e504c421e9e498dd142ce868
BLAKE2b-256 8978326c62ea2df5216fcb352f6b2c410fba92ff0e3bd87338493dc3b3c46b86

See more details on using hashes here.

Provenance

The following attestation bundles were made for ros2_image_mcp-0.1.0-py3-none-any.whl:

Publisher: pypi-publish.yml on madhawap/ros2_image_mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page