-
Notifications
You must be signed in to change notification settings - Fork 2
mcp
Pre-Alpha. This page describes behavior that may change.
The MCP server is the surface you use when an AI assistant should drive Ze. It speaks the Model Context Protocol, exposes typed tools with structured parameters, and gives any MCP-compatible client (Claude, GPT, custom agents) the same control surface a human gets at the CLI. The point of MCP, as opposed to "scrape the CLI output", is that the assistant gets typed inputs and structured outputs, so it does not have to parse text it might misread.
ze start --mcp 8080 config.confenvironment {
mcp {
enabled true;
server main {
ip 127.0.0.1;
port 8080;
}
}
}
The default listener is 127.0.0.1:8080. That is deliberate: MCP is local-only unless you explicitly override it with ze.mcp.listen=ip:port. Bearer-token auth is available through --mcp-token, the ze.mcp.token environment variable, or the token leaf in the config.
Only ze_execute has a hand-written wrapper. The remaining tools (ze_announce, ze_withdraw, ze_peers, ze_peer_control, ze_commands) are auto-generated from the command registry at runtime, so any new YANG command or plugin command appears as a typed MCP tool with no code changes.
| Tool | Description |
|---|---|
ze_execute |
Run any CLI command. The escape hatch. Hand-written wrapper. |
ze_announce |
Announce routes with typed parameters: origin, next-hop, communities, prefixes. Auto-generated. |
ze_withdraw |
Withdraw routes. Auto-generated. |
ze_peers |
Peer state, ASN, uptime. Returns structured JSON. Auto-generated. |
ze_peer_control |
Teardown, pause, resume, flush a peer. Auto-generated. |
ze_commands |
List all available daemon commands. Auto-generated. |
ze_execute is the part that turns "structured tools for the common cases" into "full daemon control": anything you can do at ze cli or ze cli -c, the assistant can do here. Route management, RIB queries, peer lifecycle, configuration commits, cache operations, event subscription, schema discovery: all of it.
An assistant connected through MCP can do something like this without ever touching plain text.
- Call
ze_peersto get every peer's state as structured JSON. - Call
ze_announcewithorigin=igp,next-hop=10.0.0.1,prefixes=[10.0.0.0/24]. - Call
ze_executewithrib routes sent peer1 ipv4/unicastto verify propagation. - Call
ze_withdrawif it needs to roll back.
Each call returns structured data, not text the assistant has to scan.
The tool registry is auto-generated, but the command catalogue is too. ze help --ai produces a machine-readable command reference from the code, suitable for feeding to an assistant as context. Lists every command, parameter, description, and example.
ze help --ai > ze-commands.jsonDrop the file into the assistant's context and the assistant can pick the right command without trial and error.
ze-test mcp provides a functional test client with a wait-established synchroniser that is what you want in a CI pipeline if you want to test that MCP-driven changes apply correctly without racing the BGP FSM.
Ze's MCP server implements the MCP 2025-11-25 task-augmented tools/call extension. When a tool call includes task context, Ze tracks the task lifecycle and reports progress through the MCP protocol. This allows AI assistants to run long-running operations (config commits, peer teardown sequences) with structured progress reporting.
The MCP server exposes an Apps resources capability (Phase 5), providing structured access to Ze's configuration tree, peer state, and plugin registry as MCP resources. Resources are read-only and follow the same YANG-modeled structure as the CLI and web UI.
-
Introspection for
ze help --aiand the schema discovery surfaces. - REST API if you would rather drive Ze with plain HTTP.
- CLI for the human-facing equivalent.
Adapted from main/docs/features/mcp-integration.md.
Unreviewed draft. This wiki was authored in bulk and has not been reviewed. File corrections on the issue tracker.
- Overview
- YANG Model
- Editor Workflow
- Archive and Rollback
- System
- Interfaces
- VRRP
- BFD
- FIB
- OSPF
- IS-IS
- MPLS / LDP / RSVP-TE
- RSVP-TE
- SRv6
- Static Routes
- Policy Routing
- Firewall
- Traffic Control
- Class of Service
- L2TP/PPP
- PPPoE
- VPP Data Plane
- RPKI
- IPsec VPN
- TACACS+ AAA
- RADIUS AAA
- AS112 DNS
- Authorization
- Fleet
- BGP
- Starting and Stopping
- Show Commands
- Monitoring
- Flow Export
- DDoS Mitigation
- Anomaly Detection
- Health Checks
- Audit Trail
- Production Diagnostics
- Logging
- Operational Reports
- Healthcheck
- Self-Update
- Zero-Touch Provisioning
- MRT Analysis
- Upgrade and Restart
- Storage
- Policy
- Core
- Resilience
- Validation
- Capabilities
- Address Families
- Protocol
- Subsystems
- Infrastructure
- Route Server at an IXP
- Transit Edge with RPKI
- Public Looking Glass
- ExaBGP Migration Walkthrough
- FlowSpec Injection
- Chaos-Tested Peering
- AS Path Topology