Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Introduction

Welcome to the User Guide for Flock Networks® MCP and its utility flockmcp.

flockmcp lets an AI assistant read the operational state of routers running the Flock Networks IP Routing Suite. It speaks the Model Context Protocol (MCP) to the assistant and gRPC to the flockd daemon on each router, so in one conversation an assistant can look at several routers and compare them.

AI assistant ──MCP──▶ flockmcp ──gRPC──▶ flockd on router r1
                               ├───────▶ flockd on router r2
                               └───────▶ flockd on router ...

With flockmcp an assistant can answer questions such as:

  • Which BGP sessions are down across my routers, and since when ?
  • Why does router r1 send traffic for 198.51.100.7 that way ?
  • Do routers r1 and r2 agree on the route to 10.1.0.0/16 ?
  • What did this neighbor send us for that prefix, and what did we send it ?

flockmcp covers the System, RIB, Static and BGP components of flockd. See the Flock Networks Routing Suite User Guide for flockd itself.

  • flockmcp reads. Of its tools all but one only report state. The one that acts, a BGP neighbor reset, is off unless both flockmcp and the router are told to allow it.
  • flockmcp returns the same values flockc prints, as JSON, so an answer from an assistant can be checked against flockc on the router.
  • A routing table is returned a part at a time, so a large table cannot flood the assistant.
  • A router that is down, or that fails to answer, does not stop the assistant asking the others.

If you have any questions, suggestions or issues, please email support@flocknetworks.com.

Installation

flockmcp and flockmcpd are shipped as two Debian packages, and flockmcpd also as a container image. Install the one your AI assistant needs. Neither need be on a router: each reaches the routers over the network.

  • flockmcp, the utility, is installed on the host the AI assistant runs on, which starts it.
  • flockmcpd, the service, is installed on a host the assistant can reach over HTTP, for an assistant that connects to an MCP server by URL rather than starting one.

Download the latest Debian packages from the Flock Networks demo page.

flockmcp

Install it from its Debian package (as root or using sudo);

# dpkg -i flockmcp_<version>-1_amd64.deb

The Flock MCP Utility flockmcp is copied to;

/usr/bin/flockmcp

Check the installation;

$ flockmcp --version

flockmcp is not a service and has no configuration file. The AI assistant starts it when it is needed, with the options that name the routers, and stops it when the conversation ends. See MCP Clients.

flockmcpd

Install it from its Debian package (as root or using sudo);

# dpkg -i flockmcpd_<version>-1_amd64.deb

The package installs;

/usr/sbin/flockmcpd                           the Flock MCP Service
/etc/flockmcpd/flockmcpd.json                 its configuration file
/etc/flockmcpd/flockmcpd.json.sample          an example with every key
/usr/lib/systemd/system/flockmcpd.service     its systemd unit

The service is enabled, so it starts when the host boots, but it is not started by the install. The configuration file installed is {}: it serves on [::1]:8650 and talks to the flockd on the same host. Name the routers in /etc/flockmcpd/flockmcpd.json, then start it;

# systemctl start flockmcpd

Check it is running;

$ systemctl status flockmcpd

An upgrade restarts the service if it is running. Removing the package stops it. See Running as a service.

Which version to install

The major and minor version of flockmcp are those of the flockd release line it is built for, and its patch number is its own. flockmcp talks only to a flockd of the same major and minor version, so flockmcp 26.5.x is for routers running flockd 26.5.x. See Versions.

Quick Start

This guide connects an AI assistant to two routers, r1 and r2, that are already running flockd.

1. Let the routers be reached

flockd serves its API on the loopback address [::1] of the router unless told otherwise. On each router, set the address to serve it on in the system section of /etc/flockd/flockd.json, and restart flockd:

"system": {
    "api": {
        "grpc": {
            "bind_ip_addr": "192.0.2.1"
        }
    }
}

The API has no authentication. Use an address on a management network that only trusted hosts can reach. See Connecting to Routers.

Check each router can be reached from the host the assistant runs on, using flockc:

$ flockc -e http://192.0.2.1:50051 sys overview

2. Install flockmcp

On the host the assistant runs on, install the flockmcp release that matches the routers' flockd release.

3. Tell the assistant about flockmcp

Register flockmcp with the assistant, naming each router and giving its endpoint. For example with Claude Code:

$ claude mcp add flock -- /usr/bin/flockmcp \
      --daemon r1=http://192.0.2.1:50051 \
      --daemon r2=http://192.0.2.2:50051

MCP Clients has the same for other assistants.

4. Ask

Start the assistant and ask about the routers in plain language.

> Which routers can you see ?

> Are all the BGP sessions on r1 and r2 established ?

> What route does r1 use for 198.51.100.7, and where did it come from ?

> Compare the BGP routes r1 sends r2 with what r2 says it received.

The assistant chooses which tools to call. Most assistants show each call and its answer, and ask before calling a tool for the first time.

Flock MCP Utility: flockmcp

Overview

flockmcp is a utility, not a service. It is started by the AI assistant, not by systemd. The assistant runs it as a child process and talks to it on its standard input and output. It runs for as long as the conversation needs it and exits when the assistant closes its input.

flockmcp holds a connection to each router it is told about. It connects to a router the first time a tool asks that router something, and connects again by itself if the connection is lost. It starts whether or not the routers are up.

Options

flockmcp [OPTIONS]

