pyATS MCP Server

pyATS MCP Server

An MCP Server for pyATS (experimental)

automateyournetwork

Developer Tools
Visit Server

README

pyATS MCP Server

This project implements a Model Context Protocol (MCP) Server that wraps Cisco pyATS and Genie functionality. It enables structured, model-driven interaction with network devices over STDIO using the JSON-RPC 2.0 protocol.

🚨 This server does not use HTTP or SSE. All communication is done via STDIN/STDOUT (standard input/output), making it ideal for secure, embedded, containerized, or LangGraph-based tool integrations.

🔧 What It Does

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

🚀 Usage

  1. Set your testbed path

export PYATS_TESTBED_PATH=/absolute/path/to/testbed.yaml

  1. Run the server

Continuous STDIO Mode (default)


python3 pyats_mcp_server.py

Launches a long-running process that reads JSON-RPC requests from stdin and writes responses to stdout.

One-Shot Mode


echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/discover"}' | python3 pyats_mcp_server.py --oneshot

Processes a single JSON-RPC request and exits.

📦 Docker Support

Build the container


docker build -t pyats-mcp-server .

Run the container (STDIO Mode)

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

🧠 Available MCP Tools

Tool Description

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)

All inputs are validated using Pydantic schemas for safety and consistency.

🤖 LangGraph Integration

Add the MCP server as a tool node in your LangGraph pipeline like so:


("pyats-mcp", ["python3", "pyats_mcp_server.py", "--oneshot"], "tools/discover", "tools/call")

Name: pyats-mcp

Command: python3 pyats_mcp_server.py --oneshot

Discover Method: tools/discover

Call Method: tools/call

STDIO-based communication ensures tight integration with LangGraph’s tool invocation model without opening HTTP ports or exposing REST endpoints.

📜 Example Requests

Discover Tools


{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/discover"
}

Run Show Command


{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "run_show_command",
    "arguments": {
      "device_name": "router1",
      "command": "show ip interface brief"
    }
  }
}

🔒 Security Features

Input validation using Pydantic

Blocks unsafe commands like erase, reload, write

Prevents pipe/redirect abuse (e.g., | include, >, copy, etc.)

Gracefully handles parsing fallbacks and errors

📁 Project Structure


.
├── pyats_mcp_server.py     # MCP server with JSON-RPC and pyATS integration
├── Dockerfile              # Docker container definition
├── testbed.yaml            # pyATS testbed (user-provided)
└── README.md               # This file

✍️ Author

John Capobianco

Product Marketing Evangelist, Selector AI

Author, Automate Your Network

Let me know if you’d like to add:

A sample LangGraph graph config

Companion client script

CI/CD integration (e.g., GitHub Actions)

Happy to help!

The testbed.yaml file works with the Cisco DevNet Cisco Modeling Labs (CML) Sandbox!

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
MCP Package Docs Server

MCP Package Docs Server

Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.

Featured
Local
TypeScript
Claude Code MCP

Claude Code MCP

An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.

Featured
Local
JavaScript
@kazuph/mcp-taskmanager

@kazuph/mcp-taskmanager

Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.

Featured
Local
JavaScript
Linear MCP Server

Linear MCP Server

Enables interaction with Linear's API for managing issues, teams, and projects programmatically through the Model Context Protocol.

Featured
JavaScript
mermaid-mcp-server

mermaid-mcp-server

A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.

Featured
JavaScript
Jira-Context-MCP

Jira-Context-MCP

MCP server to provide Jira Tickets information to AI coding agents like Cursor

Featured
TypeScript
Linear MCP Server

Linear MCP Server

A Model Context Protocol server that integrates with Linear's issue tracking system, allowing LLMs to create, update, search, and comment on Linear issues through natural language interactions.

Featured
JavaScript
Sequential Thinking MCP Server

Sequential Thinking MCP Server

This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.

Featured
Python