post-engineer-mcp 1.1.1 → 1.3.1

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 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
 
@@ -15,7 +15,7 @@ Public MCP (Model Context Protocol) server for [Post Engineer](https://post-engi
15
15
 
16
16
  ## Requirements
17
17
 
18
- - Node.js 20+
18
+ - Node.js 20.10+
19
19
  - API key generated at https://post-engineer.com/api-keys
20
20
 
21
21
  ## Use
@@ -38,6 +38,29 @@ Configure your agent (`opencode.json`, `claude_desktop_config.json`, `.mcp.json`
38
38
 
39
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.
40
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
+
41
64
  ## Local development
42
65
 
43
66
  ```bash
@@ -46,26 +69,45 @@ pnpm build
46
69
  pnpm start
47
70
  ```
48
71
 
49
- Set your API key locally (the API URL is built in and always points to production):
72
+ Set your API key locally (defaults to the production API; override with `POST_ENGINEER_API_URL` for staging/self-hosted):
50
73
 
51
74
  ```bash
52
75
  export POST_ENGINEER_API_KEY="<MY_API_KEY>"
76
+ # optional: export POST_ENGINEER_API_URL=https://staging.example.com
53
77
  ```
54
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.
55
80
  ## Tools
56
81
 
57
82
  - `list_personas`: list existing personas.
58
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`.
59
85
  - `create_persona`: create an AI persona (avatar, voice, language, niche).
60
86
  - `update_persona`: update an existing persona (only the provided fields change).
61
87
  - `get_token_balance`: get the prepaid token wallet balance. Check before generating videos, which cost tokens.
62
- - `generate_video_from_persona`: generate a video with a persona.
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.
63
89
  - `get_video_status`: check generation status and get the final video URL.
64
90
  - `list_social_accounts`: list connected social accounts with the account IDs needed for scheduling.
65
91
  - `schedule_video`: schedule automated posting (must be at least 24h in advance; each provider needs an account ID from `list_social_accounts`).
66
92
  - `list_schedules`: list automation schedules.
93
+ - `list_posts`: list upcoming (scheduled) and past (published/failed) posts across all connected accounts.
67
94
  - `cancel_schedule`: cancel a schedule by its ID.
68
95
 
96
+ ### Social account IDs for `schedule_video`
97
+
98
+ Each provider's `*AccountIds` field expects the provider's account identifier
99
+ from `list_social_accounts` — **not** the `recordId` (that is the internal
100
+ database row id and is rejected):
101
+
102
+ | Provider | `schedule_video` field | Use this `list_social_accounts` field |
103
+ |---|---|---|
104
+ | YouTube | `youtubeAccountIds` | `channelId` |
105
+ | Instagram | `instagramAccountIds` | `igUserId` |
106
+ | LinkedIn | `linkedinAccountIds` | `providerAccountId` |
107
+ | Bluesky | `blueskyAccountIds` | `did` (e.g. `did:plc:...`) |
108
+
109
+ Passing a `recordId` fails fast with an error naming the right field.
110
+
69
111
  ## Links
70
112
 
71
113
  - Platform: https://post-engineer.com/
package/dist/client.d.ts CHANGED
@@ -1,5 +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
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;
3
17
  }
4
18
  export interface CreatePersonaInput {
5
19
  name: string;
@@ -12,15 +26,24 @@ export interface CreatePersonaInput {
12
26
  niche?: string;
13
27
  faceMixPercent?: number;
14
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;
15
33
  }
16
34
  export interface GenerateVideoJobInput {
17
- personaId: string;
35
+ personaId?: string;
36
+ videoSubject?: string;
37
+ voiceId?: string;
18
38
  scriptPrompt?: string;
39
+ audioUrl?: string;
40
+ /** Library image ID overriding the deterministic per-video selection. */
41
+ imageId?: string;
19
42
  }
20
43
  export interface UpdatePersonaInput {
21
44
  personaId: string;
22
45
  name?: string;
23
- avatarUrl?: string | null;
46
+ avatarUrl?: string;
24
47
  voiceId?: string;
25
48
  language?: string;
26
49
  videoAspect?: '9:16' | '16:9';
@@ -30,32 +53,58 @@ export interface UpdatePersonaInput {
30
53
  }
31
54
  export interface CreateScheduleInput {
32
55
  personaId: string;
33
- providers: ('youtube' | 'instagram' | 'linkedin')[];
56
+ providers: ('youtube' | 'instagram' | 'linkedin' | 'bluesky')[];
34
57
  youtubeAccountIds?: string[];
35
58
  instagramAccountIds?: string[];
36
59
  linkedinAccountIds?: string[];
60
+ blueskyAccountIds?: string[];
37
61
  scheduledAt?: string | Date;
38
62
  daysOfWeek?: number[];
39
63
  startHour?: number;
40
64
  endHour?: number;
41
65
  postsPerDay?: number;
42
66
  timezone?: string;
43
- _nowForTesting?: Date;
44
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;
45
77
  export declare class PostEngineerClient {
46
78
  private readonly baseUrl;
47
79
  private readonly apiKey?;
80
+ private readonly now;
48
81
  constructor(options?: PostEngineerClientOptions);
49
82
  private getHeaders;
83
+ private request;
50
84
  createPersona(input: CreatePersonaInput): Promise<unknown>;
51
85
  listPersonas(): Promise<unknown>;
52
86
  listVoices(): Promise<unknown>;
87
+ listFaces(): Promise<unknown>;
53
88
  updatePersona(input: UpdatePersonaInput): Promise<unknown>;
54
89
  listSocialAccounts(): Promise<unknown>;
90
+ getOAuthConnectUrl(provider: string): Promise<unknown>;
91
+ connectBlueskyAccount(handle: string, appPassword: string): Promise<unknown>;
55
92
  listSchedules(): Promise<unknown>;
93
+ listPosts(limit?: number): Promise<unknown>;
56
94
  cancelSchedule(scheduleId: string): Promise<unknown>;
57
95
  getTokenBalance(): Promise<unknown>;
58
96
  generateVideoJob(input: GenerateVideoJobInput): Promise<unknown>;
59
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>;
60
109
  createSchedule(input: CreateScheduleInput): Promise<unknown>;
61
110
  }