Oxidized MCP

v0.3.0
io.github.mhajder/oxidized-mcp Checked 6 hours ago Published 3 days ago

MCP server for Oxidized network device configuration backups

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_nodes List Nodes

List nodes (network devices) managed by Oxidized. Returns each node's name, full name (group/name), IP, group, model, last run status and time, and last run details. Node vars are redacted unless redaction is disabled in the server configuration. Pass a group or model on large installations: they are filtered by Oxidized itself, so only matching nodes are transferred. The group must match exactly; use find_nodes when unsure of the name.

ParameterTypeDescription
groupOnly nodes in this group - exact, case-sensitive name as shown by list_nodes (e.g. 'core'); 'default' selects nodes without a group
limitintegerMaximum nodes to return
modelOnly nodes of this Oxidized model (e.g. 'IOS', 'JunOS', 'RouterOS'); built-in model names are case-insensitive
name_containsOnly nodes whose name, full name or IP contains this text (case-insensitive)
offsetintegerNumber of matching nodes to skip
statusOnly nodes whose last run had this status (e.g. 'success', 'no_connection', 'fail', 'never')

get_node Get Node

Get details of a single Oxidized node. Returns the node's name, full name, IP, group, model, vars and details of its last backup run (start, end, status, duration).

ParameterTypeDescription
node *stringNode name or IP address (e.g. 'core-sw01')

find_nodes Find Nodes

Find nodes by partial name, full name or IP address. Useful to resolve an ambiguous device name before calling other tools. Exact matches are listed first, then prefix matches, then other substring matches (all case-insensitive).

ParameterTypeDescription
query *stringPart of a node name, full name (group/name) or IP address
limitintegerMaximum nodes to return

get_backup_stats Get Backup Stats

Summarise backup health across Oxidized nodes. Computed from the node list (oxidized-web's own stats JSON is not usable): counts per last-run status, per group and per model, the success rate, and lists of failed nodes, nodes never backed up and stale nodes. Optionally limited to one group or model, filtered by Oxidized itself. "Stale" means Oxidized has not *attempted* a backup within the threshold (e.g. it is not polling the node); nodes that are attempted but keep failing are listed under failed_nodes instead. Oxidized does not expose the time of the last *successful* backup, and its run…

ParameterTypeDescription
groupOnly include nodes in this group (exact, case-sensitive name)
max_listedintegerMaximum nodes listed in each of the failed/never/stale lists
modelOnly include nodes of this Oxidized model (e.g. 'IOS')
stale_hoursintegerReport nodes whose last backup attempt (successful or not) is older than this many hours

get_node_config Get Node Config

Get the latest backed-up configuration of a node. Large configurations are paged by lines: when 'truncated' is true, call again with offset set to 'next_offset' to read the rest.

ParameterTypeDescription
node *stringNode name or IP address (e.g. 'core-sw01')
groupNode group, to disambiguate nodes with the same name in different groups
max_linesintegerMaximum lines to return (0 = whole configuration)
offsetintegerZero-based first line to return

search_configs Search Configs

Search the latest configurations of all nodes for a pattern. oxidized-web first finds the nodes whose configuration matches, then those configurations are fetched to return the matching lines with line numbers. Use this to answer questions such as "which devices still have telnet enabled" or "where is VLAN 42 configured". The pattern must be valid in both Ruby (oxidized-web) and Python regular expressions - stick to common syntax. Lines are matched one at a time, so patterns spanning several lines find nodes but no lines.

ParameterTypeDescription
pattern *stringRegular expression (or literal text with literal=true) to search for, e.g. 'snmp-server community'
case_sensitivebooleanMatch case-sensitively
context_linesintegerLines of context to include before and after each match
groupOnly search nodes in this group - exact, case-sensitive name as shown by list_nodes; 'default' selects nodes without a group
literalbooleanTreat the pattern as literal text
max_matchesintegerMaximum matching lines to return in total
max_nodesintegerMaximum matching nodes whose configurations are searched (nodes without a stored configuration are skipped and not counted)

list_node_versions List Node Versions

List the stored configuration versions of a node, newest first. Each version has its git oid, date, author and commit message. Requires the Oxidized 'git' (or 'gitcrypt') output.

ParameterTypeDescription
node *stringNode name or IP address (e.g. 'core-sw01')
groupNode group; looked up automatically when omitted
limitintegerMaximum versions to return

get_node_version Get Node Version

Get the configuration of a node as it was at a specific version. Large configurations are paged by lines: when 'truncated' is true, call again with offset set to 'next_offset' to read the rest.

ParameterTypeDescription
node *stringNode name or IP address (e.g. 'core-sw01')
oid *stringVersion oid from list_node_versions (full or unique prefix)
groupNode group; looked up automatically when omitted
max_linesintegerMaximum lines to return (0 = whole configuration)
offsetintegerZero-based first line to return

diff_node_versions Diff Node Versions

Show what changed in a node's configuration between two versions. Returns a unified diff from 'base_oid' (older) to 'oid' (newer). With no arguments besides the node it shows the most recent change.

ParameterTypeDescription
node *stringNode name or IP address (e.g. 'core-sw01')
base_oidOlder version oid to compare against; defaults to the version before 'oid'
context_linesintegerUnchanged lines of context around each change
groupNode group; looked up automatically when omitted
max_linesintegerMaximum diff lines to return (0 = whole diff)
offsetintegerZero-based first diff line to return
oidNewer version oid (full or prefix); defaults to the latest version

trigger_node_backup Trigger Node Backup

Queue an immediate configuration backup of a node. Oxidized moves the node to the head of its queue; the backup itself runs asynchronously. Check get_node afterwards for the run result, and list_node_versions for a new version if the configuration changed. Oxidized picks the node by name or IP only (no group), so node names must be unique - otherwise the first node with that name is queued.

ParameterTypeDescription
node *stringNode name or IP address (e.g. 'core-sw01')
messageCommit message recorded if this backup produces a new version
userAuthor name recorded if this backup produces a new version

reload_nodes Reload Nodes

Reload the Oxidized node list from its source (router.db, SQL, HTTP, ...). Use after devices were added, removed or changed in the source so Oxidized picks up the change without waiting for its next refresh. Always reloads every node: oxidized-web's per-node reload (/reload?node=X) replaces the whole in-memory node list with just the matching nodes, so it is deliberately not offered.