posterly-mcp-server 0.52.0 → 0.52.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -123,7 +123,7 @@ Add the same server definition to your Cursor MCP settings:
123
123
 
124
124
  ## Available tools
125
125
 
126
- `posterly-mcp-server@0.52.0` exposes 64 tools covering 100 actions. The hosted HTTP endpoint exposes the same catalog minus the three signup tools: 61 tools covering 97 actions.
126
+ `posterly-mcp-server@0.52.2` exposes 64 tools covering 100 actions. The hosted HTTP endpoint exposes the same catalog minus the three signup tools: 61 tools covering 97 actions.
127
127
 
128
128
  Many tools pick what to do with one parameter: `view` (reads), `action` (writes), or `type`. A few pick their mode from which parameters you pass (for example `update_post` with `status` changes the status instead of editing). Every tool description names all of its views and actions.
129
129
 
@@ -1254,6 +1254,7 @@ export type SignedUploadBatchSlot = {
1254
1254
  max_size: number;
1255
1255
  headers?: Record<string, string>;
1256
1256
  provider?: string;
1257
+ content_type_pinned?: boolean;
1257
1258
  } | {
1258
1259
  index: number;
1259
1260
  filename: string;
@@ -1703,18 +1704,19 @@ export declare class PosterlyClient {
1703
1704
  getXPostingQuota(params?: {
1704
1705
  workspace_id?: string;
1705
1706
  }): Promise<XPostingQuotaResponse>;
1706
- getSignedUploadUrl(filename: string, contentType: string, size: number, workspaceId?: string): Promise<{
1707
+ getSignedUploadUrl(filename: string, contentType: string, size: number, workspaceId?: string, pinContentType?: boolean): Promise<{
1707
1708
  upload_url: string;
1708
1709
  token: string;
1709
1710
  path: string;
1710
1711
  public_url: string;
1711
1712
  headers?: Record<string, string>;
1713
+ content_type_pinned?: boolean;
1712
1714
  }>;
1713
1715
  getSignedUploadUrls(files: Array<{
1714
1716
  filename: string;
1715
1717
  content_type: string;
1716
1718
  size: number;
1717
- }>, workspaceId?: string): Promise<SignedUploadBatchResponse>;
1719
+ }>, workspaceId?: string, pinContentType?: boolean): Promise<SignedUploadBatchResponse>;
1718
1720
  createMediaDrop(input?: {
1719
1721
  filename?: string;
1720
1722
  maxFiles?: number;
@@ -665,18 +665,20 @@ export class PosterlyClient {
665
665
  const qs = searchParams.toString();
666
666
  return this.request('GET', `/x-posting/quota${qs ? `?${qs}` : ''}`);
667
667
  }
668
- async getSignedUploadUrl(filename, contentType, size, workspaceId) {
668
+ async getSignedUploadUrl(filename, contentType, size, workspaceId, pinContentType) {
669
669
  return this.request('POST', '/media/signed-upload', {
670
670
  filename,
671
671
  content_type: contentType,
672
672
  size,
673
673
  ...(workspaceId ? { workspace_id: workspaceId } : {}),
674
+ ...(pinContentType ? { pin_content_type: true } : {}),
674
675
  });
675
676
  }
676
- async getSignedUploadUrls(files, workspaceId) {
677
+ async getSignedUploadUrls(files, workspaceId, pinContentType) {
677
678
  return this.request('POST', '/media/signed-upload', {
678
679
  files,
679
680
  ...(workspaceId ? { workspace_id: workspaceId } : {}),
681
+ ...(pinContentType ? { pin_content_type: true } : {}),
680
682
  });
681
683
  }
682
684
  async createMediaDrop(input) {
@@ -715,12 +717,18 @@ export class PosterlyClient {
715
717
  if (fileBuffer.length > SIZE_THRESHOLD) {
716
718
  // Large file: PUT to the object-storage signed URL (not a Vercel relay).
717
719
  const signed = await this.getSignedUploadUrl(input.filename, contentType, fileBuffer.length, input.workspaceId);
720
+ // Send the returned headers verbatim. The storage URL can be signed for
721
+ // that exact Content-Type (pinned uploads answer 403 otherwise), and
722
+ // header names are case-insensitive: adding our own 'Content-Type' next
723
+ // to the returned 'content-type' would send both, joined as
724
+ // "video/mp4, video/mp4". Only fall back to our type if none came back.
725
+ const returnedHeaders = signed.headers || {};
726
+ const hasReturnedContentType = Object.keys(returnedHeaders).some((name) => name.toLowerCase() === 'content-type');
718
727
  const uploadRes = await fetch(signed.upload_url, {
719
728
  method: 'PUT',
720
- headers: {
721
- 'Content-Type': contentType,
722
- ...(signed.headers || {}),
723
- },
729
+ headers: hasReturnedContentType
730
+ ? returnedHeaders
731
+ : { 'Content-Type': contentType, ...returnedHeaders },
724
732
  body: new Uint8Array(fileBuffer),
725
733
  });
726
734
  if (!uploadRes.ok) {
@@ -1 +1 @@
1
- export declare const POSTERLY_MCP_VERSION = "0.52.0";
1
+ export declare const POSTERLY_MCP_VERSION = "0.52.2";
@@ -5,4 +5,4 @@
5
5
  // tool set (minus the intentional pre-auth signup tools that only this stdio
6
6
  // package exposes). `npm run check:mcp-parity` enforces both the version match
7
7
  // and the tool-list match, and runs in the pre-commit hook.
8
- export const POSTERLY_MCP_VERSION = '0.52.0';
8
+ export const POSTERLY_MCP_VERSION = '0.52.2';
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  export const createMediaDropTool = {
3
3
  name: 'create_media_drop',
4
- description: 'Create a human drop page so ChatGPT or Claude users can upload laptop files (up to 20 per link) without dashboard login. Returns drop_url (https://www.poster.ly/drop/<token>). Send that URL to the user, wait, then call list_media. This is not the chat paperclip and not create_signed_upload.',
4
+ description: 'Create a human drop page so ChatGPT or Claude users can upload laptop files (up to 20 per link) without dashboard login. Returns drop_url (https://www.poster.ly/drop/<token>). Send that URL to the user, wait, then call list_media. Accepts JPEG, PNG, GIF, WebP, MP4, MOV, WebM, and PDF up to 50MB (a PDF is for LinkedIn document posts); HEIC is not accepted. This is not the chat paperclip and not create_signed_upload.',
5
5
  inputSchema: z.object({
6
6
  filename: z.string().optional().describe('Optional filename hint for the user, e.g. launch-video.mp4'),
7
7
  max_files: z
@@ -28,7 +28,7 @@ export const createMediaDropTool = {
28
28
  `• Max files: ${drop.max_files}`,
29
29
  drop.instructions,
30
30
  'After they finish, call list_media with this drop_session_id, then validate_post / create_post using public_url.',
31
- 'Chat attachments never reach MCP. HEIC and PDF are rejected.',
31
+ 'Chat attachments never reach MCP. Accepted: JPEG, PNG, GIF, WebP, MP4, MOV, WebM, and PDF up to 50MB (a PDF is for LinkedIn document posts). HEIC is not accepted.',
32
32
  ].join('\n');
33
33
  },
34
34
  };
@@ -10,6 +10,7 @@ type SignedUploadInput = {
10
10
  size: number;
11
11
  }>;
12
12
  workspace_id?: string;
13
+ pin_content_type?: boolean;
13
14
  };
14
15
  export declare function formatSignedUploadBatch(batch: SignedUploadBatchResponse, requested: Array<{
15
16
  content_type: string;
@@ -34,9 +35,11 @@ export declare const createSignedUploadTool: {
34
35
  content_type: string;
35
36
  size: number;
36
37
  }>, "many">>;
38
+ pin_content_type: z.ZodOptional<z.ZodBoolean>;
37
39
  workspace_id: z.ZodOptional<z.ZodString>;
38
40
  }, "strip", z.ZodTypeAny, {
39
41
  workspace_id?: string | undefined;
42
+ pin_content_type?: boolean | undefined;
40
43
  filename?: string | undefined;
41
44
  content_type?: string | undefined;
42
45
  size?: number | undefined;
@@ -47,6 +50,7 @@ export declare const createSignedUploadTool: {
47
50
  }[] | undefined;
48
51
  }, {
49
52
  workspace_id?: string | undefined;
53
+ pin_content_type?: boolean | undefined;
50
54
  filename?: string | undefined;
51
55
  content_type?: string | undefined;
52
56
  size?: number | undefined;
@@ -26,6 +26,9 @@ export function formatSignedUploadBatch(batch, requested) {
26
26
  continue;
27
27
  lines.push(` ${key}: ${headers[key]}`);
28
28
  }
29
+ if (slot.content_type_pinned === true) {
30
+ lines.push(' Content-Type is locked: send exactly the Content-Type above or storage rejects the PUT with 403.');
31
+ }
29
32
  lines.push(` Public URL after upload: ${slot.public_url}`);
30
33
  if (slot.expires_at && (!earliestExpiry || slot.expires_at < earliestExpiry)) {
31
34
  earliestExpiry = slot.expires_at;
@@ -37,12 +40,15 @@ export function formatSignedUploadBatch(batch, requested) {
37
40
  }
38
41
  lines.push('');
39
42
  });
43
+ if (batch.slots.some((slot) => slot.ok && slot.content_type_pinned === true)) {
44
+ lines.push('Slots marked "Content-Type is locked" accept only a PUT whose Content-Type header is exactly the one shown (curl --data-binary needs -H "Content-Type: ...").');
45
+ }
40
46
  lines.push(`PUT each file, then pass public_url to create_post / create_posts_batch. Slots expire at ${earliestExpiry ?? 'the expires_at time returned (15 minutes)'}, call again for fresh slots.`);
41
47
  return lines.join('\n');
42
48
  }
43
49
  export const createSignedUploadTool = {
44
50
  name: 'create_signed_upload',
45
- description: 'Create signed upload URLs for larger images or videos, 1 to 20 files per call. For one file pass filename, content_type and size. For several pass files: [{filename, content_type, size}] (up to 20) and get one slot per file, with any file that fails reported in place. PUT the raw bytes of each file to its upload_url (object storage) with the returned headers, then pass public_url to create_post / create_posts_batch. Slots expire in 15 minutes.',
51
+ description: 'Create signed upload URLs for larger images, videos or PDFs, 1 to 20 files per call. Accepts JPEG, PNG, GIF, WebP, MP4, MOV, WebM, and PDF up to 50MB (a PDF is for LinkedIn document posts); HEIC is not accepted. For one file pass filename, content_type and size. For several pass files: [{filename, content_type, size}] (up to 20) and get one slot per file, with any file that fails reported in place. PUT the raw bytes of each file to its upload_url (object storage) with the returned headers, then pass public_url to create_post / create_posts_batch. For a PDF, create the post with post_type document, media_url set to that public_url and a document_title in settings (LinkedIn only). Pinning is available per request with pin_content_type: true, which locks each slot to the content_type you declare (a PUT with any other Content-Type then fails with 403). posterly may turn it on by default in the future, so always send the Content-Type header returned with the slot. Slots expire in 15 minutes.',
46
52
  inputSchema: z.object({
47
53
  filename: z.string().optional().describe('Single file: filename with extension, e.g. launch-video.mp4. Omit when using files.'),
48
54
  content_type: z.string().optional().describe('Single file: MIME type, e.g. video/mp4. Omit when using files.'),
@@ -53,6 +59,10 @@ export const createSignedUploadTool = {
53
59
  .max(20)
54
60
  .optional()
55
61
  .describe('Batch: 1 to 20 files, each with filename, content_type and size. Use instead of the single-file fields.'),
62
+ pin_content_type: z
63
+ .boolean()
64
+ .optional()
65
+ .describe('Optional. true locks each slot to the declared content_type so a PUT with any other Content-Type fails with 403. Send the returned Content-Type header exactly.'),
56
66
  workspace_id: z.string().optional().describe('Optional. The workspace this acts in and whose plan pays (from whoami). Needed only when your connection can act in several workspaces.'),
57
67
  }),
58
68
  async execute(client, input) {
@@ -60,13 +70,27 @@ export const createSignedUploadTool = {
60
70
  if (input.filename !== undefined || input.content_type !== undefined || input.size !== undefined) {
61
71
  throw new Error('Pass either files or the single-file fields (filename, content_type, size), not both.');
62
72
  }
63
- const batch = await client.getSignedUploadUrls(input.files, input.workspace_id);
73
+ const batch = await client.getSignedUploadUrls(input.files, input.workspace_id, input.pin_content_type === true);
64
74
  return formatSignedUploadBatch(batch, input.files);
65
75
  }
66
76
  if (!input.filename || !input.content_type || !input.size) {
67
77
  throw new Error('Provide filename, content_type and size for one file, or files for a batch of up to 20.');
68
78
  }
69
- const signed = await client.getSignedUploadUrl(input.filename, input.content_type, input.size, input.workspace_id);
79
+ const signed = await client.getSignedUploadUrl(input.filename, input.content_type, input.size, input.workspace_id, input.pin_content_type === true);
80
+ if (signed.content_type_pinned === true) {
81
+ const headers = signed.headers || {};
82
+ const contentTypeKey = Object.keys(headers).find((key) => key.toLowerCase() === 'content-type');
83
+ const sendType = contentTypeKey ? headers[contentTypeKey] : input.content_type;
84
+ return [
85
+ 'Signed upload created.',
86
+ `• Upload URL: ${signed.upload_url}`,
87
+ `• Token: ${signed.token}`,
88
+ `• Storage path: ${signed.path}`,
89
+ `• Content-Type to send: ${sendType}`,
90
+ `• Public URL after upload: ${signed.public_url}`,
91
+ 'Content-Type is locked: PUT the raw file bytes to the upload URL with exactly the Content-Type above (curl --data-binary needs -H "Content-Type: ..."), or storage rejects it with 403. Then pass public_url to create_post.',
92
+ ].join('\n');
93
+ }
70
94
  return [
71
95
  'Signed upload created.',
72
96
  `• Upload URL: ${signed.upload_url}`,
@@ -3,7 +3,7 @@ import { mdError, mdSuccess } from '../lib/format.js';
3
3
  import { validateArgs } from '../lib/tool-runtime.js';
4
4
  export const uploadMediaTool = {
5
5
  name: 'upload_media',
6
- description: 'Upload an image or video to posterly storage and get a URL for create_post. Supports JPEG, PNG, GIF, WebP, MP4, MOV, WebM. Images up to 10MB, videos up to 50MB. Three ways in: file_path (an explicit local path the user gave you), base64_data with filename (PREFERRED for images shared in chat, which are not on the local filesystem), or url (a public HTTPS image or video; local/private network URLs are blocked).\n\n' +
6
+ description: 'Upload an image or video to posterly storage and get a URL for create_post. Supports JPEG, PNG, GIF, WebP, MP4, MOV, WebM (PDFs are not accepted here: use create_signed_upload or create_media_drop). Images up to 10MB, videos up to 50MB. Three ways in: file_path (an explicit local path the user gave you), base64_data with filename (PREFERRED for images shared in chat, which are not on the local filesystem), or url (a public HTTPS image or video; local/private network URLs are blocked).\n\n' +
7
7
  'This writes to the user\'s media storage (counts against quota) but does NOT publish the file anywhere. Uploading is safe - it\'s the subsequent `create_post` call that publishes content, and that tool has its own confirmation requirements. Never guess file paths. You can also pass public HTTP(S) media URLs directly to create_post/update_post; use url here when you want to upload once and reuse the returned posterly URL.',
8
8
  inputSchema: z.object({
9
9
  file_path: z
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "posterly-mcp-server",
3
- "version": "0.52.0",
3
+ "version": "0.52.2",
4
4
  "mcpName": "io.github.awpthorp/posterly",
5
5
  "description": "MCP server for posterly: schedule and publish social media posts across 18 platforms from any MCP client (Claude, ChatGPT, Cursor, Windsurf, Cline, and more)",
6
6
  "license": "MIT",
package/server.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "name": "io.github.awpthorp/posterly",
4
4
  "title": "posterly",
5
5
  "description": "Validate, schedule, publish, and analyze social content across 18 platforms with posterly.",
6
- "version": "0.52.0",
6
+ "version": "0.52.2",
7
7
  "websiteUrl": "https://www.poster.ly/mcp",
8
8
  "repository": {
9
9
  "url": "https://github.com/awpthorp/posterly-mcp-server",
@@ -13,7 +13,7 @@
13
13
  {
14
14
  "registryType": "npm",
15
15
  "identifier": "posterly-mcp-server",
16
- "version": "0.52.0",
16
+ "version": "0.52.2",
17
17
  "transport": {
18
18
  "type": "stdio"
19
19
  },