# automateyournetwork/mcpyats architecture

> Architecture diagram of the GitHub repository automateyournetwork/mcpyats, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/automateyournetwork/mcpyats
- Repository: https://github.com/automateyournetwork/mcpyats

## Overview

- A2A Agent-to-Agent adapter
- ~20 MCP tool servers
- A LangGraph-driven AI orchestration agent (mcpyats)
- A Streamlit UI frontend
- Shared volume storage

##### Main Components
a. Frontend
- Streamlit UI (streamlit/streamlit.py) running on :8501
b. Orchestrator
- mcpyats LangGraph Agent (mcpyats/mcpyats.py) on :2024
- A2A Adapter (a2a/a2a_adapter.py) on :10000
c. Tool Servers (“mcp_servers/*”)
- chatgpt, github, slack, netbox, google_search, etc.
- Each is a standalone Docker container exposing HTTP JSON-RPC or STDIO interfaces
d. Visual Editor
e. Shared Storage
f. External Services & APIs
- LLM providers (OpenAI, Gemini)
- Cloud APIs (Google Maps, NIST, AbuseIPDB, ServiceNow, GitHub, etc.)

##### Relationships & Data Flow
- User → Streamlit UI → HTTP → LangGraph Agent
- LangGraph Agent
– Discovers local tools (tools/ folder)
– Discovers MCP servers via STDIO or HTTP
– Discovers peer agents via A2A Adapter (.well-known/agent.json)
– Binds selected tools to LLM → issues JSON-RPC calls
- Agent → Tool Servers → Tool Execution → Agent
- Agent / A2A Adapter → Peer Agents (delegate tasks)
- Agent & Tool Servers → shared_output volume (read/write artifacts)
- External APIs ← Tool Servers

##### Architectural Patterns
- Microservices: each tool is its own container
- Orchestrator + Service Bus: LangGraph as central coordinator
- Polyglot: Python (FastAPI), Node.js/TypeScript, shell scripts, Streamlit
- Tool Discovery: dynamic via STDIO or HTTP JSON-RPC
- A2A Protocol: decentralized agent collaboration

##### Technologies
- Docker / Docker Compose (containers)
- FastAPI & Uvicorn (A2A adapter)
- LangGraph (state graph engine)
- pyATS (network automation)
- Streamlit (frontend)
- HTTP JSON-RPC (tools)
- InMemoryVectorStore + LLMs

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% UI Layer
    subgraph "UI Layer"
        direction TB
        Streamlit["Streamlit UI (:8501)"]:::ui
        DrawIO["Draw.io UI (:8080)"]:::ui
        DrawMCP["Draw.io MCP Bridge (:11434)"]:::green
    end

    %% Orchestration Layer
    subgraph "Orchestration Layer"
        direction TB
        Agent["LangGraph Agent mcpyats (:2024)\n• Built-in Tools\n• InMemoryVectorStore"]:::orchestrator
        A2A["A2A Adapter (:10000)\n.well-known/agent.json"]:::orchestrator
    end

    %% Tool Layer
    subgraph "Tool Layer"
        direction TB
        subgraph "MCP Servers"
            direction TB
            ChatGPT["ChatGPT Server"]:::tool
            DrawServer["Draw.io MCP Server"]:::tool
            GitHub["GitHub Server"]:::tool
            Slack["Slack Server"]:::tool
            NetBox["NetBox Server"]:::tool
            GoogleSearch["Google Search Server"]:::tool
            NIST["NIST Server"]:::tool
            PyATS["PyATS MCP Server"]:::tool
        end
    end

    %% Storage Layer
    Shared["shared_output\n(volume)"]:::storage

    %% External Services
    subgraph "External Services"
        direction TB
        LLMs["LLM Providers\n(OpenAI, Gemini)"]:::external
        CloudAPIs["Cloud APIs\n(Google Maps, NIST, AbuseIPDB, ServiceNow, GitHub)"]:::external
    end

    %% Orchestration Script & Env
    Env[".env.example"]:::config
    Startup["docker_startup.sh\n(Build→Launch)"]:::script

    %% Peer Agents placeholder
    Peer["Peer Agents"]:::orchestrator

    %% Connections
    User(("User")):::external -->|HTTP| Streamlit
    Streamlit -->|HTTP→2024| Agent
    DrawIO <-->|WebSockets/TCP| DrawServer
    DrawServer --> Shared
    Agent -->|discovers| ChatGPT
    Agent --> GitHub
    Agent --> Slack
    Agent --> NetBox
    Agent --> GoogleSearch
    Agent --> NIST
    Agent --> PyATS
    Agent --> Shared
    ChatGPT -->|JSON-RPC| Agent
    GitHub -->|HTTP| CloudAPIs
    Slack -->|HTTP| CloudAPIs
    NetBox -->|HTTP| CloudAPIs
    GoogleSearch -->|HTTP| CloudAPIs
    NIST -->|HTTP| CloudAPIs
    PyATS -->|STDIO/JSON-RPC| Agent
    Agent -->|A2A| A2A
    A2A -->|peer discovery| Peer
    Peer -->|delegate tasks| Agent
    Agent -->|LLM calls| LLMs

    Env -->|secrets| Streamlit
    Env -->|secrets| Agent
    Env -->|secrets| A2A
    Env -->|secrets| ChatGPT
    Env -->|secrets| GitHub
    Env -->|secrets| Slack
    Env -->|secrets| NetBox
    Env -->|secrets| GoogleSearch
    Env -->|secrets| NIST
    Env -->|secrets| PyATS
    Startup -->|orchestrates| Streamlit
    Startup --> Agent
    Startup --> A2A
    Startup --> ChatGPT
    Startup --> GitHub
    Startup --> Slack
    Startup --> NetBox
    Startup --> GoogleSearch
    Startup --> NIST
    Startup --> PyATS
    Startup --> DrawIO
    Startup --> DrawServer

    %% Click Events
    click Streamlit "https://github.com/automateyournetwork/mcpyats/blob/main/streamlit/streamlit.py"
    click Streamlit "https://github.com/automateyournetwork/mcpyats/tree/main/streamlit/Dockerfile"
    click DrawIO "https://github.com/automateyournetwork/mcpyats/tree/main/drawio/Dockerfile"
    click DrawIO "https://github.com/automateyournetwork/mcpyats/blob/main/drawio/drawio-26.2.15.zip"
    click DrawIO "https://github.com/automateyournetwork/mcpyats/blob/main/drawio/mcp-bridge.js"
    click DrawIO "https://github.com/automateyournetwork/mcpyats/blob/main/drawio/CiscoDevNetCMLSandbox.drawio"
    click DrawMCP "https://github.com/automateyournetwork/mcpyats/tree/main/drawio/Dockerfile"
    click A2A "https://github.com/automateyournetwork/mcpyats/blob/main/a2a/a2a_adapter.py"
    click A2A "https://github.com/automateyournetwork/mcpyats/tree/main/a2a/Dockerfile"
    click A2A "https://github.com/automateyournetwork/mcpyats/blob/main/a2a/.well-known/agent.json"
    click Agent "https://github.com/automateyournetwork/mcpyats/blob/main/mcpyats/mcpyats.py"
    click Agent "https://github.com/automateyournetwork/mcpyats/tree/main/mcpyats/Dockerfile"
    click Agent "https://github.com/automateyournetwork/mcpyats/blob/main/mcpyats/langgraph.json"
    click Agent "https://github.com/automateyournetwork/mcpyats/blob/main/mcpyats/scripts/startup.sh"
    click ChatGPT "https://github.com/automateyournetwork/mcpyats/blob/main/mcp_servers/chatgpt/server.py"
    click ChatGPT "https://github.com/automateyournetwork/mcpyats/tree/main/mcp_servers/chatgpt/Dockerfile"
    click DrawServer "https://github.com/automateyournetwork/mcpyats/tree/main/mcp_servers/drawio_mcp/Dockerfile"
    click DrawServer "https://github.com/automateyournetwork/mcpyats/blob/main/mcp_servers/drawio_mcp/package.json"
    click DrawServer "https://github.com/automateyournetwork/mcpyats/blob/main/mcp_servers/drawio_mcp/src/index.ts"
    click GitHub "https://github.com/automateyournetwork/mcpyats/blob/main/mcp_servers/github/index.ts"
    click GitHub "https://github.com/automateyournetwork/mcpyats/tree/main/mcp_servers/github/operations"
    click GitHub "https://github.com/automateyournetwork/mcpyats/tree/main/mcp_servers/github/common"
    click GitHub "https://github.com/automateyournetwork/mcpyats/tree/main/mcp_servers/github/Dockerfile"
    click Slack "https://github.com/automateyournetwork/mcpyats/blob/main/mcp_servers/slack/index.ts"
    click Slack "https://github.com/automateyournetwork/mcpyats/tree/main/mcp_servers/slack/Dockerfile"
    click NetBox "https://github.com/automateyournetwork/mcpyats/blob/main/mcp_servers/netbox/server.py"
    click NetBox "https://github.com/automateyournetwork/mcpyats/blob/main/mcp_servers/netbox/netbox_client.py"
    click NetBox "https://github.com/automateyournetwork/mcpyats/tree/main/mcp_servers/netbox/Dockerfile"
    click GoogleSearch "https://github.com/automateyournetwork/mcpyats/blob/main/mcp_servers/google_search/src/server.ts"
    click GoogleSearch "https://github.com/automateyournetwork/mcpyats/tree/main/mcp_servers/google_search/Dockerfile"
    click NIST "https://github.com/automateyournetwork/mcpyats/blob/main/mcp_servers/nist/server.py"
    click NIST "https://github.com/automateyournetwork/mcpyats/tree/main/mcp_servers/nist/Dockerfile"
    click PyATS "https://github.com/automateyournetwork/mcpyats/blob/main/mcp_servers/pyats_mcp_server/pyats_mcp_server.py"
    click PyATS "https://github.com/automateyournetwork/mcpyats/tree/main/mcp_servers/pyats_mcp_server/Dockerfile"
    click Startup "https://github.com/automateyournetwork/mcpyats/blob/main/docker_startup.sh"
    click Env "https://github.com/automateyournetwork/mcpyats/blob/main/.env.example"

    %% Styles
    classDef ui fill:#FFDD99,stroke:#333,stroke-width:1px
    classDef orchestrator fill:#FFEE33,stroke:#333,stroke-width:1px
    classDef tool fill:#99FF99,stroke:#333,stroke-width:1px
    classDef green fill:#99FF99,stroke:#333,stroke-width:1px
    classDef storage fill:#CCCCCC,stroke:#333,stroke-width:1px
    classDef external fill:#87CEEB,stroke:#333,stroke-width:1px
    classDef script fill:#DDDDDD,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5
    classDef config fill:#EEEEEE,stroke:#333,stroke-width:1px,stroke-dasharray: 2 2
```
