A Model Context Protocol (MCP) server that provides AI assistants with tools to introspect and interact with ROS2 robotics systems. This server enables Large Language Models (LLMs) and other AI systems to understand, monitor, and analyze ROS2 robot systems in real-time.
The ROS2 MCP Server bridges the gap between AI assistants and robotics systems by exposing ROS2 functionality through the Model Context Protocol. It provides tools for topic monitoring, sensor data collection, system introspection, and real-time robot state analysis.
- Topic Monitoring: Echo messages from any ROS2 topic with configurable message counts and timeouts
- Image Processing: Direct image retrieval from ROS2 Image topics for VLM (Vision Language Model) analysis
- System Introspection: List all available topics, nodes, and message types
- Interface Analysis: Detailed inspection of ROS2 message/service/action interfaces
- Real-time Status: Live system health monitoring and status reporting
- Structured Prompts: Pre-built prompts for common robotics analysis tasks
- Resource Streaming: Live system status via MCP resources
- VLM Integration: Direct image data provision for computer vision analysis
- Error Handling: Robust error reporting and fallback mechanisms
- ROS2 (Humble, Iron, or Jazzy)
- Python 3.8+
- OpenCV (
cv_bridge
package)
Docker images are automatically built and published to the L-CAS registry:
docker pull lcas.lincoln.ac.uk/<repository-name>:latest
To build the Docker image locally:
docker build -t ros2-mcp .
# Run with ROS2 network access
docker run -it --rm --network host ros2-mcp
# Run with custom ROS_DOMAIN_ID
docker run -it --rm --network host -e ROS_DOMAIN_ID=42 ros2-mcp
For easier deployment with the SSE interface exposed on port 8000:
# Start the MCP server with Docker Compose
docker compose up -d
# View logs
docker compose logs -f ros2-mcp-server
# Stop the service
docker compose down
The Docker Compose setup can be configured via environment variables in the .env
file:
DOCKER_REPO
: Docker repository name (default:ros2-mcp
)TAG
: Image tag to use (default:latest
)ROS_DOMAIN_ID
: ROS2 domain ID (default:0
)MCP_HOST
: Host to bind the MCP server (default:0.0.0.0
)MCP_PORT
: Port for the SSE interface (default:8000
)
Once running, the MCP server's SSE interface will be available at:
- Local:
http://localhost:8000
- Health check:
http://localhost:8000/health
The Docker image is based on lcas.lincoln.ac.uk/lcas/ros-docker-images:humble-2
and includes all necessary dependencies for the ROS2 MCP server.