post-engineer-mcp 1.52.571 → 1.52.575

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 (62) hide show
  1. package/README.md +46 -0
  2. package/dist/account-shapes.d.ts +1 -0
  3. package/dist/account-shapes.js +16 -0
  4. package/dist/account-shapes.js.map +1 -1
  5. package/dist/analytics.d.ts +3 -1
  6. package/dist/analytics.js +12 -5
  7. package/dist/analytics.js.map +1 -1
  8. package/dist/client-publish-uploaded.d.ts +8 -0
  9. package/dist/client-publish-uploaded.js +130 -0
  10. package/dist/client-publish-uploaded.js.map +1 -0
  11. package/dist/client-types.d.ts +48 -0
  12. package/dist/client.d.ts +1 -0
  13. package/dist/client.js +5 -1
  14. package/dist/client.js.map +1 -1
  15. package/dist/cloned-voice-tools.d.ts +18 -1
  16. package/dist/cloned-voice-tools.js +35 -8
  17. package/dist/cloned-voice-tools.js.map +1 -1
  18. package/dist/direct-publish-form.d.ts +3 -2
  19. package/dist/direct-publish-form.js.map +1 -1
  20. package/dist/http-rate-limit.d.ts +5 -0
  21. package/dist/http-rate-limit.js +47 -0
  22. package/dist/http-rate-limit.js.map +1 -1
  23. package/dist/http-transport.d.ts +7 -2
  24. package/dist/http-transport.js +36 -7
  25. package/dist/http-transport.js.map +1 -1
  26. package/dist/index.d.ts +1 -0
  27. package/dist/index.js +76 -59
  28. package/dist/index.js.map +1 -1
  29. package/dist/local-file-tools.d.ts +3 -0
  30. package/dist/local-file-tools.js +15 -0
  31. package/dist/local-file-tools.js.map +1 -0
  32. package/dist/music-mood-field.d.ts +2 -0
  33. package/dist/music-mood-field.js +33 -0
  34. package/dist/music-mood-field.js.map +1 -0
  35. package/dist/publish-uploaded-shape.d.ts +73 -0
  36. package/dist/publish-uploaded-shape.js +45 -0
  37. package/dist/publish-uploaded-shape.js.map +1 -0
  38. package/dist/publish-uploaded-tools.d.ts +3 -0
  39. package/dist/publish-uploaded-tools.js +10 -0
  40. package/dist/publish-uploaded-tools.js.map +1 -0
  41. package/dist/remote-shapes.d.ts +103 -0
  42. package/dist/remote-shapes.js +59 -0
  43. package/dist/remote-shapes.js.map +1 -0
  44. package/dist/require-publishing-accounts.d.ts +1 -0
  45. package/dist/require-publishing-accounts.js +15 -0
  46. package/dist/require-publishing-accounts.js.map +1 -0
  47. package/dist/schedule-shapes.js +2 -6
  48. package/dist/schedule-shapes.js.map +1 -1
  49. package/dist/tool-annotations.d.ts +4 -0
  50. package/dist/tool-annotations.js +19 -0
  51. package/dist/tool-annotations.js.map +1 -0
  52. package/dist/tools-prompts.js +3 -2
  53. package/dist/tools-prompts.js.map +1 -1
  54. package/dist/tools-publish-uploaded.d.ts +10 -0
  55. package/dist/tools-publish-uploaded.js +73 -0
  56. package/dist/tools-publish-uploaded.js.map +1 -0
  57. package/dist/tools-publishing-accounts.js +9 -8
  58. package/dist/tools-publishing-accounts.js.map +1 -1
  59. package/dist/tools.d.ts +2 -0
  60. package/dist/tools.js +2 -1
  61. package/dist/tools.js.map +1 -1
  62. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3,18 +3,22 @@ import { realpathSync } from 'node:fs';
3
3
  import { fileURLToPath } from 'node:url';
4
4
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
5
5
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
6
- import { PostEngineerClient, MAX_LIBRARY_IMAGES, MAX_LIBRARY_IMAGE_MB, MAX_UPLOAD_VIDEO_GB } from './client.js';
7
- import { CreatePersonaShape, ListPersonasShape, ListVoicesShape, ListFacesShape, UpdatePersonaShape, ListSocialAccountsShape, ConnectAccountShape, ListSchedulesShape, GetTokenBalanceShape, ListPostsShape, CancelScheduleShape, GetSlotShape, UpdateSlotTitleShape, DeleteSlotShape, ListVideoGenerationsShape, GetVideoGenerationShape, ListTokenTransactionsShape, GetPersonaDeletePreviewShape, DeletePersonaShape, DisconnectAccountShape, GetVideoStatusShape, GetVideoTaskProgressShape, ListPersonaImagesShape, AddPersonaImageShape, UpdatePersonaImageShape, RemovePersonaImageShape, PublishVideoDirectShape, handleCreatePersona, handleListPersonas, handleListVoices, handleListFaces, handleUpdatePersona, handleListSocialAccounts, handleConnectAccount, handleListSchedules, handleCancelSchedule, handleGetSlot, handleUpdateSlotTitle, handleDeleteSlot, handleListVideoGenerations, handleGetVideoGeneration, handleListTokenTransactions, handleGetPersonaDeletePreview, handleDeletePersona, handleDisconnectAccount, handleGetTokenBalance, handleGetVideoStatus, handleGetVideoTaskProgress, handleListPersonaImages, handleAddPersonaImage, handleUpdatePersonaImage, handleRemovePersonaImage, handlePublishVideoDirect, } from './tools.js';
6
+ import { PostEngineerClient, MAX_LIBRARY_IMAGES } from './client.js';
7
+ import { CreatePersonaShape, ListPersonasShape, ListVoicesShape, ListFacesShape, UpdatePersonaShape, ListSocialAccountsShape, ConnectAccountShape, ListSchedulesShape, GetTokenBalanceShape, ListPostsShape, CancelScheduleShape, GetSlotShape, UpdateSlotTitleShape, DeleteSlotShape, ListVideoGenerationsShape, GetVideoGenerationShape, ListTokenTransactionsShape, GetPersonaDeletePreviewShape, DeletePersonaShape, DisconnectAccountShape, GetVideoStatusShape, GetVideoTaskProgressShape, ListPersonaImagesShape, UpdatePersonaImageShape, RemovePersonaImageShape, handleCreatePersona, handleListPersonas, handleListVoices, handleListFaces, handleUpdatePersona, handleListSocialAccounts, handleConnectAccount, handleListSchedules, handleCancelSchedule, handleGetSlot, handleUpdateSlotTitle, handleDeleteSlot, handleListVideoGenerations, handleGetVideoGeneration, handleListTokenTransactions, handleGetPersonaDeletePreview, handleDeletePersona, handleDisconnectAccount, handleGetTokenBalance, handleGetVideoStatus, handleGetVideoTaskProgress, handleListPersonaImages, handleUpdatePersonaImage, handleRemovePersonaImage, } from './tools.js';
8
8
  import { GetPersonaPublishingAccountsShape, SetPersonaPublishingAccountsShape, handleGetPersonaPublishingAccounts, handleSetPersonaPublishingAccounts, } from './tools-publishing-accounts.js';
9
9
  import { registerClonedVoiceTools } from './cloned-voice-tools.js';
10
10
  import { GetPostShape, GetPostMetricsShape, GetYouTubeRetentionCurveShape, handleGetPost, handleListPosts, handleGetPostMetrics, handleGetYouTubeRetentionCurve, } from './tools-posts.js';
11
11
  import { CancelVideoTaskShape, WaitForVideoTasksShape, handleCancelVideoTask, handleWaitForVideoTasks, } from './video-task-tools.js';
12
12
  import { GeneratePersonaVideoShape, ValidateScriptShape, ValidateScriptDescription, ScoreDraftShape, ScoreDraftDescription, handleGeneratePersonaVideo, handleValidateScript, handleScoreDraft } from './tools-single-video.js';