Options:
      --daemon <NAME=ENDPOINT>  A flockd daemon to talk to, e.g. r1=http://192.0.2.1:50051
      --allow-actions <NAME>    Let tools that change a daemon's running state act on this one
      --request-timeout <SECS>  How long to wait for a daemon to answer [default: 10]
      --connect-timeout <SECS>  How long to wait for a connection to a daemon [default: 3]
  -h, --help                    Print help
  -V, --version                 Print version

--daemon

--daemon names a router and gives the gRPC endpoint of its flockd. Give it once for each router.

flockmcp --daemon r1=http://192.0.2.1:50051 --daemon r2=http://[2001:db8::2]:50051

The name is what the assistant, and you, call the router: every tool that asks a router something takes it as daemon. A name is made of letters, digits, _, . and -. The endpoint may use a host name in place of an address.

With no --daemon there is one daemon, named local, at the endpoint FLOCK_ENDPOINT gives, or http://[::1]:50051 if that is not set. This is the flockd on the same host, where it serves its API by default.

--allow-actions

--allow-actions names a router that the assistant may reset a BGP neighbor on. It is not given for a router by default. See Changing a Router.

--request-timeout and --connect-timeout

A router that does not answer in --request-timeout seconds, or cannot be connected to in --connect-timeout seconds, is reported to the assistant as unreachable. The other routers are not affected.

Logging

flockmcp logs to its standard error, at the level RUST_LOG sets. Where the log goes is up to the assistant that started it.

More than one assistant

Each assistant starts a flockmcp of its own. Any number can talk to the same routers at once.

Flock MCP Service: flockmcpd

Overview

flockmcpd is the MCP server as a service. It serves the same tools as flockmcp, and answers them the same way, but it runs on its own and assistants connect to it over HTTP rather than starting it. Use it where the assistant cannot start a program on a host that can reach the routers: an assistant on another machine, or one that only connects to MCP servers by URL.

flockmcpd takes no options beyond --help and --version. It is configured by its configuration file only, which it reads once, when it starts.

Configuration file

flockmcpd reads /etc/flockmcpd/flockmcpd.json. FLOCKMCPD_CONF_DIR and FLOCKMCPD_CONF_FILE change where it looks. The file must exist, but every key in it is optional, so {} is a valid file.

{
    "system": {
        "api": {
            "http": {
                "bind_ip_addr": "::1",
                "bind_port": 8650,
                "allowed_hosts": ["mcp.example.com"]
            }
        }
    },
    "daemons": {
        "r1": { "endpoint": "http://192.0.2.1:50051" },
        "r2": { "endpoint": "http://[2001:db8::2]:50051", "allow_actions": true }
    },
    "request_timeout_secs": 10,
    "connect_timeout_secs": 3
}

A key flockmcpd does not know is refused, so a mistyped key is reported rather than ignored.

system.api.http

The address and port flockmcpd serves on, modelled on flockd's own system.api.grpc. bind_ip_addr defaults to ::1 and bind_port to 8650.

allowed_hosts lists the names, in the HTTP Host header, that flockmcpd answers to. If it is left out, flockmcpd answers only to localhost, 127.0.0.1 and ::1. An entry without a port matches any port. An empty list is refused.

daemons

Each key names a router, and its endpoint gives the gRPC endpoint of its flockd, as --daemon does for flockmcp. The names and endpoints follow the same rules. A name may appear only once.

allow_actions, false by default, lets the assistant reset a BGP neighbor on that router. See Changing a Router.

With no daemons there is one daemon, named local, at http://[::1]:50051. flockmcpd does not read FLOCK_ENDPOINT. To allow actions on that daemon, list it: "daemons": { "local": { "endpoint": "http://[::1]:50051", "allow_actions": true } }.

request_timeout_secs and connect_timeout_secs

As --request-timeout and --connect-timeout for flockmcp, in seconds. They default to 10 and 3.

Serving

flockmcpd serves MCP at the path /mcp, so with the defaults an assistant on the same host connects to http://[::1]:8650/mcp. Use the address it binds, not localhost: an assistant that resolves localhost to 127.0.0.1 first finds nothing listening there. Any other path is answered with 404. See MCP Clients for how an assistant is told the URL.

Any number of assistants can be connected at once.

Security

flockmcpd has no authentication and no encryption. Anyone who can reach its address can use every tool, including resetting a BGP neighbor on a router with allow_actions.

  • Keep the default loopback address unless the assistant is on another host, and then bind an address only trusted hosts can reach.
  • A bind_ip_addr that is not loopback is logged as a warning when flockmcpd starts.
  • So is a bind_ip_addr that is not loopback with no allowed_hosts: such a flockmcpd answers only requests that name localhost, 127.0.0.1 or ::1 as their Host, so a client that names it by its address or name is refused until allowed_hosts lists it.
  • allowed_hosts guards against a web page reaching flockmcpd through DNS rebinding. It does not keep out a client that can reach the address: such a client chooses its own Host header. Only the bind address and the network limit who is served.
  • A request naming a Host not in allowed_hosts is refused with 403. server_status counts the refusals, as refused_hosts, and reports the rest of this: the address bound, the Host names allowed, and whether those are only the loopback names.

Running as a service

The Debian package runs flockmcpd as the systemd service flockmcpd. The service runs as an unprivileged user that systemd creates for it (DynamicUser=yes), with the system read-only, as flockmcpd needs only to read its configuration file and serve an unprivileged port.

