nbox-serve

A way to run nbox as an MCP server, allowing an agent host to query NetBox through a standard tool connection. NetBox is an inventory system for network equipment and related records.

In plain words
What is it for?
Use it to expose NetBox lookup tools over local standard input/output or HTTP, and optionally enable controlled local or authenticated write access.
Why use it?
It lets agents use nbox’s NetBox search and detail views through JSON-RPC, while keeping access read-only by default.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/lance0/nbox/serve
Any agent
npx skills add lance0/nbox --skill serve
Clone the repo
git clone --depth 1 https://github.com/lance0/nbox

Made for: Claude Code, Codex.

Per session 128 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,542 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00128 $0.01542
Opus 5 $0.00064 $0.00771
Sonnet 5 $0.00026 $0.00308
Haiku 4.5 $0.00013 $0.00154

Measured 3d ago against content hash 61956648d09d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

nbox-serve scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/serve/SKILL.md · 100 lines

How it starts

The opening of the file, as written. The whole thing — 100 lines — stays where its author put it; the contents beside it link to each section on GitHub.

nbox serve (MCP server, read-only by default)

nbox serve exposes nbox's read layer as an MCP server. The tools reuse the CLI's query + view layer, so they return the same JSON view models as the equivalent nbox <cmd>. Read-only is the default — the write tools are always listed but reject at call time unless writes are explicitly opted in (see below). For the flags, run nbox serve --help — this skill is flag-free by design.

Two transports

  • stdio (default). An MCP host launches nbox serve as a subprocess and speaks JSON-RPC over stdin/stdout. JSON-RPC on stdout, logs on stderr; URL/token come from the active profile (same --profile / --config flags). Read-only by default; enable local single-user MCP writes with nbox serve --local-writes or [serve].local_writes = true, using the active profile token.
  • HTTPnbox serve --http 127.0.0.1:8080, same tools mounted at /mcp, loopback only with Origin/Host validation and an optional static bearer. Add --oidc-issuer <URL> + --audience <VALUE> for OAuth 2.1 resource-server mode: inbound IdP JWTs are validated on /mcp (alg allowlist, iss/aud/exp, nbox:read scope), a routable bind is allowed (TLS terminates in front), and Protected Resource Metadata is served at /.well-known/oauth-protected-resource. HTTP /mcp also carries an audit log and an opt-in per-caller rate limit. This is read-only Pattern 3: the last hop to NetBox still uses the one local profile token, so the audit log is accountability, not per-user RBAC — trusted single-team read-only only.

The read tools

Each maps to a CLI read and returns the same view model:

Tool What it answers
nbox_status Connection, capabilities, NetBox/Django/Python versions, token validity. Call first.
nbox_search Cross-kind ranked search (one scope filter at a time). Find a reference, then nbox_get.
nbox_get One object by kind + ref (vrf/site/group disambiguate).
nbox_get_interface One interface on a device, with its cable-path trace.
nbox_next_ip / nbox_next_prefix Next free address(es) / child block(s) — preview, reserves nothing.
nbox_journal Operator journal entries for an object.
nbox_history System audit log (create/update/delete, who + when); diff=true for full before/after.
nbox_list_tags / nbox_tagged List tags; objects carrying a tag, across kinds.
nbox_cache_clear Drop the local read cache (read-only w.r.t. NetBox).

Read the full file on GitHub · 100 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 100 lines · 128 tokens per session scan A 61956648d09d

Subscribe to this mod's changes

nbox-serve is a skill published in the GitHub repository lance0/nbox (11 stars, last pushed 21d ago), licensed Apache-2.0. It adds 128 tokens to every session and 1,542 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.