13
- import { CheckMediaDescription, CheckMediaShape, UploadMediaDescription, UploadMediaShape, handleCheckMedia, handleUploadMedia } from './tools-user-media.js';
13
+ import { CheckMediaDescription, CheckMediaShape, handleCheckMedia } from './tools-user-media.js';
14
+ import { CreatePersonaRemoteSchema, CreatePersonaRemoteShape, UpdatePersonaRemoteSchema, UpdatePersonaRemoteShape } from './remote-shapes.js';
15
+ import { registerLocalFileTools } from './local-file-tools.js';
16
+ import { registerPublishUploadedTools } from './publish-uploaded-tools.js';
14
17
  import { ListPinterestBoardsDescription, ListPinterestBoardsShape, handleListPinterestBoards } from './tools-pinterest.js';
15
18
  import { GeneratePersonaVideoBatchDescription, GeneratePersonaVideoBatchShape, handleGeneratePersonaVideoBatch } from './tools-batch.js';
16
19
  import { AddExperimentPairShape, CreateExperimentShape, GetExperimentResultsShape, ListExperimentsShape, handleAddExperimentPair, handleCreateExperiment, handleGetExperimentResults, handleListExperiments } from './tools-experiments.js';
17
20
  import { withTracking } from './analytics.js';
21
+ import { READ_ONLY, MUTATING, DESTRUCTIVE } from './tool-annotations.js';
18
22
  import { parseHttpTransportOptions, serveHttpTransport } from './http-transport.js';
19
23
  import { parseHttpAuthOptions } from './http-auth.js';
20
24
  import { SERVER_INSTRUCTIONS, registerPromptTools, withRecipeNudge, withScriptOutcome } from './tools-prompts.js';
@@ -37,123 +41,136 @@ export function createPostEngineerMcpServer(client, transport = 'stdio') {
37
41
  }, { instructions: SERVER_INSTRUCTIONS });
38
42
  registerRemotePrompts(server, apiClient);
39
43
  const recipeSession = registerPromptTools(server, apiClient, transport);
