home / mcp / netbox mcp server
Queries core NetBox data via MCP tools to fetch objects, details, and changelogs for LLM-assisted workflows.
Configuration
View docs{
"mcpServers": {
"netboxlabs-netbox-mcp-server": {
"url": "https://127.0.0.1:8000/mcp",
"headers": {
"HOST": "0.0.0.0",
"PORT": "8000",
"LOG_LEVEL": "INFO",
"TRANSPORT": "http",
"NETBOX_URL": "https://netbox.example.com/",
"VERIFY_SSL": "true",
"NETBOX_TOKEN": "<your-api-token>"
}
}
}
}You can interact with NetBox data directly through LLMs by using a read-only MCP server. It exposes core NetBox objects and change history through a simple, secure interface, enabling powerful data-driven conversations with your preferred MCP client.
You connect an MCP client to the NetBox MCP Server to retrieve core NetBox objects and view change histories. Start the server in either stdio (local) mode for development or http (HTTP) mode for web-based clients, then configure your MCP client to talk to it.
Prerequisites you need on your machine:
- Python with pip (to install dependencies) or the UV tool for running the server in stdio mode
Follow these concrete steps to set up the MCP server locally and verify it runs.
# Install dependencies using UV (recommended)
uv sync
# Or install with Python package manager
pip install -e .
# Verify the server can run locally (example values shown; replace with your NetBox URL and token)
NETBOX_URL=https://netbox.example.com/ NETBOX_TOKEN=<your-api-token> uv run netbox-mcp-server
# Optional: test the Claude Code/Code integration by adding the MCP server configuration as shown in usage examplesConfigure the server with your NetBox connection details and desired transport. The server supports two primary modes: stdio for local usage and http for web-based clients.
- In stdio mode, run the server using the UV command and point Claude Code/Claude Desktop to the local instance. Ensure your environment variables include your NetBox URL and API token.
- In HTTP mode, start the server with HTTP transport enabled, then point your web-based MCP client to the server URL (the default path includes /mcp). Ensure the server is running before attempting to connect from the client.
Create a read-only NetBox API token with permissions sufficient for the MCP tools to access data. Keep this token secret and rotate it periodically. Use transport options and SSL verification according to your security requirements.
If you need to upgrade from an older version, follow the change notes for breaking changes, update your start commands, and rebuild any runtime images if you are using containers.
- Retrieve a list of objects of a specific type (e.g., devices) and filter by a site.
- Request the change history for a particular NetBox site to audit recent activity.
- Combine NetBox data with your LLM prompts to compose network documentation or inventory reports.
Retrieves NetBox core objects based on their type and filters
Gets detailed information about a specific NetBox object by its ID
Retrieves change history records (audit trail) based on filters