EOS MCP

io.github.shigechika由 GitHub 帳號 shigechika 發布v1.4.0更新於 Oct 25, 2026

MCP server for Arista EOS device operations via eAPI

概覽

AI 產生的概覽

本機 MCP 伺服器,讓 AI 助理透過 eAPI 檢視與設定 Arista EOS 交換器,從 show 指令到受保護的設定推送。

可以做什麼
檢查伺服器健康狀態、列出已登錄裝置,並讀取裝置資訊、版本與運作時間,支援依標籤篩選與批次平行查詢。在單一或多台裝置上執行 enable 模式指令,支援平行處理。取得 running-config、檢視相對於回復檢查點的設定差異、列出 configure 工作階段。透過附帶提交計時器的 configure 工作階段推送設定,之後確認或中止待提交的工作階段。收集 tech-support 輸出,並產生多裝置每日健康簡報,涵蓋環境、errdisabled 連接埠、運作時間、MLAG 與近期 syslog 告警。
適用情境
適合讓助理協助維運一批 Arista EOS 交換器:蒐集裝置資訊與設定、跨裝置執行 show 指令,或在提交前先審閱差異再暫存設定變更。
執行需求
本機 Python 套件(Python 3.10 以上),透過 stdio 執行;Claude Code 外掛以 uvx 啟動,因此 uvx 必須在 PATH 中。需要 config.ini 存放各裝置的 eAPI 憑證,尋找順序為 EOS_MCP_CONFIG 環境變數、./config.ini、~/.config/eos-mcp/config.ini。目標裝置需啟用 eAPI,且可透過 HTTPS 連線 443 埠。
安裝前請注意
設定檔以明文保存裝置使用者名稱與密碼。指令執行類工具並不限於 show 指令,會將文字原樣傳給 eAPI Command API,因此可在單一裝置或整個裝置群上執行任意 enable 模式指令(包括 reload),且沒有 dry-run 保護。設定推送與工作階段確認/中止會改變裝置狀態;dry_run 預設為 true,但明確設定 dry_run=False 即會提交。不需要寫入時,請使用僅具 show 權限的低權限帳號。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 EOS MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

eos-mcp

English | 日本語

MCP server for Arista EOS device operations via eAPI.

Exposes EOS show commands, running-config retrieval, configuration push (via configure session with commit timer), and tech-support collection to MCP-compatible AI assistants.

Documentation: https://shigechika.github.io/eos-mcp/

Installation

bash
pip install eos-mcp

Configuration

Copy config.ini.example to ~/.config/eos-mcp/config.ini and fill in credentials:

ini
[DEFAULT]username = adminpassword = yourpasswordtransport = httpsverify = false
[switch1.example.com]tags = main,dc1
[switch2.example.com]tags = main,dc1

Config file discovery order:

  1. EOS_MCP_CONFIG environment variable
  2. ./config.ini (current directory)
  3. ~/.config/eos-mcp/config.ini

(Individual MCP tool calls may also override the path via a config_path parameter.)

Write operations

Three tools change device state through a guarded path:

ToolAPI callGated by
push_configOpens a configure session <name>, stages config_lines, then either show session-config diffs + abort (dry_run=True, the default) or commit timer HH:MM:SS (dry_run=False) — eAPI JSON-RPC Command APIThe eAPI account's own EOS privilege level: it must be able to enter configure session mode (effectively privilege 15 / enable access). dry_run=True by default means an accidental call without an explicit dry_run=False only shows a diff and aborts.
confirm_config_sessionconfigure session <name> commit — finalizes a pending commit-timer session started by push_configSame EOS account privilege requirement as push_config.
abort_config_sessionconfigure session <name> abort — discards a pending sessionSame EOS account privilege requirement as push_config.

Give the config.ini account for a device a lower-privilege, show-only role and these three tools fail against the EOS API instead of writing; every read-only tool for that device keeps working.

run_command, run_commands, run_command_batch, and run_commands_batch are not restricted to show ... commands, despite being documented and grouped as command runners. Nothing in the server validates or whitelists the command text — it is passed to the eAPI Command API verbatim — so these tools can execute arbitrary enable-mode EOS commands, including configure terminal ... or reload, on any configured device (a single host, or fleet-wide via tags in the _batch variants). This is gated by the same EOS account privilege as push_config, but without push_config's dry_run / commit-timer safety net — a de facto second write path worth remembering when deciding how privileged a device's config.ini account should be.

Usage

Claude Code (plugin)

