netmiko-mcp-linksys
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| SWITCH_HOST | Yes | Switch IP or hostname. | |
| SWITCH_USER | Yes | SSH username. | |
| SWITCH_PASSWORD | Yes | SSH password. Never logged or returned. | |
| SWITCH_AUDIT_LOG | No | If set, append one JSON line per tool call. The file is created with mode 0600. Passwords are redacted from parameters and results. | |
| SWITCH_DEVICE_TYPE | No | netmiko device type. Default: cisco_s300. | cisco_s300 |
| SWITCH_KNOWN_HOSTS | Yes | Path to an OpenSSH known_hosts file with the switch host key. System host keys are not used. | |
| SWITCH_PROTECTED_PORTS | No | Comma-separated ports (e.g. 0/24,0/25) that may not be shut down or have PoE disabled. Required before any disable / PoE-off; if unset, empty, or invalid, disable and PoE-off fail closed. | |
| NETMIKO_MCP_COMMAND_FILE | Yes | Path to a commands.yml allow/deny list. Required for show and port_overview. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
MCP server for a single Linksys LGS-series switch, based on netmiko and netmiko-mcp. Use show for allow-listed read commands and the parsed read tools (health_summary, port_status, port_counters, counters_delta, mac_table, lldp_neighbors, poe_status, config_read, config_backup, config_diff, audit_tail, show_help) for JSON. Configuration tools build fixed CLI sequences; they do not accept free-form config. Every write tool defaults to dry_run=true and only shows the commands, the current and the expected state; pass dry_run=false to apply. Real writes store a masked config snapshot first and return a before/after diff. Protected ports are refused, caution ports need confirm_caution_port=true. There are no VLAN, reboot, or reset tools. SNMP write tools are narrow and gated by hub unlock, like save_config. Secrets are redacted as [REDACTED] or [REDACTED-LINE]. Changes are not saved until save_config is called with dry_run=false. The startup-config cannot be read on this device. SWITCH_PROTECTED_PORTS is unset or invalid: port writes that check it are refused on every port (fail-closed). Caution ports (SWITCH_CAUTION_PORTS): none.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| showA | Run an allow-listed show command on the switch (no TextFSM parsing). |
| port_overviewA | Read a bundle of allow-listed status commands in a single session. Read-only: runs only the hardcoded show commands through the same netmiko-mcp command filter as the show tool. Never sends config. |
| port_set_descriptionA | Set an interface description, or clear it when text is omitted. Refused on protected ports (SWITCH_PROTECTED_PORTS; unset or invalid list refuses every port); caution ports (SWITCH_CAUTION_PORTS) need confirm_caution_port=true. dry_run=true (default) only shows the commands and current state. Does not save. SWITCH_PROTECTED_PORTS is unset or invalid: port writes that check it are refused on every port (fail-closed). Caution ports (SWITCH_CAUTION_PORTS): none. |
| snmp_view_createA | Add one allow-listed included subtree to an SNMP read view. Does not save. Gate this in the hub with unlock. subtree must be an OID or alias from the fixed allowlist (interfaces / ifmib / power-ethernet). Refused for any view used as a write view, holding a writable column or an excluded entry; build write views with snmp_write_view_create. The CLI syntax is not live-confirmed; see the README. |
| snmp_write_view_createA | Add one writable column to an SNMP write view. Does not save. Gate this in the hub with unlock. subtree must be ifAdminStatus
(1.3.6.1.2.1.2.2.1.7), ifAlias (1.3.6.1.2.1.31.1.1.1.18) or
pethPsePortAdminEnable (1.3.6.1.2.1.105.1.1.1.3, PoE on/off); whole
MIB subtrees are never allowed in a write view. There are no per-port
exclusions: anyone with a community bound to this view can write
these columns for every port, including SWITCH_PROTECTED_PORTS. The
command is sent with a "%" error check and verified in show snmp
viewtree; on any failure the column is removed again
( |
| snmp_community_createA | Create a v2c community from SWITCH_SNMP_COMMUNITY, bound to views. view_name is the read view. access is 'ro' or 'rw'; 'rw' requires a separate write_view built with snmp_write_view_create (only the writable columns, no per-port exclusions). The secret is never a tool argument and is redacted as [REDACTED] in all output. Does not save. Gate with hub unlock. The CLI syntax is not live-confirmed; see the README. |
| snmp_community_removeA | Remove an allow-listed default community (public or private). Refuses unless the configured SWITCH_SNMP_COMMUNITY community is present and mapped to a restricted allow-listed view. Never removes the configured community itself. Does not save. Gate with hub unlock. |
| snmp_user_removeA | Remove an allow-listed SNMP user (noAuthUser). Does not save. Gate this in the hub with unlock. The CLI syntax is not live-confirmed. |
| save_configA | Copy running-config to startup-config (privileged exec 'save'). The LGS CLI cannot show the startup-config. dry_run=true (default): masked diff from the running-config stored at the last save through this server to the current running-config, plus the Config Save Status; nothing is saved. dry_run=false: stores the masked running-config that is saved (SWITCH_BACKUP_DIR, tag pre-save; required unless SWITCH_PRE_WRITE_SNAPSHOT=best-effort/off), saves, returns the diff to the previous save copy and the Config Save Status. The running-config copy uses the same background dump as config_read: a slow dump answers Pending first; the next call saves. Gate with hub unlock. |
| health_summaryA | Daily health view in one session, as JSON: uptime, config save status, PoE budget/consumption, ports up/down with speed/duplex, only ports with error/discard counters > 0, the last log entries, and temperature, fan and CPU/memory load (show device temperature, show system fan status, show system utilization) when the allowlist has them. |
| port_statusB | Per port as JSON: link, speed, duplex, description, VLANs, PoE (W/class/status) and LLDP neighbor. One session, read-only. |
| port_countersC | Interface counters as JSON for all ports or one port. |
| counters_deltaA | Difference of the interface counters since the last counters_delta call (state kept in SWITCH_STATE_DIR). The first call stores the baseline. Detects new errors without clear counters. |
| mac_tableB | MAC address table as JSON (show mac-address-table and its count), optionally filtered by port or MAC address. |
| lldp_neighborsB | LLDP neighbors as JSON (local port, device id, port id, capability). |
| poe_statusB | PoE as JSON: budget, consumption and per-port admin/status/W/class. |
| config_readA | Return the masked running-config ('show current running-config'; secrets replaced by [REDACTED] / [REDACTED-LINE]). source='startup' answers 'Not available': the LGS CLI cannot show the startup-config. The show tool keeps both denied. The dump runs in the background: if it takes longer than one call, the answer is 'Pending' and the next call returns it (with read_at and age_seconds). |
| config_backupA | Store the masked running-config under SWITCH_BACKUP_DIR as YYYY-MM-DD_HHMM_running[_tag].cfg; returns path, SHA256 and the diff to the previous running backup. source='startup' is not available on this device. Like config_read, a slow dump answers 'Pending' first. |
| config_diffA | Unsaved changes, as far as this device allows: the startup-config cannot be read, so the masked running-config is diffed against the copy save_config stored at the last save through this server (tag pre-save in SWITCH_BACKUP_DIR). Also returns the Config Save Status from show system information. Saves done outside this server are not seen. |
| audit_tailA | Last n (1..500) audit log entries (JSON lines), redacted again on read. A call that has a start record but no result (hub timeout, restart) is listed with result 'unfinished' and age_ms since its start; finished calls carry duration_ms. |
| show_helpA | List CLI completions for 'show ?' (to find undocumented show commands). The line is typed, '?' lists options, then Ctrl-U clears the line: nothing is executed. Only show prefixes ([a-z0-9-] words). |
| port_enableB | Enable a switch port (no shutdown). Allowed on protected ports. dry_run=true (default) only shows commands and current state. Does not save. SWITCH_PROTECTED_PORTS is unset or invalid: port writes that check it are refused on every port (fail-closed). Caution ports (SWITCH_CAUTION_PORTS): none. |
| port_disableA | Disable a switch port (shutdown). Protected ports are refused (fail-closed). dry_run=true (default) only shows commands and current state. Does not save. SWITCH_PROTECTED_PORTS is unset or invalid: port writes that check it are refused on every port (fail-closed). Caution ports (SWITCH_CAUTION_PORTS): none. |
| poe_enableA | Enable PoE on a copper port (0/1..0/24). Allowed on protected ports. dry_run=true (default) only shows commands and current state. Does not save. SWITCH_PROTECTED_PORTS is unset or invalid: port writes that check it are refused on every port (fail-closed). Caution ports (SWITCH_CAUTION_PORTS): none. |
| poe_disableA | Disable PoE on a copper port. Protected ports are refused (fail-closed). dry_run=true (default) only shows commands and current state. Does not save. SWITCH_PROTECTED_PORTS is unset or invalid: port writes that check it are refused on every port (fail-closed). Caution ports (SWITCH_CAUTION_PORTS): none. |
| poe_cycleA | Power-cycle the device on a PoE port: PoE off, wait off_seconds (2..60), PoE on. PoE is switched on again even if the wait or the session fails (finally, then one retry in a new session). Protected ports are refused hard. dry_run=true by default. Does not save. SWITCH_PROTECTED_PORTS is unset or invalid: port writes that check it are refused on every port (fail-closed). Caution ports (SWITCH_CAUTION_PORTS): none. |
| port_security_setA | Set port security (max learned MACs 1..256) or turn it off (limit omitted). Protected ports are refused. dry_run=true by default. Does not save. SWITCH_PROTECTED_PORTS is unset or invalid: port writes that check it are refused on every port (fail-closed). Caution ports (SWITCH_CAUTION_PORTS): none. |
| storm_control_setA | Set storm control (broadcast | unknown-multicast | dlf) in packets per second, or remove it (level_pps omitted). Read-back from running-config. Protected ports are refused. dry_run=true by default. Does not save. SWITCH_PROTECTED_PORTS is unset or invalid: port writes that check it are refused on every port (fail-closed). Caution ports (SWITCH_CAUTION_PORTS): none. |
| rate_limit_setB | Set an input or output rate limit in kbps (1..80000000), or remove it (kbps omitted). Protected ports are refused. dry_run=true by default. SWITCH_PROTECTED_PORTS is unset or invalid: port writes that check it are refused on every port (fail-closed). Caution ports (SWITCH_CAUTION_PORTS): none. |
| cable_diagA | Run the cable diagnostic (TDR) on one port. Active test: it can drop the link for a few seconds. Protected ports are refused. The command stays denied for the show tool and only runs here. dry_run=true by default. SWITCH_PROTECTED_PORTS is unset or invalid: port writes that check it are refused on every port (fail-closed). Caution ports (SWITCH_CAUTION_PORTS): none. |
| syslog_setA | Add (enabled=true) or remove (enabled=false) a syslog server. The target must be listed in SWITCH_SYSLOG_ALLOWED. Severity uses the ISS keywords (emergencies, alerts, critical, errors, warnings, notification, informational, debugging). dry_run=true by default. Does not save. |
| mgmt_services_setA | Harden management services: HTTP on/off, HTTPS on/off, Telnet off. SSH cannot be changed and Telnet cannot be enabled. HTTP is only disabled after HTTPS was read back as Enabled (in the same session, after an HTTPS enable from this call). dry_run=true by default. Does not save. |
| clear_countersA | Reset interface counters for one port or all ports (port omitted). Protected ports are refused when named. Also resets the counters_delta baseline. dry_run=true by default. SWITCH_PROTECTED_PORTS is unset or invalid: port writes that check it are refused on every port (fail-closed). Caution ports (SWITCH_CAUTION_PORTS): none. |
| system_identity_setA | Set system location, contact and/or switch name. Values: [A-Za-z0-9 ._-] (name without spaces, it becomes the CLI prompt). dry_run=true by default. Does not save. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 34 tools
Most tools have a clearly distinct resource+action pairing (port_enable/port_disable, poe_enable/poe_disable/poe_cycle, snmp_view_create vs snmp_write_view_create, config_read/config_backup/config_diff). The main soft spot is the read-only bundle family: port_overview, port_status, health_summary, port_counters and show all return status data and an agent must read descriptions closely to pick the right one. Descriptions do differentiate them well enough (bundle vs per-port JSON vs daily health vs raw allow-listed show), so overlap is manageable.
Nearly everything is snake_case with an area_action or action_noun shape (port_status, poe_cycle, storm_control_set, snmp_community_create, config_read). A few deviate in verb position (save_config vs config_read, port_set_description) but the vocabulary stays predictable and greppable. No camelCase or mixed-case chaos.
34 tools is above the comfortable band and reflects very granular decomposition (separate enable/disable pairs for ports and PoE, plus distinct set-tools per feature). The domain is genuinely broad (read monitoring, port/PoE writes, SNMP, config lifecycle, security hardening), so each tool roughly earns its place. Still, the surface feels heavy and could be consolidated (e.g. status bundles, generic port-setting tools).
Read/monitoring and the config lifecycle are thoroughly covered (config_read, config_backup, config_diff, save_config, counters_delta, health_summary). There are notable asymmetries and gaps: snmp_user_remove exists with no snmp_user_create, snmp_view_create has no view-remove counterpart, and there is no VLAN configuration, speed/duplex set, NTP, or reboot/reset tool. Agents can partly work around via the raw 'show' tool but not for writes.