ros2_medkit_mcp
MCP server for ros2_medkit. Bridge LLM agents to the SOVD REST API for ROS 2 diagnostics and remote operations.
claude mcp add --transport stdio selfpatch-ros2_medkit_mcp poetry run ros2-medkit-mcp-http \ --env ROS2_MEDKIT_BASE_URL="http://localhost:8080/api/v1" \ --env ROS2_MEDKIT_BEARER_TOKEN=""
How to use
The ros2_medkit_mcp server acts as an MCP adapter that bridges an LLM to the ros2_medkit SOVD HTTP API. It does not implement the API itself but exposes MCP tools that call the existing gateway endpoints for discovery, entity data, operations, and configurations. With either the stdio or HTTP transport, you can query ROS 2 system state, topics, services, and parameters through the MCP toolset. The server supports bearer token authentication and allows configuring the base SOVD URL via environment variables.
To use the tools, run the MCP server (stdio mode for local desktop setups or http mode for remote access). Then invoke the available MCP tools such as sovd_version, sovd_entities_list, sovd_entity_data, sovd_publish_topic, sovd_list_operations, and sovd_create_execution to interact with the ROS 2 system through the ros2_medkit gateway. In VS Code or Claude Copilot, configure the MCP server in your MCP configuration file to enable the tools in your AI-assisted workflows.
How to install
Prerequisites:
- Python 3.11+
- Poetry (for dependency management)
- A running ros2_medkit gateway (default base URL http://localhost:8080/api/v1)
Installation steps:
-
Clone the repository git clone https://github.com/selfpatch/ros2_medkit_mcp.git cd ros2_medkit_mcp
-
Install Python dependencies via Poetry poetry install
-
Configure environment variables (example)
- ROS2_MEDKIT_BASE_URL=http://localhost:8080/api/v1
- ROS2_MEDKIT_BEARER_TOKEN=(optional)
- ROS2_MEDKIT_TIMEOUT_S=30
-
Run the MCP server (stdio transport) poetry run ros2-medkit-mcp-stdio
-
Alternatively, run the HTTP transport poetry run ros2-medkit-mcp-http --host 0.0.0.0 --port 8765
-
Verify the server is up (example for HTTP transport) curl http://localhost:8765/health
Additional notes
Notes and tips:
- The MCP server relies on the ros2_medkit gateway being reachable at the configured ROS2_MEDKIT_BASE_URL. If you run the gateway on a separate host or inside Docker, set ROS2_MEDKIT_BASE_URL accordingly and ensure network connectivity.
- If using Docker or remote hosts, the host network name like host.docker.internal may be required to reach the gateway from containers.
- Authentication can be enabled via ROS2_MEDKIT_BEARER_TOKEN. Leave it empty if the gateway does not require authentication.
- The MCP tools include discovery (sovd_version, sovd_entities_list), data access (sovd_entity_data, sovd_entity_topic_data), and operations (sovd_list_operations, sovd_create_execution). They can be wired into IDEs like VS Code or Claude Copilot for seamless ROS 2 queries.
- When using Docker, you can pass ROS2_MEDKIT_BASE_URL with -e to override the default base URL, and map ports as needed (e.g., -p 8765:8765).
- Example MCP configurations for VS Code or Claude Desktop show how to embed the command and environment in your mcp.json files.
Related MCP Servers
ros
Connect AI models like Claude & GPT with robots using MCP and ROS.
MCP-Bridge
A middleware to provide an openAI compatible endpoint that can call MCP tools
mcp -odoo
A Model Context Protocol (MCP) server that enables AI assistants to securely interact with Odoo ERP systems through standardized resources and tools for data retrieval and manipulation.
Gitingest
mcp server for gitingest
nav2_mcp_server
MCP server that provides tools and resources to control and monitor robots using Nav2.
microsoft_fabric_mcp
MCP server wrapping around the Fabric Rest API