ros2_dev_mcp
Allows creation and management of ROS 2 development projects, including workspaces, packages, nodes, launch files, parameter files, and tests.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ros2_dev_mcpCreate a new ROS 2 package named my_package in workspace demo_ws"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Phase 1 - Safe ROS 2 Project Creation
Goal
Phase 1 establishes the development-focused ros2_dev_mcp server and provides controlled ROS 2 project creation through MCP.
The main goal is to allow an MCP-compatible client such as Codex to create ROS 2 development projects without giving the client unrestricted filesystem or shell access.
This phase also establishes the architectural separation between ROS 2 runtime operations and ROS 2 development operations.
Runtime operations belong to:
ros2_mcpDevelopment operations belong to:
ros2_dev_mcpGenerated and managed ROS 2 workspaces are stored separately below:
~/projects/robotics/mcp_workspaces/The result is a clear separation:
~/projects/robotics/
├── ros2_mcp/ # ROS 2 runtime MCP server
├── ros2_dev_mcp/ # ROS 2 development MCP server
├── mcp_workspaces/ # MCP-managed ROS 2 workspaces
└── ...Related MCP server: shemcp
Why a Separate Development MCP Server?
ROS 2 runtime interaction and ROS 2 software development have different responsibilities and different safety requirements.
A runtime MCP server needs access to the running ROS graph.
Typical runtime operations include:
list_nodes
list_topics
read_topic
list_services
list_parameters
get_parameterA development MCP server needs controlled access to project files and development commands.
Typical development operations include:
create_workspace
create_package
create_node
create_launch_file
create_parameter_file
create_tests
build_project
run_testsCombining both responsibilities in one server would create a larger security boundary and a more complex architecture.
Therefore the projects are intentionally separated.
MCP Client
|
+---------+---------+
| |
v v
ros2_dev_mcp ros2_mcp
| |
Development Runtime
| |
Workspace Nodes
Packages Topics
Nodes Services
Launch files Parameters
Parameter files Runtime state
Tests
Build
TestThis also makes future specialized MCP servers easier to add.
Examples:
ros2_control_mcp
moveit2_mcp
nav2_mcpPhase 1 Responsibilities
Phase 1 focuses on ROS 2 project generation.
The project creation tools are:
create_workspace
create_package
create_node
create_launch_file
create_parameter_file
create_testsControlled build and test execution are implemented by the same development server but documented separately in:
docs/README_PHASE_2_BUILD_TEST.mdusing:
build_project
run_testsArchitecture
The project creation path is:
MCP Client
|
v
ros2_dev_mcp
|
v
MCP Project Tools
|
v
ProjectService
|
v
ProjectAdapter
|
v
FilesystemProjectAdapter
|
v
SafeFilesystem
|
v
Configured Managed Root
|
v
ROS 2 WorkspaceThe layers have separate responsibilities.
MCP Layer
Location:
src/ros2_dev_mcp/mcp/project_tools.pyResponsibilities:
expose project operations as MCP tools
validate MCP tool arguments
obtain the application service from the MCP context
delegate operations to
ProjectServicereturn structured results to the MCP client
The MCP layer does not directly manipulate project files.
Application Layer
Location:
src/ros2_dev_mcp/application/project/service.pyThe ProjectService contains the development use cases.
Responsibilities include delegating:
create_workspace
create_package
create_node
create_launch_file
create_parameter_file
create_tests
build_project
run_teststo the appropriate adapters.
This keeps MCP-specific behavior separate from project implementation details.
Project Adapter
Location:
src/ros2_dev_mcp/project/adapter.pyThe Project Adapter defines the interface required by the application layer.
The application service therefore does not need to know how project files are physically created.
The concrete filesystem implementation is located at:
src/ros2_dev_mcp/project/filesystem/adapter.pyThis design allows the implementation to evolve without tightly coupling the application layer to filesystem details.
Filesystem Security Boundary
One of the most important requirements of ros2_dev_mcp is that Codex or another MCP client must not receive unrestricted filesystem access through the server.
All project operations are restricted to a configured root directory.
Current managed root:
/home/sarvg/projects/robotics/mcp_workspacesEquivalent user path:
~/projects/robotics/mcp_workspacesConfiguration file:
config/ros2_dev_mcp.tomlCurrent configuration:
[project]
allowed_root = "/home/sarvg/projects/robotics/mcp_workspaces"
[execution]
build_timeout_sec = 120.0
test_timeout_sec = 120.0The managed root is intentionally outside the MCP server repositories themselves.
This means generated projects can be placed here:
~/projects/robotics/mcp_workspaces/test_ws
~/projects/robotics/mcp_workspaces/pubsub_ws
~/projects/robotics/mcp_workspaces/my_robot_wswhile existing projects outside that directory remain outside the project filesystem boundary.
Examples include:
~/projects/robotics/ros2_mcp
~/projects/robotics/ros2_dev_mcp
~/projects/robotics/openmanipulator
~/projects/robotics/turtlebot3
~/projects/robotics/universal_robots
~/projects/robotics/robotics_portfolio_1The development MCP should not use these existing projects as writable project targets.
SafeFilesystem
The filesystem boundary is implemented by:
src/ros2_dev_mcp/project/filesystem/safe_filesystem.pySafeFilesystem resolves requested project paths against the configured allowed root.
Its responsibilities include:
resolving relative paths below the allowed root
accepting absolute paths only when they remain below the allowed root
rejecting parent-directory traversal outside the root
resolving paths before validating them
preventing symlink-based escapes from the allowed root
Conceptually:
Requested Path
|
v
Resolve Path
|
v
Is Path Inside allowed_root?
|
+--+--+
| |
Yes No
| |
v v
Allow RejectExamples of valid targets:
test_ws
pubsub_ws
/home/sarvg/projects/robotics/mcp_workspaces/test_wsExamples that must be rejected:
../ros2_mcp
../openmanipulator
/tmp/test_ws
/home/sarvg/projects/robotics/ros2_mcp
/home/sarvg/projects/robotics/openmanipulatorThis boundary was explicitly verified during development.
Workspace Creation
The MCP tool:
create_workspacecreates a ROS 2 workspace below the configured managed root.
Example MCP request conceptually:
create_workspace(
workspace_path="test_ws"
)Result:
~/projects/robotics/mcp_workspaces/test_ws/
└── src/The workspace follows the standard ROS 2 workspace layout:
workspace/
└── src/Build directories are not created during workspace creation.
They are generated later by colcon build.
Typical build result:
workspace/
├── build/
├── install/
├── log/
└── src/Package Creation
The MCP tool:
create_packagecreates a ROS 2 Python package inside an existing managed workspace.
Example:
Workspace:
pubsub_ws
Package:
demo_pubsubResulting structure:
pubsub_ws/
└── src/
└── demo_pubsub/
├── demo_pubsub/
│ └── __init__.py
├── package.xml
├── resource/
│ └── demo_pubsub
├── setup.cfg
└── setup.pyThe generated package uses the ROS 2 Python package structure based on:
ament_pythonThe package metadata and Python package directory are created automatically.
Node Creation
The MCP tool:
create_nodecreates a Python ROS 2 node inside an existing package.
Example:
package:
demo_pubsub
node:
publisher_nodeGenerated file:
pubsub_ws/
└── src/
└── demo_pubsub/
└── demo_pubsub/
└── publisher_node.pyAnother node can be added independently:
subscriber_node.pyResult:
demo_pubsub/
└── demo_pubsub/
├── __init__.py
├── publisher_node.py
└── subscriber_node.pyROS 2 Executable Registration
Creating a Python file alone is not enough for:
ros2 runTherefore generated nodes are registered as Python console scripts.
Conceptually:
entry_points={
"console_scripts": [
"publisher_node = demo_pubsub.publisher_node:main",
"subscriber_node = demo_pubsub.subscriber_node:main",
],
}After building and sourcing the workspace, ROS 2 can discover the executables.
Example verification:
cd ~/projects/robotics/mcp_workspaces/pubsub_ws
source /opt/ros/jazzy/setup.bash
source install/setup.bash
ros2 pkg executables demo_pubsubA successfully generated package can expose:
demo_pubsub publisher_node
demo_pubsub subscriber_nodeThe nodes can then be started with:
ros2 run demo_pubsub publisher_nodeand:
ros2 run demo_pubsub subscriber_nodesetup.cfg
Generated Python ROS 2 packages include:
setup.cfgwith ROS 2 executable installation paths.
Conceptually:
[develop]
script_dir=$base/lib/demo_pubsub
[install]
install_scripts=$base/lib/demo_pubsubThis is required so installed Python executables are placed where ROS 2 expects them.
Launch File Creation
The MCP tool:
create_launch_filecreates a Python ROS 2 launch file.
Typical result:
demo_pubsub/
└── launch/
└── demo.launch.pyThe launch file can reference one or more nodes from the package.
This allows a higher-level development request such as:
Create a publisher and subscriber and create a launch file
that starts both nodes.The long-term goal is that Codex can express the intent while ros2_dev_mcp performs the controlled project operations.
Parameter File Creation
The MCP tool:
create_parameter_filecreates a ROS 2 YAML parameter file.
Typical structure:
demo_pubsub/
└── config/
└── demo_params.yamlA minimal ROS 2 parameter structure can look like:
publisher_node:
ros__parameters: {}Parameter values can later be expanded according to the project requirements.
Configuration files belong to the generated ROS 2 package and remain inside the managed workspace boundary.
Test Creation
The MCP tool:
create_testscreates basic tests for a generated Python ROS 2 package.
Typical structure:
demo_pubsub/
└── test/
└── test_package_import.pyThe initial test verifies that the generated Python package can be imported correctly.
Additional ROS 2-specific tests can be added in later development phases.
Complete Generated Project Structure
A generated project can therefore look like:
pubsub_ws/
└── src/
└── demo_pubsub/
├── config/
│ └── demo_params.yaml
├── demo_pubsub/
│ ├── __init__.py
│ ├── publisher_node.py
│ └── subscriber_node.py
├── launch/
│ └── demo.launch.py
├── package.xml
├── resource/
│ └── demo_pubsub
├── setup.cfg
├── setup.py
└── test/
└── test_package_import.pyAfter building, the workspace can contain:
pubsub_ws/
├── build/
├── install/
├── log/
└── src/
└── demo_pubsub/
└── ...Configuration
Application configuration is loaded from:
config/ros2_dev_mcp.tomlConfiguration loading is implemented in:
src/ros2_dev_mcp/config/settings.pyCurrent configurable values include:
project.allowed_root
execution.build_timeout_sec
execution.test_timeout_secThese values are intentionally stored outside the application logic.
This avoids hard-coding environment-specific configuration throughout the source code.
Current Source Structure
The development server is organized as:
src/ros2_dev_mcp/
├── application/
│ ├── __init__.py
│ └── project/
│ ├── __init__.py
│ └── service.py
├── config/
│ ├── __init__.py
│ └── settings.py
├── __init__.py
├── mcp/
│ ├── __init__.py
│ └── project_tools.py
├── project/
│ ├── adapter.py
│ ├── execution/
│ │ ├── adapter.py
│ │ ├── __init__.py
│ │ ├── policy.py
│ │ └── subprocess_adapter.py
│ ├── filesystem/
│ │ ├── adapter.py
│ │ ├── __init__.py
│ │ └── safe_filesystem.py
│ └── __init__.py
└── server.pyThe execution layer belongs primarily to the controlled build and test functionality documented in Phase 2.
Development Environment
The current development environment is based on:
Ubuntu 24.04
ROS 2 Jazzy
Python 3.12
uv
MCP Python SDK
colconInstallation
Create or synchronize the Python environment:
cd ~/projects/robotics/ros2_dev_mcp
uv sync
source .venv/bin/activateVerify Python:
python --versionThe project currently targets:
Python >=3.12,<3.13Start ros2_dev_mcp Directly
The server can be started directly for development or debugging.
cd ~/projects/robotics/ros2_dev_mcp
source .venv/bin/activate
python -m ros2_dev_mcp.serverThe server uses MCP standard I/O transport.
When Codex starts the configured MCP server, starting it manually is normally unnecessary.
Codex Integration
ros2_dev_mcp can be registered as an MCP server in Codex.
Register it with:
cd ~/projects/robotics/ros2_dev_mcp
source .venv/bin/activate
codex mcp add ros2_dev_mcp \
-- \
bash -lc 'cd /home/sarvg/projects/robotics/ros2_dev_mcp && source .venv/bin/activate && exec python -m ros2_dev_mcp.server'Check the registration:
codex mcp get ros2_dev_mcpList all configured MCP servers:
codex mcp listStart Codex:
cd ~/projects/robotics/ros2_dev_mcp
source .venv/bin/activate
codexInside Codex, inspect available MCP tools with:
/mcpThe expected ros2_dev_mcp tools are:
build_project
create_launch_file
create_node
create_package
create_parameter_file
create_tests
create_workspace
run_testsReal Codex Verification
The separated development MCP server was tested with Codex.
The request was:
Use only the ros2_dev_mcp MCP server.
Create a new ROS 2 workspace named split_test_ws.
Do not use shell commands.
Do not use direct filesystem operations.
Do not use ros2_mcp.
Do not modify any existing project.Codex invoked:
ros2_dev_mcp.create_workspaceThe resulting workspace was:
/home/sarvg/projects/robotics/mcp_workspaces/split_test_ws
└── src/This verifies the complete path:
User
|
v
Codex
|
v
ros2_dev_mcp
|
v
Project MCP Tool
|
v
ProjectService
|
v
FilesystemProjectAdapter
|
v
SafeFilesystem
|
v
mcp_workspacesNo existing ROS 2 project needed to be modified.
Publisher / Subscriber Development Example
A more complete development workflow was also tested using a publisher/subscriber workspace.
The development target was:
pubsub_wswith package:
demo_pubsuband nodes:
publisher_node
subscriber_nodeThe intended project structure is:
mcp_workspaces/
└── pubsub_ws/
└── src/
└── demo_pubsub/
├── demo_pubsub/
│ ├── __init__.py
│ ├── publisher_node.py
│ └── subscriber_node.py
├── package.xml
├── resource/
│ └── demo_pubsub
├── setup.cfg
└── setup.pyThe workspace was successfully built using the development MCP.
After sourcing the built workspace, ROS 2 reported the generated executables:
demo_pubsub publisher_node
demo_pubsub subscriber_nodeThe nodes were started and discovered by ROS 2.
Example node list:
/publisher_node
/ros2_mcp_runtime
/subscriber_nodeThis demonstrated that generated project artifacts could progress from MCP project creation to an actual ROS 2 workspace build and runtime discovery.
Example Codex Project Creation Request
A project creation request can be expressed at a high level.
Example:
Use only the ros2_dev_mcp MCP server.
Create a new ROS 2 workspace named pubsub_ws.
Inside it, create a Python package named demo_pubsub.
Create two nodes:
- publisher_node
- subscriber_node
Create a launch file for both nodes.
Create basic tests.
Do not use shell commands.
Do not use direct filesystem operations.
Do not use ros2_mcp.
Do not modify any existing project.The intended MCP workflow is:
Codex
|
v
create_workspace
|
v
create_package
|
+------------------+
| |
v v
create_node create_node
publisher subscriber
| |
+--------+---------+
|
v
create_launch_file
|
v
create_testsBuild and test operations then continue through Phase 2.
Desired Higher-Level Workflow
The long-term goal is not to require the user to know every individual MCP tool.
Instead, a user should eventually be able to request:
Create a ROS 2 publisher/subscriber example with a launch file,
build it, test it, and report the result.Codex can then plan the workflow and invoke the required MCP tools:
User Intent
|
v
Codex
|
+--> create_workspace
|
+--> create_package
|
+--> create_node
|
+--> create_node
|
+--> create_launch_file
|
+--> create_tests
|
+--> build_project
|
+--> run_tests
|
v
ResultThe MCP server provides controlled capabilities.
The MCP client performs the higher-level orchestration.
Important Security Principle
ros2_dev_mcp is not intended to expose a generic shell.
For example, an MCP client should not receive a tool such as:
execute_arbitrary_shell_commandInstead, specific development operations are exposed:
create_workspace
create_package
create_node
create_launch_file
create_parameter_file
create_tests
build_project
run_testsThis creates a much smaller and more understandable security boundary.
Existing Project Protection
The managed workspace boundary is particularly important because the robotics directory contains existing projects.
For example:
~/projects/robotics/
├── mcp_workspaces/
├── oakd/
├── openmanipulator/
├── robotics_portfolio_1/
├── ros2_dev_mcp/
├── ros2_mcp/
├── turtlebot3/
├── universal_robots/
└── zed2/ros2_dev_mcp project operations are restricted to:
mcp_workspaces/The MCP development tools therefore have a dedicated area for generated projects instead of operating across the entire robotics directory.
MCP Client Independence
The server uses the Model Context Protocol rather than Codex-specific APIs.
The architecture is therefore:
MCP-compatible Client
|
v
ros2_dev_mcpCodex is currently used as the primary development client.
The design should not intentionally depend on Codex-specific behavior inside the MCP server implementation.
Other MCP-compatible clients can potentially use the same server if they support the required MCP transport and tools.
Independent Implementation
ros2_dev_mcp is developed as an independent implementation.
Other ROS 2 MCP projects can be studied for:
feature comparison
architectural ideas
identifying useful ROS 2 operations
understanding MCP use cases
comparing safety approaches
Their source code is not used as a copy-and-paste implementation basis.
The project should evolve according to its own architecture and requirements.
Relationship to ros2_mcp
The generic ROS MCP architecture is intentionally divided into two primary servers.
ros2_mcp
Responsibility:
ROS 2 RuntimeExamples:
list_nodes
list_topics
topic_info
read_topic
list_services
service_info
node_info
list_parameters
get_parameterFuture runtime capabilities may include controlled:
publish_topic
call_service
set_parameter
ROS 2 actions
process monitoring
launch management
logs
diagnosticsros2_dev_mcp
Responsibility:
ROS 2 DevelopmentCurrent capabilities:
create_workspace
create_package
create_node
create_launch_file
create_parameter_file
create_tests
build_project
run_testsThis separation keeps runtime control and source/project manipulation independent.
Future Specialized MCP Servers
The long-term architecture can grow through specialized MCP servers.
MCP Clients
|
+-------------------- ros2_mcp
| Generic ROS 2 runtime
|
+-------------------- ros2_dev_mcp
| ROS 2 development
|
+-------------------- ros2_control_mcp
| ros2_control
|
+-------------------- moveit2_mcp
| MoveIt 2
|
+-------------------- nav2_mcp
Nav2This prevents the generic ROS MCP server from becoming a monolithic implementation containing every ROS 2 subsystem.
Completed Phase 1 Capabilities
The current development foundation provides:
Separate ros2_dev_mcp server ✅
Runtime / development separation ✅
Configurable managed root ✅
Safe filesystem boundary ✅
Parent traversal protection ✅
Symlink escape protection ✅
Workspace creation ✅
Python package creation ✅
Python node creation ✅
ROS executable registration ✅
Launch file creation ✅
Parameter file creation ✅
Basic test creation ✅
Codex MCP integration ✅
Real Codex workspace creation ✅
Existing project isolation ✅Phase 1 Design Rules
Phase 1 establishes the following rules:
ROS 2 development and runtime operations remain separated.
Project writes are restricted to a configured managed root.
Existing ROS 2 projects outside that root are not development targets.
Project paths are validated before filesystem operations.
Symlink and parent-path escapes must be rejected.
MCP tools expose specific development capabilities instead of unrestricted filesystem access.
The MCP layer does not directly implement filesystem behavior.
Application logic is separated from concrete adapters.
Configuration values are loaded from configuration files.
MCP clients should remain replaceable.
The implementation remains independent from other ROS MCP projects.
Generated ROS 2 projects should follow normal ROS 2 conventions.
Development features should remain understandable and testable individually.
Specialized ROS 2 subsystems should later receive separate MCP servers where appropriate.
Next Phase
Phase 2 focuses on controlled project execution.
The primary tools are:
build_project
run_testsThe execution path is:
MCP Client
|
v
Project MCP Tools
|
v
ProjectService
|
v
ExecutionAdapter
|
v
SubprocessExecutionAdapter
|
+--> CommandPolicy
|
+--> SafeFilesystem
|
v
Controlled Process
|
+--> colcon build
|
+--> colcon testPhase 2 adds:
explicit command policy
controlled
colcon buildcontrolled
colcon testpackage selection
working-directory validation
build timeout
test timeout
structured execution results
See:
docs/README_PHASE_2_BUILD_TEST.mdfor the build and test execution architecture.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityBmaintenanceAn MCP server to create secure code sandbox environment for executing code within Docker containers.326MIT
- AlicenseAqualityCmaintenanceAn MCP server that provides sandboxed shell command execution with configurable security policies, enabling safe AI-assisted command runs within a project repository.3122MIT
- Flicense-qualityDmaintenanceA secure, sandboxed MCP server that provides Void Editor with safe filesystem access, enabling AI to create, read, modify, and delete files with comprehensive security controls.1
- Alicense-qualityBmaintenanceA secure MCP server that exposes local filesystem operations to AI clients with sandboxed access and runtime directory changes.MIT
Related MCP Connectors
A MCP server built for developers enabling Git based project management with project and personal…
An MCP server for Arcjet - the runtime security platform that ships with your AI code.
An MCP server for deep research or task groups
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/vagotec/ros2_dev_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server