@hubfluencer/mcp 0.1.0
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.
- package/LICENSE +21 -0
- package/README.md +110 -0
- package/dist/index.js +30790 -0
- package/dist/login.js +377 -0
- package/package.json +51 -0
- package/src/client.ts +206 -0
- package/src/core.ts +244 -0
- package/src/credentials.ts +48 -0
- package/src/index.ts +2310 -0
- package/src/login.ts +129 -0
- package/src/uploads.ts +369 -0
- package/tsconfig.json +19 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Monocursive
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# @hubfluencer/mcp
|
|
2
|
+
|
|
3
|
+
A [Model Context Protocol](https://modelcontextprotocol.io) server that lets an AI agent
|
|
4
|
+
(e.g. Claude Code) drive Hubfluencer end-to-end: turn a text prompt into a finished,
|
|
5
|
+
post-ready short or multi-scene editor ad.
|
|
6
|
+
|
|
7
|
+
The server is a thin wrapper over the public Hubfluencer REST API. It holds **no state** —
|
|
8
|
+
auth is an opaque bearer token passed through from an env var.
|
|
9
|
+
|
|
10
|
+
## Setup
|
|
11
|
+
|
|
12
|
+
No install step — run it on demand with `npx` (commands below). For local development,
|
|
13
|
+
build from source instead: see [Develop](#develop).
|
|
14
|
+
|
|
15
|
+
### 1. Connect (recommended — no copy-paste)
|
|
16
|
+
|
|
17
|
+
Run the device-link login. It prints a URL + short code; you approve it in the signed-in
|
|
18
|
+
Hubfluencer app, and a scoped access token is saved locally to `~/.hubfluencer/credentials.json`
|
|
19
|
+
(mode 0600) — the MCP server reads it from there automatically.
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npx -y -p @hubfluencer/mcp hubfluencer-login "Claude Code"
|
|
23
|
+
# 1. Open: https://hubfluencer.com/connect?code=ABCD-EFGH
|
|
24
|
+
# 2. Confirm code: ABCDEFGH
|
|
25
|
+
# 3. Click Approve. → ✓ Connected.
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Then register the server (no token env needed — it uses the stored credential):
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
claude mcp add hubfluencer -- npx -y @hubfluencer/mcp
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Alternative: paste an access token
|
|
35
|
+
|
|
36
|
+
Create a token in the app (**Settings → Access tokens**, scoped `video:generate`+`video:read` —
|
|
37
|
+
it **cannot** delete your account, change credentials, publish, or create more tokens), then:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
claude mcp add hubfluencer --env HUBFLUENCER_API_TOKEN=YOUR_TOKEN -- npx -y @hubfluencer/mcp
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
| Env var | Required | Default | Purpose |
|
|
44
|
+
|---|---|---|---|
|
|
45
|
+
| `HUBFLUENCER_API_TOKEN` | no¹ | — | Access token (¹falls back to `~/.hubfluencer/credentials.json` from `login`) |
|
|
46
|
+
| `HUBFLUENCER_BASE_URL` | no | `https://hubfluencer.com` | API base URL |
|
|
47
|
+
| `HUBFLUENCER_OUTPUT_DIR` | no | current working dir | Allowlisted base dir for `save_path` downloads (writes are confined here) |
|
|
48
|
+
|
|
49
|
+
## Tools
|
|
50
|
+
|
|
51
|
+
**One-shot & status**
|
|
52
|
+
|
|
53
|
+
| Tool | What it does |
|
|
54
|
+
|---|---|
|
|
55
|
+
| **`make_video`** | **One shot: prompt → finished MP4** (create → **price** → start → poll → download). Use this by default. Prices the job and checks your balance before charging; pass `dry_run:true` to preview the cost without spending, or `max_credits` to cap it. `kind:"auto"` picks a multi-scene editor ad for ad/promo/story briefs, a short for simple ones (reported as `kind_inferred`). |
|
|
56
|
+
| `create_short` / `generate_short` | Create a short draft (0 credits) / render it (15 credits) |
|
|
57
|
+
| `create_editor_ad` | Create an editor project **and** run autopilot end-to-end |
|
|
58
|
+
| `start_autopilot` | Run autopilot on an **existing** editor draft (e.g. resume a `make_video` `dry_run`, or after topping up) |
|
|
59
|
+
| `get_status` / `wait_for_completion` | Normalized `{stage, terminal, ready, video_url, error}`; block-poll until terminal (bounded) |
|
|
60
|
+
| `download_result` | Get (or save) the finished MP4 URL |
|
|
61
|
+
| `get_credits` / `list_voices` / `list_projects` | Credit balance; narration voices; recent projects |
|
|
62
|
+
|
|
63
|
+
**Granular editor pipeline** — write the scenario / scenes / audio yourself, full control
|
|
64
|
+
|
|
65
|
+
| Tool | What it does |
|
|
66
|
+
|---|---|
|
|
67
|
+
| `create_editor_draft` | Editor project, no autopilot (0 credits) |
|
|
68
|
+
| `generate_scenario` / `set_scenario` | AI-draft the scenario (1 assist) **or** write your own (free) |
|
|
69
|
+
| `get_editor` | Full project state — the review step |
|
|
70
|
+
| `set_scene_count` | Grow/shrink to N scenes (1–20) |
|
|
71
|
+
| `set_segment_prompt` / `generate_segment` / `generate_all_segments` | Write a scene prompt (free); render one (5 credits) or every scene in order |
|
|
72
|
+
| `set_narration_script` / `generate_narration` | Write the voiceover script (free) **or** AI-draft it (1 assist) |
|
|
73
|
+
| `generate_voice` / `generate_music` | TTS voiceover (3 credits) / background music (5 credits) |
|
|
74
|
+
| `render` | Final MP4 (0 credits; auto-charges any still-ungenerated scenes) |
|
|
75
|
+
|
|
76
|
+
**AI assists** — a free daily quota of AI helper calls
|
|
77
|
+
|
|
78
|
+
| Tool | What it does |
|
|
79
|
+
|---|---|
|
|
80
|
+
| `get_ai_assists` / `unlock_ai_assists` | Check the daily quota / spend 1 credit for +10 |
|
|
81
|
+
| `enhance_prompt` / `suggest_next_scene` / `suggest_music_prompt` | AI helpers (1 assist each) |
|
|
82
|
+
|
|
83
|
+
## Typical flow
|
|
84
|
+
|
|
85
|
+
**One shot (recommended):**
|
|
86
|
+
`make_video({ prompt: "an ad for…", save_path: "ad.mp4" })` → returns `{ ready, video_url, saved_to, estimated_credits, available_credits }`.
|
|
87
|
+
It prices the job and only charges if it's affordable (and within `max_credits` if you set one); otherwise it returns
|
|
88
|
+
`charged:false` with the estimate and a free draft slug. Preview first with `make_video({ prompt, dry_run:true })`.
|
|
89
|
+
If it returns `terminal:false`, the render is still going — call `wait_for_completion` with the returned slug.
|
|
90
|
+
|
|
91
|
+
**Granular (control/recovery):**
|
|
92
|
+
`create_short` → `generate_short` → `wait_for_completion {kind:"short"}` → `download_result`, or
|
|
93
|
+
`create_editor_ad` → `wait_for_completion {kind:"editor"}` → `download_result`.
|
|
94
|
+
|
|
95
|
+
> Result URLs are presigned and expire (~24h). Download promptly. Publishing to
|
|
96
|
+
> TikTok/Instagram requires a human-linked social account and is out of scope —
|
|
97
|
+
> return the MP4 + a suggested caption instead.
|
|
98
|
+
|
|
99
|
+
## Develop
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
bun install
|
|
103
|
+
bun run typecheck
|
|
104
|
+
bun run dev # runs the stdio server (talk to it via an MCP client)
|
|
105
|
+
bun run build # emits dist/
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## License
|
|
109
|
+
|
|
110
|
+
[MIT](./LICENSE) © Monocursive
|