Nautobot MCP enables AI assistants and applications to interact with your network data through a standardized protocol. It runs an MCP server alongside Nautobot that exposes tools which can be used by AI systems to access and manage your network automation environment.
Install the package using pip:
pip install nautobot-mcp
Add the app to your Nautobot configuration:
# In your nautobot_config.py
PLUGINS = [
"nautobot_mcp",
# ... other plugins
]
Configure the MCP server in your Nautobot configuration file:
# In your nautobot_config.py
PLUGINS_CONFIG = {
"nautobot_mcp": {
"MCP_PORT": 8005, # MCP server port
"MCP_HOST": "0.0.0.0", # Default is 0.0.0.0
"MCP_CUSTOM_TOOLS_DIR": "/path/to/your/custom/tools", # Directory for custom tools
"MCP_LOAD_CORE_TOOLS": False, # Load built-in tools
},
}
Run the post-upgrade command to complete the installation:
nautobot-server post_upgrade
You can start the MCP server manually with:
nautobot-server start_mcp_server
For production environments, it's recommended to use systemd:
/etc/systemd/system/nautobot-mcp.service
:[Unit]
Description=Nautobot MCP Server
After=network-online.target
Wants=network-online.target
[Service]
User=nautobot
Group=nautobot
WorkingDirectory=/opt/nautobot
ExecStart=/opt/nautobot/venv/bin/nautobot-server start_mcp_server
Restart=on-failure
RestartSec=30
PrivateTmp=true
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable --now nautobot-mcp.service
You can extend functionality by creating custom tools in the directory specified by MCP_CUSTOM_TOOLS_DIR
:
# In /path/to/your/custom/tools/my_tools.py
def some_tool(param1: str, param2: str) -> dict:
"""Some tool description"""
# Your implementation here
return {"result": f"Tool result for {param1} and {param2}"}
Access the web interface to see all available tools:
https://your-nautobot-server/plugins/nautobot-mcp/tools/
This page displays all registered tools with their descriptions, module paths, and parameter specifications.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "nautobot-mcp" '{"command":"pip","args":["install","nautobot-mcp"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"nautobot-mcp": {
"command": "pip",
"args": [
"install",
"nautobot-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"nautobot-mcp": {
"command": "pip",
"args": [
"install",
"nautobot-mcp"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect