How ashwinjo/ixnetwork-mcp works
Project Type & Purpose
• This is an open-source Python tool implementing the MCP (Model Context Protocol) to let LLM-based clients (e.g. Claude Desktop) manage IxNetwork Web Sessions.
• It exposes a server (server.py) that speaks MCP and translates requests into IxNetwork REST API calls, using configuration files for session definitions.
File Structure Analysis (exclude docs & metadata)
• main.py – CLI entrypoint or local client harness
• server.py – ASGI-compatible MCP server (likely FastAPI + uvicorn)
• ixnetwork_config.json & ixia_configuration_files/*.ixncfg – configuration store for IxNetwork sessions
• pyproject.toml & uv.lock – Python project metadata and lock file
Key Components
A. LLM Client
• External application (e.g. Claude Desktop) that drives the conversation via MCP.
B. MCP Server
• Written in Python, spun up by server.py under uvicorn.
• Modules inside:
• SessionManager – creates/views/deletes IxNetwork sessions
• ProtocolController – starts/stops protocols/tests
• TrafficViewer – retrieves traffic item stats
C. Configuration Store
• JSON + .ixncfg files loaded at startup or on demand.
D. IxNetwork REST API
• External service endpoint exposed by IxNetwork Web Sessions.
Interactions & Data Flow
1) LLM Client → MCP Server: MCP protocol over HTTP/WebSocket (JSON-RPC style)
2) MCP Server → Config Store: file I/O (load/save session definitions)
3) MCP Server → IxNetwork REST API: HTTP calls to create/manage sessions and traffic
4) IxNetwork REST API → MCP Server → LLM Client: response payloads (status, stats)
Architectural Patterns & Design Principles
• Adapter/Bridge pattern for each integration point (MCP ↔ IxNetwork).
• Configuration-driven design: behavior changes by swapping JSON or .ixncfg.
• Separation of concerns: protocol handling, business logic (session/test control), config I/O, external API client.