# kodekloudhub/mcp-for-beginners architecture

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

- Interactive diagram: https://gitdiagram.com/kodekloudhub/mcp-for-beginners
- Repository: https://github.com/kodekloudhub/mcp-for-beginners

## Overview

This repository is a teaching collection of MCP server examples, not one integrated application. An MCP client invokes each server’s tools and receives results from the relevant integration: Google Calendar, Ollama, Open-Meteo, or generated Postman API requests. The calendar example adds OAuth, tool registration, and multiple transports; the smaller examples show focused server-to-service patterns. Relationships for unsampled feature handlers and integrations follow the top-level README, so their internal call paths are not inferred.

Main entry points: [`google-calendar-mcp/src/server.ts`](https://github.com/kodekloudhub/mcp-for-beginners/blob/main/google-calendar-mcp/src/server.ts) (Calendar server), [`google-calendar-mcp/src/handlers/core`](https://github.com/kodekloudhub/mcp-for-beginners/tree/main/google-calendar-mcp/src/handlers/core) (Calendar operations), [`google-calendar-mcp/src/auth/tokenManager.ts`](https://github.com/kodekloudhub/mcp-for-beginners/blob/main/google-calendar-mcp/src/auth/tokenManager.ts) (Token manager), [`google-calendar-mcp/src/index.ts`](https://github.com/kodekloudhub/mcp-for-beginners/blob/main/google-calendar-mcp/src/index.ts) (CLI entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_calendar["Google Calendar MCP"]
  node_cal_entry["CLI entry<br/>[index.ts]"]
  node_cal_server["Calendar server<br/>[server.ts]"]
  node_cal_transport["MCP transports"]
  node_cal_registry["Tool registry<br/>[registry.ts]"]
  node_cal_handlers["Calendar operations"]
  node_cal_dates["Date conversion<br/>[datetime.ts]"]
  node_cal_auth["OAuth flow<br/>[server.ts]"]
  node_cal_client["OAuth client<br/>[client.ts]"]
  node_cal_tokens["Token manager<br/>[tokenManager.ts]"]
  node_cal_store[("Token files<br/>[tokenManager.ts]")]
end

subgraph group_basic["Basic MCP Example"]
  node_basic_server["Addition server<br/>[server.js]"]
end

subgraph group_ollama["Ollama MCP Examples"]
  node_ollama_server["Prompt tools<br/>[server.js]"]
  node_ollama_demo["Demo server<br/>[server.js]"]
end

subgraph group_postman1["Generated Postman Server"]
  node_postman_server["MCP server<br/>[mcpServer.js]"]
  node_postman_discovery["Tool discovery<br/>[tools.js]"]
  node_postman_tools["Generated API tools"]
end

subgraph group_postman2["Second Generated Server"]
  node_postman2_server["MCP server<br/>[mcpServer.js]"]
  node_postman2_discovery["Tool discovery<br/>[tools.js]"]
  node_postman2_tools["Generated API tools"]
end

subgraph group_weather["Weather MCP Example"]
  node_weather_server["Weather tools<br/>[server.js]"]
end

node_client(("MCP client"))
node_google_calendar["Google Calendar API"]
node_ollama_service["Local Ollama"]
node_external_api["External APIs"]
node_open_meteo["Open-Meteo API"]

node_client -->|"starts"| node_cal_entry
node_cal_entry -->|"initializes"| node_cal_server
node_cal_server -->|"connects"| node_cal_transport
node_cal_server -->|"registers tools"| node_cal_registry
node_cal_registry -->|"dispatches to"| node_cal_handlers
node_cal_server -->|"initializes"| node_cal_client
node_cal_server -->|"starts auth"| node_cal_auth
node_cal_server -->|"validates tokens"| node_cal_tokens
node_cal_auth -->|"manages tokens"| node_cal_tokens
node_cal_tokens -->|"reads and writes"| node_cal_store
node_cal_handlers -->|"calendar operations"| node_google_calendar
node_cal_handlers -->|"converts dates"| node_cal_dates
node_client -->|"calls tool"| node_basic_server
node_client -->|"calls tools"| node_ollama_server
node_ollama_server -->|"requests completions"| node_ollama_service
node_client -->|"calls tools"| node_ollama_demo
node_ollama_demo -->|"requests completions"| node_ollama_service
node_client -->|"calls tools"| node_postman_server
node_postman_server -->|"loads tools"| node_postman_discovery
node_postman_discovery -->|"imports tools"| node_postman_tools
node_postman_tools -->|"calls APIs"| node_external_api
node_client -->|"calls tools"| node_postman2_server
node_postman2_server -->|"loads tools"| node_postman2_discovery
node_postman2_discovery -->|"imports tools"| node_postman2_tools
node_postman2_tools -->|"calls APIs"| node_external_api
node_client -->|"requests weather"| node_weather_server
node_weather_server -->|"fetches forecasts"| node_open_meteo

click node_cal_entry "https://github.com/kodekloudhub/mcp-for-beginners/blob/main/google-calendar-mcp/src/index.ts"
click node_cal_server "https://github.com/kodekloudhub/mcp-for-beginners/blob/main/google-calendar-mcp/src/server.ts"
click node_cal_transport "https://github.com/kodekloudhub/mcp-for-beginners/tree/main/google-calendar-mcp/src/transports"
click node_cal_registry "https://github.com/kodekloudhub/mcp-for-beginners/blob/main/google-calendar-mcp/src/tools/registry.ts"
click node_cal_handlers "https://github.com/kodekloudhub/mcp-for-beginners/tree/main/google-calendar-mcp/src/handlers/core"
click node_cal_dates "https://github.com/kodekloudhub/mcp-for-beginners/blob/main/google-calendar-mcp/src/handlers/utils/datetime.ts"
click node_cal_auth "https://github.com/kodekloudhub/mcp-for-beginners/blob/main/google-calendar-mcp/src/auth/server.ts"
click node_cal_client "https://github.com/kodekloudhub/mcp-for-beginners/blob/main/google-calendar-mcp/src/auth/client.ts"
click node_cal_tokens "https://github.com/kodekloudhub/mcp-for-beginners/blob/main/google-calendar-mcp/src/auth/tokenManager.ts"
click node_cal_store "https://github.com/kodekloudhub/mcp-for-beginners/blob/main/google-calendar-mcp/src/auth/tokenManager.ts"
click node_basic_server "https://github.com/kodekloudhub/mcp-for-beginners/blob/main/node-basic-mcp-server/server.js"
click node_ollama_server "https://github.com/kodekloudhub/mcp-for-beginners/blob/main/ollama-mcp/server.js"
click node_ollama_demo "https://github.com/kodekloudhub/mcp-for-beginners/blob/main/ollamademo/server.js"
click node_postman_server "https://github.com/kodekloudhub/mcp-for-beginners/blob/main/postman-mcp/postman-mcp-server/mcpServer.js"
click node_postman_discovery "https://github.com/kodekloudhub/mcp-for-beginners/blob/main/postman-mcp/postman-mcp-server/lib/tools.js"
click node_postman_tools "https://github.com/kodekloudhub/mcp-for-beginners/tree/main/postman-mcp/postman-mcp-server/tools"
click node_postman2_server "https://github.com/kodekloudhub/mcp-for-beginners/blob/main/postman-mcp/postman-mcp-server%202/mcpServer.js"
click node_postman2_discovery "https://github.com/kodekloudhub/mcp-for-beginners/blob/main/postman-mcp/postman-mcp-server%202/lib/tools.js"
click node_postman2_tools "https://github.com/kodekloudhub/mcp-for-beginners/tree/main/postman-mcp/postman-mcp-server%202/tools"
click node_weather_server "https://github.com/kodekloudhub/mcp-for-beginners/blob/main/Weather-MCP-Server/server.js"

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_cal_entry,node_cal_server,node_cal_transport,node_cal_registry,node_cal_handlers,node_cal_dates,node_cal_auth,node_cal_client,node_cal_tokens,node_cal_store,node_client toneBlue
class node_basic_server toneAmber
class node_ollama_server,node_ollama_demo,node_google_calendar,node_external_api,node_open_meteo toneMint
class node_postman_server,node_postman_discovery,node_postman_tools toneRose
class node_postman2_server,node_postman2_discovery,node_postman2_tools,node_ollama_service toneIndigo
class node_weather_server toneTeal
```

## Components

### Google Calendar MCP

- [CLI entry](https://github.com/kodekloudhub/mcp-for-beginners/blob/main/google-calendar-mcp/src/index.ts): `google-calendar-mcp/src/index.ts`
- [Calendar server](https://github.com/kodekloudhub/mcp-for-beginners/blob/main/google-calendar-mcp/src/server.ts): `google-calendar-mcp/src/server.ts`
- [MCP transports](https://github.com/kodekloudhub/mcp-for-beginners/tree/main/google-calendar-mcp/src/transports): `google-calendar-mcp/src/transports`
- [Tool registry](https://github.com/kodekloudhub/mcp-for-beginners/blob/main/google-calendar-mcp/src/tools/registry.ts): `google-calendar-mcp/src/tools/registry.ts`
- [Calendar operations](https://github.com/kodekloudhub/mcp-for-beginners/tree/main/google-calendar-mcp/src/handlers/core): `google-calendar-mcp/src/handlers/core`
- [Date conversion](https://github.com/kodekloudhub/mcp-for-beginners/blob/main/google-calendar-mcp/src/handlers/utils/datetime.ts): `google-calendar-mcp/src/handlers/utils/datetime.ts`
- [OAuth flow](https://github.com/kodekloudhub/mcp-for-beginners/blob/main/google-calendar-mcp/src/auth/server.ts): `google-calendar-mcp/src/auth/server.ts`
- [OAuth client](https://github.com/kodekloudhub/mcp-for-beginners/blob/main/google-calendar-mcp/src/auth/client.ts): `google-calendar-mcp/src/auth/client.ts`
- [Token manager](https://github.com/kodekloudhub/mcp-for-beginners/blob/main/google-calendar-mcp/src/auth/tokenManager.ts): `google-calendar-mcp/src/auth/tokenManager.ts`
- [Token files](https://github.com/kodekloudhub/mcp-for-beginners/blob/main/google-calendar-mcp/src/auth/tokenManager.ts): `google-calendar-mcp/src/auth/tokenManager.ts`

### Basic MCP Example

- [Addition server](https://github.com/kodekloudhub/mcp-for-beginners/blob/main/node-basic-mcp-server/server.js): `node-basic-mcp-server/server.js`

### Ollama MCP Examples

- [Prompt tools](https://github.com/kodekloudhub/mcp-for-beginners/blob/main/ollama-mcp/server.js): `ollama-mcp/server.js`
- [Demo server](https://github.com/kodekloudhub/mcp-for-beginners/blob/main/ollamademo/server.js): `ollamademo/server.js`

### Generated Postman Server

- [MCP server](https://github.com/kodekloudhub/mcp-for-beginners/blob/main/postman-mcp/postman-mcp-server/mcpServer.js): `postman-mcp/postman-mcp-server/mcpServer.js`
- [Tool discovery](https://github.com/kodekloudhub/mcp-for-beginners/blob/main/postman-mcp/postman-mcp-server/lib/tools.js): `postman-mcp/postman-mcp-server/lib/tools.js`
- [Generated API tools](https://github.com/kodekloudhub/mcp-for-beginners/tree/main/postman-mcp/postman-mcp-server/tools): `postman-mcp/postman-mcp-server/tools`

### Second Generated Server

- [MCP server](https://github.com/kodekloudhub/mcp-for-beginners/blob/main/postman-mcp/postman-mcp-server%202/mcpServer.js): `postman-mcp/postman-mcp-server 2/mcpServer.js`
- [Tool discovery](https://github.com/kodekloudhub/mcp-for-beginners/blob/main/postman-mcp/postman-mcp-server%202/lib/tools.js): `postman-mcp/postman-mcp-server 2/lib/tools.js`
- [Generated API tools](https://github.com/kodekloudhub/mcp-for-beginners/tree/main/postman-mcp/postman-mcp-server%202/tools): `postman-mcp/postman-mcp-server 2/tools`

### Weather MCP Example

- [Weather tools](https://github.com/kodekloudhub/mcp-for-beginners/blob/main/Weather-MCP-Server/server.js): `Weather-MCP-Server/server.js`

### Other components

- **MCP client**
- **Google Calendar API**
- **Local Ollama**
- **External APIs**
- **Open-Meteo API**

## Connections

- MCP client → CLI entry: starts
- CLI entry → Calendar server: initializes (evidence: `google-calendar-mcp/src/index.ts`)
- Calendar server → MCP transports: connects (evidence: `google-calendar-mcp/src/server.ts`)
- Calendar server → Tool registry: registers tools (evidence: `google-calendar-mcp/src/server.ts`)
- Tool registry → Calendar operations: dispatches to (evidence: `google-calendar-mcp/src/tools/registry.ts`)
- Calendar server → OAuth client: initializes (evidence: `google-calendar-mcp/src/server.ts`)
- Calendar server → OAuth flow: starts auth (evidence: `google-calendar-mcp/src/server.ts`)
- Calendar server → Token manager: validates tokens (evidence: `google-calendar-mcp/src/server.ts`)
- OAuth flow → Token manager: manages tokens (evidence: `google-calendar-mcp/src/auth/server.ts`)
- Token manager → Token files: reads and writes (evidence: `google-calendar-mcp/src/auth/tokenManager.ts`)
- Calendar operations → Google Calendar API: calendar operations
- Calendar operations → Date conversion: converts dates (evidence: `google-calendar-mcp/src/handlers/core/ListEventsHandler.ts`)
- MCP client → Addition server: calls tool
- MCP client → Prompt tools: calls tools
- Prompt tools → Local Ollama: requests completions
- MCP client → Demo server: calls tools
- Demo server → Local Ollama: requests completions
- MCP client → MCP server: calls tools
- MCP server → Tool discovery: loads tools (evidence: `postman-mcp/postman-mcp-server/mcpServer.js`)
- Tool discovery → Generated API tools: imports tools (evidence: `postman-mcp/postman-mcp-server/lib/tools.js`)
- Generated API tools → External APIs: calls APIs
- MCP client → MCP server: calls tools
- MCP server → Tool discovery: loads tools (evidence: `postman-mcp/postman-mcp-server 2/mcpServer.js`)
- Tool discovery → Generated API tools: imports tools (evidence: `postman-mcp/postman-mcp-server 2/lib/tools.js`)
- Generated API tools → External APIs: calls APIs
- MCP client → Weather tools: requests weather
- Weather tools → Open-Meteo API: fetches forecasts
