Connecting NautobotGPT MCP Server to GitHub Copilot¶
This guide walks you through connecting the NautobotGPT MCP Server to GitHub Copilot in VS Code.
Prerequisites¶
- VS Code with GitHub Copilot extension installed (see VS Code documentation and MCP setup guide)
- NautobotGPT instance
- NautobotGPT MCP Server enabled for your instance
- Your NautobotGPT API key (see Getting Your API Key)
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.
Option 1: Workspace-Level Configuration (Recommended)¶
Create a .vscode/mcp.json file in your project root. This can be shared with your team via source control.
{
"servers": {
"NautobotGPT": {
"type": "http",
"url": "https://YOUR_NAUTOBOTGPT_INSTANCE.nautobot.cloud/mcp",
"headers": {
"Authorization": "Bearer ${input:nautobotgpt-api-key}"
}
}
},
"inputs": [
{
"id": "nautobotgpt-api-key",
"type": "promptString",
"description": "NautobotGPT API Key",
"password": true
}
]
}
Configuration:
type- Must behttpfor remote MCP serversurl- Your NautobotGPT MCP Server's URLheaders- Passes your NautobotGPT API key as a Bearer tokeninputs- Prompts you securely for the API key so it is not hardcoded in the file. For local development, you can skip theinputssection and hardcode the key directly in theAuthorizationheader (e.g.,"Bearer YOUR_NAUTOBOTGPT_API_KEY").
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:
- Open the Command Palette (
Ctrl+Shift+P/Cmd+Shift+P) - Run MCP: Add Server
- Select HTTP as the server type
- Enter your server URL (e.g.,
https://YOUR_NAUTOBOTGPT_INSTANCE.nautobot.cloud/mcp) - Enter a name/ID for the server (e.g.,
NautobotGPT) - 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.

Verify Connection¶
Once started, you can verify the connection in several ways:
-
MCP Server List - Run MCP: List Servers from the Command Palette to see the status of all configured MCP servers

-
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.
-
Chat Panel - In the Copilot Chat panel, click the Configure Tools... button to see the NautobotGPT MCP Server.

Managing the Server¶
Restart or Stop¶
- Run MCP: List Servers from the Command Palette, select the NautobotGPT server, and choose Restart Server or Stop Server
- Use the inline code lens actions in
mcp.jsonto 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:
- Run MCP: List Servers from the Command Palette
- Select the NautobotGPT server
- Choose Show Output to open the MCP output channel
Troubleshooting¶
Server Not Connecting¶
- Verify server is running - Check that the NautobotGPT MCP Server is running and accessible
- Check the endpoint - Ensure the URL ends with
/mcp - Verify your token - An invalid NautobotGPT API token will prevent successful connection
- 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.
Recommended: Add Agent Instructions¶
To ensure GitHub Copilot automatically consults the NautobotGPT MCP Server when working on a Nautobot project, create a .github/copilot-instructions.md file in your repository with the following content:
# AI Agent Instructions
## NautobotGPT MCP Server Usage
This workspace uses the **NautobotGPT MCP Server**. When the user asks about anything related to Nautobot — code generation, platform knowledge, troubleshooting, or best practices — you MUST use the `nautobotgpt_query` MCP tool before writing or suggesting code.
### When to use the `nautobotgpt_query` tool
- Generating Nautobot code: models, views, forms, serializers, jobs, filters, tables, API endpoints, templates, etc.
- Questions about Nautobot architecture, conventions, or best practices
- Troubleshooting Nautobot errors or unexpected behavior
- Validating an approach before implementing it
### How to use it
Call the `nautobotgpt_query` tool with a clear, specific query describing what you need. Use the response to inform the code you write or the answer you provide.
**Do not generate Nautobot code from your own training data alone.** Always consult the MCP tool first — even if the request seems straightforward. NautobotGPT has up-to-date, authoritative knowledge of Nautobot patterns that may differ from what you know.
This instructs GitHub Copilot to always use the NautobotGPT MCP Server for any Nautobot-related queries.