feat(netbox)!: gut server from 182 to 37 tools #457

Merged
lmiranda merged 1 commits from feat/netbox-gut-to-37-tools into development 2026-02-09 02:28:28 +00:00
Owner

Summary

Gutted NetBox MCP server from 182 tools (~19,810 tokens) to 37 tools (~3,700 tokens) — 81% token reduction.

Removed all tools not needed for tracking applications, services, databases, and VPS/servers.

Changes

Deleted Modules (Entire Files)

  • circuits.py — providers, circuits, terminations
  • tenancy.py — tenants, contacts
  • vpn.py — tunnels, IKE/IPSec, L2VPN
  • wireless.py — WLANs, links, groups

Stripped Tool Categories

  • DCIM: Removed regions, locations, racks, rack roles, manufacturers, device types, platforms, cables, console ports, front/rear ports, module bays, power panels, power feeds, virtual chassis, inventory items
  • IPAM: Removed VLANs, VLAN groups, VRFs, ASNs, RIRs, aggregates, available IPs, available prefixes
  • Virtualization: Removed cluster types, cluster groups, all delete operations
  • Extras: Removed custom fields, webhooks, config contexts, update/delete for tags

Deleted Infrastructure

  • NETBOX_ENABLED_MODULES env var and all module filtering code
  • ALL_MODULES constant, PREFIX_TO_MODULE dict, _get_tool_module() function
  • Conditional module instantiation in server.py

Remaining Tools (37)

Module Categories Tools
DCIM sites (4), devices (4), interfaces (3) 11
IPAM IPs (4), prefixes (3), services (3) 10
Virtualization clusters (3), VMs (4), VM interfaces (3) 10
Extras tags (3), journal entries (3) 6

File Reductions

File Before After Reduction
server.py 1669 lines 465 lines -72%
config.py 157 lines 108 lines -31%
dcim.py 935 lines 189 lines -80%
ipam.py 718 lines 177 lines -75%
virtualization.py 296 lines 162 lines -45%
extras.py 560 lines 87 lines -84%

Token Impact

Before: ~19,810 tokens
After: ~3,700 tokens
Reduction: ~81%

Breaking Changes

⚠️ BREAKING: All tools for circuits, tenancy, VPN, wireless are removed.
⚠️ BREAKING: NETBOX_ENABLED_MODULES env var no longer supported.
⚠️ BREAKING: Many DCIM/IPAM/Virt/Extras tools removed (see above).

Follow-up Work

Update cmdb-assistant plugin skills to remove references to deleted tools (10 files). This will be done in a separate PR.

Test Plan

  • All 4 deleted module files removed
  • No stale references to deleted modules in Python code
  • Exactly 37 tools registered in TOOL_DEFINITIONS
  • README.md rewritten with accurate documentation
  • CHANGELOG.md updated with breaking change entry
  • Pre-commit validation passed

🤖 Generated with Claude Code

## Summary Gutted NetBox MCP server from 182 tools (~19,810 tokens) to 37 tools (~3,700 tokens) — **81% token reduction**. Removed all tools not needed for tracking applications, services, databases, and VPS/servers. ## Changes ### Deleted Modules (Entire Files) - `circuits.py` — providers, circuits, terminations - `tenancy.py` — tenants, contacts - `vpn.py` — tunnels, IKE/IPSec, L2VPN - `wireless.py` — WLANs, links, groups ### Stripped Tool Categories - **DCIM:** Removed regions, locations, racks, rack roles, manufacturers, device types, platforms, cables, console ports, front/rear ports, module bays, power panels, power feeds, virtual chassis, inventory items - **IPAM:** Removed VLANs, VLAN groups, VRFs, ASNs, RIRs, aggregates, available IPs, available prefixes - **Virtualization:** Removed cluster types, cluster groups, all delete operations - **Extras:** Removed custom fields, webhooks, config contexts, update/delete for tags ### Deleted Infrastructure - `NETBOX_ENABLED_MODULES` env var and all module filtering code - `ALL_MODULES` constant, `PREFIX_TO_MODULE` dict, `_get_tool_module()` function - Conditional module instantiation in server.py ## Remaining Tools (37) | Module | Categories | Tools | |--------|-----------|-------| | DCIM | sites (4), devices (4), interfaces (3) | 11 | | IPAM | IPs (4), prefixes (3), services (3) | 10 | | Virtualization | clusters (3), VMs (4), VM interfaces (3) | 10 | | Extras | tags (3), journal entries (3) | 6 | ## File Reductions | File | Before | After | Reduction | |------|--------|-------|-----------| | `server.py` | 1669 lines | 465 lines | -72% | | `config.py` | 157 lines | 108 lines | -31% | | `dcim.py` | 935 lines | 189 lines | -80% | | `ipam.py` | 718 lines | 177 lines | -75% | | `virtualization.py` | 296 lines | 162 lines | -45% | | `extras.py` | 560 lines | 87 lines | -84% | ## Token Impact **Before:** ~19,810 tokens **After:** ~3,700 tokens **Reduction:** ~81% ## Breaking Changes ⚠️ **BREAKING:** All tools for circuits, tenancy, VPN, wireless are removed. ⚠️ **BREAKING:** `NETBOX_ENABLED_MODULES` env var no longer supported. ⚠️ **BREAKING:** Many DCIM/IPAM/Virt/Extras tools removed (see above). ## Follow-up Work Update `cmdb-assistant` plugin skills to remove references to deleted tools (10 files). This will be done in a separate PR. ## Test Plan - [x] All 4 deleted module files removed - [x] No stale references to deleted modules in Python code - [x] Exactly 37 tools registered in TOOL_DEFINITIONS - [x] README.md rewritten with accurate documentation - [x] CHANGELOG.md updated with breaking change entry - [x] Pre-commit validation passed 🤖 Generated with [Claude Code](https://claude.com/claude-code)
lmiranda added 1 commit 2026-02-09 02:27:45 +00:00
BREAKING CHANGE: Removed circuits, tenancy, VPN, wireless modules entirely.
Stripped DCIM, IPAM, virtualization, extras to only essential tools.
Deleted NETBOX_ENABLED_MODULES filtering — no longer needed.

- Delete circuits.py, tenancy.py, vpn.py, wireless.py
- Strip dcim.py to sites, devices, interfaces only (11 tools)
- Strip ipam.py to IPs, prefixes, services only (10 tools)
- Strip virtualization.py to clusters, VMs, VM interfaces only (10 tools)
- Strip extras.py to tags, journal entries only (6 tools)
- Remove all module filtering code from config.py and server.py
- Rewrite README.md with accurate 37-tool documentation
- Update CHANGELOG.md with breaking change entry
- Token reduction: ~19,810 → ~3,700 (~81%)

Remaining work: Update cmdb-assistant plugin skills (10 files) in follow-up PR

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
lmiranda merged commit becf9b97b2 into development 2026-02-09 02:28:28 +00:00
lmiranda deleted branch feat/netbox-gut-to-37-tools 2026-02-09 02:28:28 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: personal-projects/leo-claude-mktplace#457