The first Model Context Protocol (MCP) server with full read AND write capabilities for NetBox.
Unlike existing read-only NetBox MCP implementations, this server provides comprehensive CRUD (Create, Read, Update, Delete) operations, enabling you to not only query your NetBox data but also modify it directly through LLMs that support MCP.
- First Read-Write NetBox MCP: The only MCP server that allows both reading from AND writing to NetBox
- Full CRUD Operations: Create, read, update, and delete any NetBox object type
- Bulk Operations: Efficiently handle multiple objects at once
- Comprehensive Coverage: Supports all major NetBox models (DCIM, IPAM, Circuits, Virtualization, etc.)
- Production Ready: Built with proper error handling, validation, and security practices
- List and filter any NetBox object type
- Get detailed information about specific objects
- Access change history and audit trails
- Advanced filtering and search capabilities
- Create new devices, IP addresses, sites, racks, and more
- Update existing object properties
- Delete objects (with proper safeguards)
- Bulk create, update, and delete operations
DCIM (Device and Infrastructure):
- devices, device-types, device-roles, manufacturers
- sites, locations, racks, rack-roles
- cables, interfaces, power-ports, console-ports
- platforms, regions, virtual-chassis
IPAM (IP Address Management):
- ip-addresses, prefixes, vlans, vrfs
- asns, aggregates, services
- roles, rirs, route-targets
Circuits:
- circuits, circuit-types, providers
- circuit-terminations, provider-networks
Virtualization:
- virtual-machines, clusters, cluster-groups
- cluster-types, vm-interfaces
And many more...
- Clone this repository:
git clone https://github.com/alexkiwi1/netbox-mcp-rw.git
cd netbox-mcp-rw- Install dependencies:
# Using UV (recommended)
uv sync
# Or using pip
pip install -e .- Set environment variables:
export NETBOX_URL="https://your-netbox-instance.com/"
export NETBOX_TOKEN="your-api-token"- Test the server:
NETBOX_URL=https://netbox.example.com/ NETBOX_TOKEN=<your-token> uv run server.pyAdd to your Claude Desktop configuration:
{
"mcpServers": {
"netbox-rw": {
"command": "uv",
"args": [
"--directory",
"/path/to/netbox-mcp-rw",
"run",
"server.py"
],
"env": {
"NETBOX_URL": "https://your-netbox-instance.com/",
"NETBOX_TOKEN": "your-api-token"
}
}
}
}This server works with any MCP-compatible client. Adjust the command and arguments based on your client's requirements.
"Show me all active devices in the NYC datacenter"
"List available IP addresses in the 10.0.1.0/24 subnet"
"What changes were made to devices last week?"
"Create a new server called 'web-01' in rack R42 at site NYC-DC1"
"Add IP address 192.168.1.100/24 to device 'firewall-01'"
"Update device 'switch-01' status to maintenance mode"
"Create a new VLAN 100 named 'DMZ' at site headquarters"
"Create 10 new servers with names web-01 through web-10"
"Update all Cisco devices to set the platform to 'ios'"
"Delete all IP addresses in the decommissioned subnet"
netbox_get_objects- List/filter any object typenetbox_get_object_by_id- Get specific object detailsnetbox_create_object- Create new objectsnetbox_update_object- Update existing objectsnetbox_delete_object- Delete objectsnetbox_bulk_create_objects- Bulk create operationsnetbox_bulk_update_objects- Bulk update operationsnetbox_bulk_delete_objects- Bulk delete operations
netbox_get_changelogs- Access change history and audit trails
- API tokens stored in environment variables (never hardcoded)
- SSL/TLS verification enabled by default
- Proper error handling and validation
- Audit trail preservation through NetBox's built-in changelog
- Python 3.13+
- NetBox instance with API access
- Valid NetBox API token with appropriate permissions
This is the first read-write NetBox MCP server - help us make it better:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
- Add input validation with Pydantic models
- Implement caching for better performance
- Add async support
- Create comprehensive test suite
- Add support for custom fields and plugins
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
Built on top of the excellent FastMCP framework and NetBox's comprehensive REST API.
Warning: This server has write capabilities. Always test in a development environment first and ensure your API token has appropriate permissions. Use bulk operations carefully as they can modify many objects at once.