post-engineer-mcp 1.0.0 → 1.3.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/README.md +40 -11
- package/dist/client.d.ts +68 -3
- package/dist/client.js +359 -49
- package/dist/client.js.map +1 -1
- package/dist/errors.d.ts +15 -0
- package/dist/errors.js +36 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +76 -47
- package/dist/index.js.map +1 -1
- package/dist/limits.d.ts +14 -0
- package/dist/limits.js +15 -0
- package/dist/limits.js.map +1 -0
- package/dist/tools.d.ts +347 -6
- package/dist/tools.js +342 -71
- package/dist/tools.js.map +1 -1
- package/package.json +12 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Post Engineer MCP Server
|
|
2
2
|
|
|
3
|
-
Public MCP (Model Context Protocol) server for [Post Engineer](https://post-engineer.com/). It lets AI agents (Claude, Cursor, Codex, OpenCode) create personas, generate videos, check generation status, and schedule posts directly on your Post Engineer account.
|
|
3
|
+
Public MCP (Model Context Protocol) server for [Post Engineer](https://post-engineer.com/). It lets AI agents (Claude, Cursor, Codex, and OpenCode) create personas, generate videos, check generation status, and schedule posts directly on your Post Engineer account.
|
|
4
4
|
|
|
5
5
|
## What is https://post-engineer.com/?
|
|
6
6
|
|
|
@@ -13,14 +13,12 @@ Public MCP (Model Context Protocol) server for [Post Engineer](https://post-engi
|
|
|
13
13
|
- Schedule automated posting.
|
|
14
14
|
- Generate and manage API keys at [https://post-engineer.com/api-keys](https://post-engineer.com/api-keys).
|
|
15
15
|
|
|
16
|
-
This MCP package does not replace the site — it connects an AI agent to your account on that site through its API. The default API URL is `https://post-engineer.com`, configurable via `POST_ENGINEER_API_URL`.
|
|
17
|
-
|
|
18
16
|
## Requirements
|
|
19
17
|
|
|
20
|
-
- Node.js 20+
|
|
18
|
+
- Node.js 20.10+
|
|
21
19
|
- API key generated at https://post-engineer.com/api-keys
|
|
22
20
|
|
|
23
|
-
## Use
|
|
21
|
+
## Use
|
|
24
22
|
|
|
25
23
|
Configure your agent (`opencode.json`, `claude_desktop_config.json`, `.mcp.json`, or Cursor settings):
|
|
26
24
|
|
|
@@ -31,7 +29,6 @@ Configure your agent (`opencode.json`, `claude_desktop_config.json`, `.mcp.json`
|
|
|
31
29
|
"type": "local",
|
|
32
30
|
"command": ["npx", "-y", "post-engineer-mcp"],
|
|
33
31
|
"environment": {
|
|
34
|
-
"POST_ENGINEER_API_URL": "https://post-engineer.com",
|
|
35
32
|
"POST_ENGINEER_API_KEY": "<MY_API_KEY>"
|
|
36
33
|
}
|
|
37
34
|
}
|
|
@@ -41,6 +38,29 @@ Configure your agent (`opencode.json`, `claude_desktop_config.json`, `.mcp.json`
|
|
|
41
38
|
|
|
42
39
|
Replace `<MY_API_KEY>` with the key you generated on https://post-engineer.com/api-keys. No repository clone or local build is required.
|
|
43
40
|
|
|
41
|
+
### OpenCode
|
|
42
|
+
|
|
43
|
+
OpenCode uses `mcp` instead of `mcpServers`. Its local MCP tool-discovery timeout defaults to 5 seconds, which can be too short while `npx` downloads the package on the first launch. Set a longer timeout:
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"$schema": "https://opencode.ai/config.json",
|
|
48
|
+
"mcp": {
|
|
49
|
+
"post-engineer": {
|
|
50
|
+
"type": "local",
|
|
51
|
+
"command": ["npx", "-y", "post-engineer-mcp"],
|
|
52
|
+
"environment": {
|
|
53
|
+
"POST_ENGINEER_API_KEY": "<MY_API_KEY>"
|
|
54
|
+
},
|
|
55
|
+
"timeout": 30000,
|
|
56
|
+
"enabled": true
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
If the server was already configured, add only `"timeout": 30000` to its existing entry and restart OpenCode.
|
|
63
|
+
|
|
44
64
|
## Local development
|
|
45
65
|
|
|
46
66
|
```bash
|
|
@@ -49,20 +69,29 @@ pnpm build
|
|
|
49
69
|
pnpm start
|
|
50
70
|
```
|
|
51
71
|
|
|
52
|
-
Set the
|
|
72
|
+
Set your API key locally (defaults to the production API; override with `POST_ENGINEER_API_URL` for staging/self-hosted):
|
|
53
73
|
|
|
54
74
|
```bash
|
|
55
|
-
export POST_ENGINEER_API_URL="https://post-engineer.com"
|
|
56
75
|
export POST_ENGINEER_API_KEY="<MY_API_KEY>"
|
|
76
|
+
# optional: export POST_ENGINEER_API_URL=https://staging.example.com
|
|
57
77
|
```
|
|
58
78
|
|
|
79
|
+
The `Authorization: Bearer` API key header is sent to the configured base URL, so only point `POST_ENGINEER_API_URL` at a server you trust.
|
|
59
80
|
## Tools
|
|
60
81
|
|
|
61
|
-
- `create_persona`: create an AI persona (avatar, voice, language, niche).
|
|
62
82
|
- `list_personas`: list existing personas.
|
|
63
|
-
- `
|
|
83
|
+
- `list_voices`: list available persona voices (live catalog from the platform, not hardcoded).
|
|
84
|
+
- `list_faces`: list default/stock persona faces (live catalog from `/api/persona/faces`). Each item has `id`, `url`, `name`, `gender`, `age` (single number, e.g. 23), `ethnicity`, `hair`, and `description` (English) so agents can choose without the photo; pass a face `url` as `avatarUrl` on `create_persona`.
|
|
85
|
+
- `create_persona`: create an AI persona (avatar, voice, language, niche).
|
|
86
|
+
- `update_persona`: update an existing persona (only the provided fields change).
|
|
87
|
+
- `get_token_balance`: get the prepaid token wallet balance. Check before generating videos, which cost tokens.
|
|
88
|
+
- `generate_video_from_persona`: generate a video with a persona. Optional `scriptPrompt` overrides the video script; optional `audioUrl` (public http(s) URL) supplies custom audio for this video, overriding the persona voice.
|
|
64
89
|
- `get_video_status`: check generation status and get the final video URL.
|
|
65
|
-
- `
|
|
90
|
+
- `list_social_accounts`: list connected social accounts with the account IDs needed for scheduling.
|
|
91
|
+
- `schedule_video`: schedule automated posting (must be at least 24h in advance; each provider needs an account ID from `list_social_accounts`).
|
|
92
|
+
- `list_schedules`: list automation schedules.
|
|
93
|
+
- `list_posts`: list upcoming (scheduled) and past (published/failed) posts across all connected accounts.
|
|
94
|
+
- `cancel_schedule`: cancel a schedule by its ID.
|
|
66
95
|
|
|
67
96
|
## Links
|
|
68
97
|
|
package/dist/client.d.ts
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
|
+
import { MAX_LIBRARY_IMAGE_BYTES, MAX_LIBRARY_IMAGE_MB } from './limits.js';
|
|
2
|
+
export { MAX_LIBRARY_IMAGE_BYTES, MAX_LIBRARY_IMAGE_MB };
|
|
1
3
|
export interface PostEngineerClientOptions {
|
|
2
|
-
baseUrl?: string;
|
|
3
4
|
apiKey?: string;
|
|
5
|
+
baseUrl?: string;
|
|
6
|
+
/** Clock override used by schedule validation (tests); defaults to the real clock. */
|
|
7
|
+
now?: () => Date;
|
|
8
|
+
}
|
|
9
|
+
/** One image for a persona's image library, read from a local file. */
|
|
10
|
+
export interface PersonaLibraryImageInput {
|
|
11
|
+
/** Local file path (JPG/JPEG, PNG, or WebP, max 10MB). */
|
|
12
|
+
path: string;
|
|
13
|
+
/** Short tag for deterministic per-video matching (e.g. casual, formal). */
|
|
14
|
+
tag?: string;
|
|
15
|
+
/** Description of the photo for keyword matching. */
|
|
16
|
+
description?: string;
|
|
4
17
|
}
|
|
5
18
|
export interface CreatePersonaInput {
|
|
6
19
|
name: string;
|
|
@@ -13,33 +26,85 @@ export interface CreatePersonaInput {
|
|
|
13
26
|
niche?: string;
|
|
14
27
|
faceMixPercent?: number;
|
|
15
28
|
faceQuality?: 'ok' | 'very_good';
|
|
29
|
+
/** Up to 10 local images of the same person for the image library. */
|
|
30
|
+
images?: PersonaLibraryImageInput[];
|
|
31
|
+
/** Index into images[] marking the primary library image. */
|
|
32
|
+
imagePrimaryIndex?: number;
|
|
16
33
|
}
|
|
17
34
|
export interface GenerateVideoJobInput {
|
|
35
|
+
personaId?: string;
|
|
36
|
+
videoSubject?: string;
|
|
37
|
+
voiceId?: string;
|
|
38
|
+
scriptPrompt?: string;
|
|
39
|
+
audioUrl?: string;
|
|
40
|
+
/** Library image ID overriding the deterministic per-video selection. */
|
|
41
|
+
imageId?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface UpdatePersonaInput {
|
|
18
44
|
personaId: string;
|
|
45
|
+
name?: string;
|
|
46
|
+
avatarUrl?: string;
|
|
47
|
+
voiceId?: string;
|
|
48
|
+
language?: string;
|
|
49
|
+
videoAspect?: '9:16' | '16:9';
|
|
19
50
|
scriptPrompt?: string;
|
|
51
|
+
paragraphNumber?: number;
|
|
52
|
+
niche?: string;
|
|
20
53
|
}
|
|
21
54
|
export interface CreateScheduleInput {
|
|
22
55
|
personaId: string;
|
|
23
|
-
providers: ('youtube' | 'instagram' | 'linkedin')[];
|
|
56
|
+
providers: ('youtube' | 'instagram' | 'linkedin' | 'bluesky')[];
|
|
24
57
|
youtubeAccountIds?: string[];
|
|
25
58
|
instagramAccountIds?: string[];
|
|
26
59
|
linkedinAccountIds?: string[];
|
|
60
|
+
blueskyAccountIds?: string[];
|
|
27
61
|
scheduledAt?: string | Date;
|
|
28
62
|
daysOfWeek?: number[];
|
|
29
63
|
startHour?: number;
|
|
30
64
|
endHour?: number;
|
|
31
65
|
postsPerDay?: number;
|
|
32
66
|
timezone?: string;
|
|
33
|
-
_nowForTesting?: Date;
|
|
34
67
|
}
|
|
68
|
+
export declare const MAX_LIBRARY_IMAGES = 10;
|
|
69
|
+
export declare const MAX_LIBRARY_TAG_LENGTH = 100;
|
|
70
|
+
export declare const MAX_LIBRARY_DESCRIPTION_LENGTH = 500;
|
|
71
|
+
/**
|
|
72
|
+
* Shared size guard for both image-read call sites (the stat pre-check and
|
|
73
|
+
* the post-read check) so the limit and the message text can't drift apart.
|
|
74
|
+
* Throws the typed ImageTooLargeError carrying the full path.
|
|
75
|
+
*/
|
|
76
|
+
export declare function assertImageSize(sizeBytes: number, path: string): void;
|
|
35
77
|
export declare class PostEngineerClient {
|
|
36
78
|
private readonly baseUrl;
|
|
37
79
|
private readonly apiKey?;
|
|
80
|
+
private readonly now;
|
|
38
81
|
constructor(options?: PostEngineerClientOptions);
|
|
39
82
|
private getHeaders;
|
|
83
|
+
private request;
|
|
40
84
|
createPersona(input: CreatePersonaInput): Promise<unknown>;
|
|
41
85
|
listPersonas(): Promise<unknown>;
|
|
86
|
+
listVoices(): Promise<unknown>;
|
|
87
|
+
listFaces(): Promise<unknown>;
|
|
88
|
+
updatePersona(input: UpdatePersonaInput): Promise<unknown>;
|
|
89
|
+
listSocialAccounts(): Promise<unknown>;
|
|
90
|
+
getOAuthConnectUrl(provider: string): Promise<unknown>;
|
|
91
|
+
connectBlueskyAccount(handle: string, appPassword: string): Promise<unknown>;
|
|
92
|
+
listSchedules(): Promise<unknown>;
|
|
93
|
+
listPosts(limit?: number): Promise<unknown>;
|
|
94
|
+
cancelSchedule(scheduleId: string): Promise<unknown>;
|
|
95
|
+
getTokenBalance(): Promise<unknown>;
|
|
42
96
|
generateVideoJob(input: GenerateVideoJobInput): Promise<unknown>;
|
|
43
97
|
getVideoStatus(taskId: string): Promise<unknown>;
|
|
98
|
+
listPersonaImages(personaId: string): Promise<unknown>;
|
|
99
|
+
addPersonaImage(personaId: string, image: PersonaLibraryImageInput & {
|
|
100
|
+
isPrimary?: true;
|
|
101
|
+
}): Promise<unknown>;
|
|
102
|
+
updatePersonaImage(input: {
|
|
103
|
+
id: string;
|
|
104
|
+
tag?: string;
|
|
105
|
+
description?: string;
|
|
106
|
+
isPrimary?: boolean;
|
|
107
|
+
}): Promise<unknown>;
|
|
108
|
+
deletePersonaImage(id: string): Promise<unknown>;
|
|
44
109
|
createSchedule(input: CreateScheduleInput): Promise<unknown>;
|
|
45
110
|
}
|