Nexus GSLB MCP Server¶
gslb-mcp is a Model Context Protocol server that exposes Nexus GSLB cluster state and configuration to AI platforms. Operators can query the live topology, get AI-assisted recommendations, and (optionally) apply configuration changes — all from tools like Claude Desktop, Cursor, or Zed.
Installation¶
Build from source alongside the other Nexus binaries:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" \
-o gslb-mcp-linux-amd64 ./cmd/gslb-mcp
Or run locally (macOS/Linux, native arch):
Configuration¶
| Flag | Env var | Required | Description |
|---|---|---|---|
--api-url |
NEXUS_API_URL |
Yes | Base URL of the Nexus GSLB API, e.g. https://gslb.example.com |
--api-key |
NEXUS_API_KEY |
Yes | API key with at least read access. A named viewer key (API keys) is the natural fit for a read-only server; --allow-writes needs a role with the write permissions you intend to use. Prefer the env var — a flag is visible in ps. |
--allow-writes |
— | No (default: off) | Enable service-affecting write tools |
Claude Desktop setup¶
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"nexus-gslb": {
"command": "/usr/local/bin/gslb-mcp",
"args": [],
"env": {
"NEXUS_API_URL": "https://gslb.example.com",
"NEXUS_API_KEY": "your-api-key-here"
}
}
}
}
To enable write tools, add "--allow-writes" to the args array. See the write tools warning before doing so.
Read tools (always available)¶
These tools are safe to expose to any operator. They are read-only and have no effect on live traffic.
Core topology¶
| Tool | Description |
|---|---|
get_topology |
Full cluster snapshot: services, pools, members, health. Start here. |
get_dashboard_stats |
High-level health summary and counts |
list_services |
All GSLB services with domain and algorithm |
get_service |
Single service details (pool, algorithm, filter chain, TTL) |
list_pools |
All member pools |
get_pool |
Single pool details |
get_pool_status |
Live health status for all members in a pool |
list_members |
All members in a pool (IP, port, weight, region, enabled) |
get_member |
Single member details |
get_member_status |
Live health score for a member (0.0–1.0) |
get_health_check |
Health check config for a pool |
list_geo_rules |
Geo-routing rules for a pool |
Observability¶
| Tool | Description |
|---|---|
get_metrics_summary |
Per-service QPS and average latency from the last 60-second window |
Cluster & infrastructure¶
| Tool | Description |
|---|---|
get_cluster_status |
NATS cluster status, peer nodes, and JetStream metrics |
get_cluster_report |
Detailed NATS cluster report: routes, streams, consumers, raft state |
get_bgp_status |
BGP RHI advertisement status and prefix list |
get_tls_status |
TLS mode, certificate subject/SANs/expiry, ACME config |
DNS configuration¶
| Tool | Description |
|---|---|
list_domains |
All delegated DNS zones |
list_redirects |
All HTTP redirect rules |
list_txt_records |
All static TXT DNS records |
list_tsig_keys |
All TSIG keys for RFC 2136 dynamic DNS (secrets redacted) |
list_rrl_allowlist |
All RRL-exempt CIDRs |
DNSSEC¶
| Tool | Description |
|---|---|
get_dnssec_status |
Signing status: active key IDs, rollover state |
list_dnssec_keys |
All ZSK/KSK keys, algorithm, state, and expiry |
get_dnssec_ds |
DS records for the active KSK (paste into parent zone) |
get_dnssec_rollover_status |
Current rollover phase (pre-publish / double-signing / done) |
Alerting¶
| Tool | Description |
|---|---|
list_alert_channels |
All alert channels (SMTP, PagerDuty, OpsGenie, Webhook) |
get_alert_channel |
Single channel details |
Identity & access¶
| Tool | Description |
|---|---|
list_users |
All user accounts (email, role, TOTP status) |
list_roles |
All RBAC roles and permission sets |
list_tenants |
All tenants |
get_usage |
Resource counts vs. license limits for the current tenant |
get_license |
License tier, feature limits, and expiry |
Intent-based routing¶
| Tool | Description |
|---|---|
get_routing_schema |
Catalog of every filter-chain step (aliases, kind, licensing, whether this license allows it) plus the geo-rule and schedule shapes |
validate_routing_config |
Dry-run validation of a proposed {filterChain, geoRules, schedules} bundle — writes nothing, reports every problem at once |
simulate_routing |
Traces a service for several client IPs at once, optionally against a proposed chain rather than the stored one |
See Intent-based routing below for the loop these are meant to be used in.
Write tools¶
⚠️ WARNING — service-affecting
Write tools modify live cluster configuration. Changes take effect immediately in the DNS rotation and can cause traffic shifts, service disruptions, or member outages. Only enable
--allow-writesif:
- You have reviewed what each tool does
- Your API key belongs to an account with appropriate permissions
- Operators understand that the AI may make mistakes and should review actions before confirming them
Write tools are not registered unless the server is started with --allow-writes. This is intentional: the default mode is an AI assistant that helps operators understand the cluster and plan changes, not an autonomous agent that applies them.
Traffic management¶
| Tool | Impact |
|---|---|
set_member_weight |
Shifts traffic distribution immediately |
enable_member |
Adds a member back into the DNS rotation |
disable_member |
Removes a member from the DNS rotation (no connection draining) |
create_member |
Adds a new backend to a pool |
delete_member |
Permanently removes a member (irreversible) |
create_pool |
Creates an empty pool (no traffic impact until assigned to a service) |
update_service |
Reassigns pool or changes algorithm for a service |
upsert_health_check |
Creates or updates health check parameters for a pool |
Alerting¶
| Tool | Impact |
|---|---|
test_alert_channel |
Sends a test notification to verify channel delivery |
create_alert_channel |
Creates a new notification channel |
delete_alert_channel |
Permanently deletes a notification channel |
Intent-based routing¶
| Tool | Impact |
|---|---|
apply_routing_config |
Applies a filter chain to a service, wrapped in a deployment gate (snapshot + soak + rollback) |
DNS management¶
| Tool | Impact |
|---|---|
create_txt_record |
Creates a static TXT record served immediately |
delete_txt_record |
Deletes a TXT record (stops being served immediately) |
create_redirect |
Creates an HTTP redirect rule (active immediately) |
delete_redirect |
Deletes an HTTP redirect rule |
Recommended usage pattern¶
- Ask the AI to call
get_topologyto load the current cluster state - Describe what you want to achieve ("I want to shift all EU traffic to the new pool")
- The AI will analyse the topology and recommend the specific configuration steps
- Review the recommendation, then either apply it manually via the WebUI/TUI or ask the AI to apply it (write tools required)
This keeps the AI in an advisory role by default and makes human review an explicit step.
Intent-based routing¶
A routing intent — "keep EU users in EU, prefer the greenest region, never send more than a third of traffic to lon-01" — is a sentence, not a config. Turning one into a filter chain is a compilation step, and the model on the other end of this MCP connection is the compiler. The daemon ships no LLM and holds no provider API keys: it ships the tools that make the compilation safe.
The loop, in order:
get_routing_schema— what steps exist, what each does to the candidate set, and which ones this license actually allows. Generated from the same table the API validates writes against, so a chain built from the schema cannot be rejected for an unknown step name.validate_routing_config— would this bundle be accepted? Same structural, script-compile, licensing and prox-member checks as a real service write, but nothing is written and every problem comes back at once rather than one per round trip.simulate_routing— does it steer the way the intent said? Pass representative client IPs (one per region the intent mentions) and afilter_chain, and each trace is run against the proposed chain while using live members, health, weights and geo rules. This is the step that catches an intent that validates cleanly and still does the wrong thing: "keep EU users in EU" compiles to a perfectly legal chain that steers nothing if no member carries aneuregion tag.apply_routing_config— only once 2 and 3 agree. Opens a deployment gate first (config snapshot + health soak + one-call rollback), then writes the chain. If the gate cannot be opened — it needs a pro license — the change is still applied and the result says loudly that it is unsnapshotted. OnlyfilterChainchanges: the service is read, sent back as fetched, and the chain swapped, so algorithm, traffic shadowing, split-horizon view, TTL and max answers are all preserved. (Until 2026-09-20 it rebuilt the body by hand and silently cleared the first three.)
Steps 1–3 are read-only and always available. Step 4 needs --allow-writes.
The same loop without an AI¶
Nothing above is MCP-specific; the endpoints are ordinary REST and are wired
into gslbctl too, which makes them usable as a CI gate:
gslbctl routing schema # what steps exist
gslbctl routing validate --chain geo-ip,wrr --pool <id> # exits non-zero if invalid
gslbctl trace <service-id> --client-ip 2.16.0.1 --chain geo-ip,wrr
gslbctl trace --chain is the same dry run: it traces the proposed chain and
labels it (proposed — not the stored chain) so a trace can never be mistaken
for the live config.