@cutpro/mcp 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +167 -67
  2. package/dist/index.js +279 -124
  3. package/package.json +12 -4
package/README.md CHANGED
@@ -1,59 +1,62 @@
1
- # @cutpro/mcp
1
+ ## CutPro MCP
2
2
 
3
- MCP server that exposes the public CutPro v1 API as tools, so AI clients can drive
4
- the full clipping flow: **analyze → submit → poll → list clips → render → download**,
5
- plus balance and templates.
3
+ [![npm version](https://img.shields.io/npm/v/@cutpro/mcp?style=flat-square&color=7C3AED)](https://www.npmjs.com/package/@cutpro/mcp)
4
+ [![MCP Registry](https://img.shields.io/badge/MCP_Registry-io.github.getcutpro%2Fcutpro-7C3AED?style=flat-square)](https://registry.modelcontextprotocol.io)
5
+ [![smithery badge](https://smithery.ai/badge/contact-8lma/cutpro)](https://smithery.ai/servers/contact-8lma/cutpro)
6
6
 
7
- Built to work **everywhere** and to be **token-efficient**.
7
+ A Model Context Protocol (MCP) server that turns long videos into viral clips with AI. It exposes the full [CutPro API](https://cut.pro/docs/api-reference) as tools, so an LLM can run the whole flow: analyze a video, clip the best moments, render the final MP4, and publish to TikTok, Instagram and YouTube.
8
8
 
9
- ## Tools
9
+ ### Key features
10
10
 
11
- All 34 v1 endpoints are exposed, grouped by resource:
11
+ - **End to end**. All 34 v1 endpoints as tools: workspace, balance, videos, clipping, clips, templates, renders, posts and connections.
12
+ - **Token efficient**. Results are compact and projected to the fields that matter; `list_clips` is rating sorted, capped, and omits long signed URLs unless asked.
13
+ - **Runs everywhere**. stdio for local clients (Claude Code, Cursor, Claude Desktop, Windsurf, VS Code, Cline, Zed) and a hosted Streamable HTTP endpoint with OAuth for ChatGPT and Claude.ai.
12
14
 
13
- - **Workspace & balance**: `get_workspace`, `get_balance`, `get_balance_history`
14
- - **Videos & uploads**: `list_videos`, `delete_video`, `start_upload`, `complete_upload`
15
- - **Clipping**: `analyze_video`, `submit_clipping`, `list_submissions`, `get_submission`, `delete_submission`
16
- - **Clips**: `list_clips`, `apply_template`, `delete_clip`
17
- - **Templates**: `list_templates`
18
- - **Renders**: `render_clip`, `list_renders`, `get_render`, `get_render_download`, `cancel_render`, `get_render_limits`, `start_bulk_download`, `get_bulk_download`
19
- - **Posts (publishing)**: `create_post`, `list_posts`, `get_post`, `update_post`, `publish_post`, `retry_post_item`, `delete_post_item`, `delete_post`
20
- - **Connections**: `list_connections`, `get_connection`
15
+ ## Getting started
21
16
 
22
- Each tool carries read-only / write / destructive annotations so clients can plan calls.
17
+ ### Requirements
23
18
 
24
- ## Token efficiency
19
+ - Node.js 18 or newer.
20
+ - A CutPro account on the **Pro** plan and an API key. Generate one at [cut.pro/studio/me/api-keys](https://cut.pro/studio/me/api-keys).
21
+ - An MCP-compatible client.
25
22
 
26
- - Results are **compact JSON** (no pretty-print) and **projected** to the fields
27
- that matter, dropping null/empty values.
28
- - `list_clips` is **rating-sorted**, capped (`limit`, default 10), and **omits the
29
- long signed URLs** unless `include_urls: true`.
30
- - Tools carry read-only / open-world **annotations** so clients can plan calls.
23
+ ### Standard config
31
24
 
32
- ## Setup
25
+ Most clients use the same JSON. Add your API key under `env`:
33
26
 
34
- ```bash
35
- bun install
36
- cp .env.example .env # set CUTPRO_API_KEY
27
+ ```json
28
+ {
29
+ "mcpServers": {
30
+ "cutpro": {
31
+ "command": "npx",
32
+ "args": ["-y", "@cutpro/mcp"],
33
+ "env": { "CUTPRO_API_KEY": "<your-api-key>" }
34
+ }
35
+ }
36
+ }
37
37
  ```
38
38
 
39
- API access requires the **Pro** plan. Generate a key at
40
- [cut.pro/studio/me/api-keys](https://cut.pro/studio/me/api-keys).
39
+ ### Install
41
40
 
42
- ## Transports
41
+ [<img src="https://img.shields.io/badge/VS_Code-Install_Server-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white" alt="Install in VS Code">](https://insiders.vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522cutpro%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522-y%2522%252C%2522%2540cutpro%252Fmcp%2522%255D%257D)
42
+ [<img src="https://img.shields.io/badge/Cursor-Install_Server-000000?style=flat-square&logo=cursor&logoColor=white" alt="Install in Cursor">](https://cursor.com/en/install-mcp?name=cutpro&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBjdXRwcm8vbWNwIl19)
43
+ [<img src="https://img.shields.io/badge/LM_Studio-Install_Server-4A26C9?style=flat-square" alt="Install in LM Studio">](https://lmstudio.ai/install-mcp?name=cutpro&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBjdXRwcm8vbWNwIl19)
44
+ [<img src="https://img.shields.io/badge/Goose-Install_Server-1A1A1A?style=flat-square" alt="Install in Goose">](goose://extension?cmd=npx&arg=-y&arg=%40cutpro%2Fmcp&id=cutpro&name=CutPro&description=AI%20video%20clipping%20via%20the%20CutPro%20API)
43
45
 
44
- ### stdio (default all local clients)
46
+ After installing via a button, add your `CUTPRO_API_KEY` to the server's `env`.
45
47
 
46
- Works with Claude Code, Claude Desktop, Cursor, Windsurf, VS Code, Cline, Zed, and
47
- any other local MCP client. The client launches the process; it speaks MCP over
48
- stdio. Set `CUTPRO_API_KEY` in the client's `env`.
49
-
50
- **Claude Code**
48
+ <details>
49
+ <summary>Claude Code</summary>
51
50
 
52
51
  ```bash
53
- claude mcp add cutpro --env CUTPRO_API_KEY=SUA_CHAVE -- npx -y @cutpro/mcp
52
+ claude mcp add cutpro --env CUTPRO_API_KEY=<your-api-key> -- npx -y @cutpro/mcp
54
53
  ```
54
+ </details>
55
+
56
+ <details>
57
+ <summary>Claude Desktop</summary>
55
58
 
56
- **Claude Desktop / Cursor / Windsurf / VS Code** (`mcpServers` config):
59
+ Add to `claude_desktop_config.json` (Settings, Developer, Edit Config):
57
60
 
58
61
  ```json
59
62
  {
@@ -61,57 +64,154 @@ claude mcp add cutpro --env CUTPRO_API_KEY=SUA_CHAVE -- npx -y @cutpro/mcp
61
64
  "cutpro": {
62
65
  "command": "npx",
63
66
  "args": ["-y", "@cutpro/mcp"],
64
- "env": { "CUTPRO_API_KEY": "SUA_CHAVE" }
67
+ "env": { "CUTPRO_API_KEY": "<your-api-key>" }
65
68
  }
66
69
  }
67
70
  }
68
71
  ```
72
+ </details>
69
73
 
70
- Until published to npm, replace `npx -y @cutpro/mcp` with
71
- `bun run /path/to/cutpro-mcp/src/index.ts`.
74
+ <details>
75
+ <summary>Cursor / Windsurf / VS Code (manual)</summary>
72
76
 
73
- ### Streamable HTTP (remote / self-host)
77
+ Add the standard config above to the client's MCP settings (`mcp.json` / `mcpServers`).
78
+ </details>
74
79
 
75
- ```bash
76
- MCP_TRANSPORT=http PORT=8787 bun run src/index.ts # serves /mcp
77
- ```
80
+ <details>
81
+ <summary>Cline</summary>
78
82
 
79
- The endpoint is stateless. The key is read **per request** from
80
- `Authorization: Bearer <key>` or `X-Api-Key` (env key is the fallback), and
81
- `X-Workspace-Id` is honored, so one deployment can serve many users.
83
+ Open the MCP Servers panel, choose Configure, and add the standard config above.
84
+ </details>
82
85
 
83
- ### OAuth 2.1 (browser clients: ChatGPT, Claude.ai)
86
+ <details>
87
+ <summary>Gemini CLI</summary>
84
88
 
85
89
  ```bash
86
- MCP_TRANSPORT=http PORT=8787 MCP_OAUTH=1 MCP_PUBLIC_URL=https://mcp.cut.pro bun run src/index.ts
90
+ gemini mcp add cutpro npx -y @cutpro/mcp -e CUTPRO_API_KEY=<your-api-key>
87
91
  ```
92
+ </details>
88
93
 
89
- With `MCP_OAUTH=1` the server becomes a full OAuth 2.1 authorization server
90
- (metadata discovery, Dynamic Client Registration, PKCE, token + refresh,
91
- revocation) using the MCP SDK helpers. The flow:
94
+ <details>
95
+ <summary>Codex</summary>
92
96
 
93
- 1. The client (ChatGPT/Claude.ai) discovers the server via the `WWW-Authenticate`
94
- header on the `401` from `/mcp` and registers itself.
95
- 2. The user is sent to a **consent page** where they paste their CutPro API key.
96
- 3. The key is validated against the API; on success a code → access token is
97
- issued. The token maps server-side to that key.
98
- 4. `/mcp` is protected by bearer auth; each call uses the token's key.
97
+ Add to `~/.codex/config.toml`:
99
98
 
100
- `MCP_PUBLIC_URL` is the public endpoint (e.g. `https://mcp.cut.pro`); its origin
101
- becomes the OAuth issuer. Token/code/client stores are **in-memory** — fine for a
102
- single instance; back them with Redis/DB for HA.
99
+ ```toml
100
+ [mcp_servers.cutpro]
101
+ command = "npx"
102
+ args = ["-y", "@cutpro/mcp"]
103
+ env = { "CUTPRO_API_KEY" = "<your-api-key>" }
104
+ ```
105
+ </details>
106
+
107
+ <details>
108
+ <summary>ChatGPT and Claude.ai (hosted, no install)</summary>
103
109
 
104
- **Hosting**: run it on a dedicated host at the root and point a reverse proxy at it:
110
+ Use the hosted server. Add a custom connector pointing to:
105
111
 
106
112
  ```
107
- your-mcp-host { reverse_proxy localhost:8787 }
113
+ https://mcp.cut.pro
108
114
  ```
109
115
 
110
- To connect to the hosted instance: add `https://mcp.cut.pro` as a custom connector
111
- in ChatGPT or Claude.ai and complete the consent step.
116
+ You authorize with your CutPro API key on a consent page (OAuth), so no local setup is needed.
117
+ </details>
118
+
119
+ ## Configuration
120
+
121
+ The server is configured with environment variables.
112
122
 
113
- ## Build
123
+ | Variable | Description | Required |
124
+ | --- | --- | --- |
125
+ | `CUTPRO_API_KEY` | Your CutPro API key (Pro plan). | Yes (stdio) |
126
+ | `CUTPRO_WORKSPACE_ID` | Selects the workspace for multi-workspace keys. | No |
127
+ | `CUTPRO_API_URL` | Override the API base URL. Defaults to `https://api.cut.pro/api/v1`. | No |
128
+
129
+ <details>
130
+ <summary>Self-hosting the remote (Streamable HTTP + OAuth)</summary>
131
+
132
+ | Variable | Description |
133
+ | --- | --- |
134
+ | `MCP_TRANSPORT=http` / `PORT` | Serve Streamable HTTP at the root instead of stdio. |
135
+ | `MCP_OAUTH=1` | Enable the full OAuth 2.1 layer (discovery, DCR, PKCE) for browser clients. |
136
+ | `MCP_PUBLIC_URL` | Public endpoint, e.g. `https://mcp.cut.pro`. Its origin becomes the OAuth issuer. |
137
+ | `MCP_REDIS_URL` | Back OAuth state with Redis so it survives restarts and scales across instances. |
114
138
 
115
139
  ```bash
116
- bun run build # outputs dist/index.js
140
+ MCP_TRANSPORT=http PORT=8787 MCP_OAUTH=1 \
141
+ MCP_PUBLIC_URL=https://mcp.cut.pro MCP_REDIS_URL=redis://127.0.0.1:6379 \
142
+ npx -y @cutpro/mcp
117
143
  ```
144
+
145
+ In OAuth mode the user authorizes with their own API key on a consent page; the access token maps server side to that key. Without `MCP_REDIS_URL`, an in-memory store is used (single instance, state lost on restart).
146
+ </details>
147
+
148
+ ## Tools
149
+
150
+ <details>
151
+ <summary>Workspace and balance</summary>
152
+
153
+ - **get_workspace**: the workspace this key resolved to, with plan and role.
154
+ - **get_balance**: current credit balance.
155
+ - **get_balance_history**: ledger of credits added and consumed.
156
+ </details>
157
+
158
+ <details>
159
+ <summary>Videos and uploads</summary>
160
+
161
+ - **list_videos**: your source video library.
162
+ - **start_upload**: get a presigned URL to upload your own file (max 2 GB; .mp4/.mov/.webm/.mkv).
163
+ - **complete_upload**: register a finished upload and get its credit cost.
164
+ - **delete_video**: delete a source video and its submissions.
165
+ </details>
166
+
167
+ <details>
168
+ <summary>Clipping</summary>
169
+
170
+ - **analyze_video**: preview metadata and credit cost of a public URL (free).
171
+ - **submit_clipping**: start AI clipping (charges credits).
172
+ - **list_submissions**: clipping jobs for a video.
173
+ - **get_submission**: poll a submission until completed or failed.
174
+ - **delete_submission**: delete a submission and its clips.
175
+ </details>
176
+
177
+ <details>
178
+ <summary>Clips and templates</summary>
179
+
180
+ - **list_clips**: clips of a completed submission, rating sorted (URLs opt-in).
181
+ - **apply_template**: apply an editing template to clips in bulk.
182
+ - **delete_clip**: delete a single clip.
183
+ - **list_templates**: editing templates to apply to clips.
184
+ </details>
185
+
186
+ <details>
187
+ <summary>Renders</summary>
188
+
189
+ - **render_clip**: render a clip to a final MP4.
190
+ - **get_render**: poll a render until completed.
191
+ - **get_render_download**: signed download URL of a completed render.
192
+ - **cancel_render**: cancel or delete a render.
193
+ - **get_render_limits**: render quota for the workspace.
194
+ - **start_bulk_download** / **get_bulk_download**: bundle several renders into one download.
195
+ </details>
196
+
197
+ <details>
198
+ <summary>Posts and connections</summary>
199
+
200
+ - **create_post**: publish rendered clips to connected accounts (immediate or scheduled).
201
+ - **list_posts** / **get_post** / **update_post** / **delete_post**: manage posts.
202
+ - **publish_post**: trigger publishing now.
203
+ - **retry_post_item** / **delete_post_item**: handle individual targets.
204
+ - **list_connections** / **get_connection**: connected social accounts.
205
+ </details>
206
+
207
+ Each tool carries read-only / write / destructive annotations so clients can plan calls.
208
+
209
+ ## Links
210
+
211
+ - Docs: [cut.pro/docs/api-reference/mcp](https://cut.pro/docs/api-reference/mcp)
212
+ - npm: [@cutpro/mcp](https://www.npmjs.com/package/@cutpro/mcp)
213
+ - MCP Registry: `io.github.getcutpro/cutpro`
214
+
215
+ ## License
216
+
217
+ MIT