postfast-mcp 0.1.24 → 0.2.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.
Files changed (61) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +7 -1
  4. package/dist/core/backend-port.d.ts +97 -0
  5. package/dist/core/backend-port.js +2 -0
  6. package/dist/core/backend-port.js.map +1 -0
  7. package/dist/core/build-tools.d.ts +32 -0
  8. package/dist/core/build-tools.js +73 -0
  9. package/dist/core/build-tools.js.map +1 -0
  10. package/dist/core/index.d.ts +12 -0
  11. package/dist/core/index.js +12 -0
  12. package/dist/core/index.js.map +1 -0
  13. package/dist/core/instructions.d.ts +3 -0
  14. package/dist/core/instructions.js +63 -0
  15. package/dist/core/instructions.js.map +1 -0
  16. package/dist/core/shared.d.ts +21 -0
  17. package/dist/core/shared.js +58 -0
  18. package/dist/core/shared.js.map +1 -0
  19. package/dist/core/tool-def.d.ts +47 -0
  20. package/dist/core/tool-def.js +2 -0
  21. package/dist/core/tool-def.js.map +1 -0
  22. package/dist/core/tools/accounts.d.ts +2 -0
  23. package/dist/core/tools/accounts.js +112 -0
  24. package/dist/core/tools/accounts.js.map +1 -0
  25. package/dist/core/tools/index.d.ts +7 -0
  26. package/dist/core/tools/index.js +16 -0
  27. package/dist/core/tools/index.js.map +1 -0
  28. package/dist/core/tools/posts.d.ts +2 -0
  29. package/dist/core/tools/posts.js +264 -0
  30. package/dist/core/tools/posts.js.map +1 -0
  31. package/dist/core/tools/uploads.d.ts +8 -0
  32. package/dist/core/tools/uploads.js +102 -0
  33. package/dist/core/tools/uploads.js.map +1 -0
  34. package/dist/core/tools/workspaces.d.ts +2 -0
  35. package/dist/core/tools/workspaces.js +15 -0
  36. package/dist/core/tools/workspaces.js.map +1 -0
  37. package/dist/core/types.js.map +1 -0
  38. package/dist/stdio/index.js +15 -0
  39. package/dist/stdio/index.js.map +1 -0
  40. package/dist/stdio/rest-adapter.d.ts +27 -0
  41. package/dist/stdio/rest-adapter.js +170 -0
  42. package/dist/stdio/rest-adapter.js.map +1 -0
  43. package/package.json +21 -7
  44. package/dist/client.d.ts +0 -9
  45. package/dist/client.js +0 -57
  46. package/dist/client.js.map +0 -1
  47. package/dist/index.js +0 -18
  48. package/dist/index.js.map +0 -1
  49. package/dist/tools/accounts.d.ts +0 -3
  50. package/dist/tools/accounts.js +0 -118
  51. package/dist/tools/accounts.js.map +0 -1
  52. package/dist/tools/files.d.ts +0 -3
  53. package/dist/tools/files.js +0 -87
  54. package/dist/tools/files.js.map +0 -1
  55. package/dist/tools/posts.d.ts +0 -3
  56. package/dist/tools/posts.js +0 -228
  57. package/dist/tools/posts.js.map +0 -1
  58. package/dist/types.js.map +0 -1
  59. /package/dist/{types.d.ts → core/types.d.ts} +0 -0
  60. /package/dist/{types.js → core/types.js} +0 -0
  61. /package/dist/{index.d.ts → stdio/index.d.ts} +0 -0
