# moonlin1213/cove-sticker-mcp architecture

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

- Interactive diagram: https://gitdiagram.com/moonlin1213/cove-sticker-mcp
- Repository: https://github.com/moonlin1213/cove-sticker-mcp

## Overview

cove-sticker-mcp is a local-first sticker library exposed through a web manager and MCP server. Users import and manage images, optionally generate tags with a configured vision provider, then search or let an agent select a sticker under frequency and recent-use policies. The graph includes backup/restore, feedback, and both MCP transports as documented capabilities. Source excerpts show key calls, but not every route or library operation; documented relationships use README evidence, and uncertain internal links are omitted.

Main entry points: [`src/sticker_mcp/library.py`](https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/library.py) (Library Operations), [`src/sticker_mcp/web.py`](https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/web.py) (Web Manager), [`src/sticker_mcp/mcp_server.py`](https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/mcp_server.py) (MCP Tools), [`src/sticker_mcp/cli.py`](https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/cli.py) (CLI Services)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User Interfaces"]
  node_manager["Web Manager<br/>[web.py]"]
  node_manager_ui["Manager UI<br/>[index.html]"]
  node_mcp["MCP Tools<br/>[mcp_server.py]"]
  node_cli["CLI Services<br/>[cli.py]"]
end

subgraph group_domain["Sticker Library"]
  node_library["Library Operations<br/>[library.py]"]
  node_asset_validation["Image Validation<br/>[assets.py]"]
  node_sticker_models["Sticker Models<br/>[models.py]"]
  node_url_validation["Provider URL Validation<br/>[urls.py]"]
  node_backup_restore["Backup and Restore<br/>[library.py]"]
  node_search_pick["Search and Selection<br/>[library.py]"]
  node_feedback_settings["Feedback and Preferences<br/>[library.py]"]
end

subgraph group_vision["Vision Tagging"]
  node_vision_queue["Tag Job Queue<br/>[vision.py]"]
  node_vision_provider["Vision Provider<br/>[vision.py]"]
end

subgraph group_state["Local State"]
  node_sqlite[("Library Database<br/>[storage.py]")]
  node_asset_files[("Image Files<br/>[assets.py]")]
end

node_agent(("MCP Client"))
node_human(("Library User"))
node_provider_service(("Vision Service"))

node_human -->|"manages library"| node_manager_ui
node_manager_ui -->|"sends requests"| node_manager
node_manager -->|"handles operations"| node_library
node_library -->|"validates images"| node_asset_validation
node_library -->|"reads and writes"| node_sqlite
node_library -->|"stores image bytes"| node_asset_files
node_library -->|"uses data models"| node_sticker_models
node_library -->|"validates endpoints"| node_url_validation
node_manager -->|"queues tagging"| node_vision_queue
node_vision_queue -->|"requests tags"| node_vision_provider
node_vision_provider -.->|"sends preview"| node_provider_service
node_vision_queue -->|"applies metadata"| node_library
node_manager -->|"tests configuration"| node_vision_provider
node_manager -->|"exports and restores"| node_backup_restore
node_manager -->|"edits preferences"| node_feedback_settings
node_agent -->|"calls tools"| node_mcp
node_mcp -->|"selects and retrieves"| node_library
node_mcp -->|"requests selection"| node_search_pick
node_mcp -->|"uses policies"| node_feedback_settings
node_cli -->|"builds services"| node_library
node_cli -->|"starts MCP"| node_mcp
node_cli -->|"starts web app"| node_manager
node_cli -->|"configures tagging"| node_vision_queue
node_mcp -->|"mounts web routes"| node_manager

