Skip to main content
Glama

mcp-server-vyos

CI codecov PyPI Python License: MIT

MCP server for VyOS router management via the HTTPS REST API. Provides both router management tools and live VyOS documentation lookup.

Installation

Install with uv:

uv tool install mcp-server-vyos

Upgrade to the latest release:

uv tool upgrade mcp-server-vyos

Alternatively, skip the install and let uvx fetch the server on demand -- see Claude Code below.

Related MCP server: OPNsense MCP Server

Configuration

Set environment variables:

  • VYOS_URL — Router API endpoint (e.g., https://vyos.example.com)

  • VYOS_API_KEY — API key for authentication

  • VYOS_READ_ONLY — Set to true to disable all mutating tools (config changes, reboot, poweroff, etc.)

VyOS Router Setup

Enable the HTTPS API on your VyOS router:

configure
set service https api keys id my-mcp-key key <your-api-key>
set service https api rest
commit
save

Claude Code

Add to your MCP client configuration:

{
  "mcpServers": {
    "vyos": {
      "command": "mcp-server-vyos",
      "env": {
        "VYOS_URL": "https://vyos.example.com",
        "VYOS_API_KEY": "your-api-key"
      }
    }
  }
}

Without installing first, run it through uvx instead -- replace the command line above with:

      "command": "uvx",
      "args": ["mcp-server-vyos"],

Read-Only Mode

For safe, query-only access (monitoring, investigation, documentation lookup), enable read-only mode:

{
  "mcpServers": {
    "vyos": {
      "command": "mcp-server-vyos",
      "env": {
        "VYOS_URL": "https://vyos.example.com",
        "VYOS_API_KEY": "your-api-key",
        "VYOS_READ_ONLY": "true"
      }
    }
  }
}

This registers only non-mutating tools: vyos_info, vyos_retrieve, vyos_return_values, vyos_exists, vyos_config_diff, vyos_config_history, vyos_show, vyos_traceroute, vyos_ping, vyos_interface_stats, vyos_system_resources, vyos_route_table, vyos_firewall_stats, vyos_bgp_summary, vyos_docs_search, and vyos_docs_read.

Tools

Router Management

Tool

Description

vyos_info

System info (no auth required)

vyos_retrieve

Read configuration at a path

vyos_return_values

Get multi-valued config node values

vyos_exists

Check if a config path exists

vyos_config_diff

Show what a commit revision changed (default: most recent)

vyos_config_history

List config revision history (number, timestamp, user, method)

vyos_show

Run operational show commands

vyos_validate

Validate config syntax (temporary apply with auto-rollback)

vyos_configure

Apply config with commit-confirm (safe default)

vyos_confirm

Confirm a pending commit-confirm

vyos_save

Save running config to disk

vyos_load

Load a configuration file

vyos_merge

Merge config file or string into running config

vyos_generate

Generate keys, certificates, etc.

vyos_reset

Reset operations

vyos_reboot

Reboot the router

vyos_poweroff

Power off the router

vyos_image_add

Add a system image from URL

vyos_image_delete

Delete a system image

Diagnostics

Tool

Description

vyos_traceroute

Traceroute to a host (structured mtr report), optionally from a VRF

vyos_ping

Ping a host, optionally from a VRF (count 1-10; needs VyOS rolling 2026.08.18+)

vyos_interface_stats

Interface RX/TX counters, errors, and link state

vyos_system_resources

CPU, memory, storage, and uptime snapshot

vyos_route_table

Routing table (RIB) by family/protocol (show ip route)

vyos_firewall_stats

Firewall and NAT rule hit counters

vyos_bgp_summary

BGP neighbor summary (state, prefixes received)

Documentation

Tool

Description

vyos_docs_search

Search VyOS docs by topic and page content (returns snippets)

vyos_docs_read

Read a specific documentation page

Documentation is fetched live from the vyos-documentation repository, so it stays in sync with the latest VyOS releases. Results are cached for 1 hour.

Safety

  • Configuration changes use commit-confirm by default -- changes auto-revert after 5 minutes unless confirmed with vyos_confirm

  • vyos_configure accepts a list of operations applied atomically in one commit-confirm -- batch related changes into a single call so they commit or roll back together

  • If the router commits without arming a rollback (a VyOS version without API commit-confirm, or another commit-confirm still pending), the tool raises an error saying the changes were committed -- confirm or let a pending window expire before the next change

  • Destructive operations (vyos_reboot, vyos_poweroff, vyos_image_delete) include warning descriptions

  • API keys are never logged or included in tool outputs

  • Self-signed TLS certificates are accepted by default (common on VyOS)

Development

uv sync --extra dev
uv run pytest
uv run ruff check .

Dependencies are pinned in the committed uv.lock. Add --locked to uv sync to fail rather than re-resolve when the lock is out of date with pyproject.toml, which is how CI installs.

License

MIT

Available Tools

28 tools
vyos_bgp_summaryA

Show the BGP neighbor summary (show bgp summary).

Neighbor state, uptime, and prefixes received per peer across all
address families. Most useful on routers running BGP; if BGP is not
running, the router returns an error response ("success": false).

Inputs: no named parameters.

vyos_config_diffA

Show what a commit revision changed (not a running-config comparison).

Returns a unified diff of revision rev+1 -> rev, i.e. what that
commit changed. Defaults to the most recent commit (rev 0). Revision
numbers are the `revision` values listed by vyos_config_history.

Note: the VyOS HTTP API cannot compare the running config against
the saved config, so this tool only diffs committed revisions.

Args:
    rev: Commit revision number (omit or 0 = most recent)

Inputs: rev.

vyos_config_historyA

List configuration revision history.

Returns the numbered config revisions VyOS retains, newest first,
each with its timestamp, the user who committed it, the method
(e.g. cli, vyos-http-api), and an optional comment. Pair with
vyos_config_diff(rev) to inspect what changed in a given revision.

Note: VyOS exposes no rollback endpoint over the HTTP API, so this
server can report revision history but cannot revert to a revision.

Inputs: no named parameters. Returns: result

vyos_configureA

Apply a list of VyOS config changes atomically with commit-confirm.

Every operation in `commands` is applied in a single commit-confirm
window — the whole batch commits or rolls back together, never
partially. Prefer batching all related set/delete changes into one
call rather than making several sequential calls; this is faster and
keeps related changes atomic.

This is the safe default — changes auto-revert after 5 minutes unless
confirmed with vyos_confirm. Confirm or let a pending window expire
before calling again: a call while one is pending commits WITHOUT its
own rollback and raises. An error saying changes were COMMITTED means
they are live; do not retry blindly. A `warning` key in the result
means auto-rollback could not be verified (`service https` changes).

Args:
    commands: List of config operations, each with 'op'
        ('set'/'delete') and 'path' (list of strings). Pass as many
        as belong together. Example:
        [{"op": "set", "path": ["firewall", "group",
          "network-group", "MY_GROUP", "network", "10.0.0.0/8"]},
         {"op": "set", "path": ["firewall", "group",
          "network-group", "MY_GROUP", "network", "192.168.0.0/16"]}]

Inputs: commands (required).

vyos_confirmA

Confirm a pending commit-confirm, making changes permanent.

Inputs: no named parameters.

vyos_docs_readA

Read a VyOS documentation page.

Fetches the raw RST content from the VyOS docs repository.
Use vyos_docs_search to find the path for a topic.

Args:
    path: Doc path, e.g. "docs/configuration/firewall/groups.rst"

Inputs: path (required). Returns: result

vyos_existsA

Check if a VyOS configuration path exists.

Returns true/false in the data field.

Args:
    path: Configuration path to check,
        e.g. ["service", "https", "api"]

Inputs: path (required).

vyos_firewall_statsA

Show firewall and NAT rule hit counters.

Returns a dict keyed by 'firewall', 'nat_source', and
'nat_destination', each holding the corresponding `show` output. On
partial failure the affected key holds an error dict with
"success": false and "error" set — check "success" before using
"data"; the commands that succeeded are still returned. Most useful
on routers with complex rulesets.

Inputs: no named parameters.

vyos_generateC

Run a VyOS generate command (keys, certificates, etc.).

Args:
    path: Command path, e.g. ["pki", "wireguard", "key-pair"]

Inputs: path (required).

vyos_image_addA

Add a VyOS system image from a URL.

Downloads and installs a new system image. This does not
reboot — the new image will be used on next boot.

The call blocks until the router finishes downloading and installing,
which can take several minutes for a full ISO (it waits up to 30
minutes). On a timeout error the install may still be running: check
vyos_show(["system", "image"]) before retrying.

Args:
    url: URL to the VyOS ISO image

Inputs: url (required).

vyos_image_deleteA

Delete a VyOS system image.

WARNING: Cannot delete the currently running image.

Args:
    name: Image name, e.g. "1.4-rolling-202102280559"

Inputs: name (required).

vyos_infoA

Get VyOS system info (no authentication required).

Inputs: no named parameters.

vyos_interface_statsA

Show interface statistics: RX/TX counters, errors, link state.

With no argument, returns the summary table for all interfaces.
Pass an interface spec as path elements (e.g. ["ethernet", "eth0"])
to get detailed byte/packet/error counters for a single interface.

Args:
    interface: Optional interface path elements, e.g. ["ethernet", "eth0"]

Inputs: interface.

vyos_loadC

Load a VyOS configuration file.

Args:
    file: Path to config file on the router,
        e.g. "/config/test.config"

Inputs: file (required).

vyos_mergeA

Merge a configuration into the running config.

Provide either a file path on the router or an inline
config string (VyOS curly-brace format).

Args:
    file: Path to config file on the router
    string: Inline config in VyOS format, e.g.
        'interfaces { ethernet eth1 { description "test" } }'

Inputs: file, string.

vyos_pingA

Ping a host from the router.

Returns the API response with the ping output (per-reply RTTs and a
loss/latency summary) in its data field. If no reply arrives the
router reports failure, so the tool errors with the ping output.
Requires VyOS rolling 2026.08.18 or later; older routers lack the
/ping endpoint and this tool reports so.

Args:
    host: Destination hostname or IP, e.g. "8.8.8.8"
    count: Number of echo requests, 1-10 (default 5)
    vrf: Optional VRF to ping from

Inputs: host (required), vrf, count.

vyos_poweroffA

Power off the VyOS router immediately.

WARNING: This will shut down the router. The router will
need physical or out-of-band access to power back on.

Inputs: no named parameters.

vyos_rebootA

Reboot the VyOS router immediately.

WARNING: This will reboot the router. All active sessions
and traffic will be interrupted.

Inputs: no named parameters.

vyos_resetC

Run a VyOS reset command.

Args:
    path: Command path, e.g. ["ip", "bgp", "192.0.2.11"]

Inputs: path (required).

vyos_retrieveB

Read VyOS configuration at a given path.

Args:
    path: Configuration path as list of strings, e.g. ["firewall", "group"]

Inputs: path (required).

vyos_return_valuesA

Get values of a multi-valued VyOS config node as a list.

Use this instead of vyos_retrieve when a node has multiple
values (e.g. addresses on an interface).

Args:
    path: Configuration path, e.g.
        ["interfaces", "dummy", "dum0", "address"]

Inputs: path (required).

vyos_route_tableA

Show the routing table / RIB (show ip route / show ipv6 route).

Raises ValueError (propagated to the caller) if family or protocol is
not one of the documented values.

Args:
    family: Address family — "ip" (IPv4, default) or "ipv6".
    protocol: Optional source filter — one of bgp, ospf, ospfv3,
        static, connected, kernel, rip, isis. Omit for all routes.

Inputs: family, protocol.

vyos_saveA

Save running VyOS configuration to disk.

Inputs: no named parameters.

vyos_showB

Run a VyOS operational show command.

Args:
    path: Command path as list of strings, e.g. ["interfaces", "ethernet"]

Inputs: path (required).

vyos_system_resourcesA

Get router system resources: CPU, memory, storage, and uptime.

Returns a dict keyed by resource (cpu, memory, storage, uptime),
each holding the corresponding `show system ...` output. Handy for
a quick health snapshot of the router.

Inputs: no named parameters.

vyos_tracerouteA

Traceroute to a host from the router.

Returns the API response with an mtr report (per-hop loss and
latency) in its data field. Useful for diagnosing reachability and
path issues from the router's perspective. The host must be a valid
hostname or IP address.

Args:
    host: Destination hostname or IP, e.g. "8.8.8.8"
    vrf: Optional VRF to trace from. Needs VyOS rolling 2026-08-24 or
        later; older routers silently ignore it and use the default VRF.

Inputs: host (required), vrf.

vyos_validateA

Validate VyOS configuration syntax without persisting changes.

Applies commands with a 1-minute commit-confirm window and does NOT
confirm, so the router automatically rolls back. This is not a true
dry-run — the configuration is temporarily applied for up to 1 minute.

A successful response means the syntax is valid. An HTTP error means the
commands contain invalid syntax or paths — unless it says the changes were
COMMITTED, in which case they persist and must be reviewed.

Args:
    commands: List of config operations, each with 'op'
        ('set'/'delete') and 'path' (list of strings).
        Example: [{"op": "set", "path": ["firewall",
        "group", "network-group", "MY_GROUP"]}]

Inputs: commands (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 28 tools

    Disambiguation4/5

    Most tools have clearly distinct purposes (e.g., vyos_ping vs vyos_traceroute, vyos_retrieve vs vyos_return_values). A few pairs could be confused, such as vyos_show vs vyos_retrieve, but descriptions clarify the distinction. vyos_config_diff is clearly differentiated from a running-config comparison.

    Naming Consistency4/5

    Almost all tools use a consistent vyos_ prefix with a verb or noun pattern. Minor deviations like vyos_info, vyos_return_values, and vyos_config_history break the strict verb_noun pattern but remain readable and predictable.

    Tool Count2/5

    With 28 tools, the set is heavy for a router management server. While each tool covers a distinct operation, the volume increases cognitive load and the risk of misselection.

    Completeness4/5

    The surface covers essential config lifecycle (retrieve, validate, configure, confirm, save) and many operational commands. Minor gaps exist: no direct rollback tool (though noted as unavailable) and no explicit interface configuration tool, but agents can work around these.

    Maintenance

    ActivityActive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      A secure MCP server for managing OPNsense firewalls through AI assistants. Provides 81 tools across system, firewall, network, DNS, DHCP, VPN, HAProxy, services, diagnostics, and security domains.
      81
      395 PyPI
      21
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      A comprehensive MCP server for network device management via SSH/Telnet. Supports multiple vendors such as Cisco IOS and BDCOM, enabling AI assistants to execute commands and manage routers, switches, and firewalls.
      4
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables managing VyOS appliances through their HTTP API, providing tools for configuration, operational commands, and interactive troubleshooting.
      MIT