@@ -0,0 +1,16 @@
1
+ import { accountTools } from './accounts.js';
2
+ import { postTools } from './posts.js';
3
+ import { uploadTools } from './uploads.js';
4
+ import { workspaceTools } from './workspaces.js';
5
+ /**
6
+ * Every PostFast tool, in registration order. The order filtered to the stdio
7
+ * binding must stay exactly the published bin's tools/list order — clients and
8
+ * their prompts see it.
9
+ */
10
+ export const ALL_TOOLS = [
11
+ ...postTools,
12
+ ...accountTools,
13
+ ...workspaceTools,
14
+ ...uploadTools,
15
+ ];
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGjD;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAc;IAClC,GAAG,SAAS;IACZ,GAAG,YAAY;IACf,GAAG,cAAc;IACjB,GAAG,WAAW;CACf,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { ToolDef } from '../tool-def.js';
2
+ export declare const postTools: ToolDef[];
@@ -0,0 +1,264 @@
1
+ import { z } from 'zod';
2
+ import { CREATE_APPROVAL_STATUSES, CREATE_STATUSES, PLATFORMS, POST_STATUSES, SET_APPROVAL_STATUSES, dataListOutputSchema, jsonParse, } from '../shared.js';
3
+ /** The upload tools available on each binding, for prose that names them. */
4
+ const UPLOAD_TOOLS = {
5
+ stdio: 'upload_media / get_upload_urls',
6
+ remote: 'upload_from_url / upload_media',
7
+ };
8
+ const mediaItemSchema = (binding) => z.object({
9
+ key: z
10
+ .string()
11
+ .describe(`Media key from ${UPLOAD_TOOLS[binding]} (e.g. image/<uuid>.jpg)`),
12
+ type: z.enum(['IMAGE', 'VIDEO']),
13
+ sortOrder: z.number().int().min(0),
14
+ coverImageKey: z
15
+ .string()
16
+ .optional()
17
+ .describe('Media key of a custom cover/thumbnail for video posts. Supported on Instagram Reels, Facebook Reels, Pinterest video pins.'),
18
+ coverTimestamp: z
19
+ .string()
20
+ .optional()
21
+ .describe('Video cover timestamp in milliseconds (e.g. "5000" = 5s). Fallback when coverImageKey is also provided.'),
22
+ });
23
+ const postItemSchema = (binding) => z.object({
24
+ content: z.string().describe('Post text content'),
25
+ firstComment: z
26
+ .string()
27
+ .optional()
28
+ .describe('First comment posted automatically after publishing. Supported on X, Instagram, Facebook, YouTube, Threads, and TikTok (TikTok: Business accounts only, max 150 chars, comments must be enabled).'),
29
+ mediaItems: z
30
+ .array(mediaItemSchema(binding))
31
+ .optional()
32
+ .describe('Media attachments'),
33
+ scheduledAt: z
34
+ .string()
35
+ .optional()
36
+ .describe('Schedule time (ISO 8601). Required when status is SCHEDULED.'),
37
+ socialMediaId: z.uuid().describe('Target social account id (from list_accounts)'),
38
+ });
39
+ /** Platform-specific controls — shared across every post in the batch. */
40
+ const controlsSchema = z.object({
41
+ // X/Twitter
42
+ xRetweetUrl: z.string().optional(),
43
+ // TikTok
44
+ tiktokPrivacy: z
45
+ .enum(['PUBLIC', 'MUTUAL_FRIENDS', 'FOLLOWER_OF_CREATOR', 'ONLY_ME'])
46
+ .optional()
47
+ .describe('Deprecated. TikTok videos use the account default privacy (no per-post control) and photos default to public; use a draft for private posts.'),
48
+ tiktokIsDraft: z.boolean().optional(),
49
+ tiktokAllowComments: z.boolean().optional(),
50
+ tiktokAllowDuet: z.boolean().optional(),
51
+ tiktokAllowStitch: z.boolean().optional(),
52
+ tiktokBrandOrganic: z.boolean().optional(),
53
+ tiktokBrandContent: z.boolean().optional(),
54
+ tiktokAutoAddMusic: z.boolean().optional(),
55
+ tiktokIsAigc: z.boolean().optional().describe('Declare video as AI-generated content'),
56
+ tiktokTitle: z
57
+ .string()
58
+ .max(90)
59
+ .optional()
60
+ .describe('Title for TikTok photo posts (max 90 chars; photo posts only). When set, the full post content becomes the description; without it, content auto-splits on the first newline into title + description.'),
61
+ // Instagram
62
+ instagramPostToGrid: z.boolean().optional(),
63
+ instagramPublishType: z.enum(['TIMELINE', 'STORY', 'REEL']).optional(),
64
+ instagramCollaborators: z.array(z.string()).optional(),
65
+ instagramLocationId: z
66
+ .string()
67
+ .optional()
68
+ .describe('Geotag a single-media IG post — a numeric Facebook Page id with location data from search_places (same id as facebookPlaceId). Image/video/reel/story only, NOT carousels.'),
69
+ instagramLocationName: z
70
+ .string()
71
+ .max(255)
72
+ .optional()
73
+ .describe('Display-only place label from search_places (stored for your portal; never sent to Meta)'),
74
+ // YouTube
75
+ youtubePrivacy: z.enum(['PUBLIC', 'PRIVATE', 'UNLISTED']).optional(),
76
+ youtubeTags: z.array(z.string()).optional(),
77
+ youtubeCategoryId: z.string().optional(),
78
+ youtubeIsShort: z.boolean().optional(),
79
+ youtubeMadeForKids: z.boolean().optional(),
80
+ youtubeTitle: z.string().optional(),
81
+ youtubePlaylistId: z
82
+ .string()
83
+ .optional()
84
+ .describe('YouTube playlist id — the playlistId field from list_youtube_playlists'),
85
+ youtubeThumbnailKey: z
86
+ .string()
87
+ .optional()
88
+ .describe('Media key for a custom YouTube thumbnail (image, max 2MB, min 640px wide, 1280x720 recommended)'),
89
+ // Facebook
90
+ facebookContentType: z.enum(['POST', 'REEL', 'STORY']).optional(),
91
+ facebookAllowComments: z.boolean().optional(),
92
+ facebookPrivacy: z
93
+ .enum(['PUBLIC', 'FRIENDS_OF_FRIENDS', 'FRIENDS', 'SELF'])
94
+ .optional(),
95
+ facebookCarouselMainLink: z.string().optional(),
96
+ facebookCarouselShowEndCard: z.boolean().optional(),
97
+ facebookReelsCollaborators: z.array(z.string()).optional(),
98
+ facebookTargetCountries: z
99
+ .array(z.string().length(2))
100
+ .max(25)
101
+ .optional()
102
+ .describe('Limit who can see a Facebook FEED post by country — ISO 3166-1 alpha-2 codes (case-insensitive), max 25. Audience gating (hidden from everyone else), feed posts only — not Reels/Stories/video.'),
103
+ facebookPlaceId: z
104
+ .string()
105
+ .optional()
106
+ .describe('Geotag a Facebook FEED post — a numeric Facebook Page id with location data from search_places (same id as instagramLocationId). Feed posts only (text/photo/carousel) — not Reels/Stories/video.'),
107
+ facebookPlaceName: z
108
+ .string()
109
+ .max(255)
110
+ .optional()
111
+ .describe('Display-only place label from search_places (stored for your portal; never sent to Meta)'),
112
+ // Google Business Profile
113
+ gbpLocationId: z
114
+ .string()
115
+ .optional()
116
+ .describe('GBP location resource name — the locationId field from list_gbp_locations'),
117
+ gbpTopicType: z.enum(['STANDARD', 'EVENT', 'OFFER']).optional().describe('Post type'),
118
+ gbpCallToActionType: z
119
+ .enum(['BOOK', 'ORDER', 'LEARN_MORE', 'SIGN_UP', 'CALL', 'SHOP'])
120
+ .optional(),
121
+ gbpCallToActionUrl: z
122
+ .string()
123
+ .optional()
124
+ .describe('CTA button URL (not needed for CALL, ignored for OFFER)'),
125
+ gbpEventTitle: z.string().optional().describe('Title for EVENT/OFFER posts (max 58 chars)'),
126
+ gbpEventStartDate: z.string().optional().describe('Start date for EVENT/OFFER (ISO 8601)'),
127
+ gbpEventEndDate: z.string().optional().describe('End date for EVENT/OFFER (ISO 8601)'),
128
+ gbpOfferCouponCode: z.string().optional().describe('Coupon code (OFFER only)'),
129
+ gbpOfferRedeemUrl: z.string().optional().describe('Redemption URL (OFFER only)'),
130
+ gbpOfferTerms: z.string().optional().describe('Terms and conditions (OFFER only)'),
131
+ // Pinterest
132
+ pinterestBoardId: z
133
+ .string()
134
+ .optional()
135
+ .describe("Pinterest board id — the boardId field from list_pinterest_boards (NOT the account's socialMediaId)"),
136
+ pinterestLink: z.string().optional(),
137
+ // LinkedIn
138
+ linkedinAttachmentKey: z.string().optional(),
139
+ linkedinAttachmentTitle: z.string().optional(),
140
+ });
141
+ export const postTools = [
142
+ {
143
+ name: 'list_posts',
144
+ binding: 'both',
145
+ title: 'List Posts',
146
+ description: 'List social media posts with optional filters for specific IDs, platform, status, and date range. Failed or missed posts carry a lastError { message, code }; codes include MISSED_DISCONNECTED (the account was disconnected when the post was due — reconnect, then retry) and MISSED_NOT_PUBLISHED (passed its scheduled time plus a 2h grace window without publishing).',
147
+ inputSchema: {
148
+ page: z.number().int().min(0).default(0).describe('Page number (0-based)'),
149
+ limit: z
150
+ .number()
151
+ .int()
152
+ .min(1)
153
+ .max(50)
154
+ .default(20)
155
+ .describe('Posts per page (max 50)'),
156
+ ids: z
157
+ .array(z.uuid())
158
+ .max(100)
159
+ .optional()
160
+ .describe('Fetch only these post ids (workspace-scoped; max 100; AND-ed with other filters)'),
161
+ platforms: z.array(z.enum(PLATFORMS)).optional().describe('Filter by platforms'),
162
+ statuses: z
163
+ .array(z.enum(POST_STATUSES))
164
+ .optional()
165
+ .describe('Filter by post statuses'),
166
+ from: z
167
+ .string()
168
+ .optional()
169
+ .describe('Start date filter (ISO 8601, e.g. 2026-01-01T00:00:00.000Z)'),
170
+ to: z
171
+ .string()
172
+ .optional()
173
+ .describe('End date filter (ISO 8601, e.g. 2026-01-31T23:59:59.999Z)'),
174
+ },
175
+ outputSchema: {
176
+ data: z.array(z.unknown()).optional(),
177
+ totalCount: z.unknown().optional(),
178
+ pageInfo: z.unknown().optional(),
179
+ },
180
+ annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
181
+ run: (port, args, workspaceId) => port.listPosts(args, workspaceId),
182
+ },
183
+ {
184
+ name: 'create_posts',
185
+ binding: 'both',
186
+ title: 'Create Posts',
187
+ description: (binding) => 'Create and schedule social media posts (batch up to 15). Each post targets one social account (socialMediaId from list_accounts). SCHEDULED requires scheduledAt on every post; DRAFT must omit scheduledAt. Scheduling to a disconnected account (connectionStatus DISABLED in list_accounts) is rejected with HTTP 400 "socialMediaDisconnected" — pre-check connectionStatus before calling. Saving as DRAFT to a disconnected account is allowed. TikTok, Instagram, YouTube, Pinterest, and Google Business Profile require at least one media item EVEN FOR DRAFTS — attach media first (ask the user for an image/video, or generate+upload one, if none was provided). Attach media via the key returned by ' +
188
+ `${UPLOAD_TOOLS[binding]}.`,
189
+ inputSchema: (binding) => ({
190
+ posts: jsonParse(z
191
+ .array(postItemSchema(binding))
192
+ .min(1)
193
+ .max(15)
194
+ .describe('Array of posts to create (1-15)')),
195
+ status: z
196
+ .enum(CREATE_STATUSES)
197
+ .default('SCHEDULED')
198
+ .describe('Post status. SCHEDULED requires scheduledAt on every post.'),
199
+ approvalStatus: z
200
+ .enum(CREATE_APPROVAL_STATUSES)
201
+ .default('APPROVED')
202
+ .describe('Approval workflow status'),
203
+ controls: jsonParse(controlsSchema
204
+ .optional()
205
+ .describe('Platform-specific controls (shared across all posts in the batch)')),
206
+ }),
207
+ outputSchema: { postIds: z.array(z.string()).optional() },
208
+ annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true },
209
+ run: (port, args, workspaceId) => port.createPosts(args, workspaceId),
210
+ },
211
+ {
212
+ name: 'approve_posts',
213
+ binding: 'remote',
214
+ title: 'Approve Posts',
215
+ description: 'Set the approval status of one or more posts (approval workflow). Typically used to move posts to APPROVED so they can publish, or to PENDING_APPROVAL / REJECTED / NEEDS_WORK.',
216
+ inputSchema: {
217
+ postIds: z.array(z.uuid()).min(1).describe('Post ids to update'),
218
+ approvalStatus: z.enum(SET_APPROVAL_STATUSES).describe('New approval status'),
219
+ },
220
+ outputSchema: { success: z.boolean().optional() },
221
+ annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true },
222
+ run: (port, args, workspaceId) => port.approvePosts(args, workspaceId),
223
+ },
224
+ {
225
+ name: 'delete_post',
226
+ binding: 'both',
227
+ title: 'Delete Post',
228
+ description: 'Delete a social media post by id.',
229
+ inputSchema: {
230
+ id: z.uuid().describe('Post id to delete'),
231
+ },
232
+ outputSchema: { deleted: z.boolean().optional() },
233
+ annotations: {
234
+ readOnlyHint: false,
235
+ destructiveHint: true,
236
+ idempotentHint: true,
237
+ openWorldHint: true,
238
+ },
239
+ run: (port, args, workspaceId) => port.deletePost(args.id, workspaceId),
240
+ },
241
+ {
242
+ name: 'get_post_analytics',
243
+ binding: 'both',
244
+ title: 'Get Post Analytics',
245
+ description: 'Fetch published posts with their latest performance metrics (impressions, reach, likes, comments, shares). Only returns published posts that have a platform post ID. LinkedIn personal accounts are excluded. Supported: Instagram, Facebook, TikTok, Threads, YouTube, LinkedIn (company pages), Pinterest (Business accounts). Metric counts are returned as strings. Pinterest extras include pin_clicks, outbound_clicks, saves_90d, save_rate_90d (saves are 90-day rolling because Pinterest API does not expose lifetime totals); video pins additionally surface mrc_views, views_10s, avg_watch_time, v50_watch_time, video_starts, quartile_95_views. Video posts also include normalized watch-time on latestMetric: avgWatchTimeSeconds, totalWatchTimeSeconds, videoViews (Facebook, Instagram Reels, YouTube, Pinterest, LinkedIn company pages, TikTok). Instagram posts also include on latestMetric: saveRate (saves / reach as a percentage, rounded to 2 decimals — on IG feed posts, reels, and carousels with metrics) and reelsSkipRate (Instagram Reels only — percentage of viewers who skipped the reel in the first 3 seconds, as reported by Instagram, rounded to 2 decimals; may be absent on low-view reels or until metrics refresh). TikTok also exposes total_time_watched, average_time_watched, and full_video_watched_rate in metric.extras.',
246
+ inputSchema: {
247
+ startDate: z
248
+ .string()
249
+ .describe('Start of date range (ISO 8601, e.g. 2026-01-01T00:00:00.000Z)'),
250
+ endDate: z
251
+ .string()
252
+ .describe('End of date range (ISO 8601, e.g. 2026-01-31T23:59:59.999Z)'),
253
+ platforms: z.array(z.enum(PLATFORMS)).optional().describe('Filter by platforms'),
254
+ socialMediaIds: z
255
+ .array(z.uuid())
256
+ .optional()
257
+ .describe('Filter by specific social media account ids'),
258
+ },
259
+ outputSchema: dataListOutputSchema,
260
+ annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },
261
+ run: (port, args, workspaceId) => port.getPostAnalytics(args, workspaceId),
262
+ },
263
+ ];
264
+ //# sourceMappingURL=posts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"posts.js","sourceRoot":"","sources":["../../../src/core/tools/posts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,OAAO,EACL,wBAAwB,EACxB,eAAe,EACf,SAAS,EACT,aAAa,EACb,qBAAqB,EACrB,oBAAoB,EACpB,SAAS,GACV,MAAM,cAAc,CAAC;AAGtB,6EAA6E;AAC7E,MAAM,YAAY,GAA4B;IAC5C,KAAK,EAAE,gCAAgC;IACvC,MAAM,EAAE,gCAAgC;CACzC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,OAAgB,EAAE,EAAE,CAC3C,CAAC,CAAC,MAAM,CAAC;IACP,GAAG,EAAE,CAAC;SACH,MAAM,EAAE;SACR,QAAQ,CAAC,kBAAkB,YAAY,CAAC,OAAO,CAAC,0BAA0B,CAAC;IAC9E,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAChC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,C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AI,EAAE,WAAW,EAAE,EAAE,CAC/B,IAAI,CAAC,gBAAgB,CAAC,IAAgC,EAAE,WAAW,CAAC;KACvE;CACF,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { ToolDef } from '../tool-def.js';
2
+ /**
3
+ * `upload_media` exists on BOTH bindings but is a different tool on each:
4
+ * the stdio bin reads a local file from disk (only possible on the user's
5
+ * machine), while the remote host ingests a conversation-attached file or
6
+ * base64 bytes. They share the name, not the schema — hence two defs.
7
+ */
8
+ export declare const uploadTools: ToolDef[];
@@ -0,0 +1,102 @@
1
+ import { z } from 'zod';
2
+ import { IMAGE_MIME_TYPES, VIDEO_MIME_TYPES, dataListOutputSchema, } from '../shared.js';
3
+ const SUPPORTED_MIME_TYPES = [...IMAGE_MIME_TYPES, ...VIDEO_MIME_TYPES].join(', ');
4
+ /**
5
+ * `upload_media` exists on BOTH bindings but is a different tool on each:
6
+ * the stdio bin reads a local file from disk (only possible on the user's
7
+ * machine), while the remote host ingests a conversation-attached file or
8
+ * base64 bytes. They share the name, not the schema — hence two defs.
9
+ */
10
+ export const uploadTools = [
11
+ {
12
+ name: 'get_upload_urls',
13
+ binding: 'stdio',
14
+ title: 'Get Upload URLs',
15
+ description: 'Get signed upload URLs for media files. Upload your file to the returned URL via PUT, then use the key in create_posts mediaItems.',
16
+ inputSchema: {
17
+ contentType: z
18
+ .string()
19
+ .describe(`MIME type of the file. Supported: ${SUPPORTED_MIME_TYPES}`),
20
+ count: z
21
+ .number()
22
+ .int()
23
+ .min(1)
24
+ .max(8)
25
+ .default(1)
26
+ .describe('Number of upload URLs (1-8 for images, 1 for videos)'),
27
+ },
28
+ outputSchema: dataListOutputSchema,
29
+ annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true },
30
+ run: (port, args, workspaceId) => port.getUploadUrls(args, workspaceId),
31
+ },
32
+ {
33
+ name: 'upload_media',
34
+ binding: 'stdio',
35
+ title: 'Upload Media',
36
+ description: 'Upload a local file to PostFast and get back a media key for use in create_posts. Handles the full flow: detects content type, gets a signed URL, uploads the file, and returns the key and type.',
37
+ inputSchema: {
38
+ filePath: z
39
+ .string()
40
+ .describe('Absolute path to the local file (e.g. /Users/me/photo.jpg)'),
41
+ },
42
+ outputSchema: {
43
+ key: z.string().optional(),
44
+ type: z.string().optional(),
45
+ contentType: z.string().optional(),
46
+ },
47
+ annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true },
48
+ run: (port, args) => port.uploadLocalFile(args.filePath),
49
+ },
50
+ {
51
+ name: 'upload_from_url',
52
+ binding: 'remote',
53
+ title: 'Upload Media From URL',
54
+ description: 'Fetch media from a public https URL and store it for use in create_posts. Returns { media_id, type }; pass media_id as a mediaItems[].key. Ideal for ChatGPT/Claude-generated image URLs and remote CDN media. Redirects are followed (each hop is SSRF-validated); the URL must be public https and within the size limit. Supported types: image/jpeg, image/png, image/gif, image/webp, video/mp4, video/webm, video/quicktime.',
55
+ inputSchema: {
56
+ sourceUrl: z.url().describe('Public https URL of the media to upload'),
57
+ contentType: z
58
+ .string()
59
+ .optional()
60
+ .describe("MIME type override. If omitted, the source's Content-Type is used."),
61
+ },
62
+ outputSchema: {
63
+ media_id: z.string().optional(),
64
+ type: z.string().optional(),
65
+ },
66
+ annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true },
67
+ run: (port, args, workspaceId) => port.uploadFromUrl(args, workspaceId),
68
+ },
69
+ {
70
+ name: 'upload_media',
71
+ binding: 'remote',
72
+ title: 'Upload Media',
73
+ description: 'Upload an image/video that is present in this conversation, for use in create_posts. Pass EITHER a ChatGPT-attached or model-generated file (the `file` argument — ChatGPT fills this automatically) OR base64 bytes (`data` + `contentType`). Returns { media_id, type }; use media_id as a mediaItems[].key. For large or remote media, prefer upload_from_url. Supported types: image/jpeg, image/png, image/gif, image/webp, video/mp4, video/webm, video/quicktime.',
74
+ inputSchema: {
75
+ file: z
76
+ .object({
77
+ download_url: z.url().describe('Temporary URL to fetch the file'),
78
+ file_id: z.string(),
79
+ mime_type: z.string().optional(),
80
+ file_name: z.string().optional(),
81
+ })
82
+ .optional()
83
+ .describe('A ChatGPT-provided file (attached or generated). Filled in automatically by ChatGPT.'),
84
+ data: z
85
+ .string()
86
+ .optional()
87
+ .describe('Base64-encoded file bytes (alternative to file; no data: prefix)'),
88
+ contentType: z
89
+ .string()
90
+ .optional()
91
+ .describe('MIME type for base64 data (e.g. image/png). Required with data.'),
92
+ },
93
+ outputSchema: {
94
+ media_id: z.string().optional(),
95
+ type: z.string().optional(),
96
+ },
97
+ annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true },
98
+ _meta: { 'openai/fileParams': ['file'] },
99
+ run: (port, args, workspaceId) => port.uploadMedia(args, workspaceId),
100
+ },
101
+ ];
102
+ //# sourceMappingURL=uploads.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uploads.js","sourceRoot":"","sources":["../../../src/core/tools/uploads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,cAAc,CAAC;AAGtB,MAAM,oBAAoB,GAAG,CAAC,GAAG,gBAAgB,EAAE,GAAG,gBAAgB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEnF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAc;IACpC;QACE,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,iBAAiB;QACxB,WAAW,EACT,oIAAoI;QACtI,WAAW,EAAE;YACX,WAAW,EAAE,CAAC;iBACX,MAAM,EAAE;iBACR,QAAQ,CAAC,qCAAqC,oBAAoB,EAAE,CAAC;YACxE,KAAK,EAAE,CAAC;iBACL,MAAM,EAAE;iBACR,GAAG,EAAE;iBACL,GAAG,CAAC,CAAC,CAAC;iBACN,GAAG,CAAC,CAAC,CAAC;iBACN,OAAO,CAAC,CAAC,CAAC;i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,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE;QACjF,KAAK,EAAE,EAAE,mBAAmB,EAAE,CAAC,MAAM,CAAC,EAAE;QACxC,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,CAC/B,IAAI,CAAC,WAAW,CAAC,IAAkC,EAAE,WAAW,CAAC;KACpE;CACF,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { ToolDef } from '../tool-def.js';
2
+ export declare const workspaceTools: ToolDef[];
@@ -0,0 +1,15 @@
1
+ import { dataListOutputSchema } from '../shared.js';
2
+ export const workspaceTools = [
3
+ {
4
+ name: 'list_workspaces',
5
+ binding: 'remote',
6
+ title: 'List Workspaces',
7
+ description: 'List the workspaces this connection can act in. Use a workspace id as the optional workspaceId argument on other tools to operate across multiple workspaces (the default workspace is used when omitted).',
8
+ inputSchema: {},
9
+ outputSchema: dataListOutputSchema,
10
+ annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
11
+ workspaceScoped: false,
12
+ run: (port) => port.listWorkspaces(),
13
+ },
14
+ ];
15
+ //# sourceMappingURL=workspaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspaces.js","sourceRoot":"","sources":["../../../src/core/tools/workspaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAGpD,MAAM,CAAC,MAAM,cAAc,GAAc;IACvC;QACE,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE,QAAQ;QACjB,KAAK,EAAE,iBAAiB;QACxB,WAAW,EACT,4MAA4M;QAC9M,WAAW,EAAE,EAAE;QACf,YAAY,EAAE,oBAAoB;QAClC,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE;QACjF,eAAe,EAAE,KAAK;QACtB,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,EAAE;KACrC;CACF,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env node
2
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
4
+ import { registerCatalogTools } from '../core/build-tools.js';
5
+ import { instructionsFor } from '../core/instructions.js';
6
+ import { RestAdapter } from './rest-adapter.js';
7
+ const server = new McpServer({
8
+ name: 'postfast',
9
+ version: '0.2.0',
10
+ }, { instructions: instructionsFor('stdio') });
11
+ const port = new RestAdapter();
12
+ registerCatalogTools(server, { binding: 'stdio', port });
13
+ const transport = new StdioServerTransport();
14
+ await server.connect(transport);
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/stdio/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,MAAM,GAAG,IAAI,SAAS,CAC1B;IACE,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,OAAO;CACjB,EACD,EAAE,YAAY,EAAE,eAAe,CAAC,OAAO,CAAC,EAAE,CAC3C,CAAC;AAEF,MAAM,IAAI,GAAG,IAAI,WAAW,EAAE,CAAC;AAE/B,oBAAoB,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;AAEzD,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC"}
@@ -0,0 +1,27 @@
1
+ import type { AnalyticsArgs, ApprovePostsArgs, BackendPort, ConnectLinkArgs, CreatePostsArgs, FollowerHistoryArgs, ListPostsArgs, LocalUploadResult, UploadUrlsArgs } from '../core/backend-port.js';
2
+ /** The stdio bin's BackendPort: the public PostFast REST API over pf-api-key. */
3
+ export declare class RestAdapter implements BackendPort {
4
+ private baseUrl;
5
+ private apiKey;
6
+ constructor();
7
+ private request;
8
+ private get;
9
+ private post;
10
+ listWorkspaces(): Promise<unknown>;
11
+ listAccounts(): Promise<unknown>;
12
+ getFollowerHistory(args: FollowerHistoryArgs): Promise<unknown>;
13
+ listPinterestBoards(socialMediaId: string): Promise<unknown>;
14
+ listYoutubePlaylists(socialMediaId: string): Promise<unknown>;
15
+ listGbpLocations(socialMediaId: string): Promise<unknown>;
16
+ searchPlaces(query: string): Promise<unknown>;
17
+ generateConnectLink(args: ConnectLinkArgs): Promise<unknown>;
18
+ listPosts(args: ListPostsArgs): Promise<unknown>;
19
+ createPosts(args: CreatePostsArgs): Promise<unknown>;
20
+ approvePosts(_args: ApprovePostsArgs): Promise<unknown>;
21
+ deletePost(id: string): Promise<unknown>;
22
+ getPostAnalytics(args: AnalyticsArgs): Promise<unknown>;
23
+ getUploadUrls(args: UploadUrlsArgs): Promise<unknown>;
24
+ uploadLocalFile(filePath: string): Promise<LocalUploadResult>;
25
+ uploadFromUrl(): Promise<unknown>;
26
+ uploadMedia(): Promise<unknown>;
27
+ }