# hmmhmmhm/daiso-mcp architecture

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

- Interactive diagram: https://gitdiagram.com/hmmhmmhm/daiso-mcp
- Repository: https://github.com/hmmhmmhm/daiso-mcp

## Overview

DAISO MCP exposes Korean and Japanese retail, convenience-store, cinema, nearby-place, and fuel-price lookups through a hosted MCP server, REST endpoints, and a CLI. The main flow is an agent or user request entering the Worker, reaching a service-specific API handler or MCP tool, then querying an upstream service and returning a normalized result. The README documents supported capabilities; source-index references and excerpts support only selected internal links, so unsampled service wiring is not expanded into detailed call chains.

Main entry points: [`src/core/registry.ts`](https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/core/registry.ts) (MCP tools), [`src/index.ts`](https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/index.ts) (Worker entry), [`src/services/gs25/client.ts`](https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/services/gs25/client.ts) (Convenience stores), [`src/api/handlers.ts`](https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/api/handlers.ts) (API handlers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User interfaces"]
  node_cli["Command interface<br/>[cli.ts]"]
end

subgraph group_runtime["Worker and MCP"]
  node_worker["Worker entry<br/>[index.ts]"]
  node_mcp["MCP tools<br/>[registry.ts]"]
  node_rest["REST endpoints"]
  node_handlers["API handlers<br/>[handlers.ts]"]
end

subgraph group_domain["Lookup services"]
  node_convenience["Convenience stores<br/>[client.ts]"]
  node_daiso["Daiso and Olive Young<br/>[client.ts]"]
  node_japan["Japan Daiso<br/>[client.ts]"]
  node_cinema["Cinema listings<br/>[client.ts]"]
  node_dtryx["Dtryx cinema<br/>[transport.ts]"]
  node_compare["Product comparison<br/>[compareProducts.ts]"]
  node_places["Places and fuel<br/>[client.ts]"]
end

subgraph group_shared["Shared runtime"]
  node_transport["Relay and direct transport"]
  node_geocode["Geocoding<br/>[geocode.ts]"]
  node_http["HTTP requests<br/>[http.ts]"]
  node_response["Response formatting<br/>[response.ts]"]
  node_health["Operational health<br/>[healthChecks.ts]"]
  node_rate[("Rate-limit metrics")]
end

node_agent(("AI agent"))
node_cliuser(("CLI user"))
node_upstream(("Retail and information services"))

node_agent -->|"uses MCP"| node_worker
node_agent -->|"queries REST"| node_rest
node_cliuser -->|"runs lookup"| node_cli
node_cli -.->|"requests data"| node_worker
node_worker -->|"dispatches tools"| node_mcp
node_worker -->|"routes requests"| node_rest
node_rest -.->|"dispatches"| node_handlers
node_handlers -->|"calls clients"| node_convenience
node_handlers -.->|"calls clients"| node_daiso
node_handlers -->|"returns lookups"| node_upstream
node_convenience -->|"uses relay"| node_transport
node_convenience -->|"resolves addresses"| node_geocode
node_convenience -->|"fetches upstream"| node_http
node_transport -->|"sends requests"| node_http
node_geocode -->|"fetches providers"| node_http
node_geocode -->|"searches places"| node_places
node_rest -.->|"formats results"| node_response
node_worker -->|"serves checks"| node_health
node_health -.->|"checks services"| node_upstream
node_worker -->|"records limits"| node_rate
node_mcp -->|"offers product lookup"| node_daiso
node_mcp -->|"offers Japan lookup"| node_japan
node_mcp -->|"offers cinema lookup"| node_cinema
node_mcp -->|"offers seat lookup"| node_dtryx
node_mcp -->|"offers price comparison"| node_compare
node_mcp -->|"offers nearby lookup"| node_places
node_mcp -->|"offers inventory lookup"| node_convenience

click node_worker "https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/index.ts"
click node_mcp "https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/core/registry.ts"
click node_rest "https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/api/routes/registerServiceRoutes.ts"
click node_cli "https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/cli.ts"
click node_handlers "https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/api/handlers.ts"
click node_convenience "https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/services/gs25/client.ts"
click node_daiso "https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/services/daiso/client.ts"
click node_japan "https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/services/daisoJp/client.ts"
click node_cinema "https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/services/cgv/client.ts"
click node_dtryx "https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/services/dtryx/transport.ts"
click node_compare "https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/services/compare/tools/compareProducts.ts"
click node_places "https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/services/places/client.ts"
click node_transport "https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/utils/convenienceTransport.ts"
click node_geocode "https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/utils/geocode.ts"
click node_http "https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/utils/http.ts"
click node_response "https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/api/response.ts"
click node_health "https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/api/healthChecks.ts"
click node_rate "https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/durableObjects/rateLimitMetricsStore.ts"

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_cli,node_cliuser toneBlue
class node_worker,node_mcp,node_rest,node_handlers toneAmber
class node_convenience,node_daiso,node_japan,node_cinema,node_dtryx,node_compare,node_places toneMint
class node_transport,node_geocode,node_http,node_response,node_health,node_rate toneRose
class node_agent,node_upstream toneIndigo
```

## Components

### User interfaces

- [Command interface](https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/cli.ts): `src/cli.ts`

### Worker and MCP

- [Worker entry](https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/index.ts): `src/index.ts`
- [MCP tools](https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/core/registry.ts): `src/core/registry.ts`
- [REST endpoints](https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/api/routes/registerServiceRoutes.ts): `src/api/routes/registerServiceRoutes.ts`
- [API handlers](https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/api/handlers.ts): `src/api/handlers.ts`

### Lookup services

- [Convenience stores](https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/services/gs25/client.ts): `src/services/gs25/client.ts`
- [Daiso and Olive Young](https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/services/daiso/client.ts): `src/services/daiso/client.ts`
- [Japan Daiso](https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/services/daisoJp/client.ts): `src/services/daisoJp/client.ts`
- [Cinema listings](https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/services/cgv/client.ts): `src/services/cgv/client.ts`
- [Dtryx cinema](https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/services/dtryx/transport.ts): `src/services/dtryx/transport.ts`
- [Product comparison](https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/services/compare/tools/compareProducts.ts): `src/services/compare/tools/compareProducts.ts`
- [Places and fuel](https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/services/places/client.ts): `src/services/places/client.ts`

### Shared runtime

- [Relay and direct transport](https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/utils/convenienceTransport.ts): `src/utils/convenienceTransport.ts`
- [Geocoding](https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/utils/geocode.ts): `src/utils/geocode.ts`
- [HTTP requests](https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/utils/http.ts): `src/utils/http.ts`
- [Response formatting](https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/api/response.ts): `src/api/response.ts`
- [Operational health](https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/api/healthChecks.ts): `src/api/healthChecks.ts`
- [Rate-limit metrics](https://github.com/hmmhmmhm/daiso-mcp/blob/main/src/durableObjects/rateLimitMetricsStore.ts): `src/durableObjects/rateLimitMetricsStore.ts`

### Other components

- **AI agent**
- **CLI user**
- **Retail and information services**

## Connections

- AI agent → Worker entry: uses MCP (evidence: `README.md`)
- AI agent → REST endpoints: queries REST (evidence: `README.md`)
- CLI user → Command interface: runs lookup (evidence: `README.md`)
- Command interface → Worker entry: requests data
- Worker entry → MCP tools: dispatches tools (evidence: `src/index.ts`)
- Worker entry → REST endpoints: routes requests (evidence: `src/index.ts`)
- REST endpoints → API handlers: dispatches
- API handlers → Convenience stores: calls clients (evidence: `src/api/handlers.ts`)
- API handlers → Daiso and Olive Young: calls clients
- API handlers → Retail and information services: returns lookups (evidence: `README.md`)
- Convenience stores → Relay and direct transport: uses relay (evidence: `src/services/gs25/client.ts`)
- Convenience stores → Geocoding: resolves addresses (evidence: `src/services/gs25/client.ts`)
- Convenience stores → HTTP requests: fetches upstream (evidence: `src/services/gs25/client.ts`)
- Relay and direct transport → HTTP requests: sends requests (evidence: `src/utils/convenienceTransport.ts`)
- Geocoding → HTTP requests: fetches providers (evidence: `src/utils/geocode.ts`)
- Geocoding → Places and fuel: searches places (evidence: `src/utils/geocode.ts`)
- REST endpoints → Response formatting: formats results
- Worker entry → Operational health: serves checks (evidence: `src/index.ts`)
- Operational health → Retail and information services: checks services
- Worker entry → Rate-limit metrics: records limits (evidence: `src/index.ts`)
- MCP tools → Daiso and Olive Young: offers product lookup (evidence: `README.md`)
- MCP tools → Japan Daiso: offers Japan lookup (evidence: `README.md`)
- MCP tools → Cinema listings: offers cinema lookup (evidence: `README.md`)
- MCP tools → Dtryx cinema: offers seat lookup (evidence: `README.md`)
- MCP tools → Product comparison: offers price comparison (evidence: `README.md`)
- MCP tools → Places and fuel: offers nearby lookup (evidence: `README.md`)
- MCP tools → Convenience stores: offers inventory lookup (evidence: `README.md`)
