Nav2 MCP Server

v1.0.0Developer Toolsstable

MCP server that provides tools and resources to control and monitor robots using Nav2.

mcpmcp-servernav2rosros2
Share:
73
Stars
0
Downloads
0
Weekly
0/5

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

Control and monitor robots using Nav2 navigation system.
Manage ROS2-based robot operations through MCP tools.
ajtudela

Maintainer

LicenseApache-2.0
Languagepython
Versionv1.0.0
UpdatedMay 20, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx nav2-mcp-server

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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 sync
2

Configure 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=INFO
3

Or 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:latest
4

Add 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"
      }
    }
  }
}
5

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.

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.

Quick Config Preview

{ "mcpServers": { "nav2-mcp-server": { "command": "npx", "args": ["-y", "nav2-mcp-server"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides