convez.ai
MCP ServerDevOps & InfraestruturaIntermediário
3kirt

NetBox MCP Server

3kirt/netbox-mcp

Acesso conversacional a dados de infraestrutura NetBox via Claude

Ver no GitHub
InicialPluginScore · de 0 a 100

Servidor MCP que conecta Claude a instâncias NetBox ao vivo, permitindo consultas em linguagem natural sobre infraestrutura de rede. Com 169 ferramentas somente-leitura, traduz perguntas como 'quais dispositivos em NYC estão em manutenção?' em queries estruturadas contra a API NetBox em tempo real.

Instalação

$npx convez-ai 3kirt/netbox-mcp

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
1
Forks
0
Acompanhando
0
Saúde
42%
Último commit
há 3 dias
Versão
v0.15.0
Issues abertas
2
Contribuidores
2

Casos de uso

  • Consultar status e configuração de dispositivos de rede em linguagem natural
  • Automatizar buscas de IPs, VRFs e atribuições de rede sem tocar a API
  • Integrar dados NetBox em fluxos de análise e documentação com Claude

Veredito

Implementação sólida e bem-pensada de MCP para NetBox, com suporte a 169 ferramentas de consulta apenas-leitura e otimização de payload. Ideal para times DevOps/Infra que já usam NetBox; requer Rust para build manual, mas binários pré-compilados estão disponíveis.

README

A tradução para o português deste README ainda está na fila.

netbox-mcp

A Model Context Protocol (MCP) server that connects Claude and other MCP-compatible AI clients to a live NetBox instance.

Ask questions like "Which devices in the NYC site are currently in maintenance?" or "Show me all IPs assigned to web01 and their VRFs" — the server translates them into real-time NetBox API queries and returns structured results.

  • Read-only — all 169 tools query NetBox but make no changes
  • stdio transport — runs as a local subprocess managed by your MCP client
  • Token-efficient — responses are slimmed before delivery, cutting typical NetBox payloads by 50–70%

Table of contents


Requirements

  • A running NetBox instance with a valid API token
  • To build from source: Rust stable toolchain (rustup install stable)
  • To use a pre-built binary: nothing — grab it from the releases page

Installation

Pre-built binary (recommended)

Download the binary for your platform from the releases page and place it somewhere on your $PATH.

From source

git clone https://github.com/3kirt/netbox-mcp
cd netbox-mcp
make install

Installs the netbox-mcp binary to $CARGO_HOME/bin (typically ~/.cargo/bin).


Configuration

netbox-mcp reads credentials from ~/.netbox_mcp.json:

{
  "url": "https://netbox.example.com",
  "token": "your-api-token"
}

Environment variables take precedence over the config file:

VariableDescription
NETBOX_URLNetBox base URL
NETBOX_TOKENNetBox API token

A custom config file path can be specified with --config:

netbox-mcp --config /path/to/config.json

Obtaining an API token

Tokens can be created in NetBox under Admin → API Tokens, or provisioned via the API:

curl -s -X POST https://netbox.example.com/api/users/tokens/provision/ \
  -H "Content-Type: application/json" \
  -d '{"username": "you", "password": "yourpassword"}' \
  | jq '.key'

Because netbox-mcp is read-only, create a read-only token (deselect "Write enabled" in the token settings). If the server starts returning 403 errors, check whether the token has expired.


Client setup

Claude Desktop

Add the following to your claude_desktop_config.json:

{
  "mcpServers": {
    "netbox": {
      "command": "netbox-mcp",
      "env": {
        "NETBOX_URL": "https://netbox.example.com",
        "NETBOX_TOKEN": "your-api-token"
      }
    }
  }
}

Config file location:

OSPath
macOS~/Library/Application Support/Claude/claude_desktop_config.json
Linux~/.config/Claude/claude_desktop_config.json
Windows%APPDATA%\Claude\claude_desktop_config.json

Claude Code

Register via the CLI:

claude mcp add --transport stdio \
  --env NETBOX_URL=https://netbox.example.com \
  --env NETBOX_TOKEN=your-api-token \
  netbox -- netbox-mcp

To share the configuration with your team (writes to .mcp.json):

claude mcp add --transport stdio --scope project \
  --env NETBOX_URL=https://netbox.example.com \
  netbox -- netbox-mcp

Available tools

169 read-only tools spanning ten NetBox API areas:

AreaCoverage
DCIMSites, racks, devices, interfaces, cables, power, modules, inventory
IPAMIP addresses, prefixes, VRFs, VLANs, aggregates, ranges, ASNs, FHRP
VirtualizationVMs, clusters, VM interfaces, virtual disks
CircuitsCircuits, providers, circuit types, terminations
VPNTunnels, L2VPNs, IKE/IPSec policies
WirelessWireless LANs, LAN groups, wireless links
TenancyTenants, tenant groups, contacts, contact roles
ExtrasTags, config contexts, journal entries, custom fields, webhooks
CoreData sources, background jobs, object change log
UsersUsers, groups, API tokens

Each area provides list (with filters) and get (by ID) tools. A meta-tool netbox_lookup_host searches both physical devices and VMs by name in a single call.


Development

make build         # cargo build
make test          # cargo test --all  (unit tests, offline)
make test-live     # live integration tests against a seeded NetBox
make lint          # cargo clippy -- -D warnings && cargo fmt --check
make clean         # remove build artifacts
make docker-build  # build Docker image

Testing

Two layers verify different risks — fast offline unit tests, and a feature-gated live suite that checks fidelity to the real NetBox API. A self-contained, auto-seeding NetBox stack for the live suite lives in test/netbox-docker/ (Podman on macOS):

cd test/netbox-docker && ./up.sh          # boot + seed a local NetBox
NETBOX_URL=http://localhost:8000 \
NETBOX_TOKEN=0123456789abcdef0123456789abcdef01234567 make test-live

See docs/testing.md for the full rationale and how to add coverage.


License

GPL-3.0

Ver o original no GitHub

Bom para

Relacionados