{"id":"585ca0bb-69dc-4890-afbc-b8939fd69dad","slug":"pyats-agent","kind":"mcp","name":"pyATS-Agent","summary":"A Google-based AI Agent for pyATS","owner":"automateyournetwork","repoUrl":"https://github.com/automateyournetwork/pyATS-Agent","license":"GPL-3.0","licenseTier":"strong-copyleft","trust":"community","stars":3,"match":null,"fewStars":true,"format":"mcp","createdAt":"2025-12-30T13:38:03.000Z","addedAt":"2026-10-21T16:33:09.642Z","logoUrl":"https://avatars.githubusercontent.com/u/44117002?u=47cc12572e97e5a83026c4682591555eb854f540&v=4","linkOnly":false,"collection":null,"skillPath":null,"categories":["utilities"],"tags":[],"runtime":"binary","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-10-23T00:03:11.434Z","sample":false,"url":"https://conduits.dev/tools/pyats-agent","language":"Python","transports":["stdio"],"install":{},"requirements":{"env":[],"upstreamMayCharge":false},"tools":null,"readme":"# 🌐 Gemini pyATS Network Agent\n\nA standalone AI Network Assistant that leverages **Google Gemini 2.0** and the **Model Context Protocol (MCP)** to interact with network infrastructure using **Cisco pyATS**.\n\nThis agent allows you to use natural language to inspect, troubleshoot, and manage network devices via a specialized pyATS MCP server. It transforms complex network data into actionable insights through a conversational interface.\n\n---\n\n## 🚀 Getting Started\n\n### 1. Prerequisites\n* **Python 3.10+**\n* A Google AI Studio **API Key** ([Get it here](https://aistudio.google.com/))\n* A pyATS **Testbed file** (e.g., `testbed.yaml`) containing your device credentials and IP addresses.\n\n### 2. Installation\n\nClone the repository and set up a virtual environment to manage dependencies:\n\n```bash\n# Clone the repo\ngit clone [https://github.com/your-username/your-repo-name.git](https://github.com/your-username/your-repo-name.git)\ncd your-repo-name\n\n# Create and activate a virtual environment\npython3 -m venv venv\nsource venv/bin/activate  # Windows: venv\\Scripts\\activate\n\n# Install all dependencies\npip install -r requirements.txt\n```\n\n### 3. Configuration\n\nThe agent requires two main configuration points to function:\n\n1. **API Key:** Create a `.env` file in the root directory and add your Google API key:\n   ```env\n   GOOGLE_API_KEY=your_gemini_api_key_here\n   ```\n\n2. **Testbed Path:** Export the path to your pyATS testbed file in your current terminal session:\n   ```bash\n   # Linux / macOS\n   export TESTBED_PATH=\"/absolute/path/to/your/testbed.yaml\"\n\n   # Windows (PowerShell)\n   $env:TESTBED_PATH=\"C:\\path\\to\\testbed.yaml\"\n   ```\n\n### 4. Running the Agent\n\nStart the interactive session:\n\n```bash\npython agent.py\n```\n\n---\n\n## 🛠️ Architecture\n\nThe agent acts as an intelligent bridge between the LLM (Gemini) and your physical or virtual network infrastructure.\n\n\n\n### How it works:\n1. **User Query:** You ask, *\"Is OSPF running on the core-router?\"*\n2. **Gemini 2.0:** Processes the intent and identifies the correct pyATS tool to use.\n3. **MCP Client:** Sends the execution request to the local pyATS MCP Server via STDIO.\n4. **pyATS/Genie:** Connects to the device, runs the `show ip ospf` command, parses the raw text into a structured JSON object, and returns it.\n5. **Gemini 2.0:** Analyzes the structured data and provides a concise, human-friendly answer.\n\n---\n\n## 💡 Example Queries\n\nYou can interact with your network using natural language:\n\n* **Health Checks:** *\"Perform a health check on all devices and tell me if any interfaces are down.\"*\n* **Routing:** *\"Show me the routing table for leaf-01 and highlight any BGP routes.\"*\n* **Connectivity:** *\"Ping 8.8.8.8 from the border-gateway and verify internet reachability.\"*\n* **Details:** *\"What version of software is running on the distribution switches?\"*\n\n---\n\n## 🔒 Security & Best Practices\n\n* **Environment Variables:** Never commit your `.env` file or your `testbed.yaml` to GitHub. They contain sensitive API keys and network credentials.\n* **Access Control:** It is recommended to use a pyATS user with **read-only** privileges for general troubleshooting to ensure the agent cannot accidentally modify configurations.\n* **Logs:** Monitor the terminal output to see exactly which commands the agent is choosing to run on your equipment.\n\n---\n\n## 📦 Project Dependencies (requirements.txt)\n\nTo ensure the agent runs correctly, the following packages are required in your `requirements.txt` file:\n\n```text\ngoogle-genai\nmcp\npydantic\npython-dotenv\npyats[full]\nasyncio\n```\n\n---"}