# systemctl restart flockmcpd     after changing the configuration file
$ journalctl -u flockmcpd         its log

systemd restarts the service if it fails, except when its configuration file is refused (exit code 78), which a restart would not fix.

In a container

flockmcpd is also shipped as the container image ghcr.io/flocknetworks/flockmcpd:<version>, for hosts that run services under Docker. Its <version> is the package's: its major and minor version are those of the flockd release line it is for, and its patch number is its own. Write a configuration file for the container, mount it over the image's own, and publish its port on the host's loopback address:

$ docker run -d --name flockmcpd \
      -p 127.0.0.1:8650:8650 \
      -v /srv/flockmcpd/flockmcpd.json:/etc/flockmcpd/flockmcpd.json:ro \
      ghcr.io/flocknetworks/flockmcpd:<version>

An assistant on the host then connects to http://127.0.0.1:8650/mcp.

  • The configuration must bind ::: "system": {"api": {"http": {"bind_ip_addr": "::"}}}. Docker forwards a published port to the container's own network address, not to its loopback, so a flockmcpd left at the default ::1 is up but no client reaches it. That makes a configuration written for the Debian package the wrong one to mount. Binding :: inside the container does not expose it: who can reach it is decided by where the port is published.
  • The image's own configuration binds :: and names no daemons. It is only a safe default to mount a real one over.
  • Name each daemon by an address the container can reach. The default daemon, local at http://[::1]:50051, is the container's own loopback, where there is no flockd.
  • A configuration that leaves out allowed_hosts serves only the loopback Host names, which is what an assistant on the host sends. An assistant that reaches the container by a name or another address needs that name or address in allowed_hosts.
  • The image runs flockmcpd as the user nobody. A mounted file keeps its owner and mode from the host, so the configuration file must be readable by others (mode 0644), or flockmcpd exits with code 78. Otherwise run the container with --user set to a user that can read it.
  • To reach a flockd on the same host, the container can share the host's network with --network host. Then -p is ignored and flockmcpd binds the host's own addresses, so this is the one case where bind_ip_addr is ::1, or it serves on every interface the host has.
  • The image sets no RUST_LOG, so docker logs flockmcpd holds warnings only. Pass -e RUST_LOG=info for more, such as the line naming the address it serves on.

Stopping

flockmcpd exits on SIGTERM or SIGINT without waiting for the assistants connected to it, so systemctl stop and docker stop take effect at once.

Logging

flockmcpd logs to its standard error, at the level RUST_LOG sets. If RUST_LOG is not set, warn and above are logged, so the warnings above are seen.

Exit codes

CodeMeaning
0Stopped by SIGTERM or SIGINT.
1Any other failure to start. The reason is on standard error.
2An option it does not take.
69The address could not be bound, most often because another program is using the port. No other failure exits with 69.
78The configuration file is missing or refused. The reason is on standard error.

Connecting to Routers

flockmcp is a client of the same gRPC API that flockc uses. If flockc -e <endpoint> sys overview works from the host flockmcp runs on, flockmcp can reach that router at the same endpoint.

The address flockd serves its API on

By default flockd serves its API on the IPv6 loopback address, port 50051, which only programs on the router itself can reach. To reach a router from another host, set the address in the system section of its /etc/flockd/flockd.json:

"system": {
    "api": {
        "grpc": {
            "bind_ip_addr": "192.0.2.1",
            "bind_port": 50051
        }
    }
}

Both fields are optional and default to ::1 and 50051. flockd reads them only when it starts. The address must be one the router has when flockd starts. :: serves the API on every address of the router.

Security

The flockd API has no authentication and no encryption. Anyone who can reach the address can read the router's state.

  • Serve the API on a management network that only trusted hosts can reach, not on an address reachable from the networks the router forwards for.
  • Leave allow_actions off on a router unless an assistant is meant to reset BGP neighbors on it.
  • flockmcp cannot change a router's configuration. allow_config on the router is not needed and can stay off.

Versions

The major and minor version of flockmcp are those of the flockd release line it is built for. Its patch number is its own, as flockmcp and flockd are each patched only when they change.

flockmcp asks each router for its flockd version when it first connects to it, and again whenever it has had to connect anew. It talks to a flockd whose major and minor version are the same as its own: flockmcp 26.5.0 talks to flockd 26.5.0 and 26.5.3, and not to 26.4.x or 26.6.x.

A router running another version is refused. Every tool asked about it reports the two versions, and list_daemons shows it with version_match false. The other routers are not affected.

When routers are upgraded to a new flockd minor release, install the flockmcp of that release, even where the release changed nothing flockmcp uses. Routers on two releases need a flockmcp of each, registered with the assistant under two names.

A router that is down or restarts

A router that cannot be reached is reported as unreachable by any tool that asks it, with its endpoint and the reason. flockmcp tries again the next time it is asked.

A router that restarts is connected to again by itself. A call that is the first to reach a router after it restarted has the router's version checked, and is asked again once. A call the router stops under is reported as unreachable: ask again. A BGP neighbor reset is never sent twice: see Changing a Router.

MCP Clients

Any AI assistant that can start a local program to speak MCP with can use flockmcp. The assistant is told the command to run and its arguments. The Model Context Protocol calls any program that offers tools to an assistant an "MCP server", so that is the name assistants use in their settings and commands, as in mcpServers below. It does not mean a service that is left running: the assistant starts flockmcp and stops it. The command is the same for every assistant:

