netbox-mcp-server
This server provides a Model Context Protocol (MCP) interface for AI assistants to interact with a NetBox instance, offering comprehensive read and write access to infrastructure data across DCIM, IPAM, circuits, virtualization, tenancy, power, and plugins (especially the netbox-inventory plugin).
Key capabilities:
Global Search – Fuzzy-search across all object types (sites, devices, IPs, VLANs, etc.) in a single call.
Schema Introspection –
netbox_discoverlists supported object types and operations;netbox_describereturns detailed field definitions, enum values, and filters for any type, derived from the live API schema.Read Operations – Retrieve individual objects by ID or list collections with advanced filtering, pagination (up to 1000 items/page), and sorting. Output can be human-readable Markdown or structured JSON.
Write Operations – Create, update (using PATCH semantics – only supplied fields are changed), or delete objects. Deletes require a confirmation with the object’s display value. All writes are validated against the instance’s schema and governed by the NetBox API token’s permissions.
Dynamic Adaptation – The tool surface automatically adjusts to the connected instance’s custom fields, plugins, and configuration.
Supported object types (read & write unless noted):
DCIM: Sites, locations, racks, manufacturers, device types, device roles, platforms, devices, interfaces, cables.
IPAM: Prefixes, IP addresses, VLANs, VLAN groups, VRFs, aggregates, IP ranges, IPAM roles.
netbox-inventory plugin: Assets, suppliers, purchases, deliveries, asset roles, inventory item types, inventory item groups.
Additional types for circuits, virtualization, tenancy, and power are also supported.
Additional features:
Tag and date-range filtering on list queries.
Custom field support on all write operations.
Pagination metadata (
total,has_more,next_offset) and automatic result truncation for large lists.
Click on "Install 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-servershow me all devices in site Chicago"
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
A Model Context Protocol server that lets an AI assistant read — and, if its token allows, write — your NetBox instance: DCIM, IPAM, circuits, virtualization, tenancy, power, and whatever plugins that instance has installed.
Written in TypeScript on the official @modelcontextprotocol/sdk. Runs locally over
stdio as a subprocess of an MCP-aware client (Claude Desktop, Claude Code, Cursor,
Codex).
Five tools, not several hundred. The object types, fields, filters and enum values
are not hard-coded — they are derived at runtime from the connected instance's own
/api/schema/ document, so the surface describes your NetBox, including its plugins
and custom fields. A tools/list response is about 12,000 characters of descriptions and
schemas, roughly 3,000 tokens.
Installing this? Paste this into Claude, ChatGPT, or any assistant that can browse and run commands:
Read https://raw.githubusercontent.com/zenixsolutions/netbox-mcp-server/main/AGENTS.md and follow it to install the NetBox MCP server on my Mac.
AGENTS.mdis a step-by-step runbook written for an AI assistant to execute without guessing. Humans can use the Quick start below instead.
Quick start
There is nothing to clone or build. Your MCP client launches the server with npx, which
fetches the published package on first use.
You need:
Node.js >= 20.11 (
node --version). Node 18 is end-of-life and unsupported.A NetBox API token — see Creating the token below.
Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or
%APPDATA%\Claude\claude_desktop_config.json (Windows). Add the netbox entry to the
mcpServers object you already have; do not replace the file.
{
"mcpServers": {
"netbox": {
"command": "/opt/homebrew/bin/npx",
"args": ["-y", "@zenixsolutions/netbox-mcp"],
"env": {
"NETBOX_URL": "https://netbox.yourcompany.com",
"NETBOX_TOKEN": "your-api-token"
}
}
}
}Use the absolute path from command -v npx as command. Claude Desktop is launched
from Finder and never sources your shell profile, so a bare "npx" — like a bare
"node" — often fails with spawn npx ENOENT. Fully quit Claude Desktop (Cmd-Q) and
reopen it after editing the config.
Claude Code
read -rs NETBOX_TOKEN # paste the token; nothing is echoed
claude mcp add netbox \
--env NETBOX_URL="https://netbox.yourcompany.com" \
--env NETBOX_TOKEN="$NETBOX_TOKEN" \
-- "$(command -v npx)" -y @zenixsolutions/netbox-mcp
unset NETBOX_TOKENDo not put the token in ~/.zshrc or any other shell profile. It belongs in the client
config and nowhere else.
Pin the version — "@zenixsolutions/netbox-mcp@0.1.3" — if you do not want the tool
surface to change between restarts. This project is below 1.0.0, and the
CHANGELOG is where surface changes are recorded. Other clients:
AGENTS.md.
Then ask your assistant: "Using the netbox tools, list the first 5 sites."
Creating the token
NetBox → your user menu → API Tokens → Add a token.
Leave Write enabled unchecked unless the assistant is meant to change infrastructure records. This is the only write control there is (see Write access).
Set an expiry date.
Constrain the token's object permissions to what the assistant actually needs.
Related MCP server: NetBox MCP Server - Read & Write Edition
The five tools
Tool | What it does |
| Finds a named thing when you do not know its type — a hostname, an IP, a VLAN name, a serial. |
| Lists the object types this instance supports, and the operations each one allows. |
| Explains one object type: required fields, optional fields with enum values, read-only fields, prerequisites, and the filters |
| Reads objects — one by id, or a filtered, paginated list. Never modifies anything. |
| Creates, updates or deletes one object. |
The intended path for a change is netbox_discover → netbox_describe → netbox_write.
netbox_global_search is the shortcut past that: looking one named object up costs a
single call rather than three. A read where you already know the type — dcim.device,
ipam.prefix — is one call to netbox_read.
Object type keys are <app>.<model>, singular. Plugin models are
plugins.<plugin>.<model> and are not guessable, which is what netbox_discover is for.
A few behaviours worth knowing:
A wrong object type or filter name is refused locally, with near-misses or the valid filter names listed. NetBox itself answers
200and the entire unfiltered collection for a query parameter it does not recognise, so the server rejects unknown filters rather than passing them through.netbox_writevalidatesdataagainst the instance's schema before sending anything. A rejection returns the same descriptionnetbox_describewould have.updateis a partial write. Only the fields present indatachange.deleterequiresconfirmto equal the object's currentdisplayvalue. Read the object first, copydisplay, pass it back. NetBox cascades deletes — removing a site can remove its racks, devices and prefixes — and it cannot be undone.netbox_readandnetbox_global_searchreturn Markdown by default or JSON on request. Lists page at 50 by default (max 1000) and reporttotal,has_moreandnext_offset; any response over 25,000 characters is truncated with the offset to resume from.
Layering costs round-trips. A trivial read that one netbox_read call answers has
been observed taking four calls, and a name lookup ten. That is measured, not estimated,
and rewording the tool descriptions did not fix it — see
docs/reference/eval-model-in-loop.md and
docs/reference/eval-results.md. What it buys is a
tools/list that fits in a context window.
The design rationale is RFC-003.
Configuration
Three environment variables. There are no others.
Variable | Required | Default | Meaning |
| yes | — | Base URL of your NetBox, e.g. |
| yes | — | NetBox API token. |
| no | off |
|
The instance's OpenAPI document is fetched once and cached on disk under
$XDG_CACHE_HOME/netbox-mcp (or ~/.cache/netbox-mcp), keyed by the NetBox version and
installed plugin set from /api/status/. Upgrading NetBox or adding a plugin invalidates
it; a cache that cannot be read or written is never fatal.
Write access
Write access is controlled by the NetBox token, not by this server. There is no
server-side read-only switch, and that is deliberate: an environment variable that hides
the write tool is a suggestion, whereas a token with write_enabled unchecked and scoped
object permissions is enforced by NetBox, where no tool argument can reach it.
Issue a read-only token for anyone who does not need to change records. If a write is
refused, NetBox answers 403 and the server's error text names the likely cause —
including the token's write_enabled flag.
More on operating this safely, including prompt-injection risk with a write-enabled token: SECURITY.md.
Command-line surface
The binary is normally launched by a client, but it has four verbs for verifying an
install. Substitute node dist/index.js for netbox-mcp if you built from a clone.
Command | Does | Exit code |
| Prints usage and every environment variable. Reads no configuration. | 0 |
| Prints the version, e.g. | 0 |
| Validates configuration and names the first missing or invalid variable. | 0 usable, 78 not usable |
| Prints each tool name to stdout and | 0 |
--check is the verb for diagnosing a configuration problem. --help returns before any
configuration is read, so it prints the same output whether your credentials are correct,
wrong, or absent — it can never surface a config error.
# Is the configuration usable? Names the offending variable and exits 78 if not.
NETBOX_URL=https://netbox.corp.com NETBOX_TOKEN="$NETBOX_TOKEN" netbox-mcp --check
# -> ok: netbox-mcp-server v0.1.3 configured for https://netbox.corp.com
# Does the binary work at all? Needs no credentials and makes no network calls.
netbox-mcp --list-tools
# -> netbox_global_search / netbox_discover / netbox_describe / netbox_read / netbox_write
# 5 tools registered. (on stderr)
# Do the credentials work against NetBox itself?
curl -sS -H "Authorization: Token $NETBOX_TOKEN" \
"$NETBOX_URL/api/dcim/sites/?limit=1" | head -c 200Keep the token in a shell variable rather than typing it into a command: command lines
land in shell history and are visible in ps to every process on the machine.
Compatibility and limitations
The honest source is docs/compatibility.md. In short:
Contract-tested against NetBox 4.6.0 with
netbox_inventory2.6.0 — 435 checks, 0 defects. That is one instance, which is evidence, not a supported range. Response shapes differ across NetBox versions; please include yours in any bug report. The compatibility doc explains how to run the suite against your own instance with a read-only token, and what to send back.stdio only. There is no remote HTTP transport, so clients that only speak HTTP (ChatGPT connectors, Grok connectors) cannot use this.
One plugin has been verified. Others have never been tried.
Known limitations — round-trip cost, the
device_idargument name, no file uploads, no GraphQL — are listed there rather than duplicated here.
Building from a clone
For contributors, and for machines that cannot reach the npm registry:
git clone https://github.com/zenixsolutions/netbox-mcp-server.git
cd netbox-mcp-server
npm ci
npm run build
node dist/index.js --check # exits 0 when NETBOX_URL and NETBOX_TOKEN are usableRun npm ci in a shell with no NETBOX_TOKEN exported: it executes the install
scripts of every package in the dependency tree, and each one inherits your environment.
Then use the same client config as above, with command set to the absolute path from
command -v node and args set to the absolute path of dist/index.js:
"netbox": {
"command": "/opt/homebrew/bin/node",
"args": ["/Users/YOU/netbox-mcp-server/dist/index.js"],
"env": { "NETBOX_URL": "...", "NETBOX_TOKEN": "..." }
}Tildes (~) are not expanded by MCP clients — both paths must be absolute.
Troubleshooting
The most common failure by far: spawn npx ENOENT / spawn node ENOENT in a GUI
client. Claude Desktop is launched from Finder and never sources your ~/.zshrc, so an
npx or node installed by nvm/fnm/asdf/Volta/Homebrew is invisible to it. Put the
absolute path from command -v npx (or command -v node) in the config, not the bare
string "npx".
Second most common: Missing required environment variable .... Run --check with
the same variables the config sets — it names the variable and exits 78.
Claude Desktop logs each server separately:
tail -f ~/Library/Logs/Claude/mcp-server-netbox.logFull table of symptoms and fixes: AGENTS.md.
Development
npm run dev # tsx watch src/index.ts
npm run build # tsc -> dist/
npm run typecheck # tsc --noEmit, sources + tests
npm run lint # eslint
npm run format:check # prettier --check
npm test # vitest run
npm run test:contract # opt-in, against a live instance with a read-only token
npm run eval # opt-in, evals/src/
index.ts entry point; argv parsing (--help/--version/--check/--list-tools)
server.ts server construction and introspection
config.ts env parsing / validation
constants.ts character limits, page sizes, env var names
client.ts axios-based NetBox client
errors.ts NetBox API error formatting
formatting.ts markdown rendering + pagination payload
schema/ fetch, cache and interpret the instance's /api/schema/
schemas/common.ts shared Zod schemas
tools/layered/ the five tools: search, discover, describe, read, write
skills/
netbox-modeling/ agent skill, versioned with the tool contract it names
scripts/
check-changelog.mjs release guard: CHANGELOG has a section for the current versionEach tool's description text lives beside its implementation in
src/tools/layered/*.ts — that text is the interface most models actually see, and it is
reviewed as such.
Contributing
Issues and pull requests welcome — see CONTRIBUTING.md.
Security vulnerabilities should be reported privately, not as public issues. See SECURITY.md.
Disclaimer
This is an independent, community-maintained project. It is not affiliated with, endorsed by, or supported by NetBox Labs or the NetBox open-source project. "NetBox" is a trademark of its respective owner.
Provided as-is under the MIT license. You are responsible for what an AI assistant does with the credentials you give it — read SECURITY.md before issuing a write-enabled token for a production NetBox instance.
License
MIT — see LICENSE.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityFmaintenanceAn integration that enables AI assistants to interact with network data through a standardized protocol, providing AI-ready tools and interfaces for network automation and management.16
- 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.916Apache 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

NetBox MCP Serverofficial
AlicenseAqualityAmaintenanceRead-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.4213Apache 2.0
Related MCP Connectors
Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analy…
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Connect your AI assistants to Keboola and expose your data, transformations, SQL queries, ...
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ZenixSolutions/netbox-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server