netbox-mcp
This server gives an LLM read and write access to a NetBox installation via generic REST API tools for discovery, CRUD, and server-side actions.
Discover all supported NetBox endpoints grouped by app (
netbox_list_endpoints)Inspect field schemas, required fields, types, and valid choices before writing (
netbox_get_schema)List or search objects with optional filters and configurable limits (
netbox_list_objects)Fetch a single object by numeric ID (
netbox_get_object)Create new objects with arbitrary field data (
netbox_create_object)Partially update existing objects (
netbox_update_object)Delete objects, but only with explicit confirmation (
netbox_delete_object)List available server-side actions beyond CRUD, such as IP/prefix/VLAN/ASN allocation, cable trace, config rendering, rack elevation, and data source sync (
netbox_list_actions)Call those actions on specific objects (
netbox_call_action)Run in read-only mode to disable all create/update/delete tools, protecting real NetBox installations
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 List the sites in NetBox and how many devices are in each."
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
An MCP server that gives an LLM read and write access to a NetBox installation over its REST API.
By default it points at the public demo instance at https://demo.netbox.dev. Point it at your own NetBox installation later by changing two environment variables — no code changes needed.
Tools
Rather than one tool per NetBox object type (there are 100+), this server exposes a small set of generic tools that operate on any endpoint:
netbox_list_endpoints— list every supportedapp.endpointvalue (e.g.dcim.devices,ipam.prefixes), grouped by NetBox app.netbox_get_schema(endpoint)— get field definitions (required fields, types, valid choices) for an endpoint before writing to it.netbox_list_objects(endpoint, filters=None, limit=50)— list/search objects.netbox_get_object(endpoint, id)— get a single object by ID.netbox_create_object(endpoint, data)— create a new object.netbox_update_object(endpoint, id, data)— partially update an object.netbox_delete_object(endpoint, id, confirm=True)— delete an object (requires explicit confirmation).netbox_list_actions— list every supported server-side "action" (beyond plain CRUD), e.g. allocating the next available IP/prefix/VLAN/ASN, tracing a cable path, rendering a device's config, a rack's elevation, or triggering a data source sync.netbox_call_action(endpoint, id, action, method="list", params=None, data=None)— call one of those actions on a specific object.
Related MCP server: NetBox MCP Server
Setup
Requires uv.
uv sync
cp .env.example .envEdit .env:
NETBOX_URL— your NetBox instance, e.g.https://demo.netbox.devor your own install.NETBOX_TOKEN— an API token from your NetBox user profile (Admin > API Tokens). Required for both reads and writes. For the public demo, create a free account (it's reset periodically) then generate a token from your user profile.NETBOX_MCP_READ_ONLY— set totrueto disable all create/update/delete tools. Recommended until you're confident in the setup, especially against a real installation.NETBOX_VERIFY_SSL— set tofalseonly if your instance uses a self-signed certificate.
Running
uv run netbox-mcpThis runs the server over stdio, which is how MCP clients like Claude Code and Claude Desktop launch it.
Try it interactively
uv run mcp dev src/netbox_mcp/server.pyOpens the MCP Inspector so you can call tools directly and see NetBox's responses before wiring the server into a client.
Connect to Claude Code
Add to .mcp.json in your project (or user-level MCP config):
{
"mcpServers": {
"netbox": {
"command": "uv",
"args": ["--directory", "/path/to/netbox-mcp", "run", "netbox-mcp"],
"env": {
"NETBOX_URL": "https://demo.netbox.dev",
"NETBOX_TOKEN": "your-api-token",
"NETBOX_MCP_READ_ONLY": "false"
}
}
}
}Connect to Claude Desktop
Add the same netbox entry under mcpServers in your claude_desktop_config.json.
Switching to your own NetBox instance
Change NETBOX_URL and NETBOX_TOKEN (in .env, or in the client's MCP server config) and restart the server. Nothing else changes.
Example prompts
"List the sites in NetBox and how many devices are in each."
"What's the schema for creating a device? I want to add a new switch called sw-core-02."
"Find all unused IP addresses in the 10.0.0.0/24 prefix."
"Create a new VLAN 200 named 'guest-wifi' in the site called Amsterdam."
Tests
uv run pytestAvailable Tools
7 toolsnetbox_create_objectA
Create a new object at a NetBox endpoint. Disabled when the server is running in read-only mode.
Args:
endpoint: An "app.endpoint" string, e.g. "dcim.sites".
data: Field values for the new object. Use netbox_get_schema to
see required and valid fields first.
Inputs: data (required), endpoint (required). Returns: object
netbox_delete_objectA
Delete an object from a NetBox endpoint. This is permanent. Requires confirm=True to actually perform the deletion, and is disabled when the server is running in read-only mode.
Args:
endpoint: An "app.endpoint" string, e.g. "dcim.devices".
id: The object's numeric ID.
confirm: Must be explicitly set to true to perform the deletion.
Inputs: id (required), endpoint (required), confirm. Returns: result
netbox_get_objectA
Get a single object from a NetBox endpoint by its numeric ID.
Args:
endpoint: An "app.endpoint" string, e.g. "dcim.devices".
id: The object's numeric ID.
Inputs: id (required), endpoint (required). Returns: object
netbox_get_schemaA
Get field definitions for a NetBox endpoint (names, types, whether required/read-only, and valid choice values), via an authenticated OPTIONS request. Use this before creating or updating objects to see what fields are valid.
Args:
endpoint: An "app.endpoint" string, e.g. "dcim.devices". See
netbox_list_endpoints for valid values.
Inputs: endpoint (required). Returns: object
netbox_list_endpointsA
List every supported NetBox 'app.endpoint' value, grouped by app, with a short description of what each endpoint represents. Call this first to discover which endpoint strings are valid for the other tools.
Inputs: no named parameters. Returns: object
netbox_list_objectsA
List/search objects at a NetBox endpoint.
Args:
endpoint: An "app.endpoint" string, e.g. "ipam.prefixes". See
netbox_list_endpoints for valid values.
filters: Optional field filters applied server-side, e.g.
{"site": "ams1", "status": "active"}. Omit to list all objects.
limit: Maximum number of objects to return (default 50, use 0 for
no limit).
Inputs: endpoint (required), limit, filters. Returns: result
netbox_update_objectA
Partially update an existing object at a NetBox endpoint. Only the
fields included in data are changed. Disabled when the server is
running in read-only mode.
Args:
endpoint: An "app.endpoint" string, e.g. "dcim.devices".
id: The object's numeric ID.
data: Field values to change.
Inputs: id (required), data (required), endpoint (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool has a clearly distinct purpose: endpoint discovery, schema introspection, list/search, get by ID, and create/update/delete. The only potential overlap is list_objects vs get_object, but their descriptions make the collection-versus-single-object distinction unambiguous.
All tools follow a consistent netbox_verb_noun pattern (e.g., netbox_list_objects, netbox_create_object, netbox_get_schema). The naming convention is uniform and predictable across the entire set.
Seven tools is well-scoped for a generic NetBox CRUD interface. Each tool covers a distinct operation needed to interact with any NetBox endpoint without being redundant or overwhelming.
The toolset provides full lifecycle coverage for NetBox objects: discovery, schema inspection, listing/searching, retrieving, creating, updating, and deleting. The endpoint-driven design means these operations apply broadly across NetBox's many object types, so there are no obvious dead ends.
Maintenance
Related MCP Connectors
Provides capabilities that let LLM agents perform a range of infrastructure management tasks.
Turn any task into the right API calls: discover, evaluate, and integrate public APIs.
Every Canopy public API operation as a tool, run as you after a browser sign-in or on an API key.
Enables AI assistants to retrieve event data and execute event management operations in Nunify.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables comprehensive interaction with NetBox infrastructure management through both read and write operations. Supports full CRUD operations for devices, IP addresses, sites, racks, and other NetBox objects through natural language commands.918Apache 2.0
- 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
- AlicenseBqualityCmaintenanceGives AI assistants read (and optionally write) access to a NetBox instance, covering DCIM, IPAM, circuits, virtualization, tenancy, and more.10033 npm1MIT
- AlicenseNot gradedqualityCmaintenanceEnables interaction with Nautobot instances through schema-driven tools for CRUD operations, dependency planning, and GraphQL queries, efficiently handling large APIs without overwhelming agent context.Apache 2.0