MCP.so
ログイン

pyATS MCP Server

@automateyournetwork

基本情報

カテゴリ

その他

ライセンス

MIT

トランスポート

stdio

作者

automateyournetwork

pyATS MCP Server について

An MCP Server for pyATS (experimental)

pyATS MCP Server の設定

以下の設定を使って、このサーバーを MCP 対応クライアントに追加してください。

{
  "mcpServers": {
    "pyats": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "PYATS_TESTBED_PATH",
        "-v",
        "/absolute/path/to/testbed/folder:/app",
        "pyats-mcp-server"
      ],
      "env": {
        "PYATS_TESTBED_PATH": "/app/testbed.yaml"
      }
    }
  }
}

pyATS MCP Server のツール

15

List all devices in the testbed

Fuzzy-search devices by name or alias

Run a validated show command; returns parsed JSON or raw output

Run a show command across multiple devices concurrently

Execute a ping from a network device

Run a command on a Linux host

Apply configuration commands with safety guardrails

Apply configuration across multiple devices concurrently

Apply config and return a before/after diff

Roll back to the last saved configuration snapshot

Snapshot CPU, memory, interfaces, and routing state

Retrieve CDP/LLDP neighbors

Find which interface owns a given IP address

Execute a sandboxed pyATS test script

Retrieve the in-memory operation log

概要

What is pyATS MCP Server?

pyATS MCP Server wraps Cisco pyATS and Genie, letting AI agents (Claude, LangGraph, etc.) run show commands, apply configuration, and query network state over STDIO using JSON-RPC 2.0. It communicates solely via STDIN/STDOUT with no HTTP ports or REST endpoints.

How to use pyATS MCP Server?

Clone the repository, install dependencies (pip install -r requirements.txt), copy .env.example to .env, edit the environment file with device credentials and testbed path, then run python3 pyats_mcp_server.py. Alternatively, build and run via Docker, passing the .env file and mounting the testbed YAML.

Key features of pyATS MCP Server

  • Over a dozen tools for show commands, config, and diagnostics
  • Validates show commands against pipes/redirects/dangerous keywords
  • Blocks config commands containing reload, erase, delete, etc.
  • Dynamic test scripts run in a restricted sandbox
  • All credentials live in .env — never in source code or testbed file
  • Supports concurrent operations on multiple devices

Use cases of pyATS MCP Server

  • AI‑assisted network troubleshooting with parsed show commands
  • Automated configuration rollback and diff-based change management
  • Multi‑vendor health checks (CPU, memory, interfaces, routing)
  • Sandboxed execution of custom test scripts against live devices
  • Centralised ping and connectivity verification from network devices

よくある質問

1

What protocols and platforms does the server support?

It supports Cisco IOS XE, IOS XR, NX‑OS, IOS, Arista EOS, Juniper Junos, Palo Alto PAN‑OS, Linux, and Windows, set via `{DEVICENAME}_OS` in `.env`. A `generic` OS option lets Unicon autodetect on first connect.

2

Are the tools safe for production use?

Show commands are validated against dangerous pipes, redirects, and keywords. Config commands are checked for `reload`, `erase`, `write erase`, `delete`, and `format`. Dynamic tests run in a sandbox that bans `os`, `sys`, `subprocess` and other risky imports.

3

How are device credentials handled?

Credentials are never stored in the testbed YAML or source code. All device‑specific credentials (username, password, enable password) are defined in the `.env` file using a `{DEVICENAME}_{FIELD}` naming convention and referenced in the testbed via `%ENV{}` substitution.

4

What are the runtime dependencies?

The server requires Python 3 and the packages listed in `requirements.txt`. It can be run locally or inside a Docker container built from the provided `Dockerfile`.

5

How does the server communicate with clients?

All communication uses STDIN/STDOUT and JSON‑RPC 2.0. There are no HTTP ports or REST endpoints, making it suitable for MCP clients like Claude and LangGraph.

コメント

「その他」の他のコンテンツ