Skip to content

Connecting Nautobot MCP Server to GitHub Copilot

This guide walks you through connecting an already-running Nautobot MCP Server to GitHub Copilot in VS Code.

Prerequisites

Configure VS Code

VS Code supports remote MCP servers natively over HTTP. You configure the server in a .vscode/mcp.json file (workspace-level) or via user settings.

Create a .vscode/mcp.json file in your project root. This can be shared with your team via source control.

{
  "servers": {
    "Nautobot": {
      "type": "http",
      "url": "https://mcp.yourcompany.com/mcp",
      "headers": {
        "Authorization": "Bearer ${input:nautobot-api-token}"
      }
    }
  },
  "inputs": [
    {
      "id": "nautobot-api-token",
      "type": "promptString",
      "description": "Nautobot API Token",
      "password": true
    }
  ]
}

Configuration:

  • type - Must be http for remote MCP servers
  • url - 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.
  • headers - Passes your Nautobot API token as a Bearer token
  • inputs - Prompts you securely for the API token so it is not hardcoded in the file. For local development, you can skip the inputs section and hardcode the token directly in the Authorization header (e.g., "Bearer YOUR_NAUTOBOT_API_TOKEN").

Option 2: User-Level Configuration

To configure the server globally across all projects, open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and run MCP: Open User Configuration. Add the same server configuration as shown above.

Option 3: Command Palette

You can also add the server interactively:

  1. Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
  2. Run MCP: Add Server
  3. Select HTTP as the server type
  4. Enter your server URL (e.g., https://mcp.yourcompany.com/mcp)
  5. Enter a name/ID for the server (e.g., Nautobot)
  6. Select the configuration level (workspace or user)

Note: The Command Palette method does not prompt for headers. You will need to manually add the headers section to the generated configuration file afterward.

Start the Server

After adding the configuration, VS Code will show a Start code lens action above the server entry in mcp.json. Click Start to initialize the connection, or run MCP: List Servers from the Command Palette and start the server from there.

VS Code MCP Start

Verify Connection

Once started, you can verify the connection in several ways:

  1. MCP Server List - Run MCP: List Servers from the Command Palette to see the status of all configured MCP servers

    VS Code MCP Server List

  2. Extensions Sidebar - In the Extensions view (Ctrl+Shift+X / Cmd+Shift+X), expand the MCP Servers - Installed section to see the server status, configuration, and management options.

    VS Code MCP Extensions View

  3. Chat Panel - In the Copilot Chat panel, click the Configure Tools... button to see the Nautobot MCP Server.

    VS Code MCP Tools

Managing the Server

Restart or Stop

  • Run MCP: List Servers from the Command Palette, select the Nautobot server, and choose Restart Server or Stop Server
  • Use the inline code lens actions in mcp.json to restart or stop the server

Remove

Delete the server entry from your .vscode/mcp.json file or user configuration.

View Logs

If the server encounters issues, you can view the output logs:

  1. Run MCP: List Servers from the Command Palette
  2. Select the Nautobot server
  3. Choose Show Output to open the MCP output channel

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 output - Run MCP: List Servers -> Show Output to view error details

TLS Certificate Issues

If connecting to a server with a self-signed or private CA certificate, you may need to set http.proxyStrictSSL to false in your VS Code settings, or add the CA certificate to your system trust store.

Token Not Being Sent

Ensure the headers section is correctly configured in your mcp.json. If using input variables, verify the inputs array is present and the id matches the ${input:...} reference in the header value.

Example Usage in GitHub Copilot

Once configured, you can ask GitHub Copilot to query your Nautobot instance using the Chat panel in VS Code:

"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"

GitHub Copilot will use the Nautobot MCP Server to query your Nautobot instance.