40
- server.tool('create_persona', 'Create a new AI persona with avatar, voice, language, and niche prompt. A face is REQUIRED: pass avatarUrl (public URL or list_faces) or avatarPath (local photo file, uploaded directly). A video without a face is a per-video choice — set options.videoType to "faceless" on generate_persona_video.', CreatePersonaShape, withTracking('create_persona', withRecipeNudge(recipeSession, 'create_persona', async (args) => {
41
- return handleCreatePersona(apiClient, args);
42
- })));
43
- server.tool('list_personas', 'List all existing personas for the authenticated user.', ListPersonasShape, withTracking('list_personas', withRecipeNudge(recipeSession, 'list_personas', async () => {
44
+ const isRemote = transport === 'http';
45
+ if (isRemote) {
46
+ server.tool('create_persona', 'Create a new AI persona with avatar, voice, language, and niche prompt. A face is REQUIRED: pass avatarUrl (public URL or list_faces). The remote server cannot read local files. A video without a face is a per-video choice — set options.videoType to "faceless" on generate_persona_video. At least one publishing account is REQUIRED (accounts): the persona is bound to those accounts and videos publish only to them.', CreatePersonaRemoteShape, MUTATING, withTracking('create_persona', withRecipeNudge(recipeSession, 'create_persona', async (args) => {
47
+ return handleCreatePersona(apiClient, CreatePersonaRemoteSchema.parse(args));
48
+ })));
49
+ }
50
+ else {
51
+ server.tool('create_persona', 'Create a new AI persona with avatar, voice, language, and niche prompt. A face is REQUIRED: pass avatarUrl (public URL or list_faces) or avatarPath (local photo file, uploaded directly). A video without a face is a per-video choice — set options.videoType to "faceless" on generate_persona_video. At least one publishing account is REQUIRED (accounts): the persona is bound to those accounts and videos publish only to them.', CreatePersonaShape, MUTATING, withTracking('create_persona', withRecipeNudge(recipeSession, 'create_persona', async (args) => {
52
+ return handleCreatePersona(apiClient, args);
53
+ })));
54
+ }
55
+ server.tool('list_personas', 'List all existing personas for the authenticated user.', ListPersonasShape, READ_ONLY, withTracking('list_personas', withRecipeNudge(recipeSession, 'list_personas', async () => {
44
56
  return handleListPersonas(apiClient);
45
57
  })));
46
- server.tool('list_voices', 'List persona voices (voiceId options): 65 English house voices, each with a text description of how it sounds plus gender/accent/kind, and your ready clones. Filter with gender, origin and search (e.g. "deep calm").', ListVoicesShape, withTracking('list_voices', async (args) => {
58
+ server.tool('list_voices', 'List persona voices (voiceId options): 65 English house voices, each with a text description of how it sounds plus gender/accent/kind, and your ready clones. Filter with gender, origin and search (e.g. "deep calm").', ListVoicesShape, READ_ONLY, withTracking('list_voices', async (args) => {
47
59
  return handleListVoices(apiClient, args);
48
60
  }));
49
61
  // Cloned-voice tools (list/create/get/delete/preview, plus the house-voice
50
62
  // preview) live in cloned-voice-tools.ts, next to their shapes/handlers.
51
- registerClonedVoiceTools(server, apiClient);
52
- 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, withTracking('list_faces', async () => {
63
+ registerClonedVoiceTools(server, apiClient, isRemote);
64
+ 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, READ_ONLY, withTracking('list_faces', async () => {
53
65
  return handleListFaces(apiClient);
54
66
  }));
55
- server.tool('update_persona', 'Update an existing AI persona (only the provided fields change). Replace the face with avatarUrl or avatarPath (local photo file).', UpdatePersonaShape, withTracking('update_persona', async (args) => {
56
- return handleUpdatePersona(apiClient, args);
57
- }));
58
- server.tool('list_social_accounts', 'List connected social accounts (YouTube, Instagram, LinkedIn, Threads, Facebook Pages, Bluesky, Pinterest, Rumble, Fanvue) with the account IDs needed for posting.', ListSocialAccountsShape, withTracking('list_social_accounts', withRecipeNudge(recipeSession, 'list_social_accounts', async () => {
67
+ if (isRemote) {
68
+ server.tool('update_persona', 'Update an existing AI persona (only the provided fields change). Replace the face with avatarUrl. The remote server cannot read local files.', UpdatePersonaRemoteShape, MUTATING, withTracking('update_persona', async (args) => {
69
+ return handleUpdatePersona(apiClient, UpdatePersonaRemoteSchema.parse(args));
70
+ }));
71
+ }
72
+ else {
73
+ server.tool('update_persona', 'Update an existing AI persona (only the provided fields change). Replace the face with avatarUrl or avatarPath (local photo file).', UpdatePersonaShape, MUTATING, withTracking('update_persona', async (args) => {
74
+ return handleUpdatePersona(apiClient, args);
75
+ }));
76
+ }
77
+ server.tool('list_social_accounts', 'List connected social accounts (YouTube, Instagram, LinkedIn, Threads, Facebook Pages, Bluesky, Pinterest, Rumble, Fanvue) with the account IDs needed for posting.', ListSocialAccountsShape, READ_ONLY, withTracking('list_social_accounts', withRecipeNudge(recipeSession, 'list_social_accounts', async () => {
59
78
  return handleListSocialAccounts(apiClient);
60
79
  })));
61
- server.tool('list_pinterest_boards', ListPinterestBoardsDescription, ListPinterestBoardsShape, withTracking('list_pinterest_boards', async (args) => {
80
+ server.tool('list_pinterest_boards', ListPinterestBoardsDescription, ListPinterestBoardsShape, READ_ONLY, withTracking('list_pinterest_boards', async (args) => {
62
81
  return handleListPinterestBoards(apiClient, args);
63
82
  }));
64
- server.tool('get_persona_publishing_accounts', "List a persona's default publishing accounts per provider. generate_persona_video falls back to these when no account IDs are passed; explicit IDs always win.", GetPersonaPublishingAccountsShape, withTracking('get_persona_publishing_accounts', async (args) => {
83
+ server.tool('get_persona_publishing_accounts', "List the publishing accounts a persona is bound to, per provider. generate_persona_video falls back to these when no account IDs are passed; explicit IDs must be a subset of the binding.", GetPersonaPublishingAccountsShape, READ_ONLY, withTracking('get_persona_publishing_accounts', async (args) => {
65
84
  return handleGetPersonaPublishingAccounts(apiClient, args);
66
85
  }));
67
- server.tool('set_persona_publishing_accounts', "Replace a persona's default publishing accounts (per provider). Account IDs come from list_social_accounts. Providers mapped to empty arrays keep no defaults.", SetPersonaPublishingAccountsShape, withTracking('set_persona_publishing_accounts', async (args) => {
86
+ server.tool('set_persona_publishing_accounts', "Replace the publishing accounts a persona is bound to (per provider). Account IDs come from list_social_accounts. Providers mapped to empty arrays keep no binding for that provider; the binding as a whole must keep at least one account.", SetPersonaPublishingAccountsShape, MUTATING, withTracking('set_persona_publishing_accounts', async (args) => {
68
87
  return handleSetPersonaPublishingAccounts(apiClient, args);
69
88
  }));
70
- server.tool('connect_account', 'Connect a social account. For youtube/instagram/linkedin/threads/facebook/pinterest/fanvue: returns an authorization URL — the user must open it in a browser where they are signed in to Post Engineer with the same account, and authorize; the account then connects automatically (verify with list_social_accounts). A browser that is not signed in, or signed in as another user, is rejected. For bluesky: connects directly with handle + appPassword (app password, not the main account password). For 3speak: connects directly with Hive username + posting key (posting key, not the owner/active/master password) For rumble: connects directly with channelId + accessToken (40-character Simple Upload API token, issued by emailing bd@rumble.com — no OAuth).', ConnectAccountShape, withTracking('connect_account', async (args) => {
89
+ server.tool('connect_account', 'Connect a social account. For youtube/instagram/linkedin/threads/facebook/pinterest/fanvue: returns an authorization URL — the user must open it in a browser where they are signed in to Post Engineer with the same account, and authorize; the account then connects automatically (verify with list_social_accounts). A browser that is not signed in, or signed in as another user, is rejected. For bluesky: connects directly with handle + appPassword (app password, not the main account password). For 3speak: connects directly with Hive username + posting key (posting key, not the owner/active/master password) For rumble: connects directly with channelId + accessToken (40-character Simple Upload API token, issued by emailing bd@rumble.com — no OAuth).', ConnectAccountShape, MUTATING, withTracking('connect_account', async (args) => {
71
90
  return handleConnectAccount(apiClient, args);
72
91
  }));
73
- server.tool('list_schedules', 'List all automation schedules for the authenticated user.', ListSchedulesShape, withTracking('list_schedules', async () => {
92
+ server.tool('list_schedules', 'List all automation schedules for the authenticated user.', ListSchedulesShape, READ_ONLY, withTracking('list_schedules', async () => {
74
93
  return handleListSchedules(apiClient);
75
94
  }));
76
- server.tool('list_posts', 'List upcoming (scheduled) and past (published/failed) posts across all connected accounts. With from + to (ISO-8601 timestamps with UTC offset, at most 62 days) it instead returns every post of any status (awaiting|generating|ready|publishing|published|failed) with slot_at in [from, to) as one slots list plus truncated (true when the cap was hit) — use it to read a day or month. Without from/to it returns two lists: upcoming slots and recent results, each with id, slot_at, status (awaiting|generating|ready|publishing|published|failed; publishing appears in upcoming only when the slot already has userNotices), title, schedule_id, task_id, postUrl (the link to the post detail page — send it in chat so the user can watch or download the video and edit, reschedule or delete the post), progress (0-100: 0 for awaiting, 100 for ready/publishing/published, live engine progress for generating, last known for failed), stage (engine pipeline stage like "lipsync" while generating, "done" when complete, null otherwise), queuePosition/queueTotal (1-based position among the schedule\'s awaiting+generating slots; awaiting slots only, null otherwise). Failed slots also carry error and retryable (boolean: true when the failure looks transient). Use when the user asks about their posts — what is coming next, what already went out, how far a video has generated, where it sits in the queue, or why a post failed. Combine with list_schedules or list_social_accounts when persona/account names are needed. A slot that is still publishing is included in upcoming when it already has userNotices (requiresUser true): relay each notice as-is and do not retry, because only the user can fix the account. providerFailures lists every terminal account failure; its requiresUser is true only for the failures also in userNotices.', ListPostsShape, withTracking('list_posts', async (args) => {
95
+ server.tool('list_posts', 'List upcoming (scheduled) and past (published/failed) posts across all connected accounts. With from + to (ISO-8601 timestamps with UTC offset, at most 62 days) it instead returns every post of any status (awaiting|generating|ready|publishing|published|failed) with slot_at in [from, to) as one slots list plus truncated (true when the cap was hit) — use it to read a day or month. Without from/to it returns two lists: upcoming slots and recent results, each with id, slot_at, status (awaiting|generating|ready|publishing|published|failed; publishing appears in upcoming only when the slot already has userNotices), title, schedule_id, task_id, postUrl (the link to the post detail page — send it in chat so the user can watch or download the video and edit, reschedule or delete the post), progress (0-100: 0 for awaiting, 100 for ready/publishing/published, live engine progress for generating, last known for failed), stage (engine pipeline stage like "lipsync" while generating, "done" when complete, null otherwise), queuePosition/queueTotal (1-based position among the schedule\'s awaiting+generating slots; awaiting slots only, null otherwise). Failed slots also carry error and retryable (boolean: true when the failure looks transient). Use when the user asks about their posts — what is coming next, what already went out, how far a video has generated, where it sits in the queue, or why a post failed. Combine with list_schedules or list_social_accounts when persona/account names are needed. A slot that is still publishing is included in upcoming when it already has userNotices (requiresUser true): relay each notice as-is and do not retry, because only the user can fix the account. providerFailures lists every terminal account failure; its requiresUser is true only for the failures also in userNotices.', ListPostsShape, READ_ONLY, withTracking('list_posts', async (args) => {
77
96
  return handleListPosts(apiClient, args);
78
97
  }));
79
- server.tool('cancel_schedule', 'Cancel (delete) an automation schedule by its schedule ID. Unpublished slots (pending, generating, or ready) are removed so they cannot publish, and their prepaid tokens are refunded. A post already publishing or already published is not recalled. Use list_schedules to find the ID.', CancelScheduleShape, withTracking('cancel_schedule', async (args) => {
98
+ server.tool('cancel_schedule', 'Cancel (delete) an automation schedule by its schedule ID. Unpublished slots (pending, generating, or ready) are removed so they cannot publish, and their prepaid tokens are refunded. A post already publishing or already published is not recalled. Use list_schedules to find the ID.', CancelScheduleShape, DESTRUCTIVE, withTracking('cancel_schedule', async (args) => {
80
99
  return handleCancelSchedule(apiClient, args);
81
100
  }));
82
- server.tool('get_slot', 'Get one scheduled post\'s full detail by slot ID: status, title, scheduled time, generation progress, its schedule (providers, publish mode) and persona. userNotices (requiresUser true) and providerFailures are on the slot as soon as an account fails, including while the slot is still publishing. Relay each userNotices notice. Only the user can fix that account. Do not retry it. The slot carries postUrl, the link to its post detail page — send it in chat so the user can watch or download the video and edit, reschedule or delete the post. Use the slotId from list_posts.', GetSlotShape, withTracking('get_slot', async (args) => {
101
+ server.tool('get_slot', 'Get one scheduled post\'s full detail by slot ID: status, title, scheduled time, generation progress, its schedule (providers, publish mode) and persona. userNotices (requiresUser true) and providerFailures are on the slot as soon as an account fails, including while the slot is still publishing. Relay each userNotices notice. Only the user can fix that account. Do not retry it. The slot carries postUrl, the link to its post detail page — send it in chat so the user can watch or download the video and edit, reschedule or delete the post. Use the slotId from list_posts.', GetSlotShape, READ_ONLY, withTracking('get_slot', async (args) => {
83
102
  return handleGetSlot(apiClient, args);
84
103
  }));
85
- server.tool('update_slot_title', 'Edit the title text of one scheduled post. Only a pending/awaiting or ready slot can be edited — published or mid-flight slots are rejected.', UpdateSlotTitleShape, withTracking('update_slot_title', async (args) => {
104
+ server.tool('update_slot_title', 'Edit the title text of one scheduled post. Only a pending/awaiting or ready slot can be edited — published or mid-flight slots are rejected.', UpdateSlotTitleShape, MUTATING, withTracking('update_slot_title', async (args) => {
86
105
  return handleUpdateSlotTitle(apiClient, args);
87
106
  }));
88
- server.tool('delete_slot', 'Delete one scheduled post slot. Only pending (awaiting), ready or failed slots can be deleted; published or mid-flight slots are rejected. The schedule\'s last slot cannot be deleted — use cancel_schedule to delete the whole schedule instead.', DeleteSlotShape, withTracking('delete_slot', async (args) => {
107
+ server.tool('delete_slot', 'Delete one scheduled post slot. Only pending (awaiting), ready or failed slots can be deleted; published or mid-flight slots are rejected. The schedule\'s last slot cannot be deleted — use cancel_schedule to delete the whole schedule instead.', DeleteSlotShape, DESTRUCTIVE, withTracking('delete_slot', async (args) => {
89
108
  return handleDeleteSlot(apiClient, args);
90
109
  }));
91
- server.tool('list_video_generations', 'List the video generation history (newest first): one row per generated video with status, error code, token refund flag, and timestamps. Use get_video_generation for one row\'s detail.', ListVideoGenerationsShape, withTracking('list_video_generations', async (args) => {
110
+ server.tool('list_video_generations', 'List the video generation history (newest first): one row per generated video with status, error code, token refund flag, and timestamps. Use get_video_generation for one row\'s detail.', ListVideoGenerationsShape, READ_ONLY, withTracking('list_video_generations', async (args) => {
92
111
  return handleListVideoGenerations(apiClient, args);
93
112
  }));
94
- server.tool('get_video_generation', 'Get one video generation\'s detail by generation ID (the generationId field from list_video_generations).', GetVideoGenerationShape, withTracking('get_video_generation', async (args) => {
113
+ server.tool('get_video_generation', 'Get one video generation\'s detail by generation ID (the generationId field from list_video_generations).', GetVideoGenerationShape, READ_ONLY, withTracking('get_video_generation', async (args) => {
95
114
  return handleGetVideoGeneration(apiClient, args);
96
115
  }));
97
- server.tool('cancel_video_task', 'Cancel/remove one of your video tasks on the generation engine by task id (from get_video_status, get_video_task_progress, get_post or list_posts). Only the caller\'s own task can be cancelled; a persona-scoped API key can only cancel tasks belonging to its personas. Unknown or already-finished tasks return an error. No token refund is issued by this call.', CancelVideoTaskShape, withTracking('cancel_video_task', async (args) => {
116
+ server.tool('cancel_video_task', 'Cancel/remove one of your video tasks on the generation engine by task id (from get_video_status, get_video_task_progress, get_post or list_posts). Only the caller\'s own task can be cancelled; a persona-scoped API key can only cancel tasks belonging to its personas. Unknown or already-finished tasks return an error. No token refund is issued by this call.', CancelVideoTaskShape, DESTRUCTIVE, withTracking('cancel_video_task', async (args) => {
98
117
  return handleCancelVideoTask(apiClient, args);
99
118
  }));
100
- server.tool('get_post', 'Get one post\'s full detail by id, whichever kind it is: a scheduled slot (kind "slot") or a direct video generation (kind "generation"). The server resolves the id, so there is no need to guess between get_slot and get_video_generation. Both kinds carry live generation progress while the video is still generating. A scheduled slot carries postUrl, the link to its post detail page — send it in chat so the user can watch or download the video and edit, reschedule or delete the post.', GetPostShape, withTracking('get_post', async (args) => {
119
+ server.tool('get_post', 'Get one post\'s full detail by id, whichever kind it is: a scheduled slot (kind "slot") or a direct video generation (kind "generation"). The server resolves the id, so there is no need to guess between get_slot and get_video_generation. Both kinds carry live generation progress while the video is still generating. A scheduled slot carries postUrl, the link to its post detail page — send it in chat so the user can watch or download the video and edit, reschedule or delete the post.', GetPostShape, READ_ONLY, withTracking('get_post', async (args) => {
101
120
  return handleGetPost(apiClient, args);
102
121
  }));
103
- server.tool('get_post_metrics', 'Get per-video performance snapshots (views, likes, comments, saves) of published posts for one window (24h, 7d or 28d), newest first, optionally filtered by persona, account, provider (network) and script angle. YouTube rows also carry YouTube Analytics retention for the user\'s own videos: engagedViews, stayedToWatchPct (derived: engaged views / views), averageViewPercentage, contentType, provisional (data may still change), and analyticsStatus (scope_missing = the user must reconnect YouTube). Returns rows plus truncated (true when more rows exist than the server cap).', GetPostMetricsShape, withTracking('get_post_metrics', async (args) => {
122
+ server.tool('get_post_metrics', 'Get per-video performance snapshots (views, likes, comments, saves) of published posts for one window (24h, 7d or 28d), newest first, optionally filtered by persona, account, provider (network) and script angle. YouTube rows also carry YouTube Analytics retention for the user\'s own videos: engagedViews, stayedToWatchPct (derived: engaged views / views), averageViewPercentage, contentType, provisional (data may still change), and analyticsStatus (scope_missing = the user must reconnect YouTube). Returns rows plus truncated (true when more rows exist than the server cap).', GetPostMetricsShape, READ_ONLY, withTracking('get_post_metrics', async (args) => {
104
123
  return handleGetPostMetrics(apiClient, args);
105
124
  }));
106
- server.tool('get_youtube_retention_curve', 'Get the audience retention curve of one of the user\'s own published YouTube videos, read live from YouTube Analytics: points of ratio (elapsed share of the video, 0.01-1.0), audienceWatchRatio and relativeRetentionPerformance (vs. YouTube videos of similar length). Pass account and video from a youtube get_post_metrics row. Only the user\'s own channel is ever queried; a 403 YOUTUBE_ANALYTICS_SCOPE_MISSING means the user must reconnect YouTube.', GetYouTubeRetentionCurveShape, withTracking('get_youtube_retention_curve', async (args) => {
125
+ server.tool('get_youtube_retention_curve', 'Get the audience retention curve of one of the user\'s own published YouTube videos, read live from YouTube Analytics: points of ratio (elapsed share of the video, 0.01-1.0), audienceWatchRatio and relativeRetentionPerformance (vs. YouTube videos of similar length). Pass account and video from a youtube get_post_metrics row. Only the user\'s own channel is ever queried; a 403 YOUTUBE_ANALYTICS_SCOPE_MISSING means the user must reconnect YouTube.', GetYouTubeRetentionCurveShape, READ_ONLY, withTracking('get_youtube_retention_curve', async (args) => {
107
126
  return handleGetYouTubeRetentionCurve(apiClient, args);
108
127
  }));
109
- server.tool('list_token_transactions', 'List the token ledger: every token credit and debit (purchases, generation spends, refunds), newest first, with amounts, reasons, and the related generation when there is one. Use to audit where tokens went.', ListTokenTransactionsShape, withTracking('list_token_transactions', async (args) => {
128
+ server.tool('list_token_transactions', 'List the token ledger: every token credit and debit (purchases, generation spends, refunds), newest first, with amounts, reasons, and the related generation when there is one. Use to audit where tokens went.', ListTokenTransactionsShape, READ_ONLY, withTracking('list_token_transactions', async (args) => {
110
129
  return handleListTokenTransactions(apiClient, args);
111
130
  }));
112
- server.tool('get_persona_delete_preview', 'Preview what deleting a persona would remove: counts of schedules, upcoming/published/failed slots, generated videos and library images, plus per-video download links (read-only, never mutates). Call before delete_persona.', GetPersonaDeletePreviewShape, withTracking('get_persona_delete_preview', async (args) => {
131
+ server.tool('get_persona_delete_preview', 'Preview what deleting a persona would remove: counts of schedules, upcoming/published/failed slots, generated videos and library images, plus per-video download links (read-only, never mutates). Call before delete_persona.', GetPersonaDeletePreviewShape, READ_ONLY, withTracking('get_persona_delete_preview', async (args) => {
113
132
  return handleGetPersonaDeletePreview(apiClient, args);
114
133
  }));
115
- server.tool('delete_persona', 'DESTRUCTIVE and irreversible: delete a persona with all its schedules, slots, generated videos, and image library. No token refunds — prepaid tokens for pending slots are forfeited. Call get_persona_delete_preview first.', DeletePersonaShape, withTracking('delete_persona', async (args) => {
134
+ server.tool('delete_persona', 'DESTRUCTIVE and irreversible: delete a persona with all its schedules, slots, generated videos, and image library. No token refunds — prepaid tokens for pending slots are forfeited. Call get_persona_delete_preview first.', DeletePersonaShape, DESTRUCTIVE, withTracking('delete_persona', async (args) => {
116
135
  return handleDeletePersona(apiClient, args);
117
136
  }));
118
- server.tool('disconnect_account', 'Disconnect a social account by provider and account ID (the IDs from list_social_accounts). The account stops being available for publishing.', DisconnectAccountShape, withTracking('disconnect_account', async (args) => {
137
+ server.tool('disconnect_account', 'Disconnect a social account by provider and account ID (the IDs from list_social_accounts). The account stops being available for publishing.', DisconnectAccountShape, DESTRUCTIVE, withTracking('disconnect_account', async (args) => {
119
138
  return handleDisconnectAccount(apiClient, args);
120
139
  }));
121
- server.tool('get_token_balance', 'Get the prepaid token wallet balance. Check before triggering video generation, which costs tokens.', GetTokenBalanceShape, withTracking('get_token_balance', withRecipeNudge(recipeSession, 'get_token_balance', async () => {
140
+ server.tool('get_token_balance', 'Get the prepaid token wallet balance. Check before triggering video generation, which costs tokens.', GetTokenBalanceShape, READ_ONLY, withTracking('get_token_balance', withRecipeNudge(recipeSession, 'get_token_balance', async () => {
122
141
  return handleGetTokenBalance(apiClient);
123
142
  })));
124
- server.tool('generate_persona_video', 'Generate and schedule ONE persona video from a complete script. Product rule: generation is always tied to publishing — one call generates the video AND schedules its automatic publish; there is no orphan generation. Send the full script as segments (first hook, then body, last CTA; 60-200 words total, body at least 30, CTA 5-20, hook 15-40 words ending with terminal punctuation) — no LLM expands it. title is the slot label for this video. Pass providers plus per-provider account IDs (see list_social_accounts), startAt (ISO datetime, wall-clock in timezone when naive), times (HH:MM, 24h), and timezone. Set mode to \'asap\' to publish the video the moment its generation finishes instead of scheduling it — startAt and times must NOT be set then. The slot must be 3h-30d ahead. idempotencyKey is generated automatically; reuse it to retry without generating twice (replayed: true). If the request is a topic rather than a ready script, call list_prompts first and follow the matching recipe with get_prompt instead of improvising the script — recipes pre-validate the script, media, and price facts before any token is spent; then pass its slug as recipe. Wait for the slot\'s taskId with wait_for_video_tasks — it blocks until the video completes or fails and reports the outcome.', GeneratePersonaVideoShape, withTracking('generate_persona_video', withScriptOutcome(recipeSession, 'generate_persona_video', async (args) => handleGeneratePersonaVideo(apiClient, args))));
125
- server.tool('generate_persona_video_batch', GeneratePersonaVideoBatchDescription, GeneratePersonaVideoBatchShape, withTracking('generate_persona_video_batch', async (args) => handleGeneratePersonaVideoBatch(apiClient, args)));
126
- server.tool('validate_script', ValidateScriptDescription, ValidateScriptShape, withTracking('validate_script', withScriptOutcome(recipeSession, 'validate_script', async (args) => handleValidateScript(apiClient, args))));
127
- server.tool('score_draft', ScoreDraftDescription, ScoreDraftShape, withTracking('score_draft', async (args) => handleScoreDraft(apiClient, args)));
128
- server.tool('upload_media', UploadMediaDescription, UploadMediaShape, withTracking('upload_media', async (args) => handleUploadMedia(apiClient, args)));
129
- server.tool('check_media', CheckMediaDescription, CheckMediaShape, withTracking('check_media', async (args) => handleCheckMedia(apiClient, args)));
143
+ server.tool('generate_persona_video', 'Generate and schedule ONE persona video from a complete script. Product rule: generation is always tied to publishing — one call generates the video AND schedules its automatic publish; there is no orphan generation. Send the full script as segments (first hook, then body, last CTA; 60-200 words total, body at least 30, CTA 5-20, hook 15-40 words ending with terminal punctuation) — no LLM expands it. title is the slot label for this video. Pass providers plus per-provider account IDs (see list_social_accounts), startAt (ISO datetime, wall-clock in timezone when naive), times (HH:MM, 24h), and timezone. Set mode to \'asap\' to publish the video the moment its generation finishes instead of scheduling it — startAt and times must NOT be set then. The slot must be 3h-30d ahead. idempotencyKey is generated automatically; reuse it to retry without generating twice (replayed: true). If the request is a topic rather than a ready script, call list_prompts first and follow the matching recipe with get_prompt instead of improvising the script — recipes pre-validate the script, media, and price facts before any token is spent; then pass its slug as recipe. Wait for the slot\'s taskId with wait_for_video_tasks — it blocks until the video completes or fails and reports the outcome.', GeneratePersonaVideoShape, MUTATING, withTracking('generate_persona_video', withScriptOutcome(recipeSession, 'generate_persona_video', async (args) => handleGeneratePersonaVideo(apiClient, args))));
144
+ server.tool('generate_persona_video_batch', GeneratePersonaVideoBatchDescription, GeneratePersonaVideoBatchShape, MUTATING, withTracking('generate_persona_video_batch', async (args) => handleGeneratePersonaVideoBatch(apiClient, args)));
145
+ server.tool('validate_script', ValidateScriptDescription, ValidateScriptShape, READ_ONLY, withTracking('validate_script', withScriptOutcome(recipeSession, 'validate_script', async (args) => handleValidateScript(apiClient, args))));
146
+ server.tool('score_draft', ScoreDraftDescription, ScoreDraftShape, READ_ONLY, withTracking('score_draft', async (args) => handleScoreDraft(apiClient, args)));
147
+ server.tool('check_media', CheckMediaDescription, CheckMediaShape, READ_ONLY, withTracking('check_media', async (args) => handleCheckMedia(apiClient, args)));
130
148
  // Paired A/B content experiments (issue #476).
131
- server.tool('create_experiment', 'Create a paired A/B experiment that tests ONE script variable (the hook) with two variants, each with a slug variantId (e.g. hook-aggressive; never "A"/"B"), a name and a style description you will follow when writing its hooks. Then call add_experiment_pair once per pair. Results come from get_experiment_results.', CreateExperimentShape, withTracking('create_experiment', async (args) => handleCreateExperiment(apiClient, args)));
132
- server.tool('list_experiments', 'List your paired A/B experiments with their two variants and target pairs.', ListExperimentsShape, withTracking('list_experiments', async () => handleListExperiments(apiClient)));
133
- server.tool('add_experiment_pair', 'Create both videos of one experiment pair: the same title, body and CTA (segments, without the hook) and one hook per variant. Each video is a normal generate-and-schedule video (charged as usual); the second one starts spacingHours after the first and the order alternates per pair. The server rejects the second video of a pair (before charging; a concurrent race is caught after the insert and refunded) unless it matches the first in: the same providers and accounts, the same title, voice (id and audio URL), video type, video aspect and layout, paragraph number, face quality, language, niche and CTA text, and identical body and CTA segments, with a different hook. The pinned options.imageId is not stored, so it is not compared: pass the same imageId (or none) to both videos yourself. Calling it again with the same arguments replays the videos already created.', AddExperimentPairShape, withTracking('add_experiment_pair', async (args) => handleAddExperimentPair(apiClient, args)));
134
- server.tool('get_experiment_results', 'Get an experiment\'s videos by pair and its paired results per provider for a metrics window (default 7d): per-pair views/likes/comments/average view duration, wins per variant, sign-test pValue and a label — pending (nothing to compare), indicative (not proven: too few pairs or not all pairs in) or clear (every target pair decided and p < 0.05). Never call a variant the winner unless the label is clear.', GetExperimentResultsShape, withTracking('get_experiment_results', async (args) => handleGetExperimentResults(apiClient, args)));
135
- server.tool('get_video_status', 'Check the generation status and fetch final video URLs for a taskId. When the video belongs to a scheduled slot the body also carries postUrl, the link to its post detail page — send it in chat so the user can watch or download the video.', GetVideoStatusShape, withTracking('get_video_status', async (args) => handleGetVideoStatus(apiClient, args)));
136
- server.tool('get_video_task_progress', 'Poll one video task for its machine-readable progress: returns {task_id, state, progress, stage, error, postUrl}. error is the engine failure reason when state is -1 (failed), null otherwise. postUrl is the link to the post detail page when the video belongs to a scheduled slot (null otherwise) — send it in chat so the user can watch or download the video. Use for the video after generate_persona_video; prefer this over get_video_status when only progress matters. Prefer wait_for_video_tasks when you need the final outcome instead of progress snapshots.', GetVideoTaskProgressShape, withTracking('get_video_task_progress', async (args) => {
149
+ server.tool('create_experiment', 'Create a paired A/B experiment that tests ONE script variable (the hook) with two variants, each with a slug variantId (e.g. hook-aggressive; never "A"/"B"), a name and a style description you will follow when writing its hooks. Then call add_experiment_pair once per pair. Results come from get_experiment_results.', CreateExperimentShape, MUTATING, withTracking('create_experiment', async (args) => handleCreateExperiment(apiClient, args)));
150
+ server.tool('list_experiments', 'List your paired A/B experiments with their two variants and target pairs.', ListExperimentsShape, READ_ONLY, withTracking('list_experiments', async () => handleListExperiments(apiClient)));
151
+ server.tool('add_experiment_pair', 'Create both videos of one experiment pair: the same title, body and CTA (segments, without the hook) and one hook per variant. Each video is a normal generate-and-schedule video (charged as usual); the second one starts spacingHours after the first and the order alternates per pair. The server rejects the second video of a pair (before charging; a concurrent race is caught after the insert and refunded) unless it matches the first in: the same providers and accounts, the same title, voice (id and audio URL), video type, video aspect and layout, paragraph number, face quality, language, niche and CTA text, and identical body and CTA segments, with a different hook. The pinned options.imageId is not stored, so it is not compared: pass the same imageId (or none) to both videos yourself. Calling it again with the same arguments replays the videos already created.', AddExperimentPairShape, MUTATING, withTracking('add_experiment_pair', async (args) => handleAddExperimentPair(apiClient, args)));
152
+ server.tool('get_experiment_results', 'Get an experiment\'s videos by pair and its paired results per provider for a metrics window (default 7d): per-pair views/likes/comments/average view duration, wins per variant, sign-test pValue and a label — pending (nothing to compare), indicative (not proven: too few pairs or not all pairs in) or clear (every target pair decided and p < 0.05). Never call a variant the winner unless the label is clear.', GetExperimentResultsShape, READ_ONLY, withTracking('get_experiment_results', async (args) => handleGetExperimentResults(apiClient, args)));
153
+ server.tool('get_video_status', 'Check the generation status and fetch final video URLs for a taskId. When the video belongs to a scheduled slot the body also carries postUrl, the link to its post detail page — send it in chat so the user can watch or download the video.', GetVideoStatusShape, READ_ONLY, withTracking('get_video_status', async (args) => handleGetVideoStatus(apiClient, args)));
154
+ server.tool('get_video_task_progress', 'Poll one video task for its machine-readable progress: returns {task_id, state, progress, stage, error, postUrl}. error is the engine failure reason when state is -1 (failed), null otherwise. postUrl is the link to the post detail page when the video belongs to a scheduled slot (null otherwise) — send it in chat so the user can watch or download the video. Use for the video after generate_persona_video; prefer this over get_video_status when only progress matters. Prefer wait_for_video_tasks when you need the final outcome instead of progress snapshots.', GetVideoTaskProgressShape, READ_ONLY, withTracking('get_video_task_progress', async (args) => {
137
155
  return handleGetVideoTaskProgress(apiClient, args);
138
156
  }));
139
- server.tool('wait_for_video_tasks', 'Wait for one or more video tasks to reach a terminal state: blocks until every taskId completes (state 1) or fails (state -1, or gone from the engine), or the timeout elapses. Returns {summary, allTerminal, timedOut, results} with one entry per taskId: {task_id, state, outcome, progress, stage, error, postUrl}. error is the engine failure reason when outcome is failed. postUrl is the link to the post detail page when the video belongs to a scheduled slot (null otherwise) — send it in chat so the user can watch or download the video. Use after generate_persona_video or generate_persona_video_batch instead of polling get_video_task_progress. On timeout the results are partial: call again with the unfinished taskIds.', WaitForVideoTasksShape, withTracking('wait_for_video_tasks', async (args) => {
157
+ server.tool('wait_for_video_tasks', 'Wait for one or more video tasks to reach a terminal state: blocks until every taskId completes (state 1) or fails (state -1, or gone from the engine), or the timeout elapses. Returns {summary, allTerminal, timedOut, results} with one entry per taskId: {task_id, state, outcome, progress, stage, error, postUrl}. error is the engine failure reason when outcome is failed. postUrl is the link to the post detail page when the video belongs to a scheduled slot (null otherwise) — send it in chat so the user can watch or download the video. Use after generate_persona_video or generate_persona_video_batch instead of polling get_video_task_progress. On timeout the results are partial: call again with the unfinished taskIds.', WaitForVideoTasksShape, READ_ONLY, withTracking('wait_for_video_tasks', async (args) => {
140
158
  return handleWaitForVideoTasks(apiClient, args);
141
159
  }));
142
- 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_persona_video options.imageId to force a specific image for the video.`, ListPersonaImagesShape, withTracking('list_persona_images', async (args) => {
160
+ 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_persona_video options.imageId to force a specific image for the video.`, ListPersonaImagesShape, READ_ONLY, withTracking('list_persona_images', async (args) => {
143
161
  return handleListPersonaImages(apiClient, args);
144
162
  }));
145
- 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 full libraries (${MAX_LIBRARY_IMAGES} max).`, AddPersonaImageShape, withTracking('add_persona_image', async (args) => {
146
- return handleAddPersonaImage(apiClient, args);
147
- }));
148
- server.tool('update_persona_image', 'Update a persona library image tag, description, or primary flag.', UpdatePersonaImageShape, withTracking('update_persona_image', async (args) => {
163
+ server.tool('update_persona_image', 'Update a persona library image tag, description, or primary flag.', UpdatePersonaImageShape, MUTATING, withTracking('update_persona_image', async (args) => {
149
164
  return handleUpdatePersonaImage(apiClient, args);
150
165
  }));
151
- server.tool('remove_persona_image', 'Remove an image from a persona image library.', RemovePersonaImageShape, withTracking('remove_persona_image', async (args) => {
166
+ server.tool('remove_persona_image', 'Remove an image from a persona image library.', RemovePersonaImageShape, DESTRUCTIVE, withTracking('remove_persona_image', async (args) => {
152
167
  return handleRemovePersonaImage(apiClient, args);
153
168
  }));
154
- server.tool('publish_video_direct', `Publish a ready-made video file directly to social accounts — no generation, no schedule. Reads a local video (.mp4 or .mov, max ${MAX_UPLOAD_VIDEO_GB}GB) and posts it immediately via POST /api/upload-content. YouTube requires title, description, tags, and privacyStatus; Rumble and Fanvue require title and description; Instagram/Bluesky/LinkedIn/Threads/Facebook/3Speak require caption.`, PublishVideoDirectShape, withTracking('publish_video_direct', async (args) => {
155
- return handlePublishVideoDirect(apiClient, args);
156
- }));
169
+ registerPublishUploadedTools(server, apiClient); // JSON-only signed-upload tools: both transports.
170
+ // Local-file tools exist only on stdio, where the disk is the agent's
171
+ // own machine; the remote server must never read paths from its host.
172
+ if (!isRemote)
173
+ registerLocalFileTools(server, apiClient);
157
174
  return server;
158
175
  }
159
176
  export function isMainModule() {
@@ -170,7 +187,7 @@ export function isMainModule() {
170
187
  return false;
171
188
  }
172
189
  }
173
- async function main() {
190
+ export async function main() {
174
191
  // Without --http-transport the server stays on stdio, no port; with OAuth, HTTP requests authenticate, else loopback only.
175
192
  const httpOptions = parseHttpTransportOptions(process.argv.slice(2), process.env);
176
193
  if (httpOptions !== null) {
@@ -179,7 +196,7 @@ async function main() {
179
196
  // OAuth mode needs no local key; loopback mode still fails fast without one.
180
197
  // Fresh server per request; the bearer is forwarded as this request's web API credential.
181
198
  const apiKey = authOptions !== null ? process.env.POST_ENGINEER_API_KEY : requireApiKey();
182
- await serveHttpTransport((auth) => createPostEngineerMcpServer(new PostEngineerClient({ apiKey: auth?.bearer ?? apiKey }), 'http'), httpOptions, authOptions);
199
+ await serveHttpTransport((auth) => createPostEngineerMcpServer(new PostEngineerClient({ apiKey: auth?.bearer ?? apiKey, suppressVersionHeader: true }), 'http'), httpOptions, authOptions);
183
200
  return;
184
201
  }
185
202
  const server = createPostEngineerMcpServer(new PostEngineerClient({ apiKey: requireApiKey() }));
package/dist/index.js.map CHANGED
@@ -1 +1 @@
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,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAChH,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EACnB,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,yBAAyB,EACzB,uBAAuB,EACvB,0BAA0B,EAC1B,4BAA4B,EAC5B,kBAAkB,EAClB,sBAAsB,EACtB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declare function registerLocalFileTools(server: McpServer, apiClient: PostEngineerClient): void;
@@ -0,0 +1,15 @@
1
+ import { withTracking } from './analytics.js';
2
+ import { MUTATING, DESTRUCTIVE } from './tool-annotations.js';
3
+ import { MAX_LIBRARY_IMAGE_MB, MAX_LIBRARY_IMAGES, MAX_UPLOAD_VIDEO_GB } from './client.js';
4
+ import { AddPersonaImageShape, PublishVideoDirectShape, handleAddPersonaImage, handlePublishVideoDirect, } from './tools.js';
5
+ import { UploadMediaDescription, UploadMediaShape, handleUploadMedia } from './tools-user-media.js';
6
+ export function registerLocalFileTools(server, apiClient) {
7
+ server.tool('upload_media', UploadMediaDescription, UploadMediaShape, MUTATING, withTracking('upload_media', async (args) => handleUploadMedia(apiClient, args)));
8
+ 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 full libraries (${MAX_LIBRARY_IMAGES} max).`, AddPersonaImageShape, MUTATING, withTracking('add_persona_image', async (args) => {
9
+ return handleAddPersonaImage(apiClient, args);
10
+ }));
11
+ server.tool('publish_video_direct', `Publish a ready-made video file directly to social accounts — no generation, no schedule. Reads a local video (.mp4 or .mov, max ${MAX_UPLOAD_VIDEO_GB}GB) and posts it immediately via POST /api/upload-content. YouTube requires title, description, tags, and privacyStatus; Rumble and Fanvue require title and description; Instagram/Bluesky/LinkedIn/Threads/Facebook/3Speak require caption.`, PublishVideoDirectShape, DESTRUCTIVE, withTracking('publish_video_direct', async (args) => {
12
+ return handlePublishVideoDirect(apiClient, args);
13
+ }));
14
+ }
15
+ //# sourceMappingURL=local-file-tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-file-tools.js","sourceRoot":"","sources":["../src/local-file-tools.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,mBAAmB,EAA2B,MAAM,aAAa,CAAC;AACrH,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAEpG,MAAM,UAAU,sBAAsB,CAAC,MAAiB,EAAE,SAA6B;IACrF,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,QAAQ,EAAE,YAAY,CAAC,cAAc,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,iBAAiB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IAElK,MAAM,CAAC,IAAI,CACT,mBAAmB,EACnB,+FAA+F,oBAAoB,2HAA2H,kBAAkB,QAAQ,EACxQ,oBAAoB,EAAE,QAAQ,EAC9B,YAAY,CAAC,mBAAmB,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QAC/C,OAAO,qBAAqB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAChD,CAAC,CAAC,CACH,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,sBAAsB,EACtB,oIAAoI,mBAAmB,+OAA+O,EACtY,uBAAuB,EAAE,WAAW,EACpC,YAAY,CAAC,sBAAsB,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QAClD,OAAO,wBAAwB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IACnD,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { z } from 'zod';
2
+ export declare const musicMoodField: z.ZodOptional<z.ZodString>;
@@ -0,0 +1,33 @@
1
+ // Shared musicMood field schema: single source of truth for the web app
2
+ // and the MCP server, for the options.musicMood field of
3
+ // generate-and-schedule (issue #561, first shared JSON body).
4
+ // DO NOT EDIT this copy directly in apps/web or apps/mcp: the files at
5
+ // apps/web/lib/generation/music-mood-field.ts and
6
+ // apps/mcp/src/music-mood-field.ts are generated copies of this file.
7
+ // Edit here, then run `node scripts/sync-music-mood-field.mjs` from the
8
+ // repo root (both apps also run it from their prebuild/pretest scripts).
9
+ //
10
+ // Both apps already sent this exact shape before it was shared: the web
11
+ // route's OptionsSchema and the MCP's GeneratePersonaVideoOptionsShape
12
+ // each defined `z.string().min(1).max(64).optional()` for musicMood, and
13
+ // the MCP additionally carried the describe text below. Sharing the field
14
+ // means the MCP can no longer strip or loosen a mood the web route would
15
+ // reject (or the reverse) without the drift tests failing.
16
+ //
17
+ // Zod compatibility: this file must compile and behave the same under
18
+ // Zod 3 (apps/mcp) and Zod 4 (apps/web), so it uses only syntax both
19
+ // accept — z.string().min().max().optional().describe(). No .url(),
20
+ // errorMap, or error-customization APIs, whose shapes differ by major.
21
+ //
22
+ // The shape check only bounds the value (a 1-64 char string, optional):
23
+ // the 64-char cap mirrors the engine's VideoParams.music_mood
24
+ // max_length. Whether the mood names a catalogued mood (or "none") is a
25
+ // separate pre-charge check on the web side (lib/generation/music-moods).
26
+ import { z } from 'zod';
27
+ export const musicMoodField = z
28
+ .string()
29
+ .min(1)
30
+ .max(64)
31
+ .optional()
32
+ .describe('Background-music mood for the video: a mood from the engine BGM catalog, or "none" for explicit no music. Omitted lets the engine pick the first catalogued mood; an unknown mood is rejected with a 400 naming the valid moods. Works with faceless videos too.');
33
+ //# sourceMappingURL=music-mood-field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"music-mood-field.js","sourceRoot":"","sources":["../src/music-mood-field.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,yDAAyD;AACzD,8DAA8D;AAC9D,uEAAuE;AACvE,kDAAkD;AAClD,sEAAsE;AACtE,wEAAwE;AACxE,yEAAyE;AACzE,EAAE;AACF,wEAAwE;AACxE,uEAAuE;AACvE,yEAAyE;AACzE,0EAA0E;AAC1E,yEAAyE;AACzE,2DAA2D;AAC3D,EAAE;AACF,sEAAsE;AACtE,qEAAqE;AACrE,oEAAoE;AACpE,uEAAuE;AACvE,EAAE;AACF,wEAAwE;AACxE,8DAA8D;AAC9D,wEAAwE;AACxE,0EAA0E;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC;KAC5B,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,EAAE,CAAC;KACP,QAAQ,EAAE;KACV,QAAQ,CACP,kQAAkQ,CACnQ,CAAC"}
@@ -0,0 +1,73 @@
1
+ import { z } from 'zod';
2
+ export declare const CreateVideoUploadShape: {
3
+ contentType: z.ZodEnum<{
4
+ "video/mp4": "video/mp4";
5
+ "video/quicktime": "video/quicktime";
6
+ }>;
7
+ sizeBytes: z.ZodNumber;
8
+ };
9
+ export declare const CreateVideoUploadSchema: z.ZodObject<{
10
+ contentType: z.ZodEnum<{
11
+ "video/mp4": "video/mp4";
12
+ "video/quicktime": "video/quicktime";
13
+ }>;
14
+ sizeBytes: z.ZodNumber;
15
+ }, z.core.$strict>;
16
+ export declare const CompleteVideoUploadShape: {
17
+ uploadId: z.ZodString;
18
+ };
19
+ export declare const CompleteVideoUploadSchema: z.ZodObject<{
20
+ uploadId: z.ZodString;
21
+ }, z.core.$strict>;
22
+ export declare const PublishUploadedVideoShape: {
23
+ provider: z.ZodEnum<{
24
+ youtube: "youtube";
25
+ instagram: "instagram";
26
+ linkedin: "linkedin";
27
+ bluesky: "bluesky";
28
+ threads: "threads";
29
+ facebook: "facebook";
30
+ pinterest: "pinterest";
31
+ fanvue: "fanvue";
32
+ "3speak": "3speak";
33
+ rumble: "rumble";
34
+ }>;
35
+ uploadId: z.ZodString;
36
+ accountIds: z.ZodArray<z.ZodString>;
37
+ title: z.ZodOptional<z.ZodString>;
38
+ description: z.ZodOptional<z.ZodString>;
39
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
40
+ privacyStatus: z.ZodOptional<z.ZodEnum<{
41
+ public: "public";
42
+ private: "private";
43
+ unlisted: "unlisted";
44
+ }>>;
45
+ caption: z.ZodOptional<z.ZodString>;
46
+ boardId: z.ZodOptional<z.ZodString>;
47
+ };
48
+ export declare const PublishUploadedVideoSchema: z.ZodObject<{
49
+ provider: z.ZodEnum<{
50
+ youtube: "youtube";
51
+ instagram: "instagram";
52
+ linkedin: "linkedin";
53
+ bluesky: "bluesky";
54
+ threads: "threads";
55
+ facebook: "facebook";
56
+ pinterest: "pinterest";
57
+ fanvue: "fanvue";
58
+ "3speak": "3speak";
59
+ rumble: "rumble";
60
+ }>;
61
+ uploadId: z.ZodString;
62
+ accountIds: z.ZodArray<z.ZodString>;
63
+ title: z.ZodOptional<z.ZodString>;
64
+ description: z.ZodOptional<z.ZodString>;
65
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
66
+ privacyStatus: z.ZodOptional<z.ZodEnum<{
67
+ public: "public";
68
+ private: "private";
69
+ unlisted: "unlisted";
70
+ }>>;
71
+ caption: z.ZodOptional<z.ZodString>;
72
+ boardId: z.ZodOptional<z.ZodString>;
73
+ }, z.core.$strict>;
@@ -0,0 +1,45 @@
1
+ // Shapes for the signed-upload publish flow (issue #561): the remote
2
+ // (HTTP) replacement for publish_video_direct. JSON only — no field
3
+ // names a file on disk. The caller first mints a signed upload with
4
+ // create_video_upload, PUTs the video bytes to the returned signedUrl,
5
+ // completes it with complete_video_upload, and finally publishes by id
6
+ // with publish_uploaded_video. Kept in a new module so tools.ts stays
7
+ // under the file-size ratchet.
8
+ import { z } from 'zod';
9
+ import { MAX_UPLOAD_VIDEO_BYTES, MAX_UPLOAD_VIDEO_GB } from './limits.js';
10
+ import { PublishVideoDirectShape } from './publish-direct-shape.js';
11
+ export const CreateVideoUploadShape = {
12
+ contentType: z
13
+ .enum(['video/mp4', 'video/quicktime'])
14
+ .describe('The real video type: video/mp4 for .mp4, video/quicktime for .mov. The server verifies the actual bytes at completion.'),
15
+ sizeBytes: z
16
+ .number()
17
+ .int()
18
+ .min(1)
19
+ .max(MAX_UPLOAD_VIDEO_BYTES)
20
+ .describe(`Exact size of the video in bytes (max ${MAX_UPLOAD_VIDEO_GB}GB).`),
21
+ };
22
+ export const CreateVideoUploadSchema = z.object(CreateVideoUploadShape).strict();
23
+ export const CompleteVideoUploadShape = {
24
+ uploadId: z
25
+ .string()
26
+ .min(1, 'uploadId is required')
27
+ .describe('The uploadId returned by create_video_upload, after the bytes were PUT to its signedUrl.'),
28
+ };
29
+ export const CompleteVideoUploadSchema = z.object(CompleteVideoUploadShape).strict();
30
+ export const PublishUploadedVideoShape = {
31
+ provider: PublishVideoDirectShape.provider,
32
+ uploadId: z
33
+ .string()
34
+ .min(1, 'uploadId is required')
35
+ .describe('The uploadId of a completed signed upload (create_video_upload + complete_video_upload). Single-use: one publish consumes it.'),
36
+ accountIds: PublishVideoDirectShape.accountIds,
37
+ title: PublishVideoDirectShape.title,
38
+ description: PublishVideoDirectShape.description,
39
+ tags: PublishVideoDirectShape.tags,
40
+ privacyStatus: PublishVideoDirectShape.privacyStatus,
41
+ caption: PublishVideoDirectShape.caption,
42
+ boardId: PublishVideoDirectShape.boardId,
43
+ };
44
+ export const PublishUploadedVideoSchema = z.object(PublishUploadedVideoShape).strict();
45
+ //# sourceMappingURL=publish-uploaded-shape.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publish-uploaded-shape.js","sourceRoot":"","sources":["../src/publish-uploaded-shape.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,oEAAoE;AACpE,oEAAoE;AACpE,uEAAuE;AACvE,uEAAuE;AACvE,sEAAsE;AACtE,+BAA+B;AAC/B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,C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G,CAAC,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC,MAAM,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import type { PostEngineerClient } from './client.js';
3
+ export declare function registerPublishUploadedTools(server: McpServer, apiClient: PostEngineerClient): void;
@@ -0,0 +1,10 @@
1
+ import { withTracking } from './analytics.js';
2
+ import { MUTATING, DESTRUCTIVE } from './tool-annotations.js';
3
+ import { CompleteVideoUploadShape, CreateVideoUploadShape, PublishUploadedVideoShape, } from './publish-uploaded-shape.js';
4
+ import { CompleteVideoUploadDescription, CreateVideoUploadDescription, PublishUploadedVideoDescription, handleCompleteVideoUpload, handleCreateVideoUpload, handlePublishUploadedVideo, } from './tools-publish-uploaded.js';
5
+ export function registerPublishUploadedTools(server, apiClient) {
6
+ server.tool('create_video_upload', CreateVideoUploadDescription, CreateVideoUploadShape, MUTATING, withTracking('create_video_upload', async (args) => handleCreateVideoUpload(apiClient, args)));
7
+ server.tool('complete_video_upload', CompleteVideoUploadDescription, CompleteVideoUploadShape, MUTATING, withTracking('complete_video_upload', async (args) => handleCompleteVideoUpload(apiClient, args)));
8
+ server.tool('publish_uploaded_video', PublishUploadedVideoDescription, PublishUploadedVideoShape, DESTRUCTIVE, withTracking('publish_uploaded_video', async (args) => handlePublishUploadedVideo(apiClient, args)));
9
+ }
10
+ //# sourceMappingURL=publish-uploaded-tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publish-uploaded-tools.js","sourceRoot":"","sources":["../src/publish-uploaded-tools.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,8BAA8B,EAC9B,4BAA4B,EAC5B,+BAA+B,EAC/B,yBAAyB,EACzB,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,6BAA6B,CAAC;AAErC,MAAM,UAAU,4BAA4B,CAAC,MAAiB,EAAE,SAA6B;IAC3F,MAAM,CAAC,IAAI,CACT,qBAAqB,EACrB,4BAA4B,EAC5B,sBAAsB,EAAE,QAAQ,EAChC,YAAY,CAAC,qBAAqB,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,uBAAuB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAC9F,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,uBAAuB,EACvB,8BAA8B,EAC9B,wBAAwB,EAAE,QAAQ,EAClC,YAAY,CAAC,uBAAuB,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,yBAAyB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAClG,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,wBAAwB,EACxB,+BAA+B,EAC/B,yBAAyB,EAAE,WAAW,EACtC,YAAY,CAAC,wBAAwB,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,0BAA0B,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CACpG,CAAC;AACJ,CAAC"}