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/dist/index.js
CHANGED
|
@@ -1,71 +1,100 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { realpathSync } from 'node:fs';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
2
4
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
5
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
6
|
+
import { PostEngineerClient, MAX_LIBRARY_IMAGES, MAX_LIBRARY_IMAGE_MB } from './client.js';
|
|
7
|
+
import { CreatePersonaShape, ListPersonasShape, ListVoicesShape, ListFacesShape, UpdatePersonaShape, ListSocialAccountsShape, ConnectAccountShape, ListSchedulesShape, GetTokenBalanceShape, ListPostsShape, CancelScheduleShape, GenerateVideoShape, GetVideoStatusShape, ScheduleVideoShape, ListPersonaImagesShape, AddPersonaImageShape, UpdatePersonaImageShape, RemovePersonaImageShape, handleCreatePersona, handleListPersonas, handleListVoices, handleListFaces, handleUpdatePersona, handleListSocialAccounts, handleConnectAccount, handleListSchedules, handleListPosts, handleCancelSchedule, handleGetTokenBalance, handleGenerateVideo, handleGetVideoStatus, handleScheduleVideo, handleListPersonaImages, handleAddPersonaImage, handleUpdatePersonaImage, handleRemovePersonaImage, } from './tools.js';
|
|
8
|
+
// The server advertises the package version: import it so a version bump in
|
|
9
|
+
// package.json flows through without touching this file.
|
|
10
|
+
const { default: pkg } = await import('../package.json', { with: { type: 'json' } });
|
|
11
|
+
export function requireApiKey(env = process.env) {
|
|
12
|
+
const apiKey = env.POST_ENGINEER_API_KEY;
|
|
13
|
+
if (!apiKey) {
|
|
14
|
+
throw new Error('POST_ENGINEER_API_KEY is required');
|
|
15
|
+
}
|
|
16
|
+
return apiKey;
|
|
17
|
+
}
|
|
7
18
|
export function createPostEngineerMcpServer(client) {
|
|
8
|
-
const apiClient = client ?? new PostEngineerClient();
|
|
19
|
+
const apiClient = client ?? new PostEngineerClient({ apiKey: requireApiKey() });
|
|
9
20
|
const server = new McpServer({
|
|
10
21
|
name: 'post-engineer-mcp',
|
|
11
|
-
version:
|
|
12
|
-
});
|
|
13
|
-
server.tool('create_persona', 'Create a new AI persona with avatar, voice, language, and niche prompt.', {
|
|
14
|
-
name: z.string().min(1, 'Name is required').describe('Name of the persona'),
|
|
15
|
-
avatarUrl: z.string().url().optional().nullable().describe('Public URL to the persona avatar image'),
|
|
16
|
-
voiceId: z.string().default('alloy').describe('Voice ID to use (e.g. alloy, echo)'),
|
|
17
|
-
language: z.string().default('en-US').describe('Language code (e.g. pt-BR, en-US)'),
|
|
18
|
-
videoAspect: z.enum(['9:16', '16:9']).default('9:16').describe('Video aspect ratio'),
|
|
19
|
-
scriptPrompt: z.string().optional().default('').describe('System prompt instructions for video scripts'),
|
|
20
|
-
paragraphNumber: z.number().int().min(1).max(5).default(1).describe('Number of paragraphs'),
|
|
21
|
-
niche: z.string().optional().default('General').describe('Content niche topic'),
|
|
22
|
-
faceMixPercent: z.number().min(0).max(100).default(50),
|
|
23
|
-
faceQuality: z.enum(['ok', 'very_good']).default('very_good'),
|
|
24
|
-
}, async (args) => {
|
|
22
|
+
version: pkg.version,
|
|
23
|
+
});
|
|
24
|
+
server.tool('create_persona', 'Create a new AI persona with avatar, voice, language, and niche prompt.', CreatePersonaShape, async (args) => {
|
|
25
25
|
return handleCreatePersona(apiClient, args);
|
|
26
26
|
});
|
|
27
|
-
server.tool('list_personas', 'List all existing personas for the authenticated user.',
|
|
27
|
+
server.tool('list_personas', 'List all existing personas for the authenticated user.', ListPersonasShape, async () => {
|
|
28
28
|
return handleListPersonas(apiClient);
|
|
29
29
|
});
|
|
30
|
-
server.tool('
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
server.tool('list_voices', 'List all available persona voices (voiceId options) for the authenticated user.', ListVoicesShape, async () => {
|
|
31
|
+
return handleListVoices(apiClient);
|
|
32
|
+
});
|
|
33
|
+
server.tool('list_faces', 'List default/stock persona faces (avatar options). Each face includes id, url, name, gender, age (single number, not a range), ethnicity, hair, and description in English so you can pick without seeing the photo. Pass a face url as avatarUrl when calling create_persona.', ListFacesShape, async () => {
|
|
34
|
+
return handleListFaces(apiClient);
|
|
35
|
+
});
|
|
36
|
+
server.tool('update_persona', 'Update an existing AI persona (only the provided fields change).', UpdatePersonaShape, async (args) => {
|
|
37
|
+
return handleUpdatePersona(apiClient, args);
|
|
38
|
+
});
|
|
39
|
+
server.tool('list_social_accounts', 'List connected social accounts (YouTube, Instagram, LinkedIn, Bluesky) with the account IDs needed for schedule_video.', ListSocialAccountsShape, async () => {
|
|
40
|
+
return handleListSocialAccounts(apiClient);
|
|
41
|
+
});
|
|
42
|
+
server.tool('connect_account', 'Connect a social account. For youtube/instagram/linkedin: returns an authorization URL — the user must open it in a browser and authorize, then the account connects automatically (verify with list_social_accounts). For bluesky: connects directly with handle + appPassword (app password, not the main account password).', ConnectAccountShape, async (args) => {
|
|
43
|
+
return handleConnectAccount(apiClient, args);
|
|
44
|
+
});
|
|
45
|
+
server.tool('list_schedules', 'List all automation schedules for the authenticated user.', ListSchedulesShape, async () => {
|
|
46
|
+
return handleListSchedules(apiClient);
|
|
47
|
+
});
|
|
48
|
+
server.tool('list_posts', 'List upcoming (scheduled) and past (published/failed) posts across all connected accounts. Returns two lists: upcoming slots (id, slot_at, status, topic, schedule_id) and recent results (id, slot_at, status, topic, error, published_at, schedule_id). Use when the user asks about their posts — what is coming next, what already went out, or why a post failed. Combine with list_schedules or list_social_accounts when persona/account names are needed.', ListPostsShape, async (args) => {
|
|
49
|
+
return handleListPosts(apiClient, args);
|
|
50
|
+
});
|
|
51
|
+
server.tool('cancel_schedule', 'Cancel (delete) an automation schedule by its schedule ID. Use list_schedules to find the ID.', CancelScheduleShape, async (args) => {
|
|
52
|
+
return handleCancelSchedule(apiClient, args);
|
|
53
|
+
});
|
|
54
|
+
server.tool('get_token_balance', 'Get the prepaid token wallet balance. Check before triggering video generation, which costs tokens.', GetTokenBalanceShape, async () => {
|
|
55
|
+
return handleGetTokenBalance(apiClient);
|
|
56
|
+
});
|
|
57
|
+
server.tool('generate_video_from_persona', 'Trigger video generation using an existing persona. Optional scriptPrompt overrides the video script; optional audioUrl (public http(s) URL) supplies custom audio for this video, overriding the persona voice; optional imageId picks a specific image from the persona image library (see list_persona_images), overriding the deterministic per-video selection. For faceless generation, omit personaId and provide videoSubject plus a voice source (audioUrl or voiceId).', GenerateVideoShape, async (args) => {
|
|
34
58
|
return handleGenerateVideo(apiClient, args);
|
|
35
59
|
});
|
|
36
|
-
server.tool('get_video_status', 'Check the generation status and fetch final video URLs for a taskId.', {
|
|
37
|
-
taskId: z.string().min(1, 'taskId is required').describe('The video generation task ID'),
|
|
38
|
-
}, async (args) => {
|
|
60
|
+
server.tool('get_video_status', 'Check the generation status and fetch final video URLs for a taskId.', GetVideoStatusShape, async (args) => {
|
|
39
61
|
return handleGetVideoStatus(apiClient, args);
|
|
40
62
|
});
|
|
41
|
-
server.tool('
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
startHour: z.number().int().min(0).max(23).optional(),
|
|
55
|
-
endHour: z.number().int().min(0).max(23).optional(),
|
|
56
|
-
postsPerDay: z.number().int().min(1).max(10).optional(),
|
|
57
|
-
timezone: z.string().optional().default('UTC'),
|
|
58
|
-
}, async (args) => {
|
|
63
|
+
server.tool('list_persona_images', `List the image library of a persona (up to ${MAX_LIBRARY_IMAGES} tagged images). Each entry has id, tag, description, and is_primary. Use the ids with generate_video_from_persona imageId to force a specific image for one video.`, ListPersonaImagesShape, async (args) => {
|
|
64
|
+
return handleListPersonaImages(apiClient, args);
|
|
65
|
+
});
|
|
66
|
+
server.tool('add_persona_image', `Add an image to a persona image library from a local file path (JPG/JPEG, PNG, or WebP, max ${MAX_LIBRARY_IMAGE_MB}MB). Optional tag and description drive the deterministic per-video image selection. The server rejects faceless personas and full libraries (${MAX_LIBRARY_IMAGES} max).`, AddPersonaImageShape, async (args) => {
|
|
67
|
+
return handleAddPersonaImage(apiClient, args);
|
|
68
|
+
});
|
|
69
|
+
server.tool('update_persona_image', 'Update a persona library image tag, description, or primary flag.', UpdatePersonaImageShape, async (args) => {
|
|
70
|
+
return handleUpdatePersonaImage(apiClient, args);
|
|
71
|
+
});
|
|
72
|
+
server.tool('remove_persona_image', 'Remove an image from a persona image library.', RemovePersonaImageShape, async (args) => {
|
|
73
|
+
return handleRemovePersonaImage(apiClient, args);
|
|
74
|
+
});
|
|
75
|
+
server.tool('schedule_video', 'Schedule automated video generation and posting to social channels. IMPORTANT: Schedules must be between 24h and 30 days in advance. Each provider requires at least one account ID — discover them with list_social_accounts first.', ScheduleVideoShape, async (args) => {
|
|
59
76
|
return handleScheduleVideo(apiClient, args);
|
|
60
77
|
});
|
|
61
78
|
return server;
|
|
62
79
|
}
|
|
63
|
-
import { fileURLToPath } from 'url';
|
|
64
80
|
export function isMainModule() {
|
|
65
|
-
|
|
81
|
+
const entry = process.argv[1];
|
|
82
|
+
if (!entry)
|
|
83
|
+
return false;
|
|
84
|
+
try {
|
|
85
|
+
// Realpath both sides: the published bin is launched through a symlinked
|
|
86
|
+
// .bin entry, and Node may keep the symlink path in either argv[1] or
|
|
87
|
+
// import.meta.url — realpathing both makes the comparison robust either way.
|
|
88
|
+
return realpathSync(entry) === realpathSync(fileURLToPath(import.meta.url));
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
66
93
|
}
|
|
67
94
|
async function main() {
|
|
68
|
-
|
|
95
|
+
// Fail fast: without a key every tool call would fail with an opaque 401.
|
|
96
|
+
const apiKey = requireApiKey();
|
|
97
|
+
const server = createPostEngineerMcpServer(new PostEngineerClient({ apiKey }));
|
|
69
98
|
const transport = new StdioServerTransport();
|
|
70
99
|
await server.connect(transport);
|
|
71
100
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAC3F,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,kB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C,yBAAyB,EAAE,GAAG,CAAC,CAAC;QAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/limits.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared library-image size limits.
|
|
3
|
+
*
|
|
4
|
+
* Lives in its own module so both `client.ts` (enforcement) and
|
|
5
|
+
* `errors.ts` (user-facing messages) can use the derived MB value without
|
|
6
|
+
* a client<->errors import cycle.
|
|
7
|
+
*/
|
|
8
|
+
/** Max library image size in bytes (10MB). */
|
|
9
|
+
export declare const MAX_LIBRARY_IMAGE_BYTES: number;
|
|
10
|
+
/**
|
|
11
|
+
* Same limit in whole MB, derived from the byte limit so user-facing copy
|
|
12
|
+
* (tool descriptions, error messages) can't drift from the enforced bound.
|
|
13
|
+
*/
|
|
14
|
+
export declare const MAX_LIBRARY_IMAGE_MB: number;
|
package/dist/limits.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared library-image size limits.
|
|
3
|
+
*
|
|
4
|
+
* Lives in its own module so both `client.ts` (enforcement) and
|
|
5
|
+
* `errors.ts` (user-facing messages) can use the derived MB value without
|
|
6
|
+
* a client<->errors import cycle.
|
|
7
|
+
*/
|
|
8
|
+
/** Max library image size in bytes (10MB). */
|
|
9
|
+
export const MAX_LIBRARY_IMAGE_BYTES = 10 * 1024 * 1024;
|
|
10
|
+
/**
|
|
11
|
+
* Same limit in whole MB, derived from the byte limit so user-facing copy
|
|
12
|
+
* (tool descriptions, error messages) can't drift from the enforced bound.
|
|
13
|
+
*/
|
|
14
|
+
export const MAX_LIBRARY_IMAGE_MB = MAX_LIBRARY_IMAGE_BYTES / (1024 * 1024);
|
|
15
|
+
//# sourceMappingURL=limits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limits.js","sourceRoot":"","sources":["../src/limits.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,8CAA8C;AAC9C,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAExD;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,uBAAuB,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC"}
|