# anshlambagit/mcp_masterclass architecture

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

- Interactive diagram: https://gitdiagram.com/anshlambagit/mcp_masterclass
- Repository: https://github.com/anshlambagit/mcp_masterclass

## Overview

This repository is a hands-on MCP masterclass, progressing from local servers and clients through HTTP, third-party integrations, a packaged tool server, and gateways. Its main workflow is a client discovering or invoking tools exposed by an MCP server; gateway examples aggregate tools from external servers and expose them over HTTP. The PyPI package implements terminal and file tools. The Docker chapter repeats the gateway pattern for container deployment. Some chapter capabilities are README-documented but their source was not sampled, so those links are cited to the README or left unverified.

Main entry points: [`CH-6_MCP_Docker/app/gateway.py`](https://github.com/anshlambagit/mcp_masterclass/blob/main/CH-6_MCP_Docker/app/gateway.py) (Container Gateway), [`CH-2_HTTP_MCP/2_langchain_client.py`](https://github.com/anshlambagit/mcp_masterclass/blob/main/CH-2_HTTP_MCP/2_langchain_client.py) (Multi-Transport Client), [`CH-5_MCP_Gateway/gateway.py`](https://github.com/anshlambagit/mcp_masterclass/blob/main/CH-5_MCP_Gateway/gateway.py) (MCP Gateway), [`CH-1_CreateMCP/1_first_mcpserver_stdio.py`](https://github.com/anshlambagit/mcp_masterclass/blob/main/CH-1_CreateMCP/1_first_mcpserver_stdio.py) (Stdio Server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_foundations["MCP Foundations"]
  node_stdio_server["Stdio Server"]
  node_python_client["Python Client<br/>[2_python_client.py]"]
  node_langchain_client["LangChain Client"]
  node_http_server["HTTP Server<br/>[1_http_mcp.py]"]
  node_multi_transport_client["Multi-Transport Client"]
end

subgraph group_integrations["Tool Integrations"]
  node_community_client["Community MCP Client<br/>[community_mcp.py]"]
  node_community_server["DuckDuckGo MCP"]
  node_tavily_integration["Tavily Search<br/>[tavily_mcp.py]"]
end

subgraph group_package["Packaged Tools"]
  node_package_test["Package Test Runner<br/>[1_test_package.py]"]
  node_package_client["Package Client<br/>[2_client.py]"]
  node_terminal_tools["Terminal Tools<br/>[tools.py]"]
  node_package_entry["Stdio Entry Point<br/>[main.py]"]
end

subgraph group_deployment["Gateway Deployment"]
  node_gateway["MCP Gateway<br/>[gateway.py]"]
  node_docker_gateway["Container Gateway<br/>[gateway.py]"]
  node_duck_gateway_server["DuckDuckGo Server"]
  node_terminal_server["Agentic Terminal Server"]
  node_container_runtime["Container Runtime"]
end

node_learner(("Developer"))

node_learner -->|"runs"| node_python_client
node_learner -->|"runs"| node_langchain_client
node_learner -->|"runs"| node_multi_transport_client
node_learner -->|"runs"| node_community_client
node_python_client -->|"calls tools"| node_stdio_server
node_langchain_client -->|"discovers tools"| node_stdio_server
node_multi_transport_client -->|"configures stdio"| node_stdio_server
node_multi_transport_client -->|"connects HTTP"| node_http_server
node_community_client -->|"invokes tools"| node_community_server
node_learner -->|"learns integration"| node_tavily_integration
node_package_test -->|"runs server"| node_terminal_tools
node_package_entry -->|"starts tools"| node_terminal_tools
node_package_client -.->|"connects package"| node_terminal_tools
node_learner -->|"runs gateway"| node_gateway
node_gateway -->|"proxies tools"| node_duck_gateway_server
node_gateway -->|"proxies tools"| node_terminal_server
node_learner -->|"deploys gateway"| node_docker_gateway
node_docker_gateway -->|"proxies tools"| node_duck_gateway_server
node_docker_gateway -->|"proxies tools"| node_terminal_server
node_container_runtime -.->|"hosts"| node_docker_gateway

click node_stdio_server "https://github.com/anshlambagit/mcp_masterclass/blob/main/CH-1_CreateMCP/1_first_mcpserver_stdio.py"
click node_python_client "https://github.com/anshlambagit/mcp_masterclass/blob/main/CH-1_CreateMCP/2_python_client.py"
click node_langchain_client "https://github.com/anshlambagit/mcp_masterclass/blob/main/CH-1_CreateMCP/3_langchain_client.py"
click node_http_server "https://github.com/anshlambagit/mcp_masterclass/blob/main/CH-2_HTTP_MCP/1_http_mcp.py"
click node_multi_transport_client "https://github.com/anshlambagit/mcp_masterclass/blob/main/CH-2_HTTP_MCP/2_langchain_client.py"
click node_community_client "https://github.com/anshlambagit/mcp_masterclass/blob/main/CH-3_3rdParty_MCPs/community_mcp.py"
click node_tavily_integration "https://github.com/anshlambagit/mcp_masterclass/blob/main/CH-3_3rdParty_MCPs/tavily_mcp.py"
click node_package_test "https://github.com/anshlambagit/mcp_masterclass/blob/main/CH-4_PyPI_MCP/1_test_package.py"
click node_package_client "https://github.com/anshlambagit/mcp_masterclass/blob/main/CH-4_PyPI_MCP/2_client.py"
click node_terminal_tools "https://github.com/anshlambagit/mcp_masterclass/blob/main/MCP_PYPI/src/agentic_terminal/tools.py"
click node_package_entry "https://github.com/anshlambagit/mcp_masterclass/blob/main/MCP_PYPI/src/agentic_terminal/main.py"
click node_gateway "https://github.com/anshlambagit/mcp_masterclass/blob/main/CH-5_MCP_Gateway/gateway.py"
click node_docker_gateway "https://github.com/anshlambagit/mcp_masterclass/blob/main/CH-6_MCP_Docker/app/gateway.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_stdio_server,node_python_client,node_langchain_client,node_http_server,node_multi_transport_client toneBlue
class node_community_client,node_community_server,node_tavily_integration toneAmber
class node_package_test,node_package_client,node_terminal_tools,node_package_entry toneMint
class node_gateway,node_docker_gateway,node_duck_gateway_server,node_terminal_server,node_container_runtime toneRose
class node_learner toneIndigo
```

## Components

### MCP Foundations

- [Stdio Server](https://github.com/anshlambagit/mcp_masterclass/blob/main/CH-1_CreateMCP/1_first_mcpserver_stdio.py): `CH-1_CreateMCP/1_first_mcpserver_stdio.py`
- [Python Client](https://github.com/anshlambagit/mcp_masterclass/blob/main/CH-1_CreateMCP/2_python_client.py): `CH-1_CreateMCP/2_python_client.py`
- [LangChain Client](https://github.com/anshlambagit/mcp_masterclass/blob/main/CH-1_CreateMCP/3_langchain_client.py): `CH-1_CreateMCP/3_langchain_client.py`
- [HTTP Server](https://github.com/anshlambagit/mcp_masterclass/blob/main/CH-2_HTTP_MCP/1_http_mcp.py): `CH-2_HTTP_MCP/1_http_mcp.py`
- [Multi-Transport Client](https://github.com/anshlambagit/mcp_masterclass/blob/main/CH-2_HTTP_MCP/2_langchain_client.py): `CH-2_HTTP_MCP/2_langchain_client.py`

### Tool Integrations

- [Community MCP Client](https://github.com/anshlambagit/mcp_masterclass/blob/main/CH-3_3rdParty_MCPs/community_mcp.py): `CH-3_3rdParty_MCPs/community_mcp.py`
- **DuckDuckGo MCP**
- [Tavily Search](https://github.com/anshlambagit/mcp_masterclass/blob/main/CH-3_3rdParty_MCPs/tavily_mcp.py): `CH-3_3rdParty_MCPs/tavily_mcp.py`

### Packaged Tools

- [Package Test Runner](https://github.com/anshlambagit/mcp_masterclass/blob/main/CH-4_PyPI_MCP/1_test_package.py): `CH-4_PyPI_MCP/1_test_package.py`
- [Package Client](https://github.com/anshlambagit/mcp_masterclass/blob/main/CH-4_PyPI_MCP/2_client.py): `CH-4_PyPI_MCP/2_client.py`
- [Terminal Tools](https://github.com/anshlambagit/mcp_masterclass/blob/main/MCP_PYPI/src/agentic_terminal/tools.py): `MCP_PYPI/src/agentic_terminal/tools.py`
- [Stdio Entry Point](https://github.com/anshlambagit/mcp_masterclass/blob/main/MCP_PYPI/src/agentic_terminal/main.py): `MCP_PYPI/src/agentic_terminal/main.py`

### Gateway Deployment

- [MCP Gateway](https://github.com/anshlambagit/mcp_masterclass/blob/main/CH-5_MCP_Gateway/gateway.py): `CH-5_MCP_Gateway/gateway.py`
- [Container Gateway](https://github.com/anshlambagit/mcp_masterclass/blob/main/CH-6_MCP_Docker/app/gateway.py): `CH-6_MCP_Docker/app/gateway.py`
- **DuckDuckGo Server**
- **Agentic Terminal Server**
- **Container Runtime**

### Other components

- **Developer**

## Connections

- Developer → Python Client: runs (evidence: `README.md`)
- Developer → LangChain Client: runs (evidence: `README.md`)
- Developer → Multi-Transport Client: runs (evidence: `README.md`)
- Developer → Community MCP Client: runs (evidence: `README.md`)
- Python Client → Stdio Server: calls tools (evidence: `CH-1_CreateMCP/2_python_client.py`)
- LangChain Client → Stdio Server: discovers tools (evidence: `CH-1_CreateMCP/3_langchain_client.py`)
- Multi-Transport Client → Stdio Server: configures stdio (evidence: `CH-2_HTTP_MCP/2_langchain_client.py`)
- Multi-Transport Client → HTTP Server: connects HTTP (evidence: `CH-2_HTTP_MCP/2_langchain_client.py`)
- Community MCP Client → DuckDuckGo MCP: invokes tools (evidence: `CH-3_3rdParty_MCPs/community_mcp.py`)
- Developer → Tavily Search: learns integration (evidence: `README.md`)
- Package Test Runner → Terminal Tools: runs server (evidence: `CH-4_PyPI_MCP/1_test_package.py`)
- Stdio Entry Point → Terminal Tools: starts tools (evidence: `MCP_PYPI/src/agentic_terminal/main.py`)
- Package Client → Terminal Tools: connects package (evidence: `README.md`)
- Developer → MCP Gateway: runs gateway (evidence: `README.md`)
- MCP Gateway → DuckDuckGo Server: proxies tools (evidence: `CH-5_MCP_Gateway/gateway.py`)
- MCP Gateway → Agentic Terminal Server: proxies tools (evidence: `CH-5_MCP_Gateway/gateway.py`)
- Developer → Container Gateway: deploys gateway (evidence: `README.md`)
- Container Gateway → DuckDuckGo Server: proxies tools (evidence: `CH-6_MCP_Docker/app/gateway.py`)
- Container Gateway → Agentic Terminal Server: proxies tools (evidence: `CH-6_MCP_Docker/app/gateway.py`)
- Container Runtime → Container Gateway: hosts
