# youyo/seekio architecture

> Architecture diagram of the GitHub repository youyo/seekio, 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/youyo/seekio
- Repository: https://github.com/youyo/seekio

## Overview

Seekio is a stateless Remote MCP video-inspection service: an agent uploads or imports a video, checks when Stream processing is ready, then progressively requests overview frames, frame ranges or an exact frame, and optional timed captions. Cloudflare Stream handles video storage, encoding, thumbnails and captions; the optional Images binding crops exact-frame regions. Videos are removed on request or by scheduled retention cleanup. Edges reflect the README and sampled imports/calls; some tool-to-provider details are supported only by the SOURCE INDEX, while unsampled tool internals are not inferred.

Main entry points: [`src/mcp/server.ts`](https://github.com/youyo/seekio/blob/main/src/mcp/server.ts) (MCP server registration), [`src/video/backend.ts`](https://github.com/youyo/seekio/blob/main/src/video/backend.ts) (Video backend interface), [`src/index.ts`](https://github.com/youyo/seekio/blob/main/src/index.ts) (HTTP and cron worker), [`src/mcp/tools/frame.ts`](https://github.com/youyo/seekio/blob/main/src/mcp/tools/frame.ts) (Exact frame)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Worker entry"]
  node_worker["HTTP and cron worker<br/>[index.ts]"]
  node_auth["Request authorization<br/>[auth.ts]"]
  node_config["Runtime configuration<br/>[config.ts]"]
  node_log["Structured logging<br/>[log.ts]"]
end

subgraph group_mcp["MCP tools"]
  node_server["MCP server registration<br/>[server.ts]"]
  node_upload["Create upload<br/>[create-upload.ts]"]
  node_import["Import video URL<br/>[import-url.ts]"]
  node_info["Video status<br/>[info.ts]"]
  node_overview["Timeline overview<br/>[overview.ts]"]
  node_frames["Frame ranges<br/>[frames.ts]"]
  node_frame["Exact frame<br/>[frame.ts]"]
  node_transcript["Timed transcript<br/>[transcript.ts]"]
  node_delete["Delete video<br/>[delete.ts]"]
end

subgraph group_video["Video processing"]
  node_backend["Video backend interface<br/>[backend.ts]"]
  node_timestamps["Timestamp validation<br/>[timestamps.ts]"]
  node_framefmt["Frame content formatting<br/>[frame.ts]"]
  node_region["Region geometry<br/>[region.ts]"]
  node_vtt["Caption parsing<br/>[vtt.ts]"]
  node_cleanup["Retention cleanup<br/>[cleanup.ts]"]
end

subgraph group_provider["Cloudflare services"]
  node_stream[("Cloudflare Stream")]
  node_images["Region cropper<br/>[image.ts]"]
end

node_agent(("MCP client"))

node_agent -->|"calls MCP"| node_worker
node_worker -->|"authorizes"| node_auth
node_worker -->|"resolves"| node_config
node_worker -->|"creates"| node_server
node_worker -->|"constructs backend"| node_stream
node_worker -->|"configures optionally"| node_images
node_worker -->|"runs scheduled"| node_cleanup
node_server -->|"registers"| node_upload
node_server -->|"registers"| node_import
node_server -->|"registers"| node_info
node_server -->|"registers"| node_overview
node_server -->|"registers"| node_frames
node_server -->|"registers"| node_frame
node_server -->|"registers"| node_transcript
node_server -->|"registers"| node_delete
node_upload -.->|"uses"| node_backend
node_import -.->|"uses"| node_backend
node_info -->|"reads status"| node_backend
node_overview -.->|"fetches frames"| node_backend
node_frames -.->|"fetches frames"| node_backend
node_frame -->|"fetches frame"| node_backend
node_transcript -->|"gets captions"| node_backend
node_delete -.->|"deletes video"| node_backend
node_backend -->|"implemented by"| node_stream
node_overview -.->|"selects times"| node_timestamps
node_frames -->|"validates range"| node_timestamps
node_frame -->|"validates timestamp"| node_timestamps
node_frame -->|"formats image result"| node_framefmt
node_frame -->|"validates crop"| node_region
node_frame -->|"crops optionally"| node_images
node_transcript -->|"parses captions"| node_vtt
node_cleanup -->|"lists and deletes"| node_backend
node_cleanup -.->|"acts through backend"| node_stream
node_worker -->|"records outcomes"| node_log

click node_worker "https://github.com/youyo/seekio/blob/main/src/index.ts"
click node_auth "https://github.com/youyo/seekio/blob/main/src/auth.ts"
click node_config "https://github.com/youyo/seekio/blob/main/src/config.ts"
click node_server "https://github.com/youyo/seekio/blob/main/src/mcp/server.ts"
click node_upload "https://github.com/youyo/seekio/blob/main/src/mcp/tools/create-upload.ts"
click node_import "https://github.com/youyo/seekio/blob/main/src/mcp/tools/import-url.ts"
click node_info "https://github.com/youyo/seekio/blob/main/src/mcp/tools/info.ts"
click node_overview "https://github.com/youyo/seekio/blob/main/src/mcp/tools/overview.ts"
click node_frames "https://github.com/youyo/seekio/blob/main/src/mcp/tools/frames.ts"
click node_frame "https://github.com/youyo/seekio/blob/main/src/mcp/tools/frame.ts"
click node_transcript "https://github.com/youyo/seekio/blob/main/src/mcp/tools/transcript.ts"
click node_delete "https://github.com/youyo/seekio/blob/main/src/mcp/tools/delete.ts"
click node_backend "https://github.com/youyo/seekio/blob/main/src/video/backend.ts"
click node_timestamps "https://github.com/youyo/seekio/blob/main/src/video/timestamps.ts"
click node_framefmt "https://github.com/youyo/seekio/blob/main/src/video/frame.ts"
click node_region "https://github.com/youyo/seekio/blob/main/src/video/region.ts"
click node_vtt "https://github.com/youyo/seekio/blob/main/src/video/vtt.ts"
click node_cleanup "https://github.com/youyo/seekio/blob/main/src/video/cleanup.ts"
click node_stream "https://github.com/youyo/seekio/blob/main/src/video/cloudflare-stream.ts"
click node_images "https://github.com/youyo/seekio/blob/main/src/video/image.ts"
click node_log "https://github.com/youyo/seekio/blob/main/src/log.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_worker,node_auth,node_config,node_log,node_agent toneBlue
class node_server,node_upload,node_import,node_info,node_overview,node_frames,node_frame,node_transcript,node_delete toneAmber
class node_backend,node_timestamps,node_framefmt,node_region,node_vtt,node_cleanup toneMint
class node_stream,node_images toneRose
```

## Components

### Worker entry

- [HTTP and cron worker](https://github.com/youyo/seekio/blob/main/src/index.ts): `src/index.ts`
- [Request authorization](https://github.com/youyo/seekio/blob/main/src/auth.ts): `src/auth.ts`
- [Runtime configuration](https://github.com/youyo/seekio/blob/main/src/config.ts): `src/config.ts`
- [Structured logging](https://github.com/youyo/seekio/blob/main/src/log.ts): `src/log.ts`

### MCP tools

- [MCP server registration](https://github.com/youyo/seekio/blob/main/src/mcp/server.ts): `src/mcp/server.ts`
- [Create upload](https://github.com/youyo/seekio/blob/main/src/mcp/tools/create-upload.ts): `src/mcp/tools/create-upload.ts`
- [Import video URL](https://github.com/youyo/seekio/blob/main/src/mcp/tools/import-url.ts): `src/mcp/tools/import-url.ts`
- [Video status](https://github.com/youyo/seekio/blob/main/src/mcp/tools/info.ts): `src/mcp/tools/info.ts`
- [Timeline overview](https://github.com/youyo/seekio/blob/main/src/mcp/tools/overview.ts): `src/mcp/tools/overview.ts`
- [Frame ranges](https://github.com/youyo/seekio/blob/main/src/mcp/tools/frames.ts): `src/mcp/tools/frames.ts`
- [Exact frame](https://github.com/youyo/seekio/blob/main/src/mcp/tools/frame.ts): `src/mcp/tools/frame.ts`
- [Timed transcript](https://github.com/youyo/seekio/blob/main/src/mcp/tools/transcript.ts): `src/mcp/tools/transcript.ts`
- [Delete video](https://github.com/youyo/seekio/blob/main/src/mcp/tools/delete.ts): `src/mcp/tools/delete.ts`

### Video processing

- [Video backend interface](https://github.com/youyo/seekio/blob/main/src/video/backend.ts): `src/video/backend.ts`
- [Timestamp validation](https://github.com/youyo/seekio/blob/main/src/video/timestamps.ts): `src/video/timestamps.ts`
- [Frame content formatting](https://github.com/youyo/seekio/blob/main/src/video/frame.ts): `src/video/frame.ts`
- [Region geometry](https://github.com/youyo/seekio/blob/main/src/video/region.ts): `src/video/region.ts`
- [Caption parsing](https://github.com/youyo/seekio/blob/main/src/video/vtt.ts): `src/video/vtt.ts`
- [Retention cleanup](https://github.com/youyo/seekio/blob/main/src/video/cleanup.ts): `src/video/cleanup.ts`

### Cloudflare services

- [Cloudflare Stream](https://github.com/youyo/seekio/blob/main/src/video/cloudflare-stream.ts): `src/video/cloudflare-stream.ts`
- [Region cropper](https://github.com/youyo/seekio/blob/main/src/video/image.ts): `src/video/image.ts`

### Other components

- **MCP client**

## Connections

- MCP client → HTTP and cron worker: calls MCP (evidence: `README.md`)
- HTTP and cron worker → Request authorization: authorizes (evidence: `src/index.ts`)
- HTTP and cron worker → Runtime configuration: resolves (evidence: `src/index.ts`)
- HTTP and cron worker → MCP server registration: creates (evidence: `src/index.ts`)
- HTTP and cron worker → Cloudflare Stream: constructs backend (evidence: `src/index.ts`)
- HTTP and cron worker → Region cropper: configures optionally (evidence: `src/index.ts`)
- HTTP and cron worker → Retention cleanup: runs scheduled (evidence: `src/index.ts`)
- MCP server registration → Create upload: registers (evidence: `src/mcp/server.ts`)
- MCP server registration → Import video URL: registers (evidence: `src/mcp/server.ts`)
- MCP server registration → Video status: registers (evidence: `src/mcp/server.ts`)
- MCP server registration → Timeline overview: registers (evidence: `src/mcp/server.ts`)
- MCP server registration → Frame ranges: registers (evidence: `src/mcp/server.ts`)
- MCP server registration → Exact frame: registers (evidence: `src/mcp/server.ts`)
- MCP server registration → Timed transcript: registers (evidence: `src/mcp/server.ts`)
- MCP server registration → Delete video: registers (evidence: `src/mcp/server.ts`)
- Create upload → Video backend interface: uses
- Import video URL → Video backend interface: uses
- Video status → Video backend interface: reads status (evidence: `src/mcp/tools/info.ts`)
- Timeline overview → Video backend interface: fetches frames
- Frame ranges → Video backend interface: fetches frames
- Exact frame → Video backend interface: fetches frame (evidence: `src/mcp/tools/frame.ts`)
- Timed transcript → Video backend interface: gets captions (evidence: `src/mcp/tools/transcript.ts`)
- Delete video → Video backend interface: deletes video
- Video backend interface → Cloudflare Stream: implemented by (evidence: `README.md`)
- Timeline overview → Timestamp validation: selects times (evidence: `src/mcp/tools/overview.ts`)
- Frame ranges → Timestamp validation: validates range (evidence: `src/mcp/tools/frames.ts`)
- Exact frame → Timestamp validation: validates timestamp (evidence: `src/mcp/tools/frame.ts`)
- Exact frame → Frame content formatting: formats image result (evidence: `src/mcp/tools/frame.ts`)
- Exact frame → Region geometry: validates crop (evidence: `src/mcp/tools/frame.ts`)
- Exact frame → Region cropper: crops optionally (evidence: `src/mcp/tools/frame.ts`)
- Timed transcript → Caption parsing: parses captions (evidence: `src/mcp/tools/transcript.ts`)
- Retention cleanup → Video backend interface: lists and deletes (evidence: `src/video/cleanup.ts`)
- Retention cleanup → Cloudflare Stream: acts through backend
- HTTP and cron worker → Structured logging: records outcomes (evidence: `src/index.ts`)
