martimy avatar

Batfish Q Mcp

martimy/batfish-q-mcp

An MCP server exposing Batfish tools so AI assistants can query network configs in plain language.

tools
9
transport
STDIO
env var
1
last updated
Nov 12, 2026

Tools

9 tools

Public tool metadata for what this MCP can expose to an agent.

batfish_list_questionsThe 60-question curated catalog, with input types and TYPE_HINTS descriptions. No Batfish server needed.

The 60-question curated catalog, with input types and TYPE_HINTS descriptions. No Batfish server needed.

No parameter schema in public metadata yet.

batfish_list_snapshotsSnapshots of a network.

Snapshots of a network.

No parameter schema in public metadata yet.

batfish_upload_snapshotUpload a snapshot zip (base64). The name is sanitized (safe_snapshot_name); collisions are made unique (name_1, ...).

Upload a snapshot zip (base64). The name is sanitized (safe_snapshot_name); collisions are made unique (name_1, ...).

No parameter schema in public metadata yet.

batfish_run_questionRun any catalog question. Giving reference_snapshot and snapshot runs a differential question. Returns JSON-safe {fun, snapshot, reference_snapshot, status, rows, removed_columns}.

Run any catalog question. Giving reference_snapshot and snapshot runs a differential question. Returns JSON-safe {fun, snapshot, reference_snapshot, status, rows, removed_columns}.

No parameter schema in public metadata yet.

batfish_list_assertionsLive pybatfish assertion names plus the 16-entry registry (specs) with parameter descriptions.

Live pybatfish assertion names plus the 16-entry registry (specs) with parameter descriptions.

No parameter schema in public metadata yet.

batfish_run_assertionValidate and run one assertion (answer-based ones fetch the answer first). Returns {type, status, message, snapshot, ran_at, runtime, fun?, answer_rows?}.

Validate and run one assertion (answer-based ones fetch the answer first). Returns {type, status, message, snapshot, ran_at, runtime, fun?, answer_rows?}.

No parameter schema in public metadata yet.

batfish_run_assertion_suiteValidate (all-or-nothing) and run a YAML suite; examples/assertions.yaml shows the schema. Returns results[], errors[], summary.

Validate (all-or-nothing) and run a YAML suite; examples/assertions.yaml shows the schema. Returns results[], errors[], summary.

No parameter schema in public metadata yet.

batfish_fork_snapshotFork a snapshot, optionally failing nodes or interfaces, then diff the fork against the base with a differential question.

Fork a snapshot, optionally failing nodes or interfaces, then diff the fork against the base with a differential question.

No parameter schema in public metadata yet.

batfish_get_topologykind="layer3" (from layer3Edges, with interface titles) or "routing" (from bgpEdges). Returns {kind, snapshot, node_count, edge_count, nodes, edges}.

kind="layer3" (from layer3Edges, with interface titles) or "routing" (from bgpEdges). Returns {kind, snapshot, node_count, edge_count, nodes, edges}.

No parameter schema in public metadata yet.

Sponsors

Configuration

BATFISH_SERVER

Host of the Batfish server (default 127.0.0.1)

Readme

batfish-q-mcp

PyPI Python License

An MCP (Model Context Protocol) server that exposes Batfish as tools for AI assistants. Point it at a snapshot of your network configs and ask questions in plain language, without writing Batfish queries yourself.

With it, an assistant can:

  • run any of 60 curated Batfish questions (node properties, routing, ACLs, reachability, parse issues, and more)
  • run assertions, such as "no forwarding loops", singly or as a YAML suite
  • fork a snapshot with failed nodes or interfaces and diff the result against the original
  • return layer 3 and routing topology as nodes and edges

View the full README on GitHub

Details

Repository
github.com/martimy/batfish-q-mcp
Package
batfish-q-mcp
Transport
STDIO
Registry
MCP registry, active