# allaboutai-yt/mcp-servers architecture

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

- Interactive diagram: https://gitdiagram.com/allaboutai-yt/mcp-servers
- Repository: https://github.com/allaboutai-yt/mcp-servers

## Overview

##### Main Components

A. Client Layer
- External applications that consume the MCP servers

B. MCP Server Layer (Core Components)
- OpenAI Server
- Handles o1-preview model interactions
- Manages API key authentication
- Implements streaming capabilities
- Flux Server
- Manages Flux model interactions
- Handles image model processing
- Manages Replicate token authentication

C. External Services Layer
- OpenAI API (o1-preview model)
- Flux API (SOTA Image Model)
- Replicate API

**Rectangle: Main server components**
**Hexagon: Authentication/Security components**

##### Component Relationships

**Client Applications**
- ↓ ↑
- [MCP Protocol]
- ↓ ↑
**┌─────────────────────┐**
- MCP Server Layer  │
- ┬──────────┤
- OpenAI  │   Flux   │
- Server  │  Server  │
- ┬────┴────┬─────┘
- ↓         ↓
**[Auth Layer (ENV)]**
- ↓         ↓
**┌─────────────────────┐**
- External Services  │
- ┬──────────┤
- OpenAI  │   Flux   │
- API   │   API    │
- ┴──────────┘

##### Important Details

A. Configuration Flow
- How environment variables (.env) connect to servers
- Configuration file relationships

B. Protocol Layer
- MCP protocol implementation
- Request/response flow

C. Security Layer
- API key management
- Environment variable handling

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client["Client Layer"]
        C1[Client Applications]
    end

    subgraph Protocol["Protocol Layer"]
        MCP[MCP Protocol]
        click MCP "https://github.com/AllAboutAI-YT/mcp-servers/blob/main/docs/mcp.md"
    end

    subgraph Servers["MCP Server Layer"]
        direction TB
        OpenAI["OpenAI Server"]
        click OpenAI "https://github.com/AllAboutAI-YT/mcp-servers/blob/main/openai-server/src/index.ts"
        Flux["Flux Server"]
        click Flux "https://github.com/AllAboutAI-YT/mcp-servers/blob/main/flux-server/src/index.ts"
        
        subgraph Types["Type Definitions"]
            OT["OpenAI Types"]
            click OT "https://github.com/AllAboutAI-YT/mcp-servers/blob/main/openai-server/src/types.ts"
            FT["Flux Types"]
            click FT "https://github.com/AllAboutAI-YT/mcp-servers/blob/main/flux-server/src/types.ts"
        end
        
        subgraph Config["Server Configuration"]
            OC["OpenAI Config"]
            click OC "https://github.com/AllAboutAI-YT/mcp-servers/blob/main/openai-server/tsconfig.json"
            FC["Flux Config"]
            click FC "https://github.com/AllAboutAI-YT/mcp-servers/blob/main/flux-server/tsconfig.json"
        end
    end

    subgraph Auth["Authentication Layer"]
        ENV[".env Configuration"]
        click ENV "https://github.com/AllAboutAI-YT/mcp-servers/blob/main/.env"
        APIKeys["API Key Management"]
    end

    subgraph External["External Services Layer"]
        OAPI["OpenAI API<br/>(o1-preview)"]
        click OAPI "https://github.com/AllAboutAI-YT/mcp-servers/blob/main/docs/openai_docs.md"
        FAPI["Flux API<br/>(SOTA Image Model)"]
        click FAPI "https://github.com/AllAboutAI-YT/mcp-servers/blob/main/docs/flux_docs.md"
        RAPI["Replicate API"]
    end

    C1 <--> MCP
    MCP <--> OpenAI & Flux
    OpenAI --- OT
    Flux --- FT
    OpenAI --- OC
    Flux --- FC
    OpenAI & Flux --> ENV
    ENV --> APIKeys
    APIKeys --> OAPI & FAPI & RAPI

    classDef client fill:#2374ab,color:#fff
    classDef protocol fill:#048ba8,color:#fff
    classDef server fill:#16db93,color:#000
    classDef auth fill:#efea5a,color:#000
    classDef external fill:#888,color:#fff
    classDef config fill:#f29e4c,color:#000
    classDef types fill:#457b9d,color:#fff

    class C1 client
    class MCP protocol
    class OpenAI,Flux server
    class ENV,APIKeys auth
    class OAPI,FAPI,RAPI external
    class OC,FC config
    class OT,FT types

    %% Legend
    subgraph Legend
        L1[Client Components]:::client
        L2[Protocol Layer]:::protocol
        L3[Server Components]:::server
        L4[Authentication]:::auth
        L5[External Services]:::external
        L6[Configuration]:::config
        L7[Type Definitions]:::types
    end
```