/usr/bin/flockmcp --daemon r1=http://192.0.2.1:50051 --daemon r2=http://192.0.2.2:50051

The name the assistant knows flockmcp by, flock in these examples, is yours to choose.

Each assistant has its own way of being told. Those below are examples: see the assistant's own documentation for where its configuration is kept and how it asks before calling a tool.

Claude Code

$ claude mcp add flock -- /usr/bin/flockmcp \
      --daemon r1=http://192.0.2.1:50051 \
      --daemon r2=http://192.0.2.2:50051

$ claude mcp list

OpenAI Codex CLI

$ codex mcp add flock -- /usr/bin/flockmcp \
      --daemon r1=http://192.0.2.1:50051 \
      --daemon r2=http://192.0.2.2:50051

$ codex mcp list

or in ~/.codex/config.toml:

[mcp_servers.flock]
command = "/usr/bin/flockmcp"
args = ["--daemon", "r1=http://192.0.2.1:50051", "--daemon", "r2=http://192.0.2.2:50051"]

Google Gemini CLI

In ~/.gemini/settings.json:

{
    "mcpServers": {
        "flock": {
            "command": "/usr/bin/flockmcp",
            "args": [
                "--daemon", "r1=http://192.0.2.1:50051",
                "--daemon", "r2=http://192.0.2.2:50051"
            ]
        }
    }
}

An open model run locally, with Ollama and MCPHost

An assistant need not be a hosted service. An open model run on your own hardware works too, which keeps the routers' state on your network. Ollama runs the model, and MCPHost, an open source MCP client, connects it to flockmcp.

In ~/.mcphost.json:

{
    "mcpServers": {
        "flock": {
            "command": "/usr/bin/flockmcp",
            "args": [
                "--daemon", "r1=http://192.0.2.1:50051",
                "--daemon", "r2=http://192.0.2.2:50051"
            ]
        }
    }
}

Fetch a model and start the assistant:

$ ollama pull qwen3
$ mcphost -m ollama:qwen3

The model must be one that supports tool calling. A small model chooses tools and reads their answers less reliably than a large one: ask it one thing at a time, and name the router.

Other assistants

Most other assistants take the same command and args, in a JSON object like the one above.

An MCP server reached by URL

An assistant that connects to an MCP server by URL, rather than starting one, uses flockmcpd instead. The routers are named in flockmcpd's configuration file, and the assistant is told only the URL. With the defaults, on the same host:

$ claude mcp add --transport http flock http://[::1]:8650/mcp

Other assistants take the URL in their own settings, often as url where a started server has command. The transport is the one MCP calls "streamable HTTP".

Checking the assistant can see the routers

Ask the assistant which routers it can see. It calls list_daemons, which names each router and says whether it can be reached and whether its version is one this flockmcp or flockmcpd talks to.

Tools

A tool is one question flockmcp can answer. The assistant is given the list of tools, with what each is for and the arguments it takes, and decides which to call. You do not call tools yourself, but knowing them helps you ask for what you want and read what the assistant shows you.

AreaTools
Fleetlist_daemons, fleet_overview, server_status
Systemsys_overview, sys_vrfs, sys_interfaces
RIBrib_lookup, rib_walk, lrib
Static routesstatic_overview, static_routes
BGPbgp_overview, bgp_vrfs, bgp_neighbors, bgp_neighbor, bgp_rib, bgp_adj_rib, bgp_evpn
Changing a routerbgp_reset_neighbor

Naming the router

Every tool that asks a router something takes daemon: the name the router was given with --daemon. list_daemons gives the names.

A tool that looks in one VRF uses the main VRF, default, when vrf is left out. A tool that lists across VRFs lists every VRF's.

Answers

An answer is JSON, and holds the same values flockc --format json prints for the same question. The Flock Networks Routing Suite User Guide describes them.

Looking one thing up

A tool that looks one thing up, such as a route or a neighbor, answers with it. Where the router has no such thing, the answer says so. That is an answer, not a failure:

{
    "found": false,
    "looked_for": "prefix 9.9.9.0/24 in the RIB of VRF default on daemon r1"
}

Walking a table

A routing table can hold far more than an assistant can read at once, so a tool that walks a table returns a part of it.

{
    "entries": [ ... ],
    "finished": false,
    "next": "10.1.37.0/24"
}
  • entries are in order: by prefix for a routing table.
  • finished is true when there is nothing after them.
  • While finished is false, the same call with start_from set to the answer's next returns the part after it.

A part holds up to 100 entries unless max_entries asks for another number, which can be up to 1000. A part is also cut at about 64KB, so entries with many paths come fewer to a part. An entry too large for a part on its own is returned alone, with a note saying so.

Walk only what is needed. root limits a walk to the prefixes under one prefix: 10.1.0.0/16 walks that prefix and the more specific prefixes within it. Leaving root out walks every IPv4 prefix, or for a table of one address family every prefix of that family. ::/0 walks every IPv6 prefix.

Arguments that are refused

flockmcp checks a tool's arguments before it asks a router, and says what to give instead:

prefix "10.1.2.3/16" has host bits set: did you mean 10.1.0.0/16?

no daemon named r9: the daemons are r1, r2

The assistant reads the message and normally corrects the call by itself.

