Get the FREE Ultimate OpenClaw Setup Guide →

clab

MCP server from FloSch62/clab-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio flosch62-clab-mcp-server ./clab-mcp-server \
  --env API_SERVER_URL="http://localhost:8080"

How to use

This MCP server (clab) provides a gateway for Claude to interact with containerlab via an MCP protocol server. It is designed to work with a running containerlab API server and a local containerlab binary. With this server, Claude can list available labs, deploy new network topologies, inspect lab details, execute commands on lab nodes, and destroy labs when finished. The API URL is typically set to http://localhost:8080 for the containerlab API server, and the MCP server itself serves as the bridge between Claude’s requests and containerlab actions.

How to install

Prerequisites:

  • Go toolchain installed to build the MCP server (as described in the project’s build instructions).
  • containerlab installed and its API server available if you plan to interact with containerlab environments.
  • A suitable target platform (Windows, macOS, or Linux) with a compatible Go build environment.

Build from source (examples shown assume you’re in the project directory):

  1. For Windows:
    • set GOOS=windows
    • set GOARCH=amd64
    • go build -o clab-mcp-server.exe main.go
  2. For Mac (Intel):
    • set GOOS=darwin
    • set GOARCH=amd64
    • go build -o clab-mcp-server main.go For Apple Silicon (M1/M2/M3):
    • set GOOS=darwin
    • set GOARCH=arm64
    • go build -o clab-mcp-server main.go
  3. For Linux:
    • set GOOS=linux
    • set GOARCH=amd64
    • go build -o clab-mcp-server main.go

Run the server (example):

  • ./clab-mcp-server

Configuration (example from Claude Desktop setup):

  • Create a file claude_desktop_config.json with an mcpServers entry pointing to the built binary and the API server URL, e.g.: { "mcpServers": { "clab-api": { "command": "/path/to/clab-mcp-server", "args": [], "env": { "API_SERVER_URL": "http://localhost:8080" } } } }

Additional notes

Notes and tips:

  • Ensure the containerlab API server is running and reachable at the configured API_SERVER_URL (default http://localhost:8080).
  • Make sure the MCP server binary has executable permissions on Unix-based systems (chmod +x clab-mcp-server).
  • If you modify the API server URL, update the environment variable API_SERVER_URL in your MCP config accordingly.
  • The MCP server is designed to work with Claude Desktop; adjust paths to your built binary as needed.
  • If you encounter connectivity issues, verify that the containerlab API server is up and that network routes allow Claude to reach it.

Related MCP Servers

Sponsor this space

Reach thousands of developers