This repository doubles as a single-plugin marketplace, so Claude Code can install the server for you:

/plugin marketplace add shigechika/eos-mcp/plugin install eos-mcp@eos-mcp

The plugin launches uvx eos-mcp and reads EOS_MCP_CONFIG, the same variable described in Configuration. Leave it unset and the server falls through to its normal discovery order (./config.ini, then ~/.config/eos-mcp/config.ini). /plugin install only wires up the server process — it cannot create the config.ini file or the per-device eAPI credentials it holds; that file must already exist on the machine running the plugin before any tool but health_check will succeed.

uvx must be on the PATH of the process that runs Claude Code — a login shell usually has it, but a GUI-launched app may not; install uv system-wide if the plugin fails to start.

Claude Code (manual)

In .mcp.json:

json
{  "mcpServers": {    "eos-mcp": {      "type": "stdio",      "command": "eos-mcp"    }  }}

Add "env": { "EOS_MCP_CONFIG": "..." } only if config.ini is not at one of the default discovery locations above.

Claude Desktop

Add the same entry to claude_desktop_config.json.

Codex

bash
codex mcp add eos-mcp -- eos-mcp

Add --env EOS_MCP_CONFIG=... (before --) only if config.ini is not at one of the default discovery locations above.

Any other MCP client that launches stdio servers works the same way: give it eos-mcp as the command.

From a shell

bash
# Verify config and list deviceseos-mcp --check
# Test connectivity to a specific hosteos-mcp --check --check-host switch1.example.com
# Start MCP server (stdio transport)eos-mcp

Tools

ToolDescription
health_checkReport server version and config status (lightweight; does NOT connect to devices)
get_router_listList registered devices (optional tag filter)
get_device_factsReturn structured facts for one device (model, serial, EOS version, uptime, memory)
get_device_facts_batchReturn device facts for multiple devices in parallel
get_versionReturn EOS version string (quick connectivity check)
run_commandRun a single enable-mode command on one device
run_commandsRun multiple enable-mode commands on one device
run_command_batchRun an enable-mode command on multiple devices in parallel
run_commands_batchRun multiple enable-mode commands on multiple devices in parallel
get_configRetrieve running-config
get_config_diffShow config diff vs rollback checkpoint
list_config_sessionsList configure sessions and their state
push_configPush config via configure session (dry_run=True by default)
confirm_config_sessionConfirm a pending commit timer session
abort_config_sessionAbort a pending session
collect_tech_supportCollect show tech-support output
daily_briefHealth check (environment, errdisabled, uptime, MLAG, recent syslog alerts) across multiple devices

Development

Live smoke test

Unit tests check logic against fixtures; they cannot tell you that a tool has stopped returning real data. scripts/smoke_test.py runs every registered tool against the configured devices and fails on empty, malformed or error answers:

bash
# uses the same inventory file as the server (EOS_MCP_CONFIG)uv run python scripts/smoke_test.pyuv run python scripts/smoke_test.py --only facts --traceback
  • Read-only. push_config, confirm_config_session and abort_config_session are skipped by name, and a test enforces that. collect_tech_support is skipped too — it changes nothing, but it is minutes of device CPU for an answer no assertion would read. The command-running tools are exercised with show version: they accept enable-mode commands in general, and a smoke test must not be the thing that types one that matters.
  • No payloads in the report. Tool names and statuses only; error text is redacted too, since every error here is prefixed with the device it came from and the payloads are configuration.
  • Nothing estate-specific in the specs. The device the per-host tools need is discovered at run time from the configured inventory, and skipped when it is empty. Two tests keep it that way: one refuses those parameters as literals, the other bans anything address-shaped anywhere in the file, because this repository is public.
  • Every probe refuses the Error (<host>): ... line these tools return in place of raising — otherwise an unreachable device would read as a successful call.
  • CI enforces the cheap half: a tool registered without a probe spec fails the build (tests/test_smoke_probes.py), so adding a tool forces the question "how would we know it works?".
  • scripts/smoke_harness.py is the engine and holds no EOS knowledge: it is kept identical across the servers that share it, so fix engine bugs once and sync the file rather than patching this copy.

Requirements

  • Python >= 3.10
  • Arista EOS with eAPI enabled (management api http-commands)
  • Network access to port 443 (HTTPS) on target devices

License

Apache-2.0

來源:README.md,提交 e7bb2a5

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

2
  1. v1.4.0最新Sep 29, 2026
  2. v1.3.0Sep 16, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。