Skip to main content
Glama

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 supported app.endpoint value (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 .env

Edit .env:

  • NETBOX_URL — your NetBox instance, e.g. https://demo.netbox.dev or 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 to true to disable all create/update/delete tools. Recommended until you're confident in the setup, especially against a real installation.

  • NETBOX_VERIFY_SSL — set to false only if your instance uses a self-signed certificate.

Running

uv run netbox-mcp

This 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.py

Opens 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 pytest

Available Tools

7 tools
netbox_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

    A4.6/5.0

    Scored across 7 tools

    Disambiguation5/5

    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.

    Naming Consistency5/5

    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.

    Tool Count5/5

    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.

    Completeness5/5

    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

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables 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.
      9
      18
      Apache 2.0
    • A
      license
      B
      quality
      D
      maintenance
      Enables 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.
      3
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables 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