Files
wehub-resource-sync db1d565b64
Integration Tests / melodic (push) Has been cancelled
Integration Tests / noetic (push) Has been cancelled
Integration Tests / humble (push) Has been cancelled
Integration Tests / jazzy (push) Has been cancelled
Ruff Lint & Format / ruff (push) Has been cancelled
Sync main to develop / Check if sync is needed (push) Has been cancelled
Sync main to develop / Sync main to develop (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:36:23 +08:00

1.6 KiB

Step 1: Custom / Programmatic Client

You can use the ROS-MCP server directly in your Python code using the MCP SDK.

Example

from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client

async def main():
    server_params = StdioServerParameters(
        command="uvx",
        args=["ros-mcp", "--transport=stdio"]
    )

    async with stdio_client(server_params) as (read, write):
        async with ClientSession(read, write) as session:
            # Initialize the session
            await session.initialize()

            # List available tools
            tools = await session.list_tools()
            print(tools)

            # Call a tool
            result = await session.call_tool("get_topics", {})
            print(result)

Prerequisites

Next Step

Set up rosbridge on the machine where ROS is running: Step 2: Rosbridge Setup


Advanced

  • HTTP transport — run the MCP server as a standalone HTTP service instead of stdio
  • Alternate installation methods:

Back to Installation Guide | Troubleshooting