# y-vex/chronodrive-mcp architecture

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

- Interactive diagram: https://gitdiagram.com/y-vex/chronodrive-mcp
- Repository: https://github.com/y-vex/chronodrive-mcp

## Overview

Chronodrive MCP exposes product search and cart management to MCP-compatible assistants. The assistant can use search results to help build a reviewed grocery cart from a meal plan; recipe interpretation and review happen outside this repository. The server dispatches tool calls to the Chronodrive client, which manages authentication, search, and cart API requests. The README documents these capabilities; the graph follows the sampled server and client source, without implying unsampled integrations.

Main entry points: [`server.py`](https://github.com/y-vex/chronodrive-mcp/blob/main/server.py) (Tool dispatcher), [`client.py`](https://github.com/y-vex/chronodrive-mcp/blob/main/client.py) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mcp["MCP interface"]
  node_server["Tool server<br/>[server.py]"]
  node_dispatcher["Tool dispatcher<br/>[server.py]"]
end

subgraph group_client["Chronodrive client"]
  node_api_client["API client<br/>[client.py]"]
  node_authentication["Authentication<br/>[client.py]"]
  node_product_search["Product search<br/>[client.py]"]
  node_cart_ops["Cart operations<br/>[client.py]"]
end

subgraph group_state["Local state"]
  node_session_file[("Session file<br/>[client.py]")]
  node_config_cache[("Frontend config cache<br/>[client.py]")]
end

node_assistant(("MCP assistant"))
node_chronodrive["Chronodrive APIs"]
node_connect["Chronodrive Connect"]
node_website["Chronodrive website"]

node_assistant -->|"invokes tools"| node_server
node_server -->|"dispatches calls"| node_dispatcher
node_dispatcher -->|"authenticates"| node_authentication
node_dispatcher -->|"gets session"| node_api_client
node_dispatcher -->|"searches products"| node_product_search
node_dispatcher -->|"manages cart"| node_cart_ops
node_api_client -->|"validates session"| node_authentication
node_authentication -->|"reads/writes"| node_session_file
node_api_client -->|"loads config"| node_config_cache
node_authentication -->|"requests tokens"| node_connect
node_authentication -->|"fetches customer/cart"| node_chronodrive
node_product_search -->|"searches products"| node_chronodrive
node_cart_ops -->|"reads/writes cart"| node_chronodrive
node_api_client -->|"fetches API config"| node_website

click node_server "https://github.com/y-vex/chronodrive-mcp/blob/main/server.py"
click node_dispatcher "https://github.com/y-vex/chronodrive-mcp/blob/main/server.py"
click node_api_client "https://github.com/y-vex/chronodrive-mcp/blob/main/client.py"
click node_authentication "https://github.com/y-vex/chronodrive-mcp/blob/main/client.py"
click node_product_search "https://github.com/y-vex/chronodrive-mcp/blob/main/client.py"
click node_cart_ops "https://github.com/y-vex/chronodrive-mcp/blob/main/client.py"
click node_session_file "https://github.com/y-vex/chronodrive-mcp/blob/main/client.py"
click node_config_cache "https://github.com/y-vex/chronodrive-mcp/blob/main/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_server,node_dispatcher toneBlue
class node_api_client,node_authentication,node_product_search,node_cart_ops toneAmber
class node_session_file,node_config_cache,node_chronodrive toneMint
class node_assistant,node_connect,node_website toneIndigo
```

## Components

### MCP interface

- [Tool server](https://github.com/y-vex/chronodrive-mcp/blob/main/server.py): `server.py`
- [Tool dispatcher](https://github.com/y-vex/chronodrive-mcp/blob/main/server.py): `server.py`

### Chronodrive client

- [API client](https://github.com/y-vex/chronodrive-mcp/blob/main/client.py): `client.py`
- [Authentication](https://github.com/y-vex/chronodrive-mcp/blob/main/client.py): `client.py`
- [Product search](https://github.com/y-vex/chronodrive-mcp/blob/main/client.py): `client.py`
- [Cart operations](https://github.com/y-vex/chronodrive-mcp/blob/main/client.py): `client.py`

### Local state

- [Session file](https://github.com/y-vex/chronodrive-mcp/blob/main/client.py): `client.py`
- [Frontend config cache](https://github.com/y-vex/chronodrive-mcp/blob/main/client.py): `client.py`

### Other components

- **MCP assistant**
- **Chronodrive APIs**
- **Chronodrive Connect**
- **Chronodrive website**

## Connections

- MCP assistant → Tool server: invokes tools
- Tool server → Tool dispatcher: dispatches calls
- Tool dispatcher → Authentication: authenticates
- Tool dispatcher → API client: gets session
- Tool dispatcher → Product search: searches products
- Tool dispatcher → Cart operations: manages cart
- API client → Authentication: validates session
- Authentication → Session file: reads/writes
- API client → Frontend config cache: loads config
- Authentication → Chronodrive Connect: requests tokens
- Authentication → Chronodrive APIs: fetches customer/cart
- Product search → Chronodrive APIs: searches products
- Cart operations → Chronodrive APIs: reads/writes cart
- API client → Chronodrive website: fetches API config
