pyATS MCP Server logo

pyATS MCP Server

by automateyournetwork

The pyATS MCP Server enables structured, model-driven interaction with network devices over STDIO using the JSON-RPC 2.0 protocol. It wraps Cisco pyATS and Genie functionality for secure and portable network automation.

View on GitHub

Last updated: N/A

What is pyATS MCP Server?

The pyATS MCP Server is a Model Context Protocol (MCP) server that wraps Cisco pyATS and Genie, allowing interaction with network devices using JSON-RPC 2.0 over STDIO. It provides a secure and portable way to execute commands, apply configurations, and retrieve data from network devices.

How to use pyATS MCP Server?

To use the server, set the PYATS_TESTBED_PATH environment variable to point to your testbed.yaml file. Then, run the server in either continuous STDIO mode or one-shot mode using the provided commands. For Docker usage, build and run the container, mounting your testbed directory.

Key features of pyATS MCP Server

  • Connects to Cisco IOS/NX-OS devices defined in a pyATS testbed

  • Supports safe execution of validated CLI commands (show, ping)

  • Allows controlled configuration changes

  • Returns structured (parsed) or raw output

  • Exposes a set of well-defined tools via tools/discover and tools/call

  • Operates entirely via STDIO for minimal surface area and maximum portability

  • Input validation using Pydantic

  • Blocks unsafe commands

  • Prevents pipe/redirect abuse

  • Gracefully handles parsing fallbacks and errors

Use cases of pyATS MCP Server

  • Automated network device configuration

  • Network device state validation

  • Integration with LangGraph for AI-driven network automation

  • Secure and portable network automation in containerized environments

  • Remote execution of commands on network devices

FAQ from pyATS MCP Server

What is the Model Context Protocol (MCP)?

MCP is a protocol for interacting with network devices in a structured, model-driven way.

What is pyATS?

pyATS is a Python Automated Test System, a Cisco-developed framework for network testing and automation.

What is Genie?

Genie is a Python library within pyATS that provides a rich set of APIs for parsing and interacting with network device configurations and operational data.

Why use STDIO for communication?

STDIO provides a minimal surface area and maximum portability, making it ideal for secure, embedded, containerized, or LangGraph-based tool integrations.

What kind of security features are included?

The server includes input validation using Pydantic, blocks unsafe commands, prevents pipe/redirect abuse, and gracefully handles parsing fallbacks and errors.