NetBox MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@NetBox MCP Server List all devices in the Equinix DC14 site"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
NetBox MCP Server
⚠️ Breaking Change in v1.0.0: The project structure has changed. If upgrading from v0.1.0, update your configuration:
Change
uv run server.pytouv run netbox-mcp-serverUpdate Claude Desktop/Code configs to use
netbox-mcp-serverinstead ofserver.pyDocker users: rebuild images with updated CMD
See CHANGELOG.md for full details
This is a simple read-only Model Context Protocol server for NetBox. It enables you to interact with your data in NetBox directly via LLMs that support MCP.
Tools
Tool | Description |
get_objects | Retrieves NetBox core objects based on their type and filters |
get_object_by_id | Gets detailed information about a specific NetBox object by its ID |
get_changelogs | Retrieves change history records (audit trail) based on filters |
Note: the set of supported object types is explicitly defined and limited to the core NetBox objects for now, and won't work with object types from plugins.
Related MCP server: NetBox MCP Server
Usage
Create a read-only API token in NetBox with sufficient permissions for the tool to access the data you want to make available via MCP.
Install dependencies:
# Using UV (recommended) uv sync # Or using pip pip install -e .Verify the server can run:
NETBOX_URL=https://netbox.example.com/ NETBOX_TOKEN=<your-api-token> uv run netbox-mcp-serverAdd the MCP server to your LLM client. See below for some examples with Claude.
Claude Code
Stdio Transport (Default)
Add the server using the claude mcp add command:
claude mcp add --transport stdio netbox \
--env NETBOX_URL=https://netbox.example.com/ \
--env NETBOX_TOKEN=<your-api-token> \
-- uv --directory /path/to/netbox-mcp-server run netbox-mcp-serverImportant notes:
Replace
/path/to/netbox-mcp-serverwith the absolute path to your local cloneThe
--separator distinguishes Claude Code flags from the server commandUse
--scope projectto share the configuration via.mcp.jsonin version controlUse
--scope userto make it available across all your projects (default islocal)
After adding, verify with /mcp in Claude Code or claude mcp list in your terminal.
SSE Transport
For SSE transport, first start the server manually:
# Start the server with SSE transport (using .env or environment variables)
NETBOX_URL=https://netbox.example.com/ \
NETBOX_TOKEN=<your-api-token> \
TRANSPORT=sse \
uv run netbox-mcp-serverThen add the running server to Claude Code:
# Add the SSE MCP server (note: URL must include http:// or https:// prefix)
claude mcp add --transport sse netbox http://127.0.0.1:8000/sseImportant notes:
The URL must include the protocol prefix (
http://orhttps://)The default endpoint is
/ssewhen using SSE transportUse
/mcpendpoint forstreamable-httptransportThe server must be running before Claude Code can connect
Verify the connection with
claude mcp list- you should see a ✓ next to the server name
Claude Desktop
Add the server configuration to your Claude Desktop config file. On Mac, edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"netbox": {
"command": "uv",
"args": [
"--directory",
"/path/to/netbox-mcp-server",
"run",
"netbox-mcp-server"
],
"env": {
"NETBOX_URL": "https://netbox.example.com/",
"NETBOX_TOKEN": "<your-api-token>"
}
}
}
}On Windows, use full, escaped path to your instance, such as
C:\\Users\\myuser\\.local\\bin\\uvandC:\\Users\\myuser\\netbox-mcp-server. For detailed troubleshooting, consult the MCP quickstart.
Use the tools in your LLM client. For example:
> Get all devices in the 'Equinix DC14' site
...
> Tell me about my IPAM utilization
...
> What Cisco devices are in my network?
...
> Who made changes to the NYC site in the last week?
...
> Show me all configuration changes to the core router in the last monthField Filtering (Token Optimization)
Both netbox_get_objects() and netbox_get_object_by_id() support an optional fields parameter to reduce token usage:
# Without fields: ~5000 tokens for 50 devices
devices = netbox_get_objects('devices', {'site': 'datacenter-1'})
# With fields: ~500 tokens (90% reduction)
devices = netbox_get_objects(
'devices',
{'site': 'datacenter-1'},
fields=['id', 'name', 'status', 'site']
)Common field patterns:
Devices:
['id', 'name', 'status', 'device_type', 'site', 'primary_ip4']IP Addresses:
['id', 'address', 'status', 'dns_name', 'description']Interfaces:
['id', 'name', 'type', 'enabled', 'device']Sites:
['id', 'name', 'status', 'region', 'description']
The fields parameter uses NetBox's native field filtering. See the NetBox API documentation for details.
Configuration
The server supports multiple configuration sources with the following precedence (highest to lowest):
Command-line arguments (highest priority)
Environment variables
.envfile in the project rootDefault values (lowest priority)
Configuration Reference
Setting | Type | Default | Required | Description |
| URL | - | Yes | Base URL of your NetBox instance (e.g., https://netbox.example.com/) |
| String | - | Yes | API token for authentication |
|
|
| No | MCP transport protocol |
| String |
| If SSE/HTTP | Host address for network server |
| Integer |
| If SSE/HTTP | Port for network server |
| Boolean |
| No | Whether to verify SSL certificates |
|
|
| No | Logging verbosity |
Transport Examples
Stdio Transport (Claude Desktop/Code)
For local Claude Desktop or Claude Code usage with stdio transport:
{
"mcpServers": {
"netbox": {
"command": "uv",
"args": ["--directory", "/path/to/netbox-mcp-server", "run", "netbox-mcp-server"],
"env": {
"NETBOX_URL": "https://netbox.example.com/",
"NETBOX_TOKEN": "<your-api-token>"
}
}
}
}SSE / Streamable HTTP Transport (Web Clients, LibreChat)
For web-based MCP clients (including LibreChat) using SSE or Streamable HTTP transport:
# Using environment variables (SSE - recommended for LibreChat)
export NETBOX_URL=https://netbox.example.com/
export NETBOX_TOKEN=<your-api-token>
export TRANSPORT=sse
export HOST=127.0.0.1
export PORT=8000
uv run netbox-mcp-server
# Or using Streamable HTTP transport
uv run netbox-mcp-server \
--netbox-url https://netbox.example.com/ \
--netbox-token <your-api-token> \
--transport streamable-http \
--host 127.0.0.1 \
--port 8000LibreChat Integration
To use this MCP server with LibreChat, add the following to your librechat.yaml configuration file:
Option 1: SSE Transport (Recommended)
First, start the server:
NETBOX_URL=https://netbox.example.com/ \
NETBOX_TOKEN=<your-api-token> \
TRANSPORT=sse \
HOST=0.0.0.0 \
PORT=8000 \
uv run netbox-mcp-serverThen configure LibreChat:
mcpServers:
netbox:
type: sse
url: http://localhost:8000/sse
timeout: 30000
initTimeout: 10000
serverInstructions: trueOption 2: Streamable HTTP Transport
mcpServers:
netbox:
type: streamable-http
url: http://localhost:8000/mcp
timeout: 30000
initTimeout: 10000
serverInstructions: trueOption 3: Stdio Transport (Direct Process)
mcpServers:
netbox:
type: stdio
command: uv
args:
- "--directory"
- "/path/to/netbox-mcp-server"
- "run"
- "netbox-mcp-server"
env:
NETBOX_URL: "https://netbox.example.com/"
NETBOX_TOKEN: "${NETBOX_TOKEN}" # Reference environment variable
timeout: 30000
initTimeout: 10000
serverInstructions: trueDocker with LibreChat
If running both LibreChat and NetBox MCP Server in Docker, you can use Docker networking:
# docker-compose.yml addition
services:
netbox-mcp:
build: ./netbox-mcp-server
environment:
- NETBOX_URL=https://netbox.example.com/
- NETBOX_TOKEN=${NETBOX_TOKEN}
- TRANSPORT=sse
- HOST=0.0.0.0
- PORT=8000
ports:
- "8000:8000"Then in librechat.yaml:
mcpServers:
netbox:
type: sse
url: http://netbox-mcp:8000/sse # Use Docker service name
timeout: 30000
mcpSettings:
allowedDomains:
- "netbox-mcp" # Allow internal Docker network hostnameExample .env File
Create a .env file in the project root:
# Core NetBox Configuration
NETBOX_URL=https://netbox.example.com/
NETBOX_TOKEN=your_api_token_here
# Transport Configuration (optional, defaults to stdio)
# Options: stdio, sse, streamable-http
TRANSPORT=stdio
# Network Transport Settings (only used if TRANSPORT=sse or streamable-http)
# HOST=127.0.0.1
# PORT=8000
# Security (optional, defaults to true)
VERIFY_SSL=true
# Logging (optional, defaults to INFO)
LOG_LEVEL=INFOCLI Arguments
All configuration options can be overridden via CLI arguments:
uv run netbox-mcp-server --help
# Common examples:
uv run netbox-mcp-server --log-level DEBUG --no-verify-ssl # Development
uv run netbox-mcp-server --transport sse --port 9000 # SSE on custom port
uv run netbox-mcp-server --transport streamable-http # Streamable HTTP transportDocker Usage
Standard Docker Image
Build and run the NetBox MCP server in a container:
# Build the image
docker build -t netbox-mcp-server:latest .
# Run with SSE transport (recommended for Docker containers)
docker run --rm \
-e NETBOX_URL=https://netbox.example.com/ \
-e NETBOX_TOKEN=<your-api-token> \
-e TRANSPORT=sse \
-e HOST=0.0.0.0 \
-e PORT=8000 \
-p 8000:8000 \
netbox-mcp-server:latestNote: Docker containers require
TRANSPORT=sseorTRANSPORT=streamable-httpsince stdio transport doesn't work in containerized environments.
Connecting to NetBox on your host machine:
If your NetBox instance is running on your host machine (not in a container), you need to use host.docker.internal instead of localhost on macOS and Windows:
# For NetBox running on host (macOS/Windows)
docker run --rm \
-e NETBOX_URL=http://host.docker.internal:18000/ \
-e NETBOX_TOKEN=<your-api-token> \
-e TRANSPORT=sse \
-e HOST=0.0.0.0 \
-e PORT=8000 \
-p 8000:8000 \
netbox-mcp-server:latestNote: On Linux, you can use
--network hostinstead, or use the host's IP address directly.
With additional configuration options:
docker run --rm \
-e NETBOX_URL=https://netbox.example.com/ \
-e NETBOX_TOKEN=<your-api-token> \
-e TRANSPORT=sse \
-e HOST=0.0.0.0 \
-e LOG_LEVEL=DEBUG \
-e VERIFY_SSL=false \
-p 8000:8000 \
netbox-mcp-server:latestThe server will be accessible at:
SSE transport:
http://localhost:8000/sseStreamable HTTP transport:
http://localhost:8000/mcp
Development
Contributions are welcome! Please open an issue or submit a PR.
License
This project is licensed under the Apache 2.0 license. See the LICENSE file for details.
Available Tools
4 toolsnetbox_get_changelogsA
Get object change records (changelogs) from NetBox based on filters.
Args: filters: dict of filters to apply to the API call based on the NetBox API filtering options
Returns: Paginated response dict with the following structure: - count: Total number of changelog entries matching the query ALWAYS REFER TO THIS FIELD FOR THE TOTAL NUMBER OF CHANGELOG ENTRIES MATCHING THE QUERY - next: URL to next page (or null if no more pages) ALWAYS REFER TO THIS FIELD FOR THE NEXT PAGE OF RESULTS - previous: URL to previous page (or null if on first page) ALWAYS REFER TO THIS FIELD FOR THE PREVIOUS PAGE OF RESULTS - results: Array of changelog entries for this page ALWAYS REFER TO THIS FIELD FOR THE CHANGELOG ENTRIES ON THIS PAGE
Filtering options include:
user_id: Filter by user ID who made the change
user: Filter by username who made the change
changed_object_type_id: Filter by numeric ContentType ID (e.g., 21 for dcim.device) Note: This expects a numeric ID, not an object type string
changed_object_id: Filter by ID of the changed object
object_repr: Filter by object representation (usually contains object name)
action: Filter by action type (created, updated, deleted)
time_before: Filter for changes made before a given time (ISO 8601 format)
time_after: Filter for changes made after a given time (ISO 8601 format)
q: Search term to filter by object representation
Examples: To find all changes made to a specific object by ID: {"changed_object_id": 123}
To find changes by object name pattern: {"object_repr": "router-01"}
To find all deletions in the last 24 hours: {"action": "delete", "time_after": "2023-01-01T00:00:00Z"}
Each changelog entry contains:
id: The unique identifier of the changelog entry
user: The user who made the change
user_name: The username of the user who made the change
request_id: The unique identifier of the request that made the change
action: The type of action performed (created, updated, deleted)
changed_object_type: The type of object that was changed
changed_object_id: The ID of the object that was changed
object_repr: String representation of the changed object
object_data: The object's data after the change (null for deletions)
object_data_v2: Enhanced data representation
prechange_data: The object's data before the change (null for creations)
postchange_data: The object's data after the change (null for deletions)
time: The timestamp when the change was made
Inputs: filters (required).
netbox_get_object_by_idA
Get detailed information about a specific NetBox object by its ID.
Args: object_type: String representing the NetBox object type (e.g. "dcim.device", "ipam.ipaddress") object_id: The numeric ID of the object fields: Optional list of specific fields to return IMPORTANT: ALWAYS USE THIS PARAMETER TO MINIMIZE TOKEN USAGE Field filtering reduces response payload by 80-90% and is critical for performance.
- None or [] = returns all fields (NOT RECOMMENDED - use only when you need complete objects)
- ['id', 'name'] = returns only specified fields (RECOMMENDED)
Examples:
- For basic info: ['id', 'name', 'status']
- For devices: ['id', 'name', 'status', 'site']
- For IP addresses: ['address', 'dns_name', 'vrf', 'status']
Uses NetBox's native field filtering via ?fields= parameter.
**Always specify only the fields you actually need.**
brief: returns only a minimal representation of the object in the response.
This is useful when you need only a summary of the object without any related data.Returns: Object dict (complete or with only requested fields based on fields parameter)
Inputs: object_id (required), object_type (required), brief, fields.
netbox_get_objectsA
Get objects from NetBox based on their type and filters
Args:
object_type: String representing the NetBox object type (e.g. "dcim.device", "ipam.ipaddress")
filters: dict of filters to apply to the API call based on the NetBox API filtering options
FILTER RULES:
Valid: Direct fields like {'site_id': 1, 'name': 'router', 'status': 'active'}
Valid: Lookups like {'name__ic': 'switch', 'id__in': [1,2,3], 'vid__gte': 100}
Invalid: Multi-hop like {'device__site_id': 1} - NOT supported
Lookup suffixes: n, ic, nic, isw, nisw, iew, niew, ie, nie,
empty, regex, iregex, lt, lte, gt, gte, in
Two-step pattern for cross-relationship queries:
sites = netbox_get_objects('dcim.site', {'name': 'NYC'})
netbox_get_objects('dcim.device', {'site_id': sites[0]['id']})
fields: Optional list of specific fields to return
**IMPORTANT: ALWAYS USE THIS PARAMETER TO MINIMIZE TOKEN USAGE**
Field filtering significantly reduces response payload and is critical for performance.
- None or [] = returns all fields (NOT RECOMMENDED - use only when you need complete objects)
- ['id', 'name'] = returns only specified fields (RECOMMENDED)
Examples:
- For counting: ['id'] (minimal payload)
- For listings: ['id', 'name', 'status']
- For IP addresses: ['address', 'dns_name', 'description']
Uses NetBox's native field filtering via ?fields= parameter.
**Always specify only the fields you actually need.**
brief: returns only a minimal representation of each object in the response.
This is useful when you need only a list of available objects without any related data.
limit: Maximum results to return (default 5, max 100)
Start with default, increase only if needed
offset: Skip this many results for pagination (default 0)
Example: offset=0 (page 1), offset=5 (page 2), offset=10 (page 3)
ordering: Fields used to determine sort order of results.
Field names may be prefixed with '-' to invert the sort order.
Multiple fields may be specified with a list of strings.
Examples:
- 'name' (alphabetical by name)
- '-id' (ordered by ID descending)
- ['facility', '-name'] (by facility, then by name descending)
- None, '' or [] (default NetBox ordering)
Returns:
Paginated response dict with the following structure:
- count: Total number of objects matching the query
ALWAYS REFER TO THIS FIELD FOR THE TOTAL NUMBER OF OBJECTS MATCHING THE QUERY
- next: URL to next page (or null if no more pages)
ALWAYS REFER TO THIS FIELD FOR THE NEXT PAGE OF RESULTS
- previous: URL to previous page (or null if on first page)
ALWAYS REFER TO THIS FIELD FOR THE PREVIOUS PAGE OF RESULTS
- results: Array of objects for this page
ALWAYS REFER TO THIS FIELD FOR THE OBJECTS ON THIS PAGE
ENSURE YOU ARE AWARE THE RESULTS ARE PAGINATED BEFORE PROVIDING RESPONSE TO THE USER.
Valid object_type values:
- circuits.circuit
circuits.circuitgroup
circuits.circuitgroupassignment
circuits.circuittermination
circuits.circuittype
circuits.provider
circuits.provideraccount
circuits.providernetwork
circuits.virtualcircuit
circuits.virtualcircuittermination
circuits.virtualcircuittype
core.datafile
core.datasource
core.job
core.objectchange
core.objecttype
dcim.cable
dcim.cabletermination
dcim.consoleport
dcim.consoleporttemplate
dcim.consoleserverport
dcim.consoleserverporttemplate
dcim.device
dcim.devicebay
dcim.devicebaytemplate
dcim.devicerole
dcim.devicetype
dcim.frontport
dcim.frontporttemplate
dcim.interface
dcim.interfacetemplate
dcim.inventoryitem
dcim.inventoryitemrole
dcim.inventoryitemtemplate
dcim.location
dcim.macaddress
dcim.manufacturer
dcim.module
dcim.modulebay
dcim.modulebaytemplate
dcim.moduletype
dcim.moduletypeprofile
dcim.platform
dcim.powerfeed
dcim.poweroutlet
dcim.poweroutlettemplate
dcim.powerpanel
dcim.powerport
dcim.powerporttemplate
dcim.rack
dcim.rackreservation
dcim.rackrole
dcim.racktype
dcim.rearport
dcim.rearporttemplate
dcim.region
dcim.site
dcim.sitegroup
dcim.virtualchassis
dcim.virtualdevicecontext
extras.bookmark
extras.configcontext
extras.configtemplate
extras.customfield
extras.customfieldchoiceset
extras.customlink
extras.eventrule
extras.exporttemplate
extras.imageattachment
extras.journalentry
extras.notification
extras.notificationgroup
extras.savedfilter
extras.script
extras.subscription
extras.tableconfig
extras.tag
extras.taggeditem
extras.webhook
ipam.aggregate
ipam.asn
ipam.asnrange
ipam.fhrpgroup
ipam.fhrpgroupassignment
ipam.ipaddress
ipam.iprange
ipam.prefix
ipam.rir
ipam.role
ipam.routetarget
ipam.service
ipam.servicetemplate
ipam.vlan
ipam.vlangroup
ipam.vlantranslationpolicy
ipam.vlantranslationrule
ipam.vrf
tenancy.contact
tenancy.contactassignment
tenancy.contactgroup
tenancy.contactrole
tenancy.tenant
tenancy.tenantgroup
users.group
users.objectpermission
users.token
users.user
virtualization.cluster
virtualization.clustergroup
virtualization.clustertype
virtualization.virtualdisk
virtualization.virtualmachine
virtualization.vminterface
vpn.ikepolicy
vpn.ikeproposal
vpn.ipsecpolicy
vpn.ipsecprofile
vpn.ipsecproposal
vpn.l2vpn
vpn.l2vpntermination
vpn.tunnel
vpn.tunnelgroup
vpn.tunneltermination
wireless.wirelesslan
wireless.wirelesslangroup
wireless.wirelesslink
See NetBox API documentation for filtering options for each object type.
Inputs: filters (required), object_type (required), brief, limit, +3 more.
netbox_search_objectsA
Perform global search across NetBox infrastructure.
Searches names, descriptions, IP addresses, serial numbers, asset tags,
and other key fields across multiple object types.
Args:
query: Search term (device names, IPs, serial numbers, hostnames, site names)
Examples: 'switch01', '192.168.1.1', 'NYC-DC1', 'SN123456'
object_types: Limit search to specific types (optional)
Default: [dcim.device', 'dcim.site', 'ipam.ipaddress', 'dcim.interface', 'dcim.rack', 'ipam.vlan', 'circuits.circuit', 'virtualization.virtualmachine]
Examples: ['dcim.device', 'ipam.ipaddress', 'dcim.site']
fields: Optional list of specific fields to return (reduces response size) IT IS STRONGLY RECOMMENDED TO USE THIS PARAMETER TO MINIMIZE TOKEN USAGE.
- None or [] = returns all fields (no filtering)
- ['id', 'name'] = returns only specified fields
Examples: ['id', 'name', 'status'], ['address', 'dns_name']
Uses NetBox's native field filtering via ?fields= parameter
limit: Max results per object type (default 5, max 100)
Returns:
Dictionary with object_type keys and list of matching objects.
All searched types present in result (empty list if no matches).
Example:
# Search for anything matching "switch"
results = netbox_search_objects('switch')
# Returns: {
# 'dcim.device': [{'id': 1, 'name': 'switch-01', ...}],
# 'dcim.site': [],
# ...
# }
# Search for IP address
results = netbox_search_objects('192.168.1.100')
# Returns: {
# 'ipam.ipaddress': [{'id': 42, 'address': '192.168.1.100/24', ...}],
# ...
# }
# Limit search to specific types with field projection
results = netbox_search_objects(
'NYC',
object_types=['dcim.site', 'dcim.location'],
fields=['id', 'name', 'status']
)
Inputs: query (required), limit, fields, object_types. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
netbox_get_objects vs netbox_search_objects overlap somewhat (both return typed object lists with filters/fields/limit), but search's cross-type fuzzy q-based behavior vs get_objects' strict per-type filtering is reasonably distinct. netbox_get_object_by_id and netbox_get_changelogs are clearly separate purposes, with only minor potential confusion between fetching a single object by ID versus by filter.
All four tools follow a strict netbox_verb_noun snake_case pattern (get_objects, get_object_by_id, get_changelogs, search_objects). The convention is predictable and easy for an agent to parse.
Four generic tools are well-scoped and each is highly leveraged, covering the entire 130+ object type model through a single parameterized interface. It is slightly on the thin side, and get_object_by_id is a minor convenience over get_objects with an id filter, but the count is reasonable for a read-focused API wrapper.
The surface is entirely read-only: there is no way to create, update, or delete any NetBox object, which is a major gap for a full NetBox API domain. Read coverage is good (list, get-by-id, search, changelog), but the absence of all mutation operations will block many real workflows.
Maintenance
Related MCP Connectors
Read-only discovery of ChatGXT's integration catalog and public MCP capabilities.
Query your org's data in natural language — read-only MCP access to SQL, NoSQL, files & warehouses.
The HubSpot MCP Server acts as a bridge that enables AI assistants and Large Language Models to securely interact with HubSpot CRM data through natural conversation, without requiring users to understand complex API structures. It provides read-only access to standard CRM objects (contacts, companies, deals, tickets, products, invoices, and more) and their associations, secured via OAuth 2.0, allowing AI agents to perform tasks like summarizing deals, fetching company updates, and looking up record changes.
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables read-only interaction with NetBox network documentation and infrastructure data through LLMs. Allows querying devices, sites, IP addresses, and viewing change history via natural language.3Apache 2.0

NetBox MCP Serverofficial
AlicenseAqualityBmaintenanceRead-only MCP server for NetBox that enables LLMs to query NetBox objects (devices, IPAM, etc.) and change logs through natural language, with field filtering for token optimization.4260Apache 2.0- AlicenseBqualityCmaintenanceGives AI assistants read (and optionally write) access to a NetBox instance, covering DCIM, IPAM, circuits, virtualization, tenancy, and more.10040 npm1MIT
- FlicenseAqualityDmaintenanceEnables an LLM to read and write NetBox data through its REST API, supporting listing endpoints, inspecting schemas, and creating, updating, or deleting objects.7-