clab-mcp
Provides graph export capabilities that render containerlab network topologies as Mermaid diagrams.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
clab-mcp
Two MCP servers that let Claude build, deploy and verify containerlab network topologies on macOS — from a plain-English sentence.
build me a 2-spine 4-leaf EVPN fabric with VNI 10010
Claude turns that into a complete topology: loopbacks, /31 fabric addressing,
OSPF areas, BGP EVPN peerings to every route reflector, per-leaf bridge and
VXLAN devices, host attachment — then deploys it and walks the verification
chain from OSPF adjacency down to a packet capture of the VXLAN header.
Full setup and usage runbook: SETUP.md
How it works
containerlab is a Linux program — netlink, network namespaces, veth pairs. On
macOS it runs inside a Linux VM. These servers run on macOS and reach into that
VM with orb -m <vm>.
macOS
├── Claude Desktop
│ ├── clab-builder ── writes topology + config files ──┐
│ └── clab-lab ── orb -m clab ──┐ │
└── OrbStack │ │
└── Linux VM "clab" <─────────┘ │
├── containerlab + docker │
└── frr containers <──────── files synced ──────┘The split is deliberate:
clab-builderonly writes files. No OrbStack, no containerlab, no network access. It cannot break a running lab.clab-labis the only thing that runs containerlab.
Related MCP server: ContainerLab MCP Server
Requirements
macOS (Apple Silicon or Intel)
Claude Desktop
Python 3.10+
OrbStack with a Linux machine (default name
clab) running Docker and containerlab
Setting up the VM itself is out of scope — SETUP.md Stage 0 verifies it rather than installing it.
Install
git clone https://github.com/<your-username>/clab-mcp.git ~/clab-mcp
cd ~/clab-mcp
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
bash register.shregister.sh runs preflight checks, backs up your Claude Desktop config with a
timestamp, then merges two entries into mcpServers — existing servers and
other top-level keys are untouched. Re-running only updates the two entries.
Then quit Claude Desktop with Cmd + Q (closing the window leaves the old
processes running) and reopen it.
Verify by asking Claude to run clab_env.
Configuration
Var | Default | Server | Meaning |
|
| clab-lab | OrbStack machine name |
|
| clab-lab | topology location inside the VM |
|
| both | lab directory on macOS |
|
| clab-lab | set empty if the VM user is root |
|
| clab-lab | seconds allowed for deploy/destroy |
|
| clab-builder | router image |
|
| clab-builder | host image |
Pass any of them to register.sh and they are written into the config entries:
CLAB_VM=mylab CLAB_MAC_DIR=~/my-labs bash register.shTools
clab-builder — generates topologies
Tool | Purpose |
| short YAML spec in, complete fabric out — the main one |
| image catalog with arm64 / login status |
| build a topology node by node |
| write the in-memory lab to disk |
| preview generated YAML without writing |
| correctness checks |
| housekeeping |
clab-lab — deploys and inspects
Tool | Purpose |
| arch, containerlab version, docker version, lab dir |
| mirror the macOS lab dir into the VM |
| discovery |
| lifecycle |
| export Mermaid or draw.io |
| node access |
| tcpdump in the node's netns |
The fabric spec
Every key except lab has a default:
lab: evpn-vxlan
spines: 2
leaves: 4
underlay: ospf # ospf (iBGP + route reflector) | ebgp (per-device ASN)
overlay: evpn # evpn | none
asn: 65000
route_reflectors: [spine1, spine2]
spine_loopbacks: 10.255.0.0/24
leaf_loopbacks: 10.255.1.0/24
p2p: 10.0.0.0/24
fabric_mtu: 9100
vnis:
- {vni: 10010, vlan: 10}
hosts:
- {name: pc1, leaf: leaf1, vni: 10010, ip: 192.168.10.11/24}
- {name: pc2, leaf: leaf2, vni: 10010, ip: 192.168.10.22/24}Change spines: and leaves: and the addressing, interface numbering, OSPF,
BGP peerings and per-leaf VXLAN devices are all recomputed.
What validate_lab catches
The failures that leave a fabric looking healthy while passing no traffic:
an interface used by two links, or an endpoint naming a node that does not exist
a
/31pair whose two ends are not actually on the same subneta BGP neighbour address matching no configured loopback or link address
a VXLAN device sourced from an IP that is not that leaf's own loopback
a VTEP whose BGP is missing
advertise-all-vnian access port joined to a bridge that is not a real link
the loopback address set after the VXLAN device is created
bgpd/ospfddisabled indaemonswhile the config uses themeBGP without
no bgp ebgp-requires-policy— FRR 7.4+ silently drops everythingan eBGP EVPN spine missing
retain route-target all, or rewriting the VTEP next-hop
Coverage and limits
underlay: ospf+overlay: evpnis the validated path — deployed and verified end to end including a packet capture of the VXLAN header.underlay: ebgpgenerates the standard eBGP-CLOS-with-EVPN pattern and passes every static check, but has not been deployed on a live fabric.L2VNI only. No L3VNI, no tenant VRF, no anycast gateway — hosts sharing a VNI must share a subnet.
FRR only. SR Linux nodes can be added with
add_node, butbuild_fabricdoes not generate SR Linux configs.Images used are arm64-native and login-free: FRRouting and network-multitool.
License
MIT — see LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
AI network lab: build and validate real multi-vendor router and switch labs from a prompt.
Rent and manage dedicated Apple Silicon Macs for iOS builds and CI/CD from your AI agent.
Rent a Mac by the hour or day. An MCP server and a skill let AI agents order, use and stop it.
Your AI apps as one team: hand work to Codex or Claude Code on your Mac, with a shared logbook.
Related MCP Servers
- AlicenseAqualityCmaintenanceWraps ipspace/netlab as an engine to give LLMs access to validated, lab-tested network device configurations instead of hallucinated ones.88Apache 2.0
- FlicenseNot gradedqualityDmaintenanceEnables network configuration, connectivity testing, and routing management for ContainerLab Linux containers through an MCP interface.3-
- AlicenseAqualityDmaintenanceEnables programmatic control of a PNETLab network-emulation lab via natural language, allowing users to build topologies, wire links, push device configs, and boot the lab through an LLM agent.316Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables LLMs to turn natural-language prompts into validated, deployed Cisco network topologies, including routing, switching, DHCP, VLANs, security auditing, and live device inspection.MIT