# sun-guannan/vectcutapi architecture

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

- Interactive diagram: https://gitdiagram.com/sun-guannan/vectcutapi
- Repository: https://github.com/sun-guannan/vectcutapi

## Overview

VectCutAPI exposes video-editing workflows through an HTTP API and an MCP interface. An agent or API client creates a draft, adds timeline media and effects, then saves or previews the project; the MCP tools forward operations to the HTTP API. The repository also includes draft serialization/profile support, project download and preview capabilities, and Jianying/CapCut desktop automation. README claims and filenames establish several feature areas, but unsampled handlers limit confidence in their internal wiring.

Main entry points: [`capcut_server.py`](https://github.com/sun-guannan/vectcutapi/blob/main/capcut_server.py) (HTTP API), [`pyJianYingDraft/script_file.py`](https://github.com/sun-guannan/vectcutapi/blob/main/pyJianYingDraft/script_file.py) (Draft serialization), [`save_draft_impl.py`](https://github.com/sun-guannan/vectcutapi/blob/main/save_draft_impl.py) (Save draft), [`mcp-server/src/index.ts`](https://github.com/sun-guannan/vectcutapi/blob/main/mcp-server/src/index.ts) (MCP server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["Client interfaces"]
  node_capcut_server["HTTP API<br/>[capcut_server.py]"]
  node_mcp_entry["MCP server<br/>[index.ts]"]
  node_mcp_tools["MCP tools<br/>[index.ts]"]
  node_api_client["API client service<br/>[api-client.ts]"]
end

subgraph group_editing["Editing operations"]
  node_create["Draft creation<br/>[create_draft.py]"]
  node_video["Video tracks<br/>[add_video_track.py]"]
  node_audio["Audio tracks<br/>[add_audio_track.py]"]
  node_image["Images<br/>[add_image_impl.py]"]
  node_text["Text and titles<br/>[add_text_impl.py]"]
  node_subtitles["Subtitles"]
  node_stickers["Stickers"]
  node_effects["Effects<br/>[add_effect_impl.py]"]
  node_keyframes["Keyframe animation"]
  node_analysis["Media analysis"]
end

subgraph group_draft["Draft engine"]
  node_draft_model["Draft serialization<br/>[script_file.py]"]
  node_profiles["Draft profiles<br/>[draft_profiles.py]"]
  node_save["Save draft<br/>[save_draft_impl.py]"]
end

subgraph group_delivery["Preview and delivery"]
  node_preview["Web preview<br/>[web_preview.py]"]
  node_downloader["Draft download<br/>[downloader.py]"]
  node_oss["Object storage<br/>[oss.py]"]
  node_desktop["Desktop automation"]
end

node_agent(("Editing agent"))
node_api_user(("API client"))
node_editor(("CapCut / Jianying"))

node_agent -->|"connects to"| node_mcp_entry
node_mcp_entry -->|"registers"| node_mcp_tools
node_mcp_tools -->|"calls"| node_api_client
node_api_client -->|"HTTP requests"| node_capcut_server
node_api_user -->|"sends requests"| node_capcut_server
node_capcut_server -->|"dispatches"| node_create
node_capcut_server -->|"dispatches"| node_video
node_capcut_server -->|"dispatches"| node_audio
node_capcut_server -->|"dispatches"| node_image
node_capcut_server -->|"dispatches"| node_text
node_capcut_server -->|"dispatches"| node_subtitles
node_capcut_server -->|"dispatches"| node_stickers
node_capcut_server -->|"dispatches"| node_effects
node_capcut_server -->|"dispatches"| node_keyframes
node_capcut_server -->|"dispatches"| node_analysis
node_create -->|"builds draft"| node_draft_model
node_video -->|"updates timeline"| node_draft_model
node_audio -->|"updates timeline"| node_draft_model
node_image -->|"adds material"| node_draft_model
node_text -->|"adds material"| node_draft_model
node_subtitles -->|"adds material"| node_draft_model
node_stickers -->|"adds material"| node_draft_model
node_effects -->|"updates timeline"| node_draft_model
node_keyframes -->|"animates clips"| node_draft_model
node_capcut_server -->|"dispatches"| node_save
node_save -->|"serializes"| node_draft_model
node_save -->|"selects format"| node_profiles
node_preview -->|"reads draft data"| node_draft_model
node_capcut_server -->|"serves preview"| node_preview
node_capcut_server -->|"dispatches downloads"| node_downloader
node_save -.->|"uploads optionally"| node_oss
node_desktop -.->|"automates export"| node_editor
node_downloader -->|"returns draft"| node_api_user

click node_capcut_server "https://github.com/sun-guannan/vectcutapi/blob/main/capcut_server.py"
click node_mcp_entry "https://github.com/sun-guannan/vectcutapi/blob/main/mcp-server/src/index.ts"
click node_mcp_tools "https://github.com/sun-guannan/vectcutapi/blob/main/mcp-server/src/tools/index.ts"
click node_api_client "https://github.com/sun-guannan/vectcutapi/blob/main/mcp-server/src/services/api-client.ts"
click node_create "https://github.com/sun-guannan/vectcutapi/blob/main/create_draft.py"
click node_video "https://github.com/sun-guannan/vectcutapi/blob/main/add_video_track.py"
click node_audio "https://github.com/sun-guannan/vectcutapi/blob/main/add_audio_track.py"
click node_image "https://github.com/sun-guannan/vectcutapi/blob/main/add_image_impl.py"
click node_text "https://github.com/sun-guannan/vectcutapi/blob/main/add_text_impl.py"
click node_subtitles "https://github.com/sun-guannan/vectcutapi/blob/main/add_subtitle_impl.py"
click node_stickers "https://github.com/sun-guannan/vectcutapi/blob/main/add_sticker_impl.py"
click node_effects "https://github.com/sun-guannan/vectcutapi/blob/main/add_effect_impl.py"
click node_keyframes "https://github.com/sun-guannan/vectcutapi/blob/main/add_video_keyframe_impl.py"
click node_analysis "https://github.com/sun-guannan/vectcutapi/blob/main/get_duration_impl.py"
click node_draft_model "https://github.com/sun-guannan/vectcutapi/blob/main/pyJianYingDraft/script_file.py"
click node_profiles "https://github.com/sun-guannan/vectcutapi/blob/main/draft_profiles.py"
click node_save "https://github.com/sun-guannan/vectcutapi/blob/main/save_draft_impl.py"
click node_preview "https://github.com/sun-guannan/vectcutapi/blob/main/web_preview.py"
click node_downloader "https://github.com/sun-guannan/vectcutapi/blob/main/downloader.py"
click node_oss "https://github.com/sun-guannan/vectcutapi/blob/main/oss.py"
click node_desktop "https://github.com/sun-guannan/vectcutapi/blob/main/pyJianYingDraft/jianying_controller.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_capcut_server,node_mcp_entry,node_mcp_tools,node_api_client,node_api_user toneBlue
class node_create,node_video,node_audio,node_image,node_text,node_subtitles,node_stickers,node_effects,node_keyframes,node_analysis toneAmber
class node_draft_model,node_profiles,node_save toneMint
class node_preview,node_downloader,node_oss,node_desktop toneRose
class node_agent,node_editor toneIndigo
```

## Components

### Client interfaces

- [HTTP API](https://github.com/sun-guannan/vectcutapi/blob/main/capcut_server.py): `capcut_server.py`
- [MCP server](https://github.com/sun-guannan/vectcutapi/blob/main/mcp-server/src/index.ts): `mcp-server/src/index.ts`
- [MCP tools](https://github.com/sun-guannan/vectcutapi/blob/main/mcp-server/src/tools/index.ts): `mcp-server/src/tools/index.ts`
- [API client service](https://github.com/sun-guannan/vectcutapi/blob/main/mcp-server/src/services/api-client.ts): `mcp-server/src/services/api-client.ts`

### Editing operations

- [Draft creation](https://github.com/sun-guannan/vectcutapi/blob/main/create_draft.py): `create_draft.py`
- [Video tracks](https://github.com/sun-guannan/vectcutapi/blob/main/add_video_track.py): `add_video_track.py`
- [Audio tracks](https://github.com/sun-guannan/vectcutapi/blob/main/add_audio_track.py): `add_audio_track.py`
- [Images](https://github.com/sun-guannan/vectcutapi/blob/main/add_image_impl.py): `add_image_impl.py`
- [Text and titles](https://github.com/sun-guannan/vectcutapi/blob/main/add_text_impl.py): `add_text_impl.py`
- [Subtitles](https://github.com/sun-guannan/vectcutapi/blob/main/add_subtitle_impl.py): `add_subtitle_impl.py`
- [Stickers](https://github.com/sun-guannan/vectcutapi/blob/main/add_sticker_impl.py): `add_sticker_impl.py`
- [Effects](https://github.com/sun-guannan/vectcutapi/blob/main/add_effect_impl.py): `add_effect_impl.py`
- [Keyframe animation](https://github.com/sun-guannan/vectcutapi/blob/main/add_video_keyframe_impl.py): `add_video_keyframe_impl.py`
- [Media analysis](https://github.com/sun-guannan/vectcutapi/blob/main/get_duration_impl.py): `get_duration_impl.py`

### Draft engine

- [Draft serialization](https://github.com/sun-guannan/vectcutapi/blob/main/pyJianYingDraft/script_file.py): `pyJianYingDraft/script_file.py`
- [Draft profiles](https://github.com/sun-guannan/vectcutapi/blob/main/draft_profiles.py): `draft_profiles.py`
- [Save draft](https://github.com/sun-guannan/vectcutapi/blob/main/save_draft_impl.py): `save_draft_impl.py`

### Preview and delivery

- [Web preview](https://github.com/sun-guannan/vectcutapi/blob/main/web_preview.py): `web_preview.py`
- [Draft download](https://github.com/sun-guannan/vectcutapi/blob/main/downloader.py): `downloader.py`
- [Object storage](https://github.com/sun-guannan/vectcutapi/blob/main/oss.py): `oss.py`
- [Desktop automation](https://github.com/sun-guannan/vectcutapi/blob/main/pyJianYingDraft/jianying_controller.py): `pyJianYingDraft/jianying_controller.py`

### Other components

- **Editing agent**
- **API client**
- **CapCut / Jianying**

## Connections

- Editing agent → MCP server: connects to
- MCP server → MCP tools: registers
- MCP tools → API client service: calls
- API client service → HTTP API: HTTP requests
- API client → HTTP API: sends requests
- HTTP API → Draft creation: dispatches
- HTTP API → Video tracks: dispatches
- HTTP API → Audio tracks: dispatches
- HTTP API → Images: dispatches
- HTTP API → Text and titles: dispatches
- HTTP API → Subtitles: dispatches
- HTTP API → Stickers: dispatches
- HTTP API → Effects: dispatches
- HTTP API → Keyframe animation: dispatches
- HTTP API → Media analysis: dispatches
- Draft creation → Draft serialization: builds draft
- Video tracks → Draft serialization: updates timeline
- Audio tracks → Draft serialization: updates timeline
- Images → Draft serialization: adds material
- Text and titles → Draft serialization: adds material
- Subtitles → Draft serialization: adds material
- Stickers → Draft serialization: adds material
- Effects → Draft serialization: updates timeline
- Keyframe animation → Draft serialization: animates clips
- HTTP API → Save draft: dispatches
- Save draft → Draft serialization: serializes
- Save draft → Draft profiles: selects format
- Web preview → Draft serialization: reads draft data
- HTTP API → Web preview: serves preview
- HTTP API → Draft download: dispatches downloads
- Save draft → Object storage: uploads optionally
- Desktop automation → CapCut / Jianying: automates export
- Draft download → API client: returns draft
