# dineshbaburam91/junos-slax-mcp-server architecture

> Architecture diagram of the GitHub repository dineshbaburam91/junos-slax-mcp-server, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dineshbaburam91/junos-slax-mcp-server
- Repository: https://github.com/dineshbaburam91/junos-slax-mcp-server

## Overview

This repository is an MCP assistant for Junos XML RPC and SLAX automation. A user asks an MCP client for reference-backed answers or a SLAX script; the server searches its reference catalog, builds a type-specific scaffold, and can save it. For optional device work, it validates and deploys scripts through the separate junos-mcp-server backend. The README documents these capabilities; sampled source confirms the main server, reference store, templates, and backend client. Unsampled tool implementations are represented at the server-module level.

Main entry points: [`server.py`](https://github.com/dineshbaburam91/junos-slax-mcp-server/blob/main/server.py) (MCP Tools), [`docs.py`](https://github.com/dineshbaburam91/junos-slax-mcp-server/blob/main/docs.py) (Reference Catalog), [`main.py`](https://github.com/dineshbaburam91/junos-slax-mcp-server/blob/main/main.py) (Server Entry), [`jmcp_client.py`](https://github.com/dineshbaburam91/junos-slax-mcp-server/blob/main/jmcp_client.py) (JMCP Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["MCP Interface"]
  node_main["Server Entry<br/>[main.py]"]
  node_mcp["MCP Tools<br/>[server.py]"]
end

subgraph group_knowledge["Reference Knowledge"]
  node_knowledge_tools["Reference Tools<br/>[server.py]"]
  node_reference_store["Reference Catalog<br/>[docs.py]"]
  node_source_cache[("Source Cache<br/>[docs.py]")]
end

subgraph group_authoring["Script Authoring"]
  node_script_generator["Scaffold Generator<br/>[server.py]"]
  node_script_templates["Type Templates<br/>[templates.py]"]
  node_script_saver["Script Saver<br/>[server.py]"]
  node_saved_scripts[("Generated Scripts")]
end

subgraph group_device["Device Operations"]
  node_device_tools["Device Tools<br/>[server.py]"]
  node_jmcp_client["JMCP Client<br/>[jmcp_client.py]"]
end

node_user(("AI Client"))
node_reference_sources["Reference Sources"]
node_jmcp_backend["JMCP Backend"]
node_junos_device["Junos Device"]

node_user -->|"requests tools"| node_main
node_main -->|"starts"| node_mcp
node_mcp -->|"exposes"| node_knowledge_tools
node_knowledge_tools -->|"searches and reads"| node_reference_store
node_reference_store -->|"loads and indexes"| node_reference_sources
node_reference_store -->|"caches sources"| node_source_cache
node_mcp -->|"exposes generation"| node_script_generator
node_script_generator -->|"retrieves passages"| node_reference_store
node_script_generator -->|"builds scaffold"| node_script_templates
node_script_generator -->|"saves scaffold"| node_script_saver
node_script_saver -->|"writes scripts"| node_saved_scripts
node_mcp -->|"exposes saving"| node_script_saver
node_mcp -->|"exposes device tools"| node_device_tools
node_device_tools -->|"calls backend"| node_jmcp_client
node_jmcp_client -->|"calls tools over stdio"| node_jmcp_backend
node_jmcp_backend -->|"validates and deploys"| node_junos_device

click node_main "https://github.com/dineshbaburam91/junos-slax-mcp-server/blob/main/main.py"
click node_mcp "https://github.com/dineshbaburam91/junos-slax-mcp-server/blob/main/server.py"
click node_knowledge_tools "https://github.com/dineshbaburam91/junos-slax-mcp-server/blob/main/server.py"
click node_reference_store "https://github.com/dineshbaburam91/junos-slax-mcp-server/blob/main/docs.py"
click node_source_cache "https://github.com/dineshbaburam91/junos-slax-mcp-server/blob/main/docs.py"
click node_script_generator "https://github.com/dineshbaburam91/junos-slax-mcp-server/blob/main/server.py"
click node_script_templates "https://github.com/dineshbaburam91/junos-slax-mcp-server/blob/main/templates.py"
click node_script_saver "https://github.com/dineshbaburam91/junos-slax-mcp-server/blob/main/server.py"
click node_device_tools "https://github.com/dineshbaburam91/junos-slax-mcp-server/blob/main/server.py"
click node_jmcp_client "https://github.com/dineshbaburam91/junos-slax-mcp-server/blob/main/jmcp_client.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_mcp,node_user toneBlue
class node_knowledge_tools,node_reference_store,node_source_cache toneAmber
class node_script_generator,node_script_templates,node_script_saver,node_saved_scripts toneMint
class node_device_tools,node_jmcp_client toneRose
class node_reference_sources,node_jmcp_backend,node_junos_device toneIndigo
```

## Components

### MCP Interface

- [Server Entry](https://github.com/dineshbaburam91/junos-slax-mcp-server/blob/main/main.py): `main.py`
- [MCP Tools](https://github.com/dineshbaburam91/junos-slax-mcp-server/blob/main/server.py): `server.py`

### Reference Knowledge

- [Reference Tools](https://github.com/dineshbaburam91/junos-slax-mcp-server/blob/main/server.py): `server.py`
- [Reference Catalog](https://github.com/dineshbaburam91/junos-slax-mcp-server/blob/main/docs.py): `docs.py`
- [Source Cache](https://github.com/dineshbaburam91/junos-slax-mcp-server/blob/main/docs.py): `docs.py`

### Script Authoring

- [Scaffold Generator](https://github.com/dineshbaburam91/junos-slax-mcp-server/blob/main/server.py): `server.py`
- [Type Templates](https://github.com/dineshbaburam91/junos-slax-mcp-server/blob/main/templates.py): `templates.py`
- [Script Saver](https://github.com/dineshbaburam91/junos-slax-mcp-server/blob/main/server.py): `server.py`
- **Generated Scripts**

### Device Operations

- [Device Tools](https://github.com/dineshbaburam91/junos-slax-mcp-server/blob/main/server.py): `server.py`
- [JMCP Client](https://github.com/dineshbaburam91/junos-slax-mcp-server/blob/main/jmcp_client.py): `jmcp_client.py`

### Other components

- **AI Client**
- **Reference Sources**
- **JMCP Backend**
- **Junos Device**

## Connections

- AI Client → Server Entry: requests tools (evidence: `README.md`)
- Server Entry → MCP Tools: starts (evidence: `main.py`)
- MCP Tools → Reference Tools: exposes (evidence: `README.md`)
- Reference Tools → Reference Catalog: searches and reads (evidence: `server.py`)
- Reference Catalog → Reference Sources: loads and indexes (evidence: `README.md`)
- Reference Catalog → Source Cache: caches sources (evidence: `docs.py`)
- MCP Tools → Scaffold Generator: exposes generation (evidence: `README.md`)
- Scaffold Generator → Reference Catalog: retrieves passages (evidence: `server.py`)
- Scaffold Generator → Type Templates: builds scaffold (evidence: `README.md`)
- Scaffold Generator → Script Saver: saves scaffold (evidence: `server.py`)
- Script Saver → Generated Scripts: writes scripts (evidence: `server.py`)
- MCP Tools → Script Saver: exposes saving (evidence: `README.md`)
- MCP Tools → Device Tools: exposes device tools (evidence: `README.md`)
- Device Tools → JMCP Client: calls backend (evidence: `server.py`)
- JMCP Client → JMCP Backend: calls tools over stdio (evidence: `jmcp_client.py`)
- JMCP Backend → Junos Device: validates and deploys (evidence: `README.md`)
