Enables interaction with Cisco IOS/NX-OS network devices through pyATS and Genie, providing tools for executing show commands, running ping tests, applying configurations, and retrieving device configs and logs with structured parsing capabilities.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@pyATS MCP Servershow ip interface brief on router1"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
Set your testbed path
Run the server
Continuous STDIO Mode (default)
Launches a long-running process that reads JSON-RPC requests from stdin and writes responses to stdout.
One-Shot Mode
Processes a single JSON-RPC request and exits.
๐ฆ Docker Support
Build the container
Run the container (STDIO Mode)
๐ง 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:
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
Run Show Command
๐ 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
๐ฅ MCP Server Config Example (pyATS MCP via Docker)
To run the pyATS MCP Server as a container with STDIO integration, configure your mcpServers like this:
๐งพ Explanation: command: Uses Docker to launch the containerized pyATS MCP server
args:
-i: Keeps STDIN open for communication
--rm: Automatically removes the container after execution
-e: Injects the environment variable PYATS_TESTBED_PATH
-v: Mounts your local testbed directory into the container
pyats-mcp-server: Name of the Docker image
env:
Sets the path to the testbed file inside the container (/app/testbed.yaml)
โ๏ธ 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!