Failures

A tool that cannot answer says why, naming the router. The assistant can go on to ask the other routers. See Troubleshooting.

Fleet Tools

These tools are about the set of routers flockmcp was told of, and about flockmcp itself.

list_daemons

Lists the routers: each one's name, endpoint, whether it can be reached, its flockd version, and whether that version is one this flockmcp talks to. An assistant starts here, as the names are what every other tool takes as daemon.

It takes no arguments, and asks every router as it is called.

{
    "daemons": [
        {
            "name": "r1",
            "endpoint": "http://192.0.2.1:50051",
            "allow_actions": true,
            "reachable": true,
            "version": "26.5.0",
            "git_commit": null,
            "version_match": true,
            "counters": {
                "connections": 1,
                "version_probes": 1,
                "requested_probes": 0,
                "version_mismatches": 0,
                "retries": 0,
                "unreachable": 0
            }
        }
    ]
}
  • allow_actions is whether flockmcp was started with --allow-actions for the router. The router has a setting of its own as well.
  • version_match is false for a router flockmcp will not talk to. It, version and git_commit are null where the router could not be asked.
  • A router that cannot be reached has reachable false and an error saying why.

The counters are kept from when flockmcp started:

CounterCounts
connectionsConnections made to the router. More than one means the connection was lost and made again
version_probesTimes the router was asked its version because it had to be: on first use, and after each new connection
requested_probesTimes it was asked its version though that was not due: by list_daemons, and before every reset
version_mismatchesTimes the version was not one this flockmcp talks to
retriesCalls asked again because the router restarted under them
unreachableTimes the router could not be reached

fleet_overview

The system overview of several routers in one call.

Argument
daemonsThe routers to ask. Leave out to ask every router

Each router has its overview, or an error saying why it could not be asked.

server_status

Reports on flockmcp or flockmcpd itself, not on a router: its version, whose major and minor version are those of the flockd release line it talks to.

{
    "server": "flockmcp",
    "version": "26.5.0",
    "build": "release",
    "refuses_version_mismatch": true
}

flockmcpd adds http, for its endpoint:

{
    "server": "flockmcpd",
    "version": "26.5.0",
    "build": "release",
    "refuses_version_mismatch": true,
    "http": {
        "bound_addr": "[::1]:8650",
        "allowed_hosts": ["localhost", "127.0.0.1", "::1"],
        "loopback_hosts_only": true,
        "refused_hosts": 0
    }
}
Field
bound_addrThe address and port it serves on
allowed_hostsThe Host names it answers to: allowed_hosts as configured, or the loopback names if that is not set
loopback_hosts_onlyallowed_hosts is not set, so only requests naming localhost, 127.0.0.1 or ::1 as their Host are answered. See Security
refused_hostsHow many requests it has refused, with 403, for a Host not in allowed_hosts

System Tools

These tools report what the System component of flockd holds: the router itself, its VRFs and its interfaces.

sys_overview

One router's overview: hostname, flockd version, uptime, the protocols it runs, its count of software errors and whether it is in maintenance mode. The same as flockc sys overview.

Argument
daemonThe router

sys_vrfs

The VRFs a router has, each with its id. The same as flockc sys list-vrfs, or flockc sys vrf <name> for one.

Argument
daemonThe router
vrfOne VRF to report on, by name. Leave out to list every VRF
{
    "vrfs": [
        {
            "vrf_id": 254,
            "vrf_name": "default",
            "underlay_vrf_name": null,
            "kernel_intf_name": null,
            "vrf_opaque_data": null
        }
    ]
}

sys_interfaces

A router's interfaces as flockd sees them: name, type, MTU, MAC address, state, VRF and IP prefixes. The same as flockc sys list-interfaces, or flockc sys interface <name> --vrf <vrf> for one.

Argument
daemonThe router
interfaceOne interface to report on, by name. Leave out to list interfaces
vrfThe VRF the interface is in, or the VRF to list the interfaces of. Leave out for an interface in the main VRF, or to list those of every VRF
{
    "intf_name": "eth1",
    "intf_id": 3,
    "intf_kernel": { "intf_id": 3, "intf_name": "eth1" },
    "intf_type": "broadcast",
    "intf_mtu": 1500,
    "intf_mac": "2e:2b:ed:3d:41:ae",
    "intf_state": "up",
    "vrf": { "vrf_id": 254, "vrf_name": "default" },
    "ip_prefixes": [
        "10.0.12.1/30",
        "fe80::2c2b:edff:fe3d:41ae/64"
    ],
    "esi": null,
    "held": false
}

An interface on the router's intf_denylist is not reported, as flockd does not use it.

RIB Tools

These tools report the RIB component of flockd: the routes the router has chosen from every protocol, which are those it forwards with, and its label RIB.

To see why BGP offered a route, or what a neighbor sent, use the BGP tools.

rib_lookup

Looks one route up: either an exact prefix, or the longest prefix that matches an address. The same as flockc rib vrf <vrf> lookup <prefix> and flockc rib vrf <vrf> lpm <address>.

Argument
daemonThe router
vrfThe VRF to look in. Leave out for the main VRF
prefixA prefix to look up exactly, e.g. 10.1.0.0/16
addressAn address to find the longest matching prefix for, e.g. 10.1.2.3

Give prefix or address, not both. address answers the question "where does this router send traffic for this destination ?".

