# krishnaik06/mcp-crash-course architecture

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

- Interactive diagram: https://gitdiagram.com/krishnaik06/mcp-crash-course
- Repository: https://github.com/krishnaik06/mcp-crash-course

## Overview

This repository contains a basic MCP example, two weather-server implementations, direct MCP clients, and an interactive LangChain/MCP agent. The weather workflow lets a user ask for alerts or forecasts, dispatches the request to a registered MCP tool, and retrieves weather data from the National Weather Service (NWS). The README also documents basic arithmetic tools and a greeting resource, though the sampled main.py only prints a greeting; its implementation details are therefore uncertain.

Main entry points: [`mcpserver/server.py`](https://github.com/krishnaik06/mcp-crash-course/blob/main/mcpserver/server.py) (Weather Tools), [`server/client.py`](https://github.com/krishnaik06/mcp-crash-course/blob/main/server/client.py) (Memory Chat Agent), [`mcpserver/client-sse.py`](https://github.com/krishnaik06/mcp-crash-course/blob/main/mcpserver/client-sse.py) (MCP Tool Clients), [`mcpserver/client-stdio.py`](https://github.com/krishnaik06/mcp-crash-course/blob/main/mcpserver/client-stdio.py) (stdio Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_basic["Basic MCP Example"]
  node_basic_capabilities["Tools and Greeting<br/>[main.py]"]
end

subgraph group_weather["Weather MCP Servers"]
  node_weather_tools["Weather Tools<br/>[server.py]"]
  node_alerts["Alert Lookup<br/>[server.py]"]
  node_forecast["Forecast Lookup<br/>[server.py]"]
  node_weather_request["Request and Formatting<br/>[server.py]"]
  node_echo_server["Echo Resource<br/>[weather.py]"]
end

subgraph group_clients["MCP Clients"]
  node_weather_client["MCP Tool Clients<br/>[client-sse.py]"]
  node_stdio_client["stdio Client<br/>[client-stdio.py]"]
end

subgraph group_agent["Agent Chat"]
  node_agent_chat["Memory Chat Agent<br/>[client.py]"]
  node_agent_config["Weather Client Config<br/>[weather.json]"]
  node_mcp_client["MCP Client<br/>[client.py]"]
end

node_basic_user(("MCP User"))
node_weather_user(("Weather User"))
node_nws["NWS API"]
node_agent_user(("Chat User"))
node_llm["Groq Chat Model"]

node_basic_user -->|"uses tools"| node_basic_capabilities
node_weather_user -->|"requests weather"| node_weather_client
node_weather_client -->|"calls tools"| node_weather_tools
node_stdio_client -->|"calls tools"| node_weather_tools
node_weather_tools -->|"registers"| node_alerts
node_weather_tools -->|"registers"| node_forecast
node_alerts -->|"fetches data"| node_weather_request
node_forecast -->|"fetches data"| node_weather_request
node_weather_request -->|"requests weather"| node_nws
node_weather_user -.->|"requests resource"| node_echo_server
node_agent_user -->|"enters prompt"| node_agent_chat
node_agent_chat -->|"runs agent"| node_mcp_client
node_agent_chat -->|"configures model"| node_llm
node_agent_chat -->|"loads config"| node_agent_config
node_mcp_client -.->|"connects tools"| node_weather_tools

click node_basic_capabilities "https://github.com/krishnaik06/mcp-crash-course/blob/main/main.py"
click node_weather_tools "https://github.com/krishnaik06/mcp-crash-course/blob/main/mcpserver/server.py"
click node_alerts "https://github.com/krishnaik06/mcp-crash-course/blob/main/mcpserver/server.py"
click node_forecast "https://github.com/krishnaik06/mcp-crash-course/blob/main/mcpserver/server.py"
click node_weather_request "https://github.com/krishnaik06/mcp-crash-course/blob/main/mcpserver/server.py"
click node_echo_server "https://github.com/krishnaik06/mcp-crash-course/blob/main/server/weather.py"
click node_weather_client "https://github.com/krishnaik06/mcp-crash-course/blob/main/mcpserver/client-sse.py"
click node_stdio_client "https://github.com/krishnaik06/mcp-crash-course/blob/main/mcpserver/client-stdio.py"
click node_agent_chat "https://github.com/krishnaik06/mcp-crash-course/blob/main/server/client.py"
click node_agent_config "https://github.com/krishnaik06/mcp-crash-course/blob/main/server/weather.json"
click node_mcp_client "https://github.com/krishnaik06/mcp-crash-course/blob/main/server/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_basic_capabilities,node_basic_user,node_weather_user,node_agent_user toneBlue
class node_weather_tools,node_alerts,node_forecast,node_weather_request,node_echo_server toneAmber
class node_weather_client,node_stdio_client,node_nws toneMint
class node_agent_chat,node_agent_config,node_mcp_client toneRose
class node_llm toneIndigo
```

## Components

### Basic MCP Example

- [Tools and Greeting](https://github.com/krishnaik06/mcp-crash-course/blob/main/main.py): `main.py`

### Weather MCP Servers

- [Weather Tools](https://github.com/krishnaik06/mcp-crash-course/blob/main/mcpserver/server.py): `mcpserver/server.py`
- [Alert Lookup](https://github.com/krishnaik06/mcp-crash-course/blob/main/mcpserver/server.py): `mcpserver/server.py`
- [Forecast Lookup](https://github.com/krishnaik06/mcp-crash-course/blob/main/mcpserver/server.py): `mcpserver/server.py`
- [Request and Formatting](https://github.com/krishnaik06/mcp-crash-course/blob/main/mcpserver/server.py): `mcpserver/server.py`
- [Echo Resource](https://github.com/krishnaik06/mcp-crash-course/blob/main/server/weather.py): `server/weather.py`

### MCP Clients

- [MCP Tool Clients](https://github.com/krishnaik06/mcp-crash-course/blob/main/mcpserver/client-sse.py): `mcpserver/client-sse.py`
- [stdio Client](https://github.com/krishnaik06/mcp-crash-course/blob/main/mcpserver/client-stdio.py): `mcpserver/client-stdio.py`

### Agent Chat

- [Memory Chat Agent](https://github.com/krishnaik06/mcp-crash-course/blob/main/server/client.py): `server/client.py`
- [Weather Client Config](https://github.com/krishnaik06/mcp-crash-course/blob/main/server/weather.json): `server/weather.json`
- [MCP Client](https://github.com/krishnaik06/mcp-crash-course/blob/main/server/client.py): `server/client.py`

### Other components

- **MCP User**
- **Weather User**
- **NWS API**
- **Chat User**
- **Groq Chat Model**

## Connections

- MCP User → Tools and Greeting: uses tools (evidence: `README.md`)
- Weather User → MCP Tool Clients: requests weather (evidence: `mcpserver/client-sse.py`)
- MCP Tool Clients → Weather Tools: calls tools (evidence: `mcpserver/client-sse.py`)
- stdio Client → Weather Tools: calls tools (evidence: `mcpserver/client-stdio.py`)
- Weather Tools → Alert Lookup: registers (evidence: `mcpserver/server.py`)
- Weather Tools → Forecast Lookup: registers (evidence: `mcpserver/server.py`)
- Alert Lookup → Request and Formatting: fetches data (evidence: `mcpserver/server.py`)
- Forecast Lookup → Request and Formatting: fetches data (evidence: `mcpserver/server.py`)
- Request and Formatting → NWS API: requests weather (evidence: `mcpserver/server.py`)
- Weather User → Echo Resource: requests resource
- Chat User → Memory Chat Agent: enters prompt (evidence: `server/client.py`)
- Memory Chat Agent → MCP Client: runs agent (evidence: `server/client.py`)
- Memory Chat Agent → Groq Chat Model: configures model (evidence: `server/client.py`)
- Memory Chat Agent → Weather Client Config: loads config (evidence: `server/client.py`)
- MCP Client → Weather Tools: connects tools
