Nav2 MCP Server
MCP server that provides tools and resources to control and monitor robots using Nav2.
What is Nav2 MCP Server?
Nav2 MCP Server is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to mcp server that provides tools and resources to control and monitor robots using nav2.
MCP server that provides tools and resources to control and monitor robots using Nav2.
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- MCP server that provides tools and resources to control and
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx nav2-mcp-serverConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Nav2 MCP Server
The Nav2 MCP server provides an MCP interface to ROS 2 Nav2 robot navigation, letting AI assistants issue navigation commands and monitor real-time robot state through natural language. Tools cover full navigation lifecycle: driving to poses, following waypoints, spinning, backing up, docking, costmap management, and path planning—making it a complete AI interface for autonomous robot control in ROS 2 Jazzy environments.
Prerequisites
- ROS 2 Jazzy installed and sourced (ros2 topic list should work in your shell)
- A running Nav2 stack connected to a physical robot or simulator such as Gazebo
- Python 3.10+ and uv package manager
- An MCP-compatible client such as Claude Desktop, Cursor, or VS Code
Clone and install the nav2_mcp_server
Clone the repository and install Python dependencies with uv. Source your ROS 2 environment first so that rclpy and Nav2 message types are available.
source /opt/ros/jazzy/setup.bash
git clone https://github.com/ajtudela/nav2_mcp_server.git
cd nav2_mcp_server
export ROS_DOMAIN_ID=0
uv syncConfigure environment variables
Create a .env file from the example template and set transport mode, ROS domain, and logging level to match your robot's configuration.
cp .env.example .env
# Set in .env:
# TRANSPORT_MODE=stdio
# ROS_DOMAIN_ID=0
# ROS_LOCALHOST_ONLY=1
# LOG_LEVEL=INFOOr pull and run the Docker image
A pre-built Docker image is available for environments where you prefer a containerized setup.
docker pull ghcr.io/ajtudela/nav2_mcp_server:latest
docker run -i --rm -e ROS_DOMAIN_ID=0 ghcr.io/ajtudela/nav2_mcp_server:latestAdd the server to your MCP client configuration
Configure your MCP client to run nav2-mcp-server via uv with the correct ROS 2 environment variables set.
{
"mcpServers": {
"nav2 mcp server": {
"type": "stdio",
"command": "uv",
"args": [
"run",
"--directory",
"/absolute/path/to/nav2_mcp_server",
"nav2-mcp-server"
],
"env": {
"ROS_DOMAIN_ID": "0",
"ROS_LOCALHOST_ONLY": "1"
}
}
}
}Restart your client and test robot pose retrieval
Restart Claude Desktop or your MCP client and ask it to retrieve the robot's current pose. This confirms the server is communicating with the Nav2 stack.
Nav2 MCP Server Examples
Client configuration
MCP client configuration for nav2_mcp_server using uv stdio transport with ROS 2 environment variables.
{
"mcpServers": {
"nav2 mcp server": {
"type": "stdio",
"command": "uv",
"args": [
"run",
"--directory",
"/home/user/nav2_mcp_server",
"nav2-mcp-server"
],
"env": {
"ROS_DOMAIN_ID": "0",
"ROS_LOCALHOST_ONLY": "1"
}
}
}
}Prompts to try
Natural language prompts to control your Nav2-enabled robot through an AI client.
- "Where is the robot right now? Give me its x, y, and yaw."
- "Navigate the robot to coordinates x=3.0, y=2.0 facing north"
- "Plan a path from the robot's current position to x=5.0, y=5.0"
- "Clear the local costmap"
- "Make the robot spin 180 degrees in place"
- "Navigate through these waypoints in order: (1,0), (2,1), (3,0)"Troubleshooting Nav2 MCP Server
Server starts but navigation commands have no effect on the robot
Check that Nav2 lifecycle nodes are in the 'active' state. If Nav2 was just started, use the nav2_lifecycle tool with action='startup' to activate all nodes. Verify ROS_DOMAIN_ID matches the domain ID used by the Nav2 stack.
rclpy or Nav2 message imports fail during startup
Source your ROS 2 installation before running uv sync and before starting the MCP server: 'source /opt/ros/jazzy/setup.bash'. The env block in your MCP config does not automatically source ROS 2, so the client process must inherit a sourced environment.
Docker container exits immediately without errors
Run the container with the -i flag to keep stdin open (as shown in the example). Ensure ROS_DOMAIN_ID is passed with -e. For network access to the ROS 2 DDS middleware, you may also need --network=host on Linux.
Frequently Asked Questions about Nav2 MCP Server
What is Nav2 MCP Server?
Nav2 MCP Server is a Model Context Protocol (MCP) server that mcp server that provides tools and resources to control and monitor robots using nav2. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Nav2 MCP Server?
Follow the installation instructions on the Nav2 MCP Server GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Nav2 MCP Server?
Nav2 MCP Server works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Nav2 MCP Server free to use?
Yes, Nav2 MCP Server is open source and available under the Apache-2.0 license. You can use it freely in both personal and commercial projects.
Nav2 MCP Server Alternatives — Similar Developer Tools Servers
Looking for alternatives to Nav2 MCP Server? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Nav2 MCP Server in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Nav2 MCP Server?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.