Skip to content

Connecting Nautobot MCP Server to Claude Code

This guide walks you through connecting an already-running Nautobot MCP Server to Claude Code.

Prerequisites

Configure Claude Code

Claude Code natively supports remote MCP servers over HTTP. You add the server using the claude mcp add command. Both streamable-http and sse transports are supported.

claude mcp add --transport http nautobot https://mcp.yourcompany.com/mcp \
  --header "Authorization: Bearer YOUR_NAUTOBOT_API_TOKEN"

Configuration:

  • --transport - Match the MCP server's MCP_TRANSPORT setting (use --transport http for streamable-http or --transport sse for SSE)
  • https://mcp.yourcompany.com/mcp - Your server's URL (use /mcp for streamable-http or /sse for SSE transport). For a local MCP server, use http://localhost:8000/mcp instead.
  • --header - Passes your Nautobot API token as a Bearer token

Verify Connection

After adding the server, verify it is configured correctly:

# List all configured MCP servers
$ claude mcp list

Checking MCP server health...

nautobot: http://localhost:8000/mcp (HTTP) -  Connected
# Get details for the Nautobot MCP Server
$ claude mcp get nautobot

Within a Claude Code session, you can also check the server status by typing:

/mcp

Managing the Server

# Remove the Nautobot MCP Server
$ claude mcp remove nautobot

Troubleshooting

Server Not Connecting

  1. Verify server is running - Check that the Nautobot MCP Server is running and accessible
  2. Check the endpoint - Ensure the URL ends with /mcp for streamable-http transport or /sse for SSE transport
  3. Verify your token - An invalid Nautobot API token will prevent successful connection
  4. Check server status - Run /mcp within a Claude Code session to see the connection status
  5. Check transport match - Ensure the --transport flag matches your server's MCP_TRANSPORT setting

TLS Certificate Issues

If connecting to a server with a self-signed or private CA certificate, you may need to set NODE_TLS_REJECT_UNAUTHORIZED=0 in your environment, or add the CA certificate to your system trust store.

Example Usage in Claude Code

Once configured, you can ask Claude Code to query your Nautobot instance:

"Get all active devices in Texas with their names, locations, and device types"

"Show me all interfaces on devices in the NYC location"

"Find the first 10 VLANs with ID between 100 and 200"

"List the primary IP addresses for devices in the production environment, limit to 20 results"

Claude Code will use the Nautobot MCP Server to query your Nautobot instance.