# yuchenssr/multi-ai-advisor-mcp architecture

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

- Interactive diagram: https://gitdiagram.com/yuchenssr/multi-ai-advisor-mcp
- Repository: https://github.com/yuchenssr/multi-ai-advisor-mcp

## Overview

##### Project Type & Purpose
- The project is a Node.js MCP (Model Context Protocol) server designed to query multiple Ollama models and then synthesize their responses – a “council of advisors” approach. It integrates with Claude for Desktop to provide diverse AI perspectives from different model “personas.”
- The README clarifies that it serves two main tools: “list-available-models” and “query-models,” while the core design revolves around external models (Ollama) and an internal synthesis (manager AI).

##### Analyzing the File Structure
- Top-level files: .env (configuration), Dockerfile (containerization), package.json (dependencies/scripts), tsconfig.json and src/ (TypeScript source), smithery.yaml (deployment/config integration with Smithery).
- The presence of a single source directory (src/) with index.ts indicates a somewhat monolithic yet modular layout focused on handling requests and orchestrating model queries.

##### Key System Components
a. Client/Request Origin:
- Claude for Desktop (as the external consumer using the MCP tools).
- Incoming requests are initiated via Claude when a user asks a question.
b. MCP Server (Core Component):
- Represented by your Node.js application.
- Entry point: src/index.ts processes incoming requests.
- Middleware / routing layer (if applicable) handling two main endpoints (for “list-available-models” and “query-models”).
c. External Service Components:
- Ollama API: Place a component for Ollama with its API URL (as configured in .env) that receives queries from the MCP server.
d. Synthesis/Manager AI:
e. Configuration & Environment:
- Use of .env settings for configuration and system prompts suggests an architectural layer for environment-based customization.
f. Deployment & Integration:

##### Representing Relationships & Interactions
- A clear directional flow starting at Claude’s query request, traversing to the MCP server and then branching into parallel requests toward each of the external Ollama model workers.
- That the MCP server registers its tools (list and query) to Claude for Desktop (using the configuration instructions provided in the README).

##### Final Assembly
- Optionally side-notate the use of Docker and configuration files as part of the deployment/infrastructure layer.

## Diagram (Mermaid)

```mermaid
graph TD
    A["Claude for Desktop"]:::client
    H["Configuration"]:::deployment
    I["Dockerfile"]:::deployment
    J["Smithery YAML"]:::deployment
    B["MCP Server"]:::internal
    C["Ollama API (Localhost:11434)"]:::external
    subgraph "Ollama Model Workers"
        D["Worker AI gemma3:1b"]:::external
        E["Worker AI llama3.2:1b"]:::external
        F["Worker AI deepseek-r1:1.5b"]:::external
    end
    G["Manager AI / Synthesizer"]:::internal

    A -->|"request"| B
    H -->|"configures"| B
    I -->|"deploys"| B
    J -->|"integrates"| B
    B -->|"queries"| C
    C -->|"invokes"| D
    C -->|"invokes"| E
    C -->|"invokes"| F
    D -->|"response"| G
    E -->|"response"| G
    F -->|"response"| G
    G -->|"aggregatedReply"| A

    click B "https://github.com/yuchenssr/multi-ai-advisor-mcp/blob/main/src/index.ts"
    click H "https://github.com/yuchenssr/multi-ai-advisor-mcp/blob/main/.env"
    click I "https://github.com/yuchenssr/multi-ai-advisor-mcp/tree/main/Dockerfile"
    click J "https://github.com/yuchenssr/multi-ai-advisor-mcp/blob/main/smithery.yaml"

    classDef client fill:#a2d2ff,stroke:#083d77,stroke-width:2px;
    classDef internal fill:#ffcdb2,stroke:#d00000,stroke-width:2px;
    classDef external fill:#caffbf,stroke:#198754,stroke-width:2px;
    classDef deployment fill:#fefae0,stroke:#ffb703,stroke-width:2px;
```
