clab-mcp
Provides graph export capabilities that render containerlab network topologies as Mermaid diagrams.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@clab-mcpbuild me a 2-spine 4-leaf EVPN fabric with VNI 10010"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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: netlab-mcp
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.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Search, read, and write your Apple Notes from ChatGPT/Claude via a local Mac agent + MCP relay.
Deploy, monitor, and manage your OpenClaw AI assistants via natural language.
Let ChatGPT, Claude & Cursor use your Mac: email, calendar, iMessage, Teams, files. Local, free.
Source-checked CLI guides and model-aware planning for Claude Code, Codex, and Grok Build.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides programmatic access to Apple's container CLI tool on macOS, enabling users to perform 50+ container operations including creation, management, and system control of Apple Silicon containers.3Apache 2.0
- AlicenseAqualityCmaintenanceWraps ipspace/netlab as an engine to give LLMs access to validated, lab-tested network device configurations instead of hallucinated ones.84Apache 2.0
- FlicenseNot gradedqualityDmaintenanceEnables network configuration, connectivity testing, and routing management for ContainerLab Linux containers through an MCP interface.3
- FlicenseAqualityDmaintenanceEnables natural language orchestration of multi-vendor network infrastructure by combining NAPALM for structured data retrieval and Netmiko for CLI execution via Nornir.5
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/mithun2k5/clab-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server