# cookie-hoo/hello-mcp architecture

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

- Interactive diagram: https://gitdiagram.com/cookie-hoo/hello-mcp
- Repository: https://github.com/cookie-hoo/hello-mcp

## Overview

##### And represent the main components
- MCP Client: There are at least two variants—in one mode (client2stdio) that communicates via standard I/O, and in another (client2sse) that registers with a running server over HTTP using SSE.
- MCP Server: Implemented in the server.py file, it utilizes FastMCP to expose MCP tools (for example, a tool that lists directory contents) and supports both SSE and stdio executions.
- Configuration Management: Show the use of configuration (config.example.yaml, which is copied to config.yaml) to inject parameters such as the DeepSeek API key.

- When using client2sse, the client component sends registration calls and interactions to the MCP Server over HTTP (using the provided server URL).
- When using client2stdio, the communication flow is directed towards local execution or internal function calls (with the server launched via a file path).
- Configuration file as a common service that both client and server rely on.

##### Point out architectural patterns
- The project leverages a modular design. Separate modules (client, client2sse, client2stdio, server) indicate that it follows a component-based design where each module has a specific responsibility.

##### Details on relevant technologies
- Python is the core language with a structure that supports packages (observed by the __init__.py and organized module files).
- SSE (Server-Sent Events) and stdio are the two communication mechanisms.
- The DeepSeek API integration is a notable external dependency.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Management section
    Config["Configuration (config.yaml)"]:::config
    subgraph "Environment Management (uv)"
        Env1["uv.lock"]:::uv
        Env2["pyproject.toml"]:::uv
    end

    %% Client Side
    subgraph "Client Side"
        ClientStdio["MCP Client (stdio)"]:::core
        ClientSSE["MCP Client (SSE)"]:::core
    end

    %% Server Side
    subgraph "Server Side"
        Server["MCP Server (FastMCP)"]:::core
    end

    %% External Dependency
    DeepSeek["DeepSeek API"]:::external

    %% Arrows from Management to Application Modules
    Config -->|"config"| ClientStdio
    Config -->|"config"| ClientSSE
    Config -->|"config"| Server

    Env1 -->|"uv_setup"| ClientStdio
    Env1 -->|"uv_setup"| ClientSSE
    Env1 -->|"uv_setup"| Server

    Env2 -->|"uv_setup"| ClientStdio
    Env2 -->|"uv_setup"| ClientSSE
    Env2 -->|"uv_setup"| Server

    %% Communication between Client and Server
    ClientSSE -->|"HTTP_SSE"| Server
    ClientStdio -->|"stdio_call"| Server

    %% External API call from Client (SSE mode)
    ClientSSE -->|"API_call"| DeepSeek

    %% Click Events
    click ClientStdio "https://github.com/cookie-hoo/hello-mcp/blob/main/hello_mcp/client2stdio.py"
    click ClientSSE "https://github.com/cookie-hoo/hello-mcp/blob/main/hello_mcp/client2sse.py"
    click Server "https://github.com/cookie-hoo/hello-mcp/blob/main/hello_mcp/server.py"
    click Config "https://github.com/cookie-hoo/hello-mcp/blob/main/config.example.yaml"
    click Env1 "https://github.com/cookie-hoo/hello-mcp/blob/main/uv.lock"
    click Env2 "https://github.com/cookie-hoo/hello-mcp/blob/main/pyproject.toml"

    %% Styles
    classDef core fill:#ADD8E6,stroke:#333,stroke-width:2px;
    classDef config fill:#FFD700,stroke:#333,stroke-width:2px;
    classDef uv fill:#FFA07A,stroke:#333,stroke-width:2px;
    classDef external fill:#90EE90,stroke:#333,stroke-width:2px;
```
