
kakimochi/ros2-mcp-server
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
kakimochi/ros2-mcp-server は [https://github.com/kakimochi/ros2-mcp-server.] からインポートされた MCP サーバー候補です
概要
kakimochi/ros2-mcp-server は [https://github.com/kakimochi/ros2-mcp-server.] からインポートされた MCP サーバー候補です
概要(AI 翻訳)
[ros2-mcp-serverは、モデルコンテキストプロトコル(MCP)をROS2と統合するPythonベースのサーバーで、AIアシスタントがROS2のトピックを介してロボットを制御することを可能にします。 FastMCP でコマンドを処理し、ROS 2 ノードとして実行し、[geometry_msgs/Twist] メッセージを [/cmd_vel]] トピックに公開します。
この実装は、[/cmd_vel] のパブリッシャーで「0.2 m/s を 5 秒間転送し、停止する」などのコマンドをサポートしています。
##特徴 -MCPインテグレーション:FastMCP を使用して、MCP クライアント(Claude など)からコマンドを処理します。
- ROS 2 ネイティブ:ROS 2 ノードとして、直接 [
/cmd_vel] に公開します。 -Time-Based Control: 期間ベースの動作コマンドをサポート(指定した時間に移動し、停止)。 -非同期処理:ROS 2のイベントループでFastMCPの[[asyncioを組み合わせて効率的な操作を行います。
前提条件
- ROS 2: インストールおよびソースの謙虚な分布。 -Python:バージョン3.10(ROS 2 Humbleとの互換性のために必須)。 -uv:依存関係管理のためのPythonパッケージマネージャ。 -Dependencies:
- [
rclpy:ROS 2のPythonクライアントライブラリ(ROS 2)でインストール).
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
ros2-mcp-server
ros2-mcp-server is a Python-based server that integrates the Model Context Protocol (MCP) with ROS 2, enabling AI assistants to control robots via ROS 2 topics. It processes commands through FastMCP and runs as a ROS 2 node, publishing geometry_msgs/Twist messages to the /cmd_vel topic to control robot movement.
This implementation supports commands like “move forward at 0.2 m/s for 5 seconds and stop,” with the /cmd_vel publisher named pub_cmd_vel.
Features
- MCP Integration: Uses FastMCP to handle commands from MCP clients (e.g., Claude).
- ROS 2 Native: Operates as a ROS 2 node, directly publishing to
/cmd_vel. - Time-Based Control: Supports duration-based movement commands (e.g., move for a specified time and stop).
- Asynchronous Processing: Combines FastMCP’s
asynciowith ROS 2’s event loop for efficient operation.
Prerequisites
- ROS 2: Humble distribution installed and sourced.
- Python: Version 3.10 (required for compatibility with ROS 2 Humble).
- uv: Python package manager for dependency management.
- Dependencies:
rclpy: ROS 2 Python client library (installed with ROS 2).fastmcp: FastMCP framework for MCP server implementation.numpy: Required by ROS 2 message types.
Installation
-
Clone the Repository:
git clone https://github.com/kakimochi/ros2-mcp-server.git cd ros2-mcp-server -
Python Version Configuration: This project uses Python 3.10 as required by ROS 2 Humble. The
.python-versionfile is already configured:# .python-version content 3.10 -
Project Dependencies: The
pyproject.tomlfile is configured with the necessary dependencies:# pyproject.toml content [project] name = "ros2-mcp-server" version = "0.1.0" description = "ROS 2 MCP Server" readme = "README.md" requires-python = ">=3.10" dependencies = [ "fastmcp", "numpy", ] -
Create uv Environment:
uv venv --python /usr/bin/python3.10 -
Activate the Virtual Environment:
source .venv/bin/activateYou’ll see
(.venv)appear at the beginning of your command prompt, indicating that the virtual environment is active. -
Install Dependencies:
uv pip install -e .
MCP Server Configuration
To use this server with Claude or other MCP clients, you need to configure it as an MCP server. Here’s how to set it up:
For Claude Desktop
- Open Claude Desktop settings and navigate to the MCP servers section.
- Add a new MCP server with the following configuration:
"ros2-mcp-server": { "autoApprove": [], "disabled": false, "timeout": 60, "command": "uv", "args": [ "--directory", "/path/to/ros2-mcp-server", "run", "bash", "-c",
インストール
This server does not publish a one-line install command.
Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →