# NetBox MCP server via ToolMesh + DADL

> Run NetBox 4.x as an MCP server via ToolMesh + the NetBox DADL — devices, IPAM, sites, racks, VLANs as tools for Claude or ChatGPT. With setup and prompts.

Canonical: https://www.toolmesh.io/en/integrations/netbox/

Use [NetBox](https://netbox.dev/) as an **MCP server** for Claude, GPT, and any MCP-compatible AI agent — without writing or maintaining custom MCP server code. The NetBox DADL exposes the NetBox 4.x [REST API](https://docs.netbox.dev/en/stable/integrations/rest-api/) (devices, IPAM, sites, racks, prefixes, IP addresses, tenants, VLANs, interfaces, cables) as tools that AI agents call through ToolMesh.

## Why this instead of a hand-written MCP server?

A hand-written NetBox MCP server means another Python service to deploy, secure, and update every time NetBox changes its API. The NetBox DADL is a single YAML file that ToolMesh reads at runtime: no separate process, no glue code, no version drift. Authorization, credential injection, and audit logging come from ToolMesh, not from each connector. Read the longer argument in [Why MCP gateways alone don't solve the real problem](/en/blog/why-mcp-gateways-alone-dont-solve-the-real-problem/).

## What is in the box

- All major NetBox 4.x endpoints — DCIM (devices, racks, sites, cables), IPAM (prefixes, IPs, VLANs, VRFs), tenancy, virtualization.
- Authentication via NetBox API token, injected from `CREDENTIAL_NETBOX_TOKEN` at call time — never exposed to the agent or its prompt.
- Pagination, filters, and field selection per endpoint, declared once in the DADL.
- Full machine-readable definition with tool list and coverage: **[dadl.ai/d/netbox](https://dadl.ai/d/netbox)**.

## Three steps to a NetBox MCP server

1. Add `netbox.dadl` to your ToolMesh `backends.yaml`:

   ```yaml
   - name: netbox
     transport: rest
     dadl: /app/dadl/netbox.dadl
     url: "https://netbox.example.com"
   ```

2. Set the credential as an environment variable:

   ```bash
   CREDENTIAL_NETBOX_TOKEN=your-netbox-api-token
   ```

3. Connect your agent — [Connect Claude](/en/setup-claude/) or [Connect ChatGPT](/en/setup-openai/). ToolMesh exposes the NetBox tools through MCP automatically.

## What you can ask the agent

- *"Show me all devices in rack R12 in Frankfurt."*
- *"Find every IP prefix in 10.0.0.0/8 whose description contains 'kubernetes'."*
- *"Create a new device `web-fra-01` as type cx22 in site fsn1."*
- *"Decommission `legacy-bastion-01` and mark its IPs as deprecated."*

Each prompt becomes one or more NetBox tool calls. Every call lands in ToolMesh's audit log — you can replay exactly what the agent did, when, and on whose behalf.

## End-to-end tutorial

For the full workflow — including importing live infrastructure from Hetzner Cloud, Linode, and Xen Orchestra into a fresh NetBox with a four-phase trust-escalation model — read **[Populating NetBox from Real Infrastructure with ToolMesh](/en/blog/populating-netbox-from-real-infrastructure/)**.

## Related integrations

Often paired with NetBox in infrastructure-inventory workflows:

- [Hetzner Cloud DADL](https://dadl.ai/d/hetzner-cloud) — server and network inventory.
- [Linode DADL](https://dadl.ai/d/linode) — instance and IP inventory.
- [Xen Orchestra DADL](https://dadl.ai/d/xen-orchestra) — VM and storage inventory.
- [Tailscale DADL](https://dadl.ai/d/tailscale) — node-to-device synchronization.
- [Mikrotik DADL](https://dadl.ai/d/mikrotik) — switch and router state.

See all 22+ ready-to-use integrations on [the integrations index](/en/integrations/) or browse the full registry at [dadl.ai/browse](https://dadl.ai/browse).
