home / mcp / pyats mcp server

pyATS MCP Server

Provides a model-driven MCP server that wraps Cisco pyATS and Genie for structured STDIO interactions and safe CLI actions.

Installation
Add the following to your MCP client configuration file.

Configuration

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

The pyATS MCP Server provides a model-context driven interface that wraps Cisco pyATS and Genie functionality and exposes a structured, JSON-RPC over STDIO workflow. It lets you interact with devices, run safe CLI commands, retrieve parsed or raw outputs, and apply changes in a controlled, tool-driven way, all without HTTP endpoints.

How to use

You connect to the MCP server from your client by invoking the server process and then sending JSON-RPC requests over standard input. Your client can discover the available tools, call them with validated parameters, and receive results on standard output. Use the provided tools to run safe show commands, ping tests, fetch running configurations, and apply configuration changes in a controlled manner. All inputs are validated to ensure safety and consistency.

How to install

Prerequisites you need before starting: a Python runtime and Docker, if you plan to run the containerized server.

# Docker-based (containerized server)
docker build -t pyats-mcp-server .

docker run -i --rm \
  -e PYATS_TESTBED_PATH=/app/testbed.yaml \
  -v /absolute/path/to/testbed/folder:/app \
  pyats-mcp-server

# Local (STDIO) server
export PYATS_TESTBED_PATH=/absolute/path/to/testbed.yaml
python3 pyats_mcp_server.py

If you prefer to run a one-shot request, you can pipe a single JSON-RPC command to the server in STDIO mode after starting it.

Additional sections

Configuration and usage notes for the pyATS MCP Server are shown in the examples and structure below. The server communicates strictly via STDIN/STDOUT, which makes it ideal for embedded deployments, containerized environments, or integration in toolchains that rely on non-HTTP IPC.

Project structure highlights the important entry points you interact with when running or configuring the server in your environment.

{
  "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"
      }
    }
  }
}
```

```json
{
  "servers": { 
    "pyats": {
      "type": "stdio",
      "command": "python3",
      "args": [
        "-u",
        "/Users/johncapobianco/pyATS_MCP/pyats_mcp_server.py"
      ],
      "env": {
        "PYATS_TESTBED_PATH": "/Users/johncapobianco/pyATS_MCP/testbed.yaml"
      }
    }
  }
}

Security and safety notes

You benefit from input validation via Pydantic, which ensures requests conform to expected schemas before any action is performed. Unsafe commands are blocked (for example, destructive actions like erase or reload commands are prevented). The server also guards against pipe or redirect abuse to prevent injection attempts and parsing errors. If parsing fails, it gracefully reports errors rather than crashing.

Tools and capabilities

The MCP server exposes a defined set of tools that you can discover and call. These include running safe show commands with optional parsing, performing ping tests, applying multi-line configuration commands, and fetching running configurations or logs. Each tool is designed to provide structured results or parsed outputs to support automation workflows.

Example requests you can issue

Discover the available tools to see what you can call, then execute a tool by name with the required arguments. The server validates inputs and returns structured results or parsing where available.

Available tools

run_show_command

Executes show commands safely with optional parsing

run_ping_command

Executes ping tests and returns parsed or raw results

apply_configuration

Applies safe configuration commands (multi-line supported)

learn_config

Fetches running config (show run brief)

learn_logging

Fetches system logs (show logging last 250)