The answer has the prefix and, for each protocol that has a route for it, its administrative distance, metric and next hops:

{
    "prefix": "198.51.100.0/24",
    "entry": {
        "protos": [
            {
                "admin_dist": 20,
                "origin": "Bgp",
                "route_type": { "Bgp": "External" },
                "ip_nhs": [
                    {
                        "RecursiveNh": {
                            "vrf": { "vrf_id": 254, "vrf_name": "default" },
                            "ip_addr": "10.0.12.2",
                            ...
                        }
                    }
                ],
                ...
            }
        ],
        ...
    }
}

rib_walk

Walks the RIB in prefix order, a part at a time. The same as flockc rib vrf <vrf> walk <root>.

Argument
daemonThe router
vrfThe VRF to walk. Leave out for the main VRF
rootWalk the prefixes under this one. Leave out for every IPv4 prefix; ::/0 for every IPv6 prefix
originReturn only the prefixes that have a route from this protocol: bgp, connected, isis, ospfv2, ospfv3 or static
start_fromGo on from after this prefix: the next of the answer before
max_entriesThe most entries to return: 100 unless given, and never over 1000

lrib

The label RIB: the router's MPLS label table. The same as flockc lrib.

Argument
daemonThe router
labelOne label to look up. Leave out to walk the label RIB
showWith no label: walk for the entries, which is what is done if this is left out, or stats for how many there are
start_fromGo on from after this label: the next of the answer before
max_entriesThe most entries to return: 100 unless given, and never over 1000

Static Route Tools

These tools report the Static component of flockd: the static routes as configured. Whether a static route is the one the router uses for its prefix is for rib_lookup to say.

static_overview

How many static routes and VRFs the Static component has, and the route counts of each VRF. The same as flockc static overview and flockc static list-vrfs, or flockc static vrf <vrf> show for one.

Argument
daemonThe router
vrfOne VRF to report on, by name. Leave out for the whole component and every VRF

static_routes

A router's static routes, with each path's next hops. The same as flockc static vrf <vrf> lookup <prefix> and flockc static vrf <vrf> walk <root>.

Argument
daemonThe router
vrfThe VRF to look in. Leave out for the main VRF
prefixOne prefix to look up, e.g. 10.1.0.0/16. Leave out to walk the static routes
rootWalk the prefixes under this one. Leave out for every IPv4 prefix; ::/0 for every IPv6 prefix
start_fromGo on from after this prefix: the next of the answer before
max_entriesThe most entries to return: 100 unless given, and never over 1000
{
    "prefix": "203.0.113.0/24",
    "paths": [
        {
            "admin_dist": null,
            "origin": { "Static": "Conf" },
            "nhs": [
                {
                    "Recursive": {
                        "vrf": { "vrf_id": 254, "vrf_name": "default" },
                        "ip_addr": "10.0.12.2",
                        "out_label": null
                    }
                }
            ]
        }
    ]
}

BGP Tools

These tools report the BGP component of flockd: the instance, its VRFs and neighbors, its own routing tables, and what was exchanged with each neighbor.

BGP's tables hold every path BGP has for a prefix. The route the router forwards with, chosen from every protocol, is in the RIB: see rib_lookup.

bgp_overview

A router's BGP instance: its AS number and router id, whether it is a route reflector or route server, how many neighbors it has and how many are established, and its route counts. The same as flockc bgp overview.

Argument
daemonThe router

bgp_vrfs

The VRFs a router runs BGP in, each with its neighbors' addresses and, for an L3VPN, its route distinguisher and export route targets. The same as flockc bgp list-vrfs, or flockc bgp vrf <vrf> show for one.

Argument
daemonThe router
vrfOne VRF to report on, by name. Leave out to list every VRF

bgp_neighbors

A router's BGP neighbors at a glance, one row each. This is the tool for finding sessions that are down. The same as flockc bgp list-neighbors.

Argument
daemonThe router
vrfList only this VRF's neighbors. Leave out for every VRF's
start_fromGo on from after this neighbor: the next of the answer before
max_entriesThe most entries to return: 100 unless given, and never over 1000
{
    "entries": [
        {
            "vrf_name": "default",
            "neigh_key": "10.0.12.2",
            "hostname": "r2",
            "asn": 65002,
            "local_as": null,
            "neigh_type": "External",
            "state": "Established",
            "last_session_state_change": "2026-11-22T17:16:07.192Z",
            "last_notify_send": null,
            "last_notify_recv": null,
            "disabled": false,
            "bfd_status": null,
            "afis": {
                "ipv4-unicast": {
                    "n_adj_rib_in_prefixes": 1,
                    "n_adj_rib_out_prefixes": 1
                }
            }
        }
    ],
    "finished": true
}

neigh_key is how the other BGP tools name the neighbor. It is the neighbor's address; for a link-local address, the address and interface, e.g. fe80::1%eth0; and where the neighbor is configured with a source address, a space and that address, e.g. 192.0.2.1 192.0.2.254.

bgp_neighbor

One BGP neighbor in full: its configuration as negotiated, both of its connections with their state and timers, its capabilities, and each address family's policies and counts. The same as flockc bgp vrf <vrf> neigh <neighbor> show.

Argument
daemonThe router
vrfThe VRF the neighbor is in. Leave out for the main VRF
neighborThe neighbor, whole as bgp_neighbors gives it in neigh_key
statstrue to also return the neighbor's message and route counters

