ros-mcp-server

ros-mcp-server

Controls Autonomous Mobile Robots (AMRs) through natural language via MQTT and an LLM bridge, enabling navigation and system commands.

Category
访问服务器

README

ros-mcp-server

ros-mcp-server is a TypeScript MCP server for controlling AMRs through a fixed MQTT contract. It does not talk to ROS2 directly. Instead, it sits between RCS, an external LLM bridge, and an AMR-side MQTT bridge.

Current flow:

User -> RCS chat UI -> ros-mcp-server (chat/tool orchestration) -> Ollama -> robot tools -> MQTT Broker -> AMR MQTT Server -> ROS2 Humble/Nav2

Architecture

This MVP combines two roles:

  • MCP tool server for robot actions
  • RCS-facing orchestration entry point via the chat tool

RCS remains a thin chat UI:

  • the operator types natural-language requests
  • RCS forwards them to MCP chat
  • ros-mcp-server calls a local or network LLM bridge
  • the LLM decides whether robot tools are needed
  • tool results are folded into the final Korean response

The server is split into four layers:

  • rms_mcp_server: MCP server creation, chat orchestration, and the WebSocket transport exposed at ws://127.0.0.1:3001/mcp
  • rms_mqtt: MQTT connection management, protocol loading, symbolic topic resolution, and request-response helpers
  • rms_core: shared config, logger, types, and error classes
  • rms_utils: low-level JSON and timeout helpers

The MQTT topic contract is defined in editable JSON at rms_mqtt/protocols/amr-mqtt-protocol.json. MCP tools resolve symbolic keys such as navigation.command instead of hardcoding topic strings.

Folder Structure

ros-mcp-server/
  package.json
  tsconfig.base.json
  .env.example
  README.md

  rms_mcp_server/
    src/
      index.ts
      orchestrator.ts
      server.ts
      transport.ts
      tooling.ts

  rms_mqtt/
    src/
      mqttClient.ts
      protocolLoader.ts
      topicResolver.ts
      requestResponse.ts
    protocols/
      amr-mqtt-protocol.json

  rms_core/
    src/
      config.ts
      logger.ts
      types.ts
      errors.ts

  rms_utils/
    src/
      json.ts
      timeout.ts
    scripts/
      pkill.sh

Install

npm install

Run

npm run dev

To start both the RMS server and a local Ollama runtime together:

npm run dev:all

dev:all checks whether Ollama is already available at the configured bridge URL. If not, it tries to start ollama serve first and then launches the RMS dev server.

The MCP WebSocket endpoint will be available at:

ws://127.0.0.1:3001/mcp

Configuration

Copy .env.example to .env and adjust values as needed.

Core values:

  • MQTT_BROKER_URL: broker endpoint used by the MQTT client
  • MQTT_CLIENT_ID: MQTT client identifier
  • DEFAULT_ROBOT_ID: fallback robot id when a tool omits robot_id
  • REQUEST_TIMEOUT_MS: default timeout for MQTT request-response operations
  • RMS_HOST, RMS_PORT, RMS_MCP_PATH: MCP WebSocket bind settings
  • RCS_MCP_SERVER_URL: convenience value for the RCS-side MCP configuration

LLM bridge values:

  • LLM_BRIDGE_PROVIDER=ollama
  • LLM_BRIDGE_URL=http://127.0.0.1:11434/api/chat
  • LLM_BRIDGE_MODEL=qwen3
  • LLM_BRIDGE_TIMEOUT_MS=30000
  • LLM_BRIDGE_THINK= optional
  • LLM_BRIDGE_KEEP_ALIVE=5m

Recommended local setup:

  1. Install Ollama
  2. Pull a model with tool-calling support such as qwen3
  3. Start Ollama
  4. Keep LLM_BRIDGE_URL=http://127.0.0.1:11434/api/chat

Windows 11 Ollama Setup

  1. Download the Windows installer from the official site: https://ollama.com/download/windows
  2. Run the installer and finish the setup
  3. Open a new PowerShell window and confirm installation:
ollama --version
  1. Pull a model with tool-calling support:
ollama pull qwen3
  1. Check available models:
ollama list
  1. Start the local Ollama server if it is not already running:
ollama serve
  1. In another terminal, start the full local stack:
npm run dev:all

MQTT Topics

Topics are resolved from symbolic keys. For example:

resolveTopic("navigation.command", { robot_id: "burger1" });
// => /amr/burger1/navigation/command

Example resolved topics:

  • /amr/burger1/navigation/command
  • /amr/burger1/navigation/result
  • /amr/burger1/pose/set
  • /amr/burger1/route/request
  • /amr/burger1/system/ping

MCP Tools

The server exposes these high-level tools:

  • chat
  • navigate_to_poses
  • cancel_navigation
  • set_initial_pose
  • save_map
  • send_motion_command
  • request_plan_segment
  • request_plan_route
  • ping_robot
  • change_robot_id

Each request automatically includes request_id and timestamp, and request-response tools subscribe to the matching response topic and correlate by request_id.

chat Tool

chat is the main entry point for RCS natural-language interaction.

Expected behavior:

  • RCS sends the latest operator utterance to the chat tool
  • ros-mcp-server sends the conversation to Ollama
  • Ollama requests robot tools when needed
  • ros-mcp-server executes the requested tools
  • the final Korean response is returned to RCS

Typical arguments:

{
  "message": "burger1을 map 기준 x=1.25, y=0.4 위치로 보내줘",
  "robot_id": "burger1"
}

Example MCP Tool Calls

After connecting your MCP client to ws://127.0.0.1:3001/mcp and completing MCP initialization, you can call tools like this.

chat:

{
  "jsonrpc": "2.0",
  "id": 9,
  "method": "tools/call",
  "params": {
    "name": "chat",
    "arguments": {
      "message": "burger1을 map 기준 x=1.25, y=0.4 위치로 보내줘",
      "robot_id": "burger1"
    }
  }
}

navigate_to_poses:

{
  "jsonrpc": "2.0",
  "id": 10,
  "method": "tools/call",
  "params": {
    "name": "navigate_to_poses",
    "arguments": {
      "robot_id": "burger1",
      "poses": [
        {
          "frame_id": "map",
          "position": { "x": 1.25, "y": 0.4, "z": 0 },
          "orientation": { "x": 0, "y": 0, "z": 0, "w": 1 }
        }
      ]
    }
  }
}

RCS Integration

RCS should connect its MCP client transport to:

ws://127.0.0.1:3001/mcp

Recommended client behavior:

  • keep the current chat-style UI
  • let the operator choose the UI label such as ChatGPT or Claude if desired
  • send the operator message to MCP chat
  • show the returned Korean response in the same chat thread
  • avoid direct OpenAI API handling in the UI when using the RMS-side Ollama bridge

This keeps RCS thin while ros-mcp-server owns natural-language orchestration and robot tool execution.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选