@rolino/mcp 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,14 @@
1
1
  // src/index.ts
2
2
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
3
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
- import { readFile, stat } from "fs/promises";
4
+ import { openAsBlob } from "fs";
5
+ import { stat } from "fs/promises";
5
6
  import { basename, extname, resolve } from "path";
6
7
  import {
7
8
  ActorSchema,
8
9
  CalendarListDataSchema,
9
10
  DraftPostInputSchema,
11
+ DraftPostUpdateInputSchema,
10
12
  IntegrationHealthListDataSchema,
11
13
  MediaAssetListDataSchema,
12
14
  MediaAssetSchema,
@@ -20,7 +22,9 @@ import {
20
22
  PostSchema,
21
23
  ProjectCreateInputSchema,
22
24
  ProjectListDataSchema,
23
- ProjectSchema
25
+ ProjectSchema,
26
+ ProviderDeliveryOptionsProviderSchema,
27
+ ProviderDeliveryOptionsSchema
24
28
  } from "@rolino/contracts";
25
29
  import {
26
30
  RolinoApiError,
@@ -32,7 +36,7 @@ import * as z from "zod/v4";
32
36
  // package.json
33
37
  var package_default = {
34
38
  name: "@rolino/mcp",
35
- version: "0.1.0",
39
+ version: "0.3.0",
36
40
  description: "Model Context Protocol server for Rolino",
37
41
  type: "module",
38
42
  license: "MIT",
@@ -91,9 +95,9 @@ var package_default = {
91
95
  dependencies: {
92
96
  "@hono/node-server": "2.0.12",
93
97
  "@modelcontextprotocol/sdk": "^1.30.0",
94
- "@rolino/contracts": "0.1.0",
95
- "@rolino/local-auth": "0.1.0",
96
- "@rolino/sdk": "0.1.0",
98
+ "@rolino/contracts": "0.3.0",
99
+ "@rolino/local-auth": "0.3.0",
100
+ "@rolino/sdk": "0.3.0",
97
101
  zod: "^4.4.3"
98
102
  },
99
103
  devDependencies: {
@@ -121,6 +125,42 @@ function resolveMcpConfiguration(env = process.env) {
121
125
  }
122
126
 
123
127
  // src/index.ts
128
+ var ProviderDeliveryOptionsToolSchema = z.object({
129
+ provider: ProviderDeliveryOptionsProviderSchema,
130
+ account: z.object({
131
+ username: z.string().nullable().optional(),
132
+ displayName: z.string().nullable(),
133
+ avatarUrl: z.string().url().nullable()
134
+ }).strict(),
135
+ health: z.object({
136
+ status: z.enum(["pass", "blocking", "unknown"]),
137
+ code: z.string().min(1),
138
+ message: z.string().min(1)
139
+ }).strict(),
140
+ checkedAt: z.string().datetime(),
141
+ allowedPostModes: z.array(z.enum(["DIRECT_POST", "MEDIA_UPLOAD"])).optional(),
142
+ visibilityOptions: z.array(z.string()).optional(),
143
+ interactions: z.object({
144
+ comment: z.object({ available: z.boolean() }).strict(),
145
+ duet: z.object({ available: z.boolean() }).strict(),
146
+ stitch: z.object({ available: z.boolean() }).strict()
147
+ }).strict().optional(),
148
+ maxVideoDurationMs: z.number().int().positive().nullable().optional(),
149
+ supportedPostTypes: z.array(z.enum(["TEXT", "SINGLE_IMAGE", "MULTI_IMAGE"])).optional(),
150
+ image: z.object({
151
+ maxItems: z.number().int().positive(),
152
+ mimeTypes: z.array(z.enum(["image/jpeg", "image/png"])),
153
+ maxPixelsExclusive: z.number().int().positive(),
154
+ maxBytes: z.number().int().positive()
155
+ }).strict().optional()
156
+ }).strict().superRefine((value, context) => {
157
+ if (!ProviderDeliveryOptionsSchema.safeParse(value).success) {
158
+ context.addIssue({
159
+ code: "custom",
160
+ message: "Provider delivery options do not match the canonical provider contract."
161
+ });
162
+ }
163
+ });
124
164
  var ROLINO_MCP_VERSION = package_default.version;
125
165
  var mcpDraftInputShape = {
126
166
  ...DraftPostInputSchema.shape,
@@ -129,12 +169,27 @@ var mcpDraftInputShape = {
129
169
  "Existing project media asset IDs. YouTube requires exactly one stored video; Bluesky accepts up to four stored JPEG, PNG, or WebP images."
130
170
  ),
131
171
  captionOverrides: DraftPostInputSchema.shape.captionOverrides.describe(
132
- "Optional destination text. YOUTUBE is the video description and BLUESKY is limited to 300 graphemes; when omitted, Rolino uses the shared caption."
172
+ "Optional destination text. YOUTUBE is the video description, BLUESKY is limited to 300 graphemes, and LINKEDIN is limited to 3,000 characters; when omitted, Rolino uses the shared caption."
173
+ ),
174
+ tiktokSettings: DraftPostInputSchema.shape.tiktokSettings.describe(
175
+ "TikTok delivery choices. First call refresh_delivery_options, then supply an explicit mode. Direct publishing requires an exact returned visibility plus yes/no choices for comments, duet, stitch, commercial content, own-brand promotion, third-party promotion, and AI-generated content. Set reviewed only after reviewing the account-specific options; this is distinct from draft mutation consent."
133
176
  ),
134
177
  youtubeSettings: DraftPostInputSchema.shape.youtubeSettings.describe(
135
178
  "Required with YOUTUBE: explicit title, numeric categoryId, privacyStatus, madeForKids declaration, synthetic-media disclosure, subscriber-notification choice, and tags. Unaudited Google API projects may be restricted to Private uploads."
136
179
  )
137
180
  };
181
+ var mcpDraftUpdateInputShape = {
182
+ ...DraftPostUpdateInputSchema.shape,
183
+ mediaAssetIds: DraftPostUpdateInputSchema.shape.mediaAssetIds.describe(
184
+ "Replacement ordered media asset IDs. Omit to preserve current media; pass an empty array to remove all media."
185
+ ),
186
+ platforms: DraftPostUpdateInputSchema.shape.platforms.describe(
187
+ "Replacement destinations. Omit to preserve current destinations; pass an empty array to remove them."
188
+ ),
189
+ tiktokSettings: DraftPostUpdateInputSchema.shape.tiktokSettings.describe(
190
+ "Replacement TikTok delivery choices. Omit to preserve current settings. Set reviewed only after reviewing fresh account-specific delivery options."
191
+ )
192
+ };
138
193
  var mcpScheduleExecuteOutputSchema = z.object({
139
194
  status: z.union([PostSchema.shape.status, z.literal("PENDING")]),
140
195
  id: PostSchema.shape.id.optional(),
@@ -202,6 +257,12 @@ var uploadMediaAnnotations = {
202
257
  idempotentHint: false,
203
258
  openWorldHint: true
204
259
  };
260
+ var deliveryOptionsAnnotations = {
261
+ readOnlyHint: false,
262
+ destructiveHint: false,
263
+ idempotentHint: true,
264
+ openWorldHint: true
265
+ };
205
266
  var ProjectCreateToolInputSchema = ProjectCreateInputSchema.safeExtend({
206
267
  idempotencyKey: z.string().min(1).max(200).describe("Stable caller-generated retry key for this exact creation.")
207
268
  });
@@ -347,8 +408,8 @@ function createRolinoMcpServer(options = {}) {
347
408
  const contentTypes = { ".jpg": "image/jpeg", ".jpeg": "image/jpeg", ".png": "image/png", ".webp": "image/webp", ".mp4": "video/mp4", ".mov": "video/quicktime" };
348
409
  const contentType = contentTypes[extname(absolutePath).toLowerCase()];
349
410
  if (!contentType) throw new TypeError("Use a JPEG, PNG, WebP, MP4, or MOV file.");
350
- const bytes = await readFile(absolutePath);
351
- return jsonResult(await api.media.upload(projectId, { fileName: basename(absolutePath), contentType, fileSize: details.size, body: new Blob([bytes], { type: contentType }) }));
411
+ const body = await openAsBlob(absolutePath, { type: contentType });
412
+ return jsonResult(await api.media.upload(projectId, { fileName: basename(absolutePath), contentType, fileSize: details.size, body }));
352
413
  } catch (error) {
353
414
  return errorResult(error);
354
415
  }
@@ -401,7 +462,7 @@ function createRolinoMcpServer(options = {}) {
401
462
  });
402
463
  server.registerTool("create_draft_post", {
403
464
  title: "Create Rolino draft post",
404
- description: "Create a draft in one exact project. This changes Rolino data but never schedules or publishes. A YouTube draft requires exactly one stored video plus explicit title, category, visibility, audience, disclosure, notification, and tag settings; its description uses the YOUTUBE caption override or shared caption. Unaudited Google API projects may be limited to Private uploads. Supply a stable idempotency key so retrying the same input cannot create a duplicate.",
465
+ description: "Create a draft in one exact project. This changes Rolino data but never schedules or publishes. Before a TikTok draft, refresh account-specific delivery options and mark the exact choices reviewed separately from mutation consent. A YouTube draft requires exactly one stored video plus explicit title, category, visibility, audience, disclosure, notification, and tag settings; its description uses the YOUTUBE caption override or shared caption. Unaudited Google API projects may be limited to Private uploads. Supply a stable idempotency key so retrying the same input cannot create a duplicate.",
405
466
  inputSchema: {
406
467
  projectId: z.string().min(1).describe("Exact Rolino project ID."),
407
468
  idempotencyKey: z.string().min(1).max(200).describe("Stable caller-generated retry key for this exact creation."),
@@ -421,13 +482,13 @@ function createRolinoMcpServer(options = {}) {
421
482
  });
422
483
  server.registerTool("update_draft_post", {
423
484
  title: "Update Rolino draft post",
424
- description: "Replace a draft's caption, destinations, media, and provider settings without scheduling or publishing it. YouTube still requires exactly one stored video and every explicit metadata declaration; its description uses the YOUTUBE caption override or shared caption. Read the post first and pass its current version; stale versions fail instead of overwriting another change. A stable idempotency key makes exact retries safe.",
485
+ description: "Update only the supplied draft fields without scheduling or publishing it; omitted caption, destinations, media, and provider settings are preserved. Read the post first and pass its current version; stale versions fail instead of overwriting another change. Editing TikTok content clears its prior review unless replacement settings are explicitly reviewed again. A stable idempotency key makes exact retries safe.",
425
486
  inputSchema: {
426
487
  projectId: z.string().min(1).describe("Exact Rolino project ID."),
427
488
  postId: z.string().min(1).describe("Exact Rolino draft post ID."),
428
489
  expectedVersion: z.number().int().positive().describe("Current version returned by get_post."),
429
490
  idempotencyKey: z.string().min(1).max(200).describe("Stable caller-generated retry key for this exact update."),
430
- ...mcpDraftInputShape
491
+ ...mcpDraftUpdateInputShape
431
492
  },
432
493
  outputSchema: PostSchema,
433
494
  annotations: updateDraftAnnotations
@@ -439,7 +500,7 @@ function createRolinoMcpServer(options = {}) {
439
500
  ...input
440
501
  }) => {
441
502
  try {
442
- const draft = DraftPostInputSchema.parse(input);
503
+ const draft = DraftPostUpdateInputSchema.parse(input);
443
504
  return jsonResult(await api.posts.update(projectId, postId, draft, {
444
505
  expectedVersion,
445
506
  idempotencyKey
@@ -589,6 +650,25 @@ function createRolinoMcpServer(options = {}) {
589
650
  return errorResult(error);
590
651
  }
591
652
  });
653
+ server.registerTool("refresh_delivery_options", {
654
+ title: "Refresh provider delivery options",
655
+ description: "Contact one connected publishing provider and return secret-safe, account-specific choices needed to prepare a compliant draft. TikTok returns account-specific video choices; LinkedIn returns its verified member and image policy. This refreshes cached provider health but never creates, schedules, or publishes a post.",
656
+ inputSchema: {
657
+ projectId: z.string().min(1).describe("Exact Rolino project ID."),
658
+ provider: ProviderDeliveryOptionsProviderSchema.describe("Provider whose delivery choices should be refreshed.")
659
+ },
660
+ outputSchema: ProviderDeliveryOptionsToolSchema,
661
+ annotations: deliveryOptionsAnnotations
662
+ }, async ({ projectId, provider }) => {
663
+ try {
664
+ if (!api.integrations.deliveryOptions) {
665
+ throw new TypeError("This Rolino client does not support provider delivery options.");
666
+ }
667
+ return jsonResult(await api.integrations.deliveryOptions(projectId, provider));
668
+ } catch (error) {
669
+ return errorResult(error);
670
+ }
671
+ });
592
672
  server.registerTool("list_calendar_events", {
593
673
  title: "List Rolino calendar events",
594
674
  description: "List scheduled posts and their enabled destinations in one exact project, including YouTube posts whose private early preparation has started. By default the bounded window spans 30 days in the past through 90 days ahead; provide both from and to for another range and paginate with nextCursor.",
@@ -628,4 +708,4 @@ export {
628
708
  createRolinoMcpServer,
629
709
  startStdioServer
630
710
  };
631
- //# sourceMappingURL=chunk-RSNR7K6Z.js.map
711
+ //# sourceMappingURL=chunk-L6II7ZEX.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../package.json","../src/configuration.ts"],"sourcesContent":["import { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\r\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\r\nimport { openAsBlob } from \"node:fs\";\r\nimport { stat } from \"node:fs/promises\";\r\nimport { basename, extname, resolve } from \"node:path\";\r\nimport {\r\n ActorSchema,\r\n CalendarListDataSchema,\r\n DraftPostInputSchema,\r\n DraftPostUpdateInputSchema,\r\n IntegrationHealthListDataSchema,\r\n MediaAssetListDataSchema,\r\n MediaAssetSchema,\r\n PostListDataSchema,\r\n PostPublishInputSchema,\r\n PostPublishPreviewSchema,\r\n PostReadinessSchema,\r\n PostScheduleInputSchema,\r\n PostSchedulePendingSchema,\r\n PostSchedulePreviewSchema,\r\n PostSchema,\r\n ProjectCreateInputSchema,\r\n ProjectListDataSchema,\r\n ProjectSchema,\r\n ProviderDeliveryOptionsProviderSchema,\r\n ProviderDeliveryOptionsSchema,\r\n type Actor,\r\n type CalendarListData,\r\n type DraftPostInput,\r\n type DraftPostUpdateInput,\r\n type IntegrationHealthListData,\r\n type MediaAsset,\r\n type MediaAssetListData,\r\n type Post,\r\n type PostListData,\r\n type PostPublishExecuteInput,\r\n type PostPublishInput,\r\n type PostPublishPreview,\r\n type PostReadiness,\r\n type PostScheduleExecuteInput,\r\n type PostScheduleExecuteResult,\r\n type PostScheduleInput,\r\n type PostSchedulePreview,\r\n type PostStatus,\r\n type Project,\r\n type ProjectCreateInput,\r\n type ProjectListData,\r\n type ProviderDeliveryOptions,\r\n type ProviderDeliveryOptionsProvider,\r\n} from \"@rolino/contracts\";\r\nimport {\r\n RolinoApiError,\r\n RolinoClient,\r\n RolinoNetworkError,\r\n} from \"@rolino/sdk\";\r\nimport * as z from \"zod/v4\";\r\nimport packageManifest from \"../package.json\" with { type: \"json\" };\r\n\r\n// MCP's tool registration requires an object-shaped output schema. Keep the\r\n// transport shape flat, then enforce the canonical discriminated contract so\r\n// provider-specific required and forbidden fields remain strict at runtime.\r\nconst ProviderDeliveryOptionsToolSchema = z.object({\r\n provider: ProviderDeliveryOptionsProviderSchema,\r\n account: z.object({\r\n username: z.string().nullable().optional(),\r\n displayName: z.string().nullable(),\r\n avatarUrl: z.string().url().nullable(),\r\n }).strict(),\r\n health: z.object({\r\n status: z.enum([\"pass\", \"blocking\", \"unknown\"]),\r\n code: z.string().min(1),\r\n message: z.string().min(1),\r\n }).strict(),\r\n checkedAt: z.string().datetime(),\r\n allowedPostModes: z.array(z.enum([\"DIRECT_POST\", \"MEDIA_UPLOAD\"])).optional(),\r\n visibilityOptions: z.array(z.string()).optional(),\r\n interactions: z.object({\r\n comment: z.object({ available: z.boolean() }).strict(),\r\n duet: z.object({ available: z.boolean() }).strict(),\r\n stitch: z.object({ available: z.boolean() }).strict(),\r\n }).strict().optional(),\r\n maxVideoDurationMs: z.number().int().positive().nullable().optional(),\r\n supportedPostTypes: z.array(z.enum([\"TEXT\", \"SINGLE_IMAGE\", \"MULTI_IMAGE\"])).optional(),\r\n image: z.object({\r\n maxItems: z.number().int().positive(),\r\n mimeTypes: z.array(z.enum([\"image/jpeg\", \"image/png\"])),\r\n maxPixelsExclusive: z.number().int().positive(),\r\n maxBytes: z.number().int().positive(),\r\n }).strict().optional(),\r\n}).strict().superRefine((value, context) => {\r\n if (!ProviderDeliveryOptionsSchema.safeParse(value).success) {\r\n context.addIssue({\r\n code: \"custom\",\r\n message: \"Provider delivery options do not match the canonical provider contract.\",\r\n });\r\n }\r\n});\r\n\r\nexport {\r\n resolveMcpConfiguration,\r\n type RolinoMcpEnvironment,\r\n} from \"./configuration.js\";\r\n\r\nexport const ROLINO_MCP_VERSION = packageManifest.version;\r\n\r\nconst mcpDraftInputShape = {\r\n ...DraftPostInputSchema.shape,\r\n platforms: DraftPostInputSchema.shape.platforms,\r\n mediaAssetIds: DraftPostInputSchema.shape.mediaAssetIds.describe(\r\n \"Existing project media asset IDs. YouTube requires exactly one stored video; Bluesky accepts up to four stored JPEG, PNG, or WebP images.\",\r\n ),\r\n captionOverrides: DraftPostInputSchema.shape.captionOverrides.describe(\r\n \"Optional destination text. YOUTUBE is the video description, BLUESKY is limited to 300 graphemes, and LINKEDIN is limited to 3,000 characters; when omitted, Rolino uses the shared caption.\",\r\n ),\r\n tiktokSettings: DraftPostInputSchema.shape.tiktokSettings.describe(\r\n \"TikTok delivery choices. First call refresh_delivery_options, then supply an explicit mode. Direct publishing requires an exact returned visibility plus yes/no choices for comments, duet, stitch, commercial content, own-brand promotion, third-party promotion, and AI-generated content. Set reviewed only after reviewing the account-specific options; this is distinct from draft mutation consent.\",\r\n ),\r\n youtubeSettings: DraftPostInputSchema.shape.youtubeSettings.describe(\r\n \"Required with YOUTUBE: explicit title, numeric categoryId, privacyStatus, madeForKids declaration, synthetic-media disclosure, subscriber-notification choice, and tags. Unaudited Google API projects may be restricted to Private uploads.\",\r\n ),\r\n};\r\n\r\nconst mcpDraftUpdateInputShape = {\r\n ...DraftPostUpdateInputSchema.shape,\r\n mediaAssetIds: DraftPostUpdateInputSchema.shape.mediaAssetIds.describe(\r\n \"Replacement ordered media asset IDs. Omit to preserve current media; pass an empty array to remove all media.\",\r\n ),\r\n platforms: DraftPostUpdateInputSchema.shape.platforms.describe(\r\n \"Replacement destinations. Omit to preserve current destinations; pass an empty array to remove them.\",\r\n ),\r\n tiktokSettings: DraftPostUpdateInputSchema.shape.tiktokSettings.describe(\r\n \"Replacement TikTok delivery choices. Omit to preserve current settings. Set reviewed only after reviewing fresh account-specific delivery options.\",\r\n ),\r\n};\r\n\r\nconst mcpScheduleExecuteOutputSchema = z.object({\r\n status: z.union([PostSchema.shape.status, z.literal(\"PENDING\")]),\r\n id: PostSchema.shape.id.optional(),\r\n postId: PostSchedulePendingSchema.shape.postId.optional(),\r\n provider: PostSchedulePendingSchema.shape.provider.optional(),\r\n mutationId: PostSchedulePendingSchema.shape.mutationId.optional(),\r\n operation: PostSchedulePendingSchema.shape.operation.optional(),\r\n message: PostSchedulePendingSchema.shape.message.optional(),\r\n}).passthrough();\r\n\r\nexport type RolinoMcpApi = {\r\n whoami(): Promise<Actor>;\r\n projects: {\r\n create(\r\n input: ProjectCreateInput,\r\n request: { idempotencyKey: string },\r\n ): Promise<Project>;\r\n list(options?: { limit?: number; cursor?: string }): Promise<ProjectListData>;\r\n get(projectId: string): Promise<Project>;\r\n };\r\n posts: {\r\n create(\r\n projectId: string,\r\n input: DraftPostInput,\r\n request: { idempotencyKey: string },\r\n ): Promise<Post>;\r\n update(\r\n projectId: string,\r\n postId: string,\r\n input: DraftPostUpdateInput,\r\n request: { idempotencyKey: string; expectedVersion: number },\r\n ): Promise<Post>;\r\n list(\r\n projectId: string,\r\n options?: { limit?: number; cursor?: string; status?: PostStatus },\r\n ): Promise<PostListData>;\r\n get(projectId: string, postId: string): Promise<Post>;\r\n readiness(projectId: string, postId: string): Promise<PostReadiness>;\r\n previewSchedule(\r\n projectId: string,\r\n postId: string,\r\n input: PostScheduleInput,\r\n request: { expectedVersion: number },\r\n ): Promise<PostSchedulePreview>;\r\n executeSchedule(\r\n projectId: string,\r\n postId: string,\r\n input: PostScheduleExecuteInput,\r\n request: { idempotencyKey: string; expectedVersion: number },\r\n ): Promise<PostScheduleExecuteResult>;\r\n previewPublish(\r\n projectId: string,\r\n postId: string,\r\n input: PostPublishInput,\r\n request: { expectedVersion: number },\r\n ): Promise<PostPublishPreview>;\r\n executePublish(\r\n projectId: string,\r\n postId: string,\r\n input: PostPublishExecuteInput,\r\n request: { idempotencyKey: string; expectedVersion: number },\r\n ): Promise<Post>;\r\n };\r\n media?: {\r\n list(projectId: string, options?: { limit?: number; cursor?: string; type?: \"IMAGE\" | \"VIDEO\"; query?: string }): Promise<MediaAssetListData>;\r\n upload(projectId: string, input: { fileName: string; contentType: string; fileSize: number; body: Blob }): Promise<MediaAsset>;\r\n };\r\n integrations: {\r\n health(projectId: string): Promise<IntegrationHealthListData>;\r\n deliveryOptions?(projectId: string, provider: ProviderDeliveryOptionsProvider): Promise<ProviderDeliveryOptions>;\r\n };\r\n calendar: {\r\n list(\r\n projectId: string,\r\n options?: {\r\n limit?: number;\r\n cursor?: string;\r\n from?: string;\r\n to?: string;\r\n },\r\n ): Promise<CalendarListData>;\r\n };\r\n};\r\n\r\nexport type RolinoMcpServerOptions = {\r\n client?: RolinoMcpApi;\r\n baseUrl?: string;\r\n token?: string;\r\n timeoutMs?: number;\r\n fetch?: typeof globalThis.fetch;\r\n};\r\n\r\nfunction jsonResult(structuredContent: Record<string, unknown>) {\r\n return {\r\n content: [{ type: \"text\" as const, text: JSON.stringify(structuredContent) }],\r\n structuredContent,\r\n };\r\n}\r\n\r\nfunction errorResult(error: unknown) {\r\n let body: Record<string, unknown>;\r\n if (error instanceof RolinoApiError) {\r\n body = {\r\n error: {\r\n code: error.code,\r\n message: error.message,\r\n ...(error.requestId ? { requestId: error.requestId } : {}),\r\n ...(error.retryAfterSeconds === null\r\n ? {}\r\n : { retryAfterSeconds: error.retryAfterSeconds }),\r\n },\r\n };\r\n } else if (error instanceof RolinoNetworkError) {\r\n body = { error: { code: error.kind, message: error.message } };\r\n } else if (error instanceof TypeError) {\r\n body = { error: { code: \"VALIDATION_ERROR\", message: error.message } };\r\n } else {\r\n body = {\r\n error: {\r\n code: \"INTERNAL_ERROR\",\r\n message: \"Rolino could not complete the tool call.\",\r\n },\r\n };\r\n }\r\n\r\n return {\r\n content: [{ type: \"text\" as const, text: JSON.stringify(body) }],\r\n isError: true,\r\n };\r\n}\r\n\r\nconst readOnlyAnnotations = {\r\n readOnlyHint: true,\r\n destructiveHint: false,\r\n idempotentHint: true,\r\n openWorldHint: false,\r\n} as const;\r\n\r\nconst createDraftAnnotations = {\r\n readOnlyHint: false,\r\n destructiveHint: false,\r\n idempotentHint: true,\r\n openWorldHint: false,\r\n} as const;\r\n\r\nconst createProjectAnnotations = {\r\n readOnlyHint: false,\r\n destructiveHint: false,\r\n idempotentHint: true,\r\n openWorldHint: false,\r\n} as const;\r\n\r\nconst uploadMediaAnnotations = {\r\n readOnlyHint: false,\r\n destructiveHint: false,\r\n idempotentHint: false,\r\n openWorldHint: true,\r\n} as const;\r\n\r\nconst deliveryOptionsAnnotations = {\r\n readOnlyHint: false,\r\n destructiveHint: false,\r\n idempotentHint: true,\r\n openWorldHint: true,\r\n} as const;\r\n\r\nconst ProjectCreateToolInputSchema = ProjectCreateInputSchema.safeExtend({\r\n idempotencyKey: z.string().min(1).max(200)\r\n .describe(\"Stable caller-generated retry key for this exact creation.\"),\r\n});\r\n\r\nconst updateDraftAnnotations = {\r\n readOnlyHint: false,\r\n destructiveHint: true,\r\n idempotentHint: true,\r\n openWorldHint: false,\r\n} as const;\r\n\r\nconst schedulePreviewAnnotations = {\r\n readOnlyHint: false,\r\n destructiveHint: false,\r\n idempotentHint: false,\r\n openWorldHint: true,\r\n} as const;\r\n\r\nconst scheduleExecuteAnnotations = {\r\n readOnlyHint: false,\r\n destructiveHint: true,\r\n idempotentHint: true,\r\n openWorldHint: true,\r\n} as const;\r\n\r\nconst publishPreviewAnnotations = {\r\n readOnlyHint: false,\r\n destructiveHint: false,\r\n idempotentHint: false,\r\n openWorldHint: true,\r\n} as const;\r\n\r\nconst publishExecuteAnnotations = {\r\n readOnlyHint: false,\r\n destructiveHint: true,\r\n idempotentHint: true,\r\n openWorldHint: true,\r\n} as const;\r\n\r\nfunction defaultClient(options: RolinoMcpServerOptions): RolinoMcpApi {\r\n return new RolinoClient({\r\n baseUrl: options.baseUrl ?? \"https://getrolino.com\",\r\n token: options.token,\r\n timeoutMs: options.timeoutMs,\r\n fetch: options.fetch,\r\n });\r\n}\r\n\r\nexport function createRolinoMcpServer(options: RolinoMcpServerOptions = {}) {\r\n const api = options.client ?? defaultClient(options);\r\n const server = new McpServer({\r\n name: \"rolino\",\r\n version: ROLINO_MCP_VERSION,\r\n description: \"Read Rolino workspace and publishing state, prepare drafts, and schedule posts through an exact server-confirmed two-step workflow.\",\r\n });\r\n\r\n server.registerTool(\"whoami\", {\r\n title: \"Show Rolino identity\",\r\n description:\r\n \"Use this before project tools to identify the authenticated Rolino user, organization, and granted capabilities. This tool never changes Rolino data.\",\r\n inputSchema: {},\r\n outputSchema: ActorSchema,\r\n annotations: readOnlyAnnotations,\r\n }, async () => {\r\n try {\r\n return jsonResult(await api.whoami());\r\n } catch (error) {\r\n return errorResult(error);\r\n }\r\n });\r\n\r\n server.registerTool(\"list_projects\", {\r\n title: \"List Rolino projects\",\r\n description:\r\n \"List projects visible to the authenticated Rolino organization. Use the returned IDs with get_project; paginate with nextCursor when present. This tool never changes Rolino data.\",\r\n inputSchema: {\r\n limit: z.number().int().min(1).max(100).default(50)\r\n .describe(\"Maximum number of projects to return, from 1 to 100.\"),\r\n cursor: z.string().min(1).optional()\r\n .describe(\"Project cursor returned by a previous list_projects call.\"),\r\n },\r\n outputSchema: ProjectListDataSchema,\r\n annotations: readOnlyAnnotations,\r\n }, async ({ limit, cursor }) => {\r\n try {\r\n return jsonResult(await api.projects.list({ limit, cursor }));\r\n } catch (error) {\r\n return errorResult(error);\r\n }\r\n });\r\n\r\n server.registerTool(\"get_project\", {\r\n title: \"Get a Rolino project\",\r\n description:\r\n \"Get one Rolino project by its exact ID after discovering it with list_projects. This tool never changes Rolino data.\",\r\n inputSchema: {\r\n projectId: z.string().min(1).describe(\"Exact Rolino project ID.\"),\r\n },\r\n outputSchema: ProjectSchema,\r\n annotations: readOnlyAnnotations,\r\n }, async ({ projectId }) => {\r\n try {\r\n return jsonResult(await api.projects.get(projectId));\r\n } catch (error) {\r\n return errorResult(error);\r\n }\r\n });\r\n\r\n server.registerTool(\"create_project\", {\r\n title: \"Create a Rolino project\",\r\n description:\r\n \"Create and save one paired Rolino project and brand. This requires projects:write and changes Rolino data, but it does not research a website, connect providers, schedule, or publish. Supply a stable idempotency key so retrying the same input cannot create a duplicate; returned website URLs are normalized and may differ from the submitted string.\",\r\n inputSchema: ProjectCreateToolInputSchema,\r\n outputSchema: ProjectSchema,\r\n annotations: createProjectAnnotations,\r\n }, async ({ idempotencyKey, ...input }) => {\r\n try {\r\n return jsonResult(await api.projects.create(input, {\r\n idempotencyKey,\r\n }));\r\n } catch (error) {\r\n return errorResult(error);\r\n }\r\n });\r\n\r\n server.registerTool(\"list_media_assets\", {\r\n title: \"List Rolino media assets\",\r\n description: \"List reusable images and videos in one exact project. Use this before uploading to avoid duplicates and pass returned asset IDs when creating or updating drafts. This tool never changes Rolino data.\",\r\n inputSchema: {\r\n projectId: z.string().min(1).describe(\"Exact Rolino project ID.\"),\r\n limit: z.number().int().min(1).max(100).default(50),\r\n cursor: z.string().min(1).optional(),\r\n type: z.enum([\"IMAGE\", \"VIDEO\"]).optional(),\r\n query: z.string().trim().min(1).max(100).optional(),\r\n },\r\n outputSchema: MediaAssetListDataSchema,\r\n annotations: readOnlyAnnotations,\r\n }, async ({ projectId, limit, cursor, type, query }) => {\r\n try {\r\n if (!api.media) throw new TypeError(\"This Rolino client does not support media operations.\");\r\n return jsonResult(await api.media.list(projectId, { limit, cursor, type, query }));\r\n } catch (error) {\r\n return errorResult(error);\r\n }\r\n });\r\n\r\n server.registerTool(\"upload_media_asset\", {\r\n title: \"Upload local media to Rolino\",\r\n description: \"Upload one explicitly approved local JPEG, PNG, WebP, MP4, or MOV file into an exact project's reusable media library. Read only the exact path supplied for this workflow. This changes Rolino data but never creates, schedules, or publishes a post. Return the asset ID for a later draft operation.\",\r\n inputSchema: {\r\n projectId: z.string().min(1).describe(\"Exact Rolino project ID.\"),\r\n filePath: z.string().min(1).describe(\"Exact local path of the user-approved media file.\"),\r\n },\r\n outputSchema: MediaAssetSchema,\r\n annotations: uploadMediaAnnotations,\r\n }, async ({ projectId, filePath }) => {\r\n try {\r\n if (!api.media) throw new TypeError(\"This Rolino client does not support media operations.\");\r\n const absolutePath = resolve(filePath);\r\n const details = await stat(absolutePath).catch(() => null);\r\n if (!details?.isFile()) throw new TypeError(\"The media path must point to a readable file.\");\r\n const contentTypes: Record<string, string> = { \".jpg\": \"image/jpeg\", \".jpeg\": \"image/jpeg\", \".png\": \"image/png\", \".webp\": \"image/webp\", \".mp4\": \"video/mp4\", \".mov\": \"video/quicktime\" };\r\n const contentType = contentTypes[extname(absolutePath).toLowerCase()];\r\n if (!contentType) throw new TypeError(\"Use a JPEG, PNG, WebP, MP4, or MOV file.\");\r\n const body = await openAsBlob(absolutePath, { type: contentType });\r\n return jsonResult(await api.media.upload(projectId, { fileName: basename(absolutePath), contentType, fileSize: details.size, body }));\r\n } catch (error) {\r\n return errorResult(error);\r\n }\r\n });\r\n\r\n server.registerTool(\"list_posts\", {\r\n title: \"List Rolino posts\",\r\n description:\r\n \"List posts in an exact Rolino project. Discover project IDs with list_projects, filter by status when useful, and paginate with nextCursor. This tool never changes Rolino data.\",\r\n inputSchema: {\r\n projectId: z.string().min(1).describe(\"Exact Rolino project ID.\"),\r\n limit: z.number().int().min(1).max(100).default(50)\r\n .describe(\"Maximum number of posts to return, from 1 to 100.\"),\r\n cursor: z.string().min(1).optional()\r\n .describe(\"Post cursor returned by a previous list_posts call.\"),\r\n status: z.enum([\r\n \"DRAFT\",\r\n \"SCHEDULED\",\r\n \"ACTION_REQUIRED\",\r\n \"PUBLISHING\",\r\n \"PUBLISHED\",\r\n \"PARTIALLY_PUBLISHED\",\r\n \"FAILED\",\r\n ]).optional().describe(\"Optional exact post status filter.\"),\r\n },\r\n outputSchema: PostListDataSchema,\r\n annotations: readOnlyAnnotations,\r\n }, async ({ projectId, limit, cursor, status }) => {\r\n try {\r\n return jsonResult(await api.posts.list(projectId, {\r\n limit,\r\n cursor,\r\n status,\r\n }));\r\n } catch (error) {\r\n return errorResult(error);\r\n }\r\n });\r\n\r\n server.registerTool(\"get_post\", {\r\n title: \"Get a Rolino post\",\r\n description:\r\n \"Get one Rolino post, including its ordered media and publication-destination status, by exact project and post IDs. This tool never changes Rolino data.\",\r\n inputSchema: {\r\n projectId: z.string().min(1).describe(\"Exact Rolino project ID.\"),\r\n postId: z.string().min(1).describe(\"Exact Rolino post ID.\"),\r\n },\r\n outputSchema: PostSchema,\r\n annotations: readOnlyAnnotations,\r\n }, async ({ projectId, postId }) => {\r\n try {\r\n return jsonResult(await api.posts.get(projectId, postId));\r\n } catch (error) {\r\n return errorResult(error);\r\n }\r\n });\r\n\r\n server.registerTool(\"create_draft_post\", {\r\n title: \"Create Rolino draft post\",\r\n description:\r\n \"Create a draft in one exact project. This changes Rolino data but never schedules or publishes. Before a TikTok draft, refresh account-specific delivery options and mark the exact choices reviewed separately from mutation consent. A YouTube draft requires exactly one stored video plus explicit title, category, visibility, audience, disclosure, notification, and tag settings; its description uses the YOUTUBE caption override or shared caption. Unaudited Google API projects may be limited to Private uploads. Supply a stable idempotency key so retrying the same input cannot create a duplicate.\",\r\n inputSchema: {\r\n projectId: z.string().min(1).describe(\"Exact Rolino project ID.\"),\r\n idempotencyKey: z.string().min(1).max(200)\r\n .describe(\"Stable caller-generated retry key for this exact creation.\"),\r\n ...mcpDraftInputShape,\r\n },\r\n outputSchema: PostSchema,\r\n annotations: createDraftAnnotations,\r\n }, async ({ projectId, idempotencyKey, ...input }) => {\r\n try {\r\n const draft = DraftPostInputSchema.parse(input);\r\n return jsonResult(await api.posts.create(projectId, draft, {\r\n idempotencyKey,\r\n }));\r\n } catch (error) {\r\n return errorResult(error);\r\n }\r\n });\r\n\r\n server.registerTool(\"update_draft_post\", {\r\n title: \"Update Rolino draft post\",\r\n description:\r\n \"Update only the supplied draft fields without scheduling or publishing it; omitted caption, destinations, media, and provider settings are preserved. Read the post first and pass its current version; stale versions fail instead of overwriting another change. Editing TikTok content clears its prior review unless replacement settings are explicitly reviewed again. A stable idempotency key makes exact retries safe.\",\r\n inputSchema: {\r\n projectId: z.string().min(1).describe(\"Exact Rolino project ID.\"),\r\n postId: z.string().min(1).describe(\"Exact Rolino draft post ID.\"),\r\n expectedVersion: z.number().int().positive()\r\n .describe(\"Current version returned by get_post.\"),\r\n idempotencyKey: z.string().min(1).max(200)\r\n .describe(\"Stable caller-generated retry key for this exact update.\"),\r\n ...mcpDraftUpdateInputShape,\r\n },\r\n outputSchema: PostSchema,\r\n annotations: updateDraftAnnotations,\r\n }, async ({\r\n projectId,\r\n postId,\r\n expectedVersion,\r\n idempotencyKey,\r\n ...input\r\n }) => {\r\n try {\r\n const draft = DraftPostUpdateInputSchema.parse(input);\r\n return jsonResult(await api.posts.update(projectId, postId, draft, {\r\n expectedVersion,\r\n idempotencyKey,\r\n }));\r\n } catch (error) {\r\n return errorResult(error);\r\n }\r\n });\r\n\r\n server.registerTool(\"get_post_readiness\", {\r\n title: \"Get Rolino post readiness\",\r\n description:\r\n \"Evaluate one saved post against its destinations, media, captions, settings, permissions, token timing, and cached provider health. YouTube checks cover one stored video, explicit metadata and declarations, description limits, Private-only audit restrictions, and queue-aware lead time. This is a read-only evaluation and does not refresh providers or publish content.\",\r\n inputSchema: {\r\n projectId: z.string().min(1).describe(\"Exact Rolino project ID.\"),\r\n postId: z.string().min(1).describe(\"Exact Rolino post ID.\"),\r\n },\r\n outputSchema: PostReadinessSchema,\r\n annotations: readOnlyAnnotations,\r\n }, async ({ projectId, postId }) => {\r\n try {\r\n return jsonResult(await api.posts.readiness(projectId, postId));\r\n } catch (error) {\r\n return errorResult(error);\r\n }\r\n });\r\n\r\n server.registerTool(\"preview_post_schedule\", {\r\n title: \"Preview a Rolino post schedule\",\r\n description:\r\n \"Validate one exact future schedule against the current post version and live provider health. A YouTube schedule must target Public and its preview explains that confirmed execution starts a private upload immediately for early processing. This contacts configured providers and creates a five-minute, single-use confirmation, but does not schedule or publish the post. Inspect the complete result before calling execute_post_schedule with identical values.\",\r\n inputSchema: {\r\n projectId: z.string().min(1).describe(\"Exact Rolino project ID.\"),\r\n postId: z.string().min(1).describe(\"Exact Rolino post ID.\"),\r\n expectedVersion: z.number().int().positive()\r\n .describe(\"Current version returned by get_post.\"),\r\n ...PostScheduleInputSchema.shape,\r\n },\r\n outputSchema: PostSchedulePreviewSchema,\r\n annotations: schedulePreviewAnnotations,\r\n }, async ({ projectId, postId, expectedVersion, ...input }) => {\r\n try {\r\n return jsonResult(await api.posts.previewSchedule(\r\n projectId,\r\n postId,\r\n input,\r\n { expectedVersion },\r\n ));\r\n } catch (error) {\r\n return errorResult(error);\r\n }\r\n });\r\n\r\n server.registerTool(\"execute_post_schedule\", {\r\n title: \"Execute a confirmed Rolino post schedule\",\r\n description:\r\n \"Schedule a post only after preview_post_schedule. Pass the unchanged time, timezone, post version, and returned one-time confirmation token. For YouTube, confirmed execution begins or resumes the private upload immediately and may return PENDING until a remote schedule change is confirmed; it never means the video already published. Rolino rechecks readiness and provider health, rejects stale or mismatched confirmation, and uses the stable idempotency key for safe retries. Scheduling causes future external publishing and is consequential.\",\r\n inputSchema: {\r\n projectId: z.string().min(1).describe(\"Exact Rolino project ID.\"),\r\n postId: z.string().min(1).describe(\"Exact Rolino post ID.\"),\r\n expectedVersion: z.number().int().positive()\r\n .describe(\"Same post version used by preview_post_schedule.\"),\r\n idempotencyKey: z.string().min(1).max(200)\r\n .describe(\"Stable caller-generated retry key for this exact execution.\"),\r\n confirmationToken: z.string().min(1).max(200)\r\n .describe(\"Single-use token returned by preview_post_schedule.\"),\r\n ...PostScheduleInputSchema.shape,\r\n },\r\n outputSchema: mcpScheduleExecuteOutputSchema,\r\n annotations: scheduleExecuteAnnotations,\r\n }, async ({\r\n projectId,\r\n postId,\r\n expectedVersion,\r\n idempotencyKey,\r\n confirmationToken,\r\n ...input\r\n }) => {\r\n try {\r\n return jsonResult(await api.posts.executeSchedule(\r\n projectId,\r\n postId,\r\n { ...input, confirmationToken },\r\n { expectedVersion, idempotencyKey },\r\n ));\r\n } catch (error) {\r\n return errorResult(error);\r\n }\r\n });\r\n\r\n server.registerTool(\"preview_post_publish\", {\r\n title: \"Preview immediate Rolino post publishing\",\r\n description:\r\n \"Validate exact destinations against the current post version, safe retry state, readiness, and live provider health. YouTube readiness requires one stored video and explicit metadata; the configured visibility is exact, while unaudited Google API projects may be restricted to Private. This contacts configured providers and creates a five-minute, single-use confirmation, but does not publish. Inspect the complete result before calling execute_post_publish with identical destinations.\",\r\n inputSchema: {\r\n projectId: z.string().min(1).describe(\"Exact Rolino project ID.\"),\r\n postId: z.string().min(1).describe(\"Exact Rolino post ID.\"),\r\n expectedVersion: z.number().int().positive()\r\n .describe(\"Current version returned by get_post.\"),\r\n destinations: PostPublishInputSchema.shape.destinations\r\n .describe(\"Exact Instagram, TikTok, YouTube, and/or Bluesky destinations to publish now.\"),\r\n },\r\n outputSchema: PostPublishPreviewSchema,\r\n annotations: publishPreviewAnnotations,\r\n }, async ({ projectId, postId, expectedVersion, destinations }) => {\r\n try {\r\n return jsonResult(await api.posts.previewPublish(\r\n projectId,\r\n postId,\r\n { destinations },\r\n { expectedVersion },\r\n ));\r\n } catch (error) {\r\n return errorResult(error);\r\n }\r\n });\r\n\r\n server.registerTool(\"execute_post_publish\", {\r\n title: \"Execute confirmed immediate Rolino post publishing\",\r\n description:\r\n \"Begin external publishing only after preview_post_publish. Pass the unchanged destinations, post version, and returned one-time confirmation token. YouTube execution starts a resumable upload and remains PREPARING until provider-confirmed upload and processing complete; no queued or local state is reported as published. Rolino rechecks readiness and safe retry state, durably queues the exact destinations, rejects ambiguous prior outcomes, and uses the stable idempotency key to prevent duplicate execution. This is immediately consequential.\",\r\n inputSchema: {\r\n projectId: z.string().min(1).describe(\"Exact Rolino project ID.\"),\r\n postId: z.string().min(1).describe(\"Exact Rolino post ID.\"),\r\n expectedVersion: z.number().int().positive()\r\n .describe(\"Same post version used by preview_post_publish.\"),\r\n idempotencyKey: z.string().min(1).max(200)\r\n .describe(\"Stable caller-generated retry key for this exact execution.\"),\r\n confirmationToken: z.string().min(1).max(200)\r\n .describe(\"Single-use token returned by preview_post_publish.\"),\r\n destinations: PostPublishInputSchema.shape.destinations\r\n .describe(\"Exact unchanged destinations returned by preview_post_publish.\"),\r\n },\r\n outputSchema: PostSchema,\r\n annotations: publishExecuteAnnotations,\r\n }, async ({\r\n projectId,\r\n postId,\r\n expectedVersion,\r\n idempotencyKey,\r\n confirmationToken,\r\n destinations,\r\n }) => {\r\n try {\r\n return jsonResult(await api.posts.executePublish(\r\n projectId,\r\n postId,\r\n { destinations, confirmationToken },\r\n { expectedVersion, idempotencyKey },\r\n ));\r\n } catch (error) {\r\n return errorResult(error);\r\n }\r\n });\r\n\r\n server.registerTool(\"list_integration_health\", {\r\n title: \"List Rolino publishing integration health\",\r\n description:\r\n \"List secret-safe cached health for every enabled publishing connection (Instagram, TikTok, YouTube, or Bluesky) in one exact project. This tool does not contact external providers or reveal social credentials.\",\r\n inputSchema: {\r\n projectId: z.string().min(1).describe(\"Exact Rolino project ID.\"),\r\n },\r\n outputSchema: IntegrationHealthListDataSchema,\r\n annotations: readOnlyAnnotations,\r\n }, async ({ projectId }) => {\r\n try {\r\n return jsonResult(await api.integrations.health(projectId));\r\n } catch (error) {\r\n return errorResult(error);\r\n }\r\n });\r\n\r\n server.registerTool(\"refresh_delivery_options\", {\r\n title: \"Refresh provider delivery options\",\r\n description:\r\n \"Contact one connected publishing provider and return secret-safe, account-specific choices needed to prepare a compliant draft. TikTok returns account-specific video choices; LinkedIn returns its verified member and image policy. This refreshes cached provider health but never creates, schedules, or publishes a post.\",\r\n inputSchema: {\r\n projectId: z.string().min(1).describe(\"Exact Rolino project ID.\"),\r\n provider: ProviderDeliveryOptionsProviderSchema.describe(\"Provider whose delivery choices should be refreshed.\"),\r\n },\r\n outputSchema: ProviderDeliveryOptionsToolSchema,\r\n annotations: deliveryOptionsAnnotations,\r\n }, async ({ projectId, provider }) => {\r\n try {\r\n if (!api.integrations.deliveryOptions) {\r\n throw new TypeError(\"This Rolino client does not support provider delivery options.\");\r\n }\r\n return jsonResult(await api.integrations.deliveryOptions(projectId, provider));\r\n } catch (error) {\r\n return errorResult(error);\r\n }\r\n });\r\n\r\n server.registerTool(\"list_calendar_events\", {\r\n title: \"List Rolino calendar events\",\r\n description:\r\n \"List scheduled posts and their enabled destinations in one exact project, including YouTube posts whose private early preparation has started. By default the bounded window spans 30 days in the past through 90 days ahead; provide both from and to for another range and paginate with nextCursor.\",\r\n inputSchema: {\r\n projectId: z.string().min(1).describe(\"Exact Rolino project ID.\"),\r\n limit: z.number().int().min(1).max(100).default(50)\r\n .describe(\"Maximum number of calendar events to return, from 1 to 100.\"),\r\n cursor: z.string().min(1).optional()\r\n .describe(\"Opaque cursor returned by a previous list_calendar_events call.\"),\r\n from: z.iso.datetime().optional()\r\n .describe(\"Inclusive ISO-8601 window start; provide together with to.\"),\r\n to: z.iso.datetime().optional()\r\n .describe(\"Exclusive ISO-8601 window end; provide together with from.\"),\r\n },\r\n outputSchema: CalendarListDataSchema,\r\n annotations: readOnlyAnnotations,\r\n }, async ({ projectId, limit, cursor, from, to }) => {\r\n try {\r\n return jsonResult(await api.calendar.list(projectId, {\r\n limit,\r\n cursor,\r\n from,\r\n to,\r\n }));\r\n } catch (error) {\r\n return errorResult(error);\r\n }\r\n });\r\n\r\n return server;\r\n}\r\n\r\nexport async function startStdioServer(options: RolinoMcpServerOptions = {}) {\r\n const server = createRolinoMcpServer(options);\r\n const transport = new StdioServerTransport();\r\n await server.connect(transport);\r\n return server;\r\n}\r\n","{\n \"name\": \"@rolino/mcp\",\n \"version\": \"0.3.0\",\n \"description\": \"Model Context Protocol server for Rolino\",\n \"type\": \"module\",\n \"license\": \"MIT\",\n \"keywords\": [\n \"rolino\",\n \"mcp\",\n \"model-context-protocol\",\n \"social-media\",\n \"ai-agent\"\n ],\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/deifos/rolino.git\",\n \"directory\": \"packages/mcp\"\n },\n \"homepage\": \"https://github.com/deifos/rolino/tree/main/packages/mcp#readme\",\n \"bugs\": {\n \"url\": \"https://github.com/deifos/rolino/issues\"\n },\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"bin\": {\n \"rolino-mcp\": \"./dist/bin.js\"\n },\n \"exports\": {\n \".\": {\n \"import\": {\n \"types\": \"./dist/index.d.ts\",\n \"default\": \"./dist/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/index.d.cts\",\n \"default\": \"./dist/index.cjs\"\n }\n }\n },\n \"files\": [\n \"dist/**/*.js\",\n \"dist/**/*.cjs\",\n \"dist/**/*.map\",\n \"dist/**/*.d.ts\",\n \"dist/**/*.d.cts\",\n \"README.md\",\n \"CHANGELOG.md\",\n \"LICENSE\"\n ],\n \"publishConfig\": {\n \"access\": \"public\"\n },\n \"scripts\": {\n \"build\": \"tsup src/index.ts src/bin.ts --format esm,cjs --dts --sourcemap --clean\",\n \"typecheck\": \"tsc --noEmit\",\n \"dev\": \"tsx src/bin.ts\"\n },\n \"dependencies\": {\n \"@hono/node-server\": \"2.0.12\",\n \"@modelcontextprotocol/sdk\": \"^1.30.0\",\n \"@rolino/contracts\": \"0.3.0\",\n \"@rolino/local-auth\": \"0.3.0\",\n \"@rolino/sdk\": \"0.3.0\",\n \"zod\": \"^4.4.3\"\n },\n \"devDependencies\": {\n \"tsx\": \"^4.21.0\"\n },\n \"engines\": {\n \"node\": \">=20.19.0\"\n }\n}\n","import { resolveCredential } from \"@rolino/local-auth\";\r\nimport { normalizeRolinoBaseUrl, parseRolinoTimeout } from \"@rolino/sdk\";\r\n\r\nexport type RolinoMcpEnvironment = Record<string, string | undefined>;\r\n\r\nexport function resolveMcpConfiguration(\r\n env: RolinoMcpEnvironment = process.env,\r\n) {\r\n const baseUrl = normalizeRolinoBaseUrl(\r\n env.ROLINO_URL ?? \"https://getrolino.com\",\r\n );\r\n const credential = resolveCredential(baseUrl, env);\r\n\r\n return {\r\n baseUrl,\r\n token: credential.token ?? undefined,\r\n timeoutMs: env.ROLINO_TIMEOUT\r\n ? parseRolinoTimeout(env.ROLINO_TIMEOUT)\r\n : undefined,\r\n credentialSource: credential.source,\r\n };\r\n}\r\n"],"mappings":";AAAA,SAAS,iBAAiB;AAC1B,SAAS,4BAA4B;AACrC,SAAS,kBAAkB;AAC3B,SAAS,YAAY;AACrB,SAAS,UAAU,SAAS,eAAe;AAC3C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAwBK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,YAAY,OAAO;;;ACvDnB;AAAA,EACE,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,aAAe;AAAA,EACf,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,UAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,YAAc;AAAA,IACZ,MAAQ;AAAA,IACR,KAAO;AAAA,IACP,WAAa;AAAA,EACf;AAAA,E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gEAAgE;AAAA,MACtF;AACA,aAAO,WAAW,MAAM,IAAI,aAAa,gBAAgB,WAAW,QAAQ,CAAC;AAAA,IAC/E,SAAS,OAAO;AACd,aAAO,YAAY,KAAK;AAAA,IAC1B;AAAA,EACF,CAAC;AAED,SAAO,aAAa,wBAAwB;AAAA,IAC1C,OAAO;AAAA,IACP,aACE;AAAA,IACF,aAAa;AAAA,MACX,WAAa,SAAO,EAAE,IAAI,CAAC,EAAE,SAAS,0BAA0B;AAAA,MAChE,OAAS,SAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,EAAE,QAAQ,EAAE,EAC/C,SAAS,6DAA6D;AAAA,MACzE,QAAU,SAAO,EAAE,IAAI,CAAC,EAAE,SAAS,EAChC,SAAS,iEAAiE;AAAA,MAC7E,MAAQ,MAAI,SAAS,EAAE,SAAS,EAC7B,SAAS,4DAA4D;AAAA,MACxE,IAAM,MAAI,SAAS,EAAE,SAAS,EAC3B,SAAS,4DAA4D;AAAA,IAC1E;AAAA,IACA,cAAc;AAAA,IACd,aAAa;AAAA,EACf,GAAG,OAAO,EAAE,WAAW,OAAO,QAAQ,MAAM,GAAG,MAAM;AACnD,QAAI;AACF,aAAO,WAAW,MAAM,IAAI,SAAS,KAAK,WAAW;AAAA,QACnD;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC,CAAC;AAAA,IACJ,SAAS,OAAO;AACd,aAAO,YAAY,KAAK;AAAA,IAC1B;AAAA,EACF,CAAC;AAED,SAAO;AACT;AAEA,eAAsB,iBAAiB,UAAkC,CAAC,GAAG;AAC3E,QAAM,SAAS,sBAAsB,OAAO;AAC5C,QAAM,YAAY,IAAI,qBAAqB;AAC3C,QAAM,OAAO,QAAQ,SAAS;AAC9B,SAAO;AACT;","names":[]}
package/dist/index.cjs CHANGED
@@ -38,6 +38,7 @@ __export(index_exports, {
38
38
  module.exports = __toCommonJS(index_exports);
39
39
  var import_mcp = require("@modelcontextprotocol/sdk/server/mcp.js");
40
40
  var import_stdio = require("@modelcontextprotocol/sdk/server/stdio.js");
41
+ var import_node_fs = require("fs");
41
42
  var import_promises = require("fs/promises");
42
43
  var import_node_path = require("path");
43
44
  var import_contracts = require("@rolino/contracts");
@@ -47,7 +48,7 @@ var z = __toESM(require("zod/v4"), 1);
47
48
  // package.json
48
49
  var package_default = {
49
50
  name: "@rolino/mcp",
50
- version: "0.1.0",
51
+ version: "0.3.0",
51
52
  description: "Model Context Protocol server for Rolino",
52
53
  type: "module",
53
54
  license: "MIT",
@@ -106,9 +107,9 @@ var package_default = {
106
107
  dependencies: {
107
108
  "@hono/node-server": "2.0.12",
108
109
  "@modelcontextprotocol/sdk": "^1.30.0",
109
- "@rolino/contracts": "0.1.0",
110
- "@rolino/local-auth": "0.1.0",
111
- "@rolino/sdk": "0.1.0",
110
+ "@rolino/contracts": "0.3.0",
111
+ "@rolino/local-auth": "0.3.0",
112
+ "@rolino/sdk": "0.3.0",
112
113
  zod: "^4.4.3"
113
114
  },
114
115
  devDependencies: {
@@ -136,6 +137,42 @@ function resolveMcpConfiguration(env = process.env) {
136
137
  }
137
138
 
138
139
  // src/index.ts
140
+ var ProviderDeliveryOptionsToolSchema = z.object({
141
+ provider: import_contracts.ProviderDeliveryOptionsProviderSchema,
142
+ account: z.object({
143
+ username: z.string().nullable().optional(),
144
+ displayName: z.string().nullable(),
145
+ avatarUrl: z.string().url().nullable()
146
+ }).strict(),
147
+ health: z.object({
148
+ status: z.enum(["pass", "blocking", "unknown"]),
149
+ code: z.string().min(1),
150
+ message: z.string().min(1)
151
+ }).strict(),
152
+ checkedAt: z.string().datetime(),
153
+ allowedPostModes: z.array(z.enum(["DIRECT_POST", "MEDIA_UPLOAD"])).optional(),
154
+ visibilityOptions: z.array(z.string()).optional(),
155
+ interactions: z.object({
156
+ comment: z.object({ available: z.boolean() }).strict(),
157
+ duet: z.object({ available: z.boolean() }).strict(),
158
+ stitch: z.object({ available: z.boolean() }).strict()
159
+ }).strict().optional(),
160
+ maxVideoDurationMs: z.number().int().positive().nullable().optional(),
161
+ supportedPostTypes: z.array(z.enum(["TEXT", "SINGLE_IMAGE", "MULTI_IMAGE"])).optional(),
162
+ image: z.object({
163
+ maxItems: z.number().int().positive(),
164
+ mimeTypes: z.array(z.enum(["image/jpeg", "image/png"])),
165
+ maxPixelsExclusive: z.number().int().positive(),
166
+ maxBytes: z.number().int().positive()
167
+ }).strict().optional()
168
+ }).strict().superRefine((value, context) => {
169
+ if (!import_contracts.ProviderDeliveryOptionsSchema.safeParse(value).success) {
170
+ context.addIssue({
171
+ code: "custom",
172
+ message: "Provider delivery options do not match the canonical provider contract."
173
+ });
174
+ }
175
+ });
139
176
  var ROLINO_MCP_VERSION = package_default.version;
140
177
  var mcpDraftInputShape = {
141
178
  ...import_contracts.DraftPostInputSchema.shape,
@@ -144,12 +181,27 @@ var mcpDraftInputShape = {
144
181
  "Existing project media asset IDs. YouTube requires exactly one stored video; Bluesky accepts up to four stored JPEG, PNG, or WebP images."
145
182
  ),
146
183
  captionOverrides: import_contracts.DraftPostInputSchema.shape.captionOverrides.describe(
147
- "Optional destination text. YOUTUBE is the video description and BLUESKY is limited to 300 graphemes; when omitted, Rolino uses the shared caption."
184
+ "Optional destination text. YOUTUBE is the video description, BLUESKY is limited to 300 graphemes, and LINKEDIN is limited to 3,000 characters; when omitted, Rolino uses the shared caption."
185
+ ),
186
+ tiktokSettings: import_contracts.DraftPostInputSchema.shape.tiktokSettings.describe(
187
+ "TikTok delivery choices. First call refresh_delivery_options, then supply an explicit mode. Direct publishing requires an exact returned visibility plus yes/no choices for comments, duet, stitch, commercial content, own-brand promotion, third-party promotion, and AI-generated content. Set reviewed only after reviewing the account-specific options; this is distinct from draft mutation consent."
148
188
  ),
149
189
  youtubeSettings: import_contracts.DraftPostInputSchema.shape.youtubeSettings.describe(
150
190
  "Required with YOUTUBE: explicit title, numeric categoryId, privacyStatus, madeForKids declaration, synthetic-media disclosure, subscriber-notification choice, and tags. Unaudited Google API projects may be restricted to Private uploads."
151
191
  )
152
192
  };
193
+ var mcpDraftUpdateInputShape = {
194
+ ...import_contracts.DraftPostUpdateInputSchema.shape,
195
+ mediaAssetIds: import_contracts.DraftPostUpdateInputSchema.shape.mediaAssetIds.describe(
196
+ "Replacement ordered media asset IDs. Omit to preserve current media; pass an empty array to remove all media."
197
+ ),
198
+ platforms: import_contracts.DraftPostUpdateInputSchema.shape.platforms.describe(
199
+ "Replacement destinations. Omit to preserve current destinations; pass an empty array to remove them."
200
+ ),
201
+ tiktokSettings: import_contracts.DraftPostUpdateInputSchema.shape.tiktokSettings.describe(
202
+ "Replacement TikTok delivery choices. Omit to preserve current settings. Set reviewed only after reviewing fresh account-specific delivery options."
203
+ )
204
+ };
153
205
  var mcpScheduleExecuteOutputSchema = z.object({
154
206
  status: z.union([import_contracts.PostSchema.shape.status, z.literal("PENDING")]),
155
207
  id: import_contracts.PostSchema.shape.id.optional(),
@@ -217,6 +269,12 @@ var uploadMediaAnnotations = {
217
269
  idempotentHint: false,
218
270
  openWorldHint: true
219
271
  };
272
+ var deliveryOptionsAnnotations = {
273
+ readOnlyHint: false,
274
+ destructiveHint: false,
275
+ idempotentHint: true,
276
+ openWorldHint: true
277
+ };
220
278
  var ProjectCreateToolInputSchema = import_contracts.ProjectCreateInputSchema.safeExtend({
221
279
  idempotencyKey: z.string().min(1).max(200).describe("Stable caller-generated retry key for this exact creation.")
222
280
  });
@@ -362,8 +420,8 @@ function createRolinoMcpServer(options = {}) {
362
420
  const contentTypes = { ".jpg": "image/jpeg", ".jpeg": "image/jpeg", ".png": "image/png", ".webp": "image/webp", ".mp4": "video/mp4", ".mov": "video/quicktime" };
363
421
  const contentType = contentTypes[(0, import_node_path.extname)(absolutePath).toLowerCase()];
364
422
  if (!contentType) throw new TypeError("Use a JPEG, PNG, WebP, MP4, or MOV file.");
365
- const bytes = await (0, import_promises.readFile)(absolutePath);
366
- return jsonResult(await api.media.upload(projectId, { fileName: (0, import_node_path.basename)(absolutePath), contentType, fileSize: details.size, body: new Blob([bytes], { type: contentType }) }));
423
+ const body = await (0, import_node_fs.openAsBlob)(absolutePath, { type: contentType });
424
+ return jsonResult(await api.media.upload(projectId, { fileName: (0, import_node_path.basename)(absolutePath), contentType, fileSize: details.size, body }));
367
425
  } catch (error) {
368
426
  return errorResult(error);
369
427
  }
@@ -416,7 +474,7 @@ function createRolinoMcpServer(options = {}) {
416
474
  });
417
475
  server.registerTool("create_draft_post", {
418
476
  title: "Create Rolino draft post",
419
- description: "Create a draft in one exact project. This changes Rolino data but never schedules or publishes. A YouTube draft requires exactly one stored video plus explicit title, category, visibility, audience, disclosure, notification, and tag settings; its description uses the YOUTUBE caption override or shared caption. Unaudited Google API projects may be limited to Private uploads. Supply a stable idempotency key so retrying the same input cannot create a duplicate.",
477
+ description: "Create a draft in one exact project. This changes Rolino data but never schedules or publishes. Before a TikTok draft, refresh account-specific delivery options and mark the exact choices reviewed separately from mutation consent. A YouTube draft requires exactly one stored video plus explicit title, category, visibility, audience, disclosure, notification, and tag settings; its description uses the YOUTUBE caption override or shared caption. Unaudited Google API projects may be limited to Private uploads. Supply a stable idempotency key so retrying the same input cannot create a duplicate.",
420
478
  inputSchema: {
421
479
  projectId: z.string().min(1).describe("Exact Rolino project ID."),
422
480
  idempotencyKey: z.string().min(1).max(200).describe("Stable caller-generated retry key for this exact creation."),
@@ -436,13 +494,13 @@ function createRolinoMcpServer(options = {}) {
436
494
  });
437
495
  server.registerTool("update_draft_post", {
438
496
  title: "Update Rolino draft post",
439
- description: "Replace a draft's caption, destinations, media, and provider settings without scheduling or publishing it. YouTube still requires exactly one stored video and every explicit metadata declaration; its description uses the YOUTUBE caption override or shared caption. Read the post first and pass its current version; stale versions fail instead of overwriting another change. A stable idempotency key makes exact retries safe.",
497
+ description: "Update only the supplied draft fields without scheduling or publishing it; omitted caption, destinations, media, and provider settings are preserved. Read the post first and pass its current version; stale versions fail instead of overwriting another change. Editing TikTok content clears its prior review unless replacement settings are explicitly reviewed again. A stable idempotency key makes exact retries safe.",
440
498
  inputSchema: {
441
499
  projectId: z.string().min(1).describe("Exact Rolino project ID."),
442
500
  postId: z.string().min(1).describe("Exact Rolino draft post ID."),
443
501
  expectedVersion: z.number().int().positive().describe("Current version returned by get_post."),
444
502
  idempotencyKey: z.string().min(1).max(200).describe("Stable caller-generated retry key for this exact update."),
445
- ...mcpDraftInputShape
503
+ ...mcpDraftUpdateInputShape
446
504
  },
447
505
  outputSchema: import_contracts.PostSchema,
448
506
  annotations: updateDraftAnnotations
@@ -454,7 +512,7 @@ function createRolinoMcpServer(options = {}) {
454
512
  ...input
455
513
  }) => {
456
514
  try {
457
- const draft = import_contracts.DraftPostInputSchema.parse(input);
515
+ const draft = import_contracts.DraftPostUpdateInputSchema.parse(input);
458
516
  return jsonResult(await api.posts.update(projectId, postId, draft, {
459
517
  expectedVersion,
460
518
  idempotencyKey
@@ -604,6 +662,25 @@ function createRolinoMcpServer(options = {}) {
604
662
  return errorResult(error);
605
663
  }
606
664
  });
665
+ server.registerTool("refresh_delivery_options", {
666
+ title: "Refresh provider delivery options",
667
+ description: "Contact one connected publishing provider and return secret-safe, account-specific choices needed to prepare a compliant draft. TikTok returns account-specific video choices; LinkedIn returns its verified member and image policy. This refreshes cached provider health but never creates, schedules, or publishes a post.",
668
+ inputSchema: {
669
+ projectId: z.string().min(1).describe("Exact Rolino project ID."),
670
+ provider: import_contracts.ProviderDeliveryOptionsProviderSchema.describe("Provider whose delivery choices should be refreshed.")
671
+ },
672
+ outputSchema: ProviderDeliveryOptionsToolSchema,
673
+ annotations: deliveryOptionsAnnotations
674
+ }, async ({ projectId, provider }) => {
675
+ try {
676
+ if (!api.integrations.deliveryOptions) {
677
+ throw new TypeError("This Rolino client does not support provider delivery options.");
678
+ }
679
+ return jsonResult(await api.integrations.deliveryOptions(projectId, provider));
680
+ } catch (error) {
681
+ return errorResult(error);
682
+ }
683
+ });
607
684
  server.registerTool("list_calendar_events", {
608
685
  title: "List Rolino calendar events",
609
686
  description: "List scheduled posts and their enabled destinations in one exact project, including YouTube posts whose private early preparation has started. By default the bounded window spans 30 days in the past through 90 days ahead; provide both from and to for another range and paginate with nextCursor.",