bgp_rib

BGP's own routing tables, with every path for a prefix and which is best.

Argument
daemonThe router
tableThe table: unicast unless given, or vpn, rtc or afi
vrfFor unicast and afi: the VRF. Leave out for the main VRF
afiFor afi: the address family, e.g. ipv4-unicast, ipv6-unicast, ipv4-mpls
rdFor vpn: a route distinguisher, e.g. 65001:100
prefixOne route to look up, e.g. 10.1.0.0/16. For vpn, give rd too
rtc_netFor rtc: one network to look up, either Default or origin_as:<asn>,route-target:<type>:<global>:<local>
rootWalk the prefixes under this one. Leave out for every IPv4 prefix; ::/0 for every IPv6 prefix. For afi, leaving it out is every prefix of that family. Not for rtc
showstats for the counts of a unicast or vpn table instead of its routes
start_fromGo on from after this entry: the next of the answer before
max_entriesThe most entries to return: 100 unless given, and never over 1000

The tables are:

tableHoldsAs flockc
unicastA VRF's IPv4 and IPv6 unicast routesbgp vrf <vrf> rib
vpnThe L3VPN routes, each a route distinguisher and a prefixbgp vpn-rib
rtcThe route target constraint routesbgp rtc-rib
afiA VRF's routes of one address familybgp vrf <vrf> afi-rib <afi>

With prefix, or rtc_net, one route is looked up. With show set to stats the table is counted. Otherwise the table is walked a part at a time.

For vpn, rd with no prefix walks or counts that route distinguisher's routes alone. Leaving rd out walks every route distinguisher's, in order. Either way, a vpn walk's next is a route distinguisher, a space and a prefix, e.g. 0:65001:100 10.1.0.0/24.

bgp_adj_rib

The BGP routes exchanged with one neighbor, in one direction:

  • in is what the neighbor sent, before import policy.
  • out is what was advertised to the neighbor, after export policy.
Argument
daemonThe router
vrfThe VRF the neighbor is in. Leave out for the main VRF
neighborThe neighbor, whole as bgp_neighbors gives it in neigh_key
directionin or out
tableThe table: unicast unless given, or vpn, rtc or afi
afi, rd, prefix, rtc_net, root, start_from, max_entriesAs for bgp_rib

The same as flockc bgp vrf <vrf> neigh <neighbor> adj-rib-unicast in and its like.

To find why a route from a neighbor is not in use, compare what the neighbor sent (bgp_adj_rib with in), what BGP holds for the prefix and which path it chose (bgp_rib), and what the router forwards with (rib_lookup).

bgp_evpn

BGP's EVPN routes, with every path for a route and which is best. The same as flockc bgp evpn rib.

Argument
daemonThe router
showThe table: rib, the only one. Need not be given
rdA route distinguisher, e.g. 65001:100
ip_addrAn IPv4 or IPv6 address to look up the routes for in rd
start_fromGo on from after this entry: the next of the answer before
max_entriesThe most entries to return: 100 unless given, and never over 1000

An EVPN route is a route distinguisher and a route of one of the EVPN route types. It is written whole, each part in brackets:

[0:65001:100]:[3]:[0]:[192.0.2.1]

With rd and ip_addr, the routes of that route distinguisher for the address are looked up. The address matches:

  • a MAC/IP Advertisement route (type 2) with that IP address;
  • an Inclusive Multicast Ethernet Tag route (type 3) or Ethernet Segment route (type 4) originated by that router;
  • an IP Prefix route (type 5) whose prefix contains the address.

Ethernet Auto-Discovery routes (type 1) are not found by an address: walk the route distinguisher for those.

Without ip_addr the routes are walked a part at a time: those of rd, or of every route distinguisher when rd is left out.

Changing a Router

All of the tools but one only read. The one that changes a router's running state is bgp_reset_neighbor.

flockmcp cannot change a router's configuration.

Allowing it

A reset is refused unless two settings both allow it. Neither is on by default.

  1. flockmcp must be started with --allow-actions naming the router:

     flockmcp --daemon r1=http://192.0.2.1:50051 --daemon r2=http://192.0.2.2:50051 --allow-actions r1
    

    Here an assistant may reset neighbors on r1 and not on r2. Give --allow-actions once for each router.

  2. The router must allow actions over its API, in the system section of its /etc/flockd/flockd.json:

     "system": {
         "api": {
             "allow_actions": true
         }
     }
    

    flockd takes a change to this setting without a restart.

list_daemons shows the first of these for each router, as allow_actions.

The assistant is told that bgp_reset_neighbor changes a router and that the other tools do not. Most assistants ask you before they call a tool that is marked so. Keep that turned on.

bgp_reset_neighbor

Resets a BGP neighbor. The same as flockc bgp vrf <vrf> neigh <neighbor> reset <reset>, where flockc writes the reset values with a hyphen in place of the underscore: soft-in.

Argument
daemonThe router. It must be one that list_daemons shows with allow_actions true
vrfThe VRF the neighbor is in. Leave out for the main VRF
neighborThe neighbor, as bgp_neighbors gives it in neigh_key
resetHow to reset it
reset
soft_inReplay what the neighbor sent through its import policy. Does not disturb the session
soft_outSend the neighbor the BGP RIB again through its export policy. Does not disturb the session
refresh_inAsk the neighbor to send its routes again
refresh_outSend the neighbor its routes again, as if it had asked
hardClose the session and establish it again. Traffic through the neighbor is disrupted