click node_manager "https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/web.py"
click node_manager_ui "https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/static/index.html"
click node_mcp "https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/mcp_server.py"
click node_cli "https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/cli.py"
click node_library "https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/library.py"
click node_asset_validation "https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/assets.py"
click node_sticker_models "https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/models.py"
click node_url_validation "https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/urls.py"
click node_vision_queue "https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/vision.py"
click node_vision_provider "https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/vision.py"
click node_sqlite "https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/storage.py"
click node_asset_files "https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/assets.py"
click node_backup_restore "https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/library.py"
click node_search_pick "https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/library.py"
click node_feedback_settings "https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/library.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_manager,node_manager_ui,node_mcp,node_cli,node_agent,node_human toneBlue
class node_library,node_asset_validation,node_sticker_models,node_url_validation,node_backup_restore,node_search_pick,node_feedback_settings toneAmber
class node_vision_queue,node_vision_provider toneMint
class node_sqlite,node_asset_files toneRose
class node_provider_service toneIndigo
```

## Components

### User Interfaces

- [Web Manager](https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/web.py): `src/sticker_mcp/web.py`
- [Manager UI](https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/static/index.html): `src/sticker_mcp/static/index.html`
- [MCP Tools](https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/mcp_server.py): `src/sticker_mcp/mcp_server.py`
- [CLI Services](https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/cli.py): `src/sticker_mcp/cli.py`

### Sticker Library

- [Library Operations](https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/library.py): `src/sticker_mcp/library.py`
- [Image Validation](https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/assets.py): `src/sticker_mcp/assets.py`
- [Sticker Models](https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/models.py): `src/sticker_mcp/models.py`
- [Provider URL Validation](https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/urls.py): `src/sticker_mcp/urls.py`
- [Backup and Restore](https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/library.py): `src/sticker_mcp/library.py`
- [Search and Selection](https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/library.py): `src/sticker_mcp/library.py`
- [Feedback and Preferences](https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/library.py): `src/sticker_mcp/library.py`

### Vision Tagging

- [Tag Job Queue](https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/vision.py): `src/sticker_mcp/vision.py`
- [Vision Provider](https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/vision.py): `src/sticker_mcp/vision.py`

### Local State

- [Library Database](https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/storage.py): `src/sticker_mcp/storage.py`
- [Image Files](https://github.com/moonlin1213/cove-sticker-mcp/blob/main/src/sticker_mcp/assets.py): `src/sticker_mcp/assets.py`

### Other components

- **MCP Client**
- **Library User**
- **Vision Service**

## Connections

- Library User → Manager UI: manages library (evidence: `README.md`)
- Manager UI → Web Manager: sends requests (evidence: `README.md`)
- Web Manager → Library Operations: handles operations (evidence: `src/sticker_mcp/web.py`)
- Library Operations → Image Validation: validates images (evidence: `src/sticker_mcp/library.py`)
- Library Operations → Library Database: reads and writes (evidence: `src/sticker_mcp/library.py`)
- Library Operations → Image Files: stores image bytes (evidence: `src/sticker_mcp/library.py`)
- Library Operations → Sticker Models: uses data models (evidence: `src/sticker_mcp/library.py`)
- Library Operations → Provider URL Validation: validates endpoints (evidence: `src/sticker_mcp/library.py`)
- Web Manager → Tag Job Queue: queues tagging (evidence: `src/sticker_mcp/web.py`)
- Tag Job Queue → Vision Provider: requests tags (evidence: `src/sticker_mcp/vision.py`)
- Vision Provider → Vision Service: sends preview (evidence: `README.md`)
- Tag Job Queue → Library Operations: applies metadata (evidence: `src/sticker_mcp/vision.py`)
- Web Manager → Vision Provider: tests configuration (evidence: `src/sticker_mcp/web.py`)
- Web Manager → Backup and Restore: exports and restores (evidence: `README.md`)
- Web Manager → Feedback and Preferences: edits preferences (evidence: `src/sticker_mcp/web.py`)
- MCP Client → MCP Tools: calls tools (evidence: `README.md`)
- MCP Tools → Library Operations: selects and retrieves (evidence: `src/sticker_mcp/mcp_server.py`)
- MCP Tools → Search and Selection: requests selection (evidence: `src/sticker_mcp/mcp_server.py`)
- MCP Tools → Feedback and Preferences: uses policies (evidence: `README.md`)
- CLI Services → Library Operations: builds services (evidence: `src/sticker_mcp/cli.py`)
- CLI Services → MCP Tools: starts MCP (evidence: `src/sticker_mcp/cli.py`)
- CLI Services → Web Manager: starts web app (evidence: `src/sticker_mcp/cli.py`)
- CLI Services → Tag Job Queue: configures tagging (evidence: `src/sticker_mcp/cli.py`)
- MCP Tools → Web Manager: mounts web routes (evidence: `src/sticker_mcp/mcp_server.py`)