A reset that flockd carried out answers:

{
    "reset": true,
    "daemon": "r1",
    "vrf": "default",
    "neighbor": "10.0.12.2"
}

A reset is sent once

flockmcp checks the router is the one it expects immediately before it sends a reset, and never sends a reset a second time.

If the router restarts as the reset is sent, flockmcp cannot tell whether the reset reached it. It says so, and does not try again:

daemon r1 restarted while it was being asked to act.  What was asked may have reached it, and is not asked again: look at its state before asking again

Environment Variables

flockmcp is started by the AI assistant, so its environment variables are set where the assistant is told how to start it. See the assistant's documentation: most take an env setting beside command and args.

flockmcpd is a service, so its environment is set where it is started, such as its systemd unit or container.

FLOCK_ENDPOINT

FLOCK_ENDPOINT sets the gRPC endpoint of the one daemon, local, that flockmcp talks to when it is started with no --daemon. If not set http://[::1]:50051 will be used. It is the same variable flockc reads.

FLOCK_ENDPOINT is not used when --daemon is given, nor by flockmcpd.

FLOCKMCPD_CONF_DIR

FLOCKMCPD_CONF_DIR sets the directory that flockmcpd will look in for its configuration. If not set /etc/flockmcpd will be used.

FLOCKMCPD_CONF_FILE

FLOCKMCPD_CONF_FILE sets the name of the file in FLOCKMCPD_CONF_DIR that flockmcpd will read its configuration from. If not set flockmcpd.json will be used.

RUST_LOG

RUST_LOG sets the level flockmcp and flockmcpd log at, to their standard error. If RUST_LOG is not set, flockmcp logs only error, and flockmcpd logs warn and error. Supported log levels in descending priority order are error, warn, info, debug and trace.

Where flockmcp's log goes is up to the assistant that started it.

Troubleshooting

When a tool cannot answer, it says why. The assistant reads the message, and usually shows it or acts on it. These are the messages and what to do about each.

To look at flockmcp apart from the assistant, start with list_daemons: ask the assistant which routers it can see. To look at a router apart from flockmcp, use flockc from the same host:

$ flockc -e http://192.0.2.1:50051 sys overview

The assistant does not have the tools

The assistant could not start flockmcp. Check the path it was given, and run the same command by hand: flockmcp reports a mistake in its options and exits.

$ /usr/bin/flockmcp --daemon r1=192.0.2.1:50051
error: daemon r1: endpoint "192.0.2.1:50051" must start http://

An endpoint is a URL, with http:// before the address. An IPv6 address is in square brackets: http://[2001:db8::1]:50051.

no daemon named ...

no daemon named r9: the daemons are r1, r2

The router is not one flockmcp was started with. Add a --daemon for it where the assistant is told how to start flockmcp, and restart the assistant.

daemon ... is unreachable

daemon r1 is unreachable at http://192.0.2.1:50051: ...

flockmcp could not connect to the router's flockd, or it did not answer in time.

  • Is flockd running on the router ?
  • Does flockd serve its API on that address ? By default it serves it on the router's loopback only: see Connecting to Routers.
  • Can the host reach the address and port ? Try flockc with the same endpoint.
  • A large router that is slow to answer may need a longer --request-timeout.

daemon ... is flockd ..., and this flockmcp ... only talks to a flockd of the same major.minor

daemon r1 is flockd 26.4.2, and this flockmcp 26.5.0 only talks to a flockd of the same major.minor

The router runs a flockd release this flockmcp is not built for. Install the flockmcp of the router's release: see Versions.

daemon ... is not one this server may act on

daemon r2 is not one this server may act on: it was not started with actions allowed for it

A BGP neighbor reset was asked of a router that flockmcp was not started with --allow-actions for. See Changing a Router.

this daemon does not allow action requests

daemon r1: this daemon does not allow action requests (flockd.json's system.api.allow_actions and allow_config decide what this daemon accepts)

The router itself refused a reset. flockmcp allows it for the router, and the router's own system.api.allow_actions does not. See Changing a Router.

this flockd does not provide that call

The router's flockd was built without the protocol the tool asks about, or its API differs from the one this flockmcp was built for. Check the router runs a flockd of the same release.

restarted while it was being asked

daemon r1 restarted while it was being asked; ask again

The router restarted, or its connection was lost, while a tool was asking it, and again when the tool asked a second time. Ask again once it is up. See A router that is down or restarts.

its system component has not answered yet

daemon r1: its system component has not answered yet; ask again shortly

flockd is up but still starting. Ask again in a few seconds.

has host bits set

prefix "10.1.2.3/16" has host bits set: did you mean 10.1.0.0/16?

A prefix was given with an address inside it. The assistant normally corrects this by itself. To find the route for an address, ask for the address: rib_lookup finds the longest prefix that matches.

An answer says found: false

That is an answer. The router was asked and has no such route, neighbor, interface or VRF. Check the VRF: a tool that looks one thing up looks in the main VRF, default, unless it is given another.

An assistant's answer looks wrong

Ask the assistant to show the tool call it made and the answer it got, and run the flockc command for the same question on the router. The tools pages give the flockc command each tool matches. The two hold the same values.

If they differ, or if you have any other issue, please email support@flocknetworks.com.