@rolino/mcp 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +9 -5
- package/dist/bin.cjs +19 -11
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.js +1 -1
- package/dist/{chunk-L6II7ZEX.js → chunk-SMMHU6JG.js} +20 -12
- package/dist/chunk-SMMHU6JG.js.map +1 -0
- package/dist/index.cjs +19 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +4 -4
- package/dist/chunk-L6II7ZEX.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @rolino/mcp
|
|
2
2
|
|
|
3
|
+
## 0.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 6d5cefc: Add LinkedIn native video capability, limits, and delivery-options parity across public agent surfaces.
|
|
8
|
+
- 4149259: Add platform-aware media-adjustment readiness actions and align LinkedIn publishing guidance across agent packages.
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies [6d5cefc]
|
|
13
|
+
- Updated dependencies [4149259]
|
|
14
|
+
- @rolino/contracts@0.4.0
|
|
15
|
+
- @rolino/sdk@0.4.0
|
|
16
|
+
- @rolino/local-auth@0.4.0
|
|
17
|
+
|
|
3
18
|
## 0.3.0
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -70,11 +70,15 @@ Direct drafts must make every declaration explicit and mark the choices
|
|
|
70
70
|
reviewed only after inspecting this result. That review is distinct from MCP
|
|
71
71
|
mutation consent. Changing TikTok content clears the prior review, and Rolino
|
|
72
72
|
never silently turns off a requested interaction.
|
|
73
|
-
For LinkedIn, `refresh_delivery_options` returns the connected member plus the
|
|
74
|
-
strict text/single-image/multi-image and JPEG/PNG limits.
|
|
75
|
-
text-only
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
For LinkedIn, `refresh_delivery_options` returns the connected member plus the
|
|
74
|
+
strict text/single-image/multi-image/video policy and JPEG/PNG/MP4 limits.
|
|
75
|
+
LinkedIn drafts can be text-only, contain up to ten stored images, or contain
|
|
76
|
+
exactly one stored MP4 without mixing images and video. Native video must be
|
|
77
|
+
75 KB to 500 MB and 3 seconds to 30 minutes, and execution remains in
|
|
78
|
+
preparation until LinkedIn confirms upload and processing. An optional
|
|
79
|
+
3,000-character LINKEDIN caption override uses the shared caption as fallback.
|
|
80
|
+
The connected member is always the author; Company Page publishing is outside
|
|
81
|
+
this contract.
|
|
78
82
|
Integration health is cached and secret-safe, post
|
|
79
83
|
readiness reuses Rolino's publishing checks, and calendar reads use bounded
|
|
80
84
|
date windows with cursor pagination. After `rolino auth login`, configure `ROLINO_URL` and
|
package/dist/bin.cjs
CHANGED
|
@@ -52,7 +52,7 @@ var z = __toESM(require("zod/v4"), 1);
|
|
|
52
52
|
// package.json
|
|
53
53
|
var package_default = {
|
|
54
54
|
name: "@rolino/mcp",
|
|
55
|
-
version: "0.
|
|
55
|
+
version: "0.4.0",
|
|
56
56
|
description: "Model Context Protocol server for Rolino",
|
|
57
57
|
type: "module",
|
|
58
58
|
license: "MIT",
|
|
@@ -111,9 +111,9 @@ var package_default = {
|
|
|
111
111
|
dependencies: {
|
|
112
112
|
"@hono/node-server": "2.0.12",
|
|
113
113
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
114
|
-
"@rolino/contracts": "0.
|
|
115
|
-
"@rolino/local-auth": "0.
|
|
116
|
-
"@rolino/sdk": "0.
|
|
114
|
+
"@rolino/contracts": "0.4.0",
|
|
115
|
+
"@rolino/local-auth": "0.4.0",
|
|
116
|
+
"@rolino/sdk": "0.4.0",
|
|
117
117
|
zod: "^4.4.3"
|
|
118
118
|
},
|
|
119
119
|
devDependencies: {
|
|
@@ -146,12 +146,20 @@ var ProviderDeliveryOptionsToolSchema = z.object({
|
|
|
146
146
|
stitch: z.object({ available: z.boolean() }).strict()
|
|
147
147
|
}).strict().optional(),
|
|
148
148
|
maxVideoDurationMs: z.number().int().positive().nullable().optional(),
|
|
149
|
-
supportedPostTypes: z.array(z.enum(["TEXT", "SINGLE_IMAGE", "MULTI_IMAGE"])).optional(),
|
|
149
|
+
supportedPostTypes: z.array(z.enum(["TEXT", "SINGLE_IMAGE", "MULTI_IMAGE", "VIDEO"])).optional(),
|
|
150
150
|
image: z.object({
|
|
151
151
|
maxItems: z.number().int().positive(),
|
|
152
152
|
mimeTypes: z.array(z.enum(["image/jpeg", "image/png"])),
|
|
153
153
|
maxPixelsExclusive: z.number().int().positive(),
|
|
154
154
|
maxBytes: z.number().int().positive()
|
|
155
|
+
}).strict().optional(),
|
|
156
|
+
video: z.object({
|
|
157
|
+
maxItems: z.number().int().positive(),
|
|
158
|
+
mimeTypes: z.array(z.literal("video/mp4")),
|
|
159
|
+
minBytes: z.number().int().positive(),
|
|
160
|
+
maxBytes: z.number().int().positive(),
|
|
161
|
+
minDurationMs: z.number().int().positive(),
|
|
162
|
+
maxDurationMs: z.number().int().positive()
|
|
155
163
|
}).strict().optional()
|
|
156
164
|
}).strict().superRefine((value, context) => {
|
|
157
165
|
if (!import_contracts.ProviderDeliveryOptionsSchema.safeParse(value).success) {
|
|
@@ -166,7 +174,7 @@ var mcpDraftInputShape = {
|
|
|
166
174
|
...import_contracts.DraftPostInputSchema.shape,
|
|
167
175
|
platforms: import_contracts.DraftPostInputSchema.shape.platforms,
|
|
168
176
|
mediaAssetIds: import_contracts.DraftPostInputSchema.shape.mediaAssetIds.describe(
|
|
169
|
-
"Existing project media asset IDs. YouTube requires exactly one stored video; Bluesky accepts up to four stored JPEG, PNG, or WebP images."
|
|
177
|
+
"Existing project media asset IDs. YouTube requires exactly one stored video; LinkedIn accepts one MP4 video or up to ten JPEG/PNG images; Bluesky accepts up to four stored JPEG, PNG, or WebP images."
|
|
170
178
|
),
|
|
171
179
|
captionOverrides: import_contracts.DraftPostInputSchema.shape.captionOverrides.describe(
|
|
172
180
|
"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."
|
|
@@ -511,7 +519,7 @@ function createRolinoMcpServer(options = {}) {
|
|
|
511
519
|
});
|
|
512
520
|
server.registerTool("get_post_readiness", {
|
|
513
521
|
title: "Get Rolino post readiness",
|
|
514
|
-
description: "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.",
|
|
522
|
+
description: "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. LinkedIn checks allow text, JPEG/PNG images, or exactly one MP4 within its size and duration limits. This is a read-only evaluation and does not refresh providers or publish content.",
|
|
515
523
|
inputSchema: {
|
|
516
524
|
projectId: z.string().min(1).describe("Exact Rolino project ID."),
|
|
517
525
|
postId: z.string().min(1).describe("Exact Rolino post ID.")
|
|
@@ -587,7 +595,7 @@ function createRolinoMcpServer(options = {}) {
|
|
|
587
595
|
projectId: z.string().min(1).describe("Exact Rolino project ID."),
|
|
588
596
|
postId: z.string().min(1).describe("Exact Rolino post ID."),
|
|
589
597
|
expectedVersion: z.number().int().positive().describe("Current version returned by get_post."),
|
|
590
|
-
destinations: import_contracts.PostPublishInputSchema.shape.destinations.describe("Exact Instagram, TikTok, YouTube, and/or
|
|
598
|
+
destinations: import_contracts.PostPublishInputSchema.shape.destinations.describe("Exact Instagram, TikTok, YouTube, Bluesky, and/or LinkedIn destinations to publish now.")
|
|
591
599
|
},
|
|
592
600
|
outputSchema: import_contracts.PostPublishPreviewSchema,
|
|
593
601
|
annotations: publishPreviewAnnotations
|
|
@@ -605,7 +613,7 @@ function createRolinoMcpServer(options = {}) {
|
|
|
605
613
|
});
|
|
606
614
|
server.registerTool("execute_post_publish", {
|
|
607
615
|
title: "Execute confirmed immediate Rolino post publishing",
|
|
608
|
-
description: "Begin external publishing only after preview_post_publish. Pass the unchanged destinations, post version, and returned one-time confirmation token.
|
|
616
|
+
description: "Begin external publishing only after preview_post_publish. Pass the unchanged destinations, post version, and returned one-time confirmation token. Video execution remains PREPARING for YouTube and LinkedIn 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.",
|
|
609
617
|
inputSchema: {
|
|
610
618
|
projectId: z.string().min(1).describe("Exact Rolino project ID."),
|
|
611
619
|
postId: z.string().min(1).describe("Exact Rolino post ID."),
|
|
@@ -637,7 +645,7 @@ function createRolinoMcpServer(options = {}) {
|
|
|
637
645
|
});
|
|
638
646
|
server.registerTool("list_integration_health", {
|
|
639
647
|
title: "List Rolino publishing integration health",
|
|
640
|
-
description: "List secret-safe cached health for every enabled publishing connection (Instagram, TikTok, YouTube, or
|
|
648
|
+
description: "List secret-safe cached health for every enabled publishing connection (Instagram, TikTok, YouTube, Bluesky, or LinkedIn) in one exact project. This tool does not contact external providers or reveal social credentials.",
|
|
641
649
|
inputSchema: {
|
|
642
650
|
projectId: z.string().min(1).describe("Exact Rolino project ID.")
|
|
643
651
|
},
|
|
@@ -652,7 +660,7 @@ function createRolinoMcpServer(options = {}) {
|
|
|
652
660
|
});
|
|
653
661
|
server.registerTool("refresh_delivery_options", {
|
|
654
662
|
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
|
|
663
|
+
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 plus image and native-video policy. This refreshes cached provider health but never creates, schedules, or publishes a post.",
|
|
656
664
|
inputSchema: {
|
|
657
665
|
projectId: z.string().min(1).describe("Exact Rolino project ID."),
|
|
658
666
|
provider: import_contracts.ProviderDeliveryOptionsProviderSchema.describe("Provider whose delivery choices should be refreshed.")
|
package/dist/bin.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/configuration.ts","../src/index.ts","../package.json","../src/bin.ts"],"sourcesContent":["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","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","#!/usr/bin/env node\r\n\r\nimport { resolveMcpConfiguration } from \"./configuration.js\";\r\nimport { startStdioServer } from \"./index.js\";\r\n\r\nasync function main() {\r\n const configuration = resolveMcpConfiguration(process.env);\r\n\r\n await startStdioServer({\r\n baseUrl: configuration.baseUrl,\r\n token: configuration.token,\r\n timeoutMs: configuration.timeoutMs,\r\n });\r\n}\r\n\r\nvoid main().catch(() => {\r\n // stdout is reserved exclusively for MCP JSON-RPC messages.\r\n process.stderr.write(\r\n \"Rolino MCP could not start. Check ROLINO_URL, ROLINO_TIMEOUT, and configuration.\\n\",\r\n );\r\n process.exitCode = 1;\r\n});\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAAkC;AAClC,iBAA2D;AAIpD,SAAS,wBACd,MAA4B,QAAQ,KACpC;AACA,QAAM,cAAU;AAAA,IACd,IAAI,cAAc;AAAA,EACpB;AACA,QAAM,iBAAa,qCAAkB,SAAS,GAAG;AAEjD,SAAO;AAAA,IACL;AAAA,IACA,OAAO,WAAW,SAAS;AAAA,IAC3B,WAAW,IAAI,qBACX,+BAAmB,IAAI,cAAc,IACrC;AAAA,IACJ,kBAAkB,WAAW;AAAA,EAC/B;AACF;;;ACrBA,iBAA0B;AAC1B,mBAAqC;AACrC,qBAA2B;AAC3B,sBAAqB;AACrB,uBAA2C;AAC3C,uBA4CO;AACP,IAAAA,cAIO;AACP,QAAmB;;;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,I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B;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,kCAAqB;AAC3C,QAAM,OAAO,QAAQ,SAAS;AAC9B,SAAO;AACT;;;AE9xBA,eAAe,OAAO;AACpB,QAAM,gBAAgB,wBAAwB,QAAQ,GAAG;AAEzD,QAAM,iBAAiB;AAAA,IACrB,SAAS,cAAc;AAAA,IACvB,OAAO,cAAc;AAAA,IACrB,WAAW,cAAc;AAAA,EAC3B,CAAC;AACH;AAEA,KAAK,KAAK,EAAE,MAAM,MAAM;AAEtB,UAAQ,OAAO;AAAA,IACb;AAAA,EACF;AACA,UAAQ,WAAW;AACrB,CAAC;","names":["import_sdk"]}
|
|
1
|
+
{"version":3,"sources":["../src/configuration.ts","../src/index.ts","../package.json","../src/bin.ts"],"sourcesContent":["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","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\", \"VIDEO\"])).optional(),\n image: z.object({\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(),\n video: z.object({\n maxItems: z.number().int().positive(),\n mimeTypes: z.array(z.literal(\"video/mp4\")),\n minBytes: z.number().int().positive(),\n maxBytes: z.number().int().positive(),\n minDurationMs: z.number().int().positive(),\n maxDurationMs: z.number().int().positive(),\n }).strict().optional(),\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; LinkedIn accepts one MP4 video or up to ten JPEG/PNG images; Bluesky accepts up to four stored JPEG, PNG, or WebP images.\",\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. LinkedIn checks allow text, JPEG/PNG images, or exactly one MP4 within its size and duration limits. This is a read-only evaluation and does not refresh providers or publish content.\",\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\n .describe(\"Exact Instagram, TikTok, YouTube, Bluesky, and/or LinkedIn destinations to publish now.\"),\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. Video execution remains PREPARING for YouTube and LinkedIn 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.\",\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\",\n description:\n \"List secret-safe cached health for every enabled publishing connection (Instagram, TikTok, YouTube, Bluesky, or LinkedIn) in one exact project. This tool does not contact external providers or reveal social credentials.\",\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 plus image and native-video policy. This refreshes cached provider health but never creates, schedules, or publishes a post.\",\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.4.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.4.0\",\n \"@rolino/local-auth\": \"0.4.0\",\n \"@rolino/sdk\": \"0.4.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","#!/usr/bin/env node\r\n\r\nimport { resolveMcpConfiguration } from \"./configuration.js\";\r\nimport { startStdioServer } from \"./index.js\";\r\n\r\nasync function main() {\r\n const configuration = resolveMcpConfiguration(process.env);\r\n\r\n await startStdioServer({\r\n baseUrl: configuration.baseUrl,\r\n token: configuration.token,\r\n timeoutMs: configuration.timeoutMs,\r\n });\r\n}\r\n\r\nvoid main().catch(() => {\r\n // stdout is reserved exclusively for MCP JSON-RPC messages.\r\n process.stderr.write(\r\n \"Rolino MCP could not start. Check ROLINO_URL, ROLINO_TIMEOUT, and configuration.\\n\",\r\n );\r\n process.exitCode = 1;\r\n});\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAAkC;AAClC,iBAA2D;AAIpD,SAAS,wBACd,MAA4B,QAAQ,KACpC;AACA,QAAM,cAAU;AAAA,IACd,IAAI,cAAc;AAAA,EACpB;AACA,QAAM,iBAAa,qCAAkB,SAAS,GAAG;AAEjD,SAAO;AAAA,IACL;AAAA,IACA,OAAO,WAAW,SAAS;AAAA,IAC3B,WAAW,IAAI,qBACX,+BAAmB,IAAI,cAAc,IACrC;AAAA,IACJ,kBAAkB,WAAW;AAAA,EAC/B;AACF;;;ACrBA,iBAA0B;AAC1B,mBAAqC;AACrC,qBAA2B;AAC3B,sBAAqB;AACrB,uBAA2C;AAC3C,uBA4CO;AACP,IAAAA,cAIO;AACP,QAAmB;;;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,EACA,UAAY;AAAA,EAC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Ac;AAAA,IACvB,OAAO,cAAc;AAAA,IACrB,WAAW,cAAc;AAAA,EAC3B,CAAC;AACH;AAEA,KAAK,KAAK,EAAE,MAAM,MAAM;AAEtB,UAAQ,OAAO;AAAA,IACb;AAAA,EACF;AACA,UAAQ,WAAW;AACrB,CAAC;","names":["import_sdk"]}
|
package/dist/bin.js
CHANGED
|
@@ -36,7 +36,7 @@ import * as z from "zod/v4";
|
|
|
36
36
|
// package.json
|
|
37
37
|
var package_default = {
|
|
38
38
|
name: "@rolino/mcp",
|
|
39
|
-
version: "0.
|
|
39
|
+
version: "0.4.0",
|
|
40
40
|
description: "Model Context Protocol server for Rolino",
|
|
41
41
|
type: "module",
|
|
42
42
|
license: "MIT",
|
|
@@ -95,9 +95,9 @@ var package_default = {
|
|
|
95
95
|
dependencies: {
|
|
96
96
|
"@hono/node-server": "2.0.12",
|
|
97
97
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
98
|
-
"@rolino/contracts": "0.
|
|
99
|
-
"@rolino/local-auth": "0.
|
|
100
|
-
"@rolino/sdk": "0.
|
|
98
|
+
"@rolino/contracts": "0.4.0",
|
|
99
|
+
"@rolino/local-auth": "0.4.0",
|
|
100
|
+
"@rolino/sdk": "0.4.0",
|
|
101
101
|
zod: "^4.4.3"
|
|
102
102
|
},
|
|
103
103
|
devDependencies: {
|
|
@@ -146,12 +146,20 @@ var ProviderDeliveryOptionsToolSchema = z.object({
|
|
|
146
146
|
stitch: z.object({ available: z.boolean() }).strict()
|
|
147
147
|
}).strict().optional(),
|
|
148
148
|
maxVideoDurationMs: z.number().int().positive().nullable().optional(),
|
|
149
|
-
supportedPostTypes: z.array(z.enum(["TEXT", "SINGLE_IMAGE", "MULTI_IMAGE"])).optional(),
|
|
149
|
+
supportedPostTypes: z.array(z.enum(["TEXT", "SINGLE_IMAGE", "MULTI_IMAGE", "VIDEO"])).optional(),
|
|
150
150
|
image: z.object({
|
|
151
151
|
maxItems: z.number().int().positive(),
|
|
152
152
|
mimeTypes: z.array(z.enum(["image/jpeg", "image/png"])),
|
|
153
153
|
maxPixelsExclusive: z.number().int().positive(),
|
|
154
154
|
maxBytes: z.number().int().positive()
|
|
155
|
+
}).strict().optional(),
|
|
156
|
+
video: z.object({
|
|
157
|
+
maxItems: z.number().int().positive(),
|
|
158
|
+
mimeTypes: z.array(z.literal("video/mp4")),
|
|
159
|
+
minBytes: z.number().int().positive(),
|
|
160
|
+
maxBytes: z.number().int().positive(),
|
|
161
|
+
minDurationMs: z.number().int().positive(),
|
|
162
|
+
maxDurationMs: z.number().int().positive()
|
|
155
163
|
}).strict().optional()
|
|
156
164
|
}).strict().superRefine((value, context) => {
|
|
157
165
|
if (!ProviderDeliveryOptionsSchema.safeParse(value).success) {
|
|
@@ -166,7 +174,7 @@ var mcpDraftInputShape = {
|
|
|
166
174
|
...DraftPostInputSchema.shape,
|
|
167
175
|
platforms: DraftPostInputSchema.shape.platforms,
|
|
168
176
|
mediaAssetIds: DraftPostInputSchema.shape.mediaAssetIds.describe(
|
|
169
|
-
"Existing project media asset IDs. YouTube requires exactly one stored video; Bluesky accepts up to four stored JPEG, PNG, or WebP images."
|
|
177
|
+
"Existing project media asset IDs. YouTube requires exactly one stored video; LinkedIn accepts one MP4 video or up to ten JPEG/PNG images; Bluesky accepts up to four stored JPEG, PNG, or WebP images."
|
|
170
178
|
),
|
|
171
179
|
captionOverrides: DraftPostInputSchema.shape.captionOverrides.describe(
|
|
172
180
|
"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."
|
|
@@ -511,7 +519,7 @@ function createRolinoMcpServer(options = {}) {
|
|
|
511
519
|
});
|
|
512
520
|
server.registerTool("get_post_readiness", {
|
|
513
521
|
title: "Get Rolino post readiness",
|
|
514
|
-
description: "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.",
|
|
522
|
+
description: "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. LinkedIn checks allow text, JPEG/PNG images, or exactly one MP4 within its size and duration limits. This is a read-only evaluation and does not refresh providers or publish content.",
|
|
515
523
|
inputSchema: {
|
|
516
524
|
projectId: z.string().min(1).describe("Exact Rolino project ID."),
|
|
517
525
|
postId: z.string().min(1).describe("Exact Rolino post ID.")
|
|
@@ -587,7 +595,7 @@ function createRolinoMcpServer(options = {}) {
|
|
|
587
595
|
projectId: z.string().min(1).describe("Exact Rolino project ID."),
|
|
588
596
|
postId: z.string().min(1).describe("Exact Rolino post ID."),
|
|
589
597
|
expectedVersion: z.number().int().positive().describe("Current version returned by get_post."),
|
|
590
|
-
destinations: PostPublishInputSchema.shape.destinations.describe("Exact Instagram, TikTok, YouTube, and/or
|
|
598
|
+
destinations: PostPublishInputSchema.shape.destinations.describe("Exact Instagram, TikTok, YouTube, Bluesky, and/or LinkedIn destinations to publish now.")
|
|
591
599
|
},
|
|
592
600
|
outputSchema: PostPublishPreviewSchema,
|
|
593
601
|
annotations: publishPreviewAnnotations
|
|
@@ -605,7 +613,7 @@ function createRolinoMcpServer(options = {}) {
|
|
|
605
613
|
});
|
|
606
614
|
server.registerTool("execute_post_publish", {
|
|
607
615
|
title: "Execute confirmed immediate Rolino post publishing",
|
|
608
|
-
description: "Begin external publishing only after preview_post_publish. Pass the unchanged destinations, post version, and returned one-time confirmation token.
|
|
616
|
+
description: "Begin external publishing only after preview_post_publish. Pass the unchanged destinations, post version, and returned one-time confirmation token. Video execution remains PREPARING for YouTube and LinkedIn 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.",
|
|
609
617
|
inputSchema: {
|
|
610
618
|
projectId: z.string().min(1).describe("Exact Rolino project ID."),
|
|
611
619
|
postId: z.string().min(1).describe("Exact Rolino post ID."),
|
|
@@ -637,7 +645,7 @@ function createRolinoMcpServer(options = {}) {
|
|
|
637
645
|
});
|
|
638
646
|
server.registerTool("list_integration_health", {
|
|
639
647
|
title: "List Rolino publishing integration health",
|
|
640
|
-
description: "List secret-safe cached health for every enabled publishing connection (Instagram, TikTok, YouTube, or
|
|
648
|
+
description: "List secret-safe cached health for every enabled publishing connection (Instagram, TikTok, YouTube, Bluesky, or LinkedIn) in one exact project. This tool does not contact external providers or reveal social credentials.",
|
|
641
649
|
inputSchema: {
|
|
642
650
|
projectId: z.string().min(1).describe("Exact Rolino project ID.")
|
|
643
651
|
},
|
|
@@ -652,7 +660,7 @@ function createRolinoMcpServer(options = {}) {
|
|
|
652
660
|
});
|
|
653
661
|
server.registerTool("refresh_delivery_options", {
|
|
654
662
|
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
|
|
663
|
+
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 plus image and native-video policy. This refreshes cached provider health but never creates, schedules, or publishes a post.",
|
|
656
664
|
inputSchema: {
|
|
657
665
|
projectId: z.string().min(1).describe("Exact Rolino project ID."),
|
|
658
666
|
provider: ProviderDeliveryOptionsProviderSchema.describe("Provider whose delivery choices should be refreshed.")
|
|
@@ -708,4 +716,4 @@ export {
|
|
|
708
716
|
createRolinoMcpServer,
|
|
709
717
|
startStdioServer
|
|
710
718
|
};
|
|
711
|
-
//# sourceMappingURL=chunk-
|
|
719
|
+
//# sourceMappingURL=chunk-SMMHU6JG.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\", \"VIDEO\"])).optional(),\n image: z.object({\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(),\n video: z.object({\n maxItems: z.number().int().positive(),\n mimeTypes: z.array(z.literal(\"video/mp4\")),\n minBytes: z.number().int().positive(),\n maxBytes: z.number().int().positive(),\n minDurationMs: z.number().int().positive(),\n maxDurationMs: z.number().int().positive(),\n }).strict().optional(),\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; LinkedIn accepts one MP4 video or up to ten JPEG/PNG images; Bluesky accepts up to four stored JPEG, PNG, or WebP images.\",\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. LinkedIn checks allow text, JPEG/PNG images, or exactly one MP4 within its size and duration limits. This is a read-only evaluation and does not refresh providers or publish content.\",\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\n .describe(\"Exact Instagram, TikTok, YouTube, Bluesky, and/or LinkedIn destinations to publish now.\"),\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. Video execution remains PREPARING for YouTube and LinkedIn 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.\",\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\",\n description:\n \"List secret-safe cached health for every enabled publishing connection (Instagram, TikTok, YouTube, Bluesky, or LinkedIn) in one exact project. This tool does not contact external providers or reveal social credentials.\",\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 plus image and native-video policy. This refreshes cached provider health but never creates, schedules, or publishes a post.\",\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.4.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.4.0\",\n \"@rolino/local-auth\": \"0.4.0\",\n \"@rolino/sdk\": \"0.4.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,EACA,UAAY;AAAA,EACZ,MAAQ;AAAA,IACN,KAAO;AAAA,EACT;AAAA,EACA,MAAQ;AAAA,EACR,QAAU;AAAA,EACV,OAAS;AAAA,EACT,KAAO;AAAA,IACL,cAAc;AAAA,EAChB;AAAA,EACA,SAAW;AAAA,IACT,KAAK;AAAA,MACH,QAAU;AAAA,QACR,OAAS;AAAA,QACT,SAAW;AAAA,MACb;AAAA,MACA,SAAW;AAAA,QACT,OAAS;AAAA,QACT,SAAW;AAAA,MACb;AAAA,IACF;AAAA,EACF;AAAA,EACA,OAAS;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA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C/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
|
@@ -48,7 +48,7 @@ var z = __toESM(require("zod/v4"), 1);
|
|
|
48
48
|
// package.json
|
|
49
49
|
var package_default = {
|
|
50
50
|
name: "@rolino/mcp",
|
|
51
|
-
version: "0.
|
|
51
|
+
version: "0.4.0",
|
|
52
52
|
description: "Model Context Protocol server for Rolino",
|
|
53
53
|
type: "module",
|
|
54
54
|
license: "MIT",
|
|
@@ -107,9 +107,9 @@ var package_default = {
|
|
|
107
107
|
dependencies: {
|
|
108
108
|
"@hono/node-server": "2.0.12",
|
|
109
109
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
110
|
-
"@rolino/contracts": "0.
|
|
111
|
-
"@rolino/local-auth": "0.
|
|
112
|
-
"@rolino/sdk": "0.
|
|
110
|
+
"@rolino/contracts": "0.4.0",
|
|
111
|
+
"@rolino/local-auth": "0.4.0",
|
|
112
|
+
"@rolino/sdk": "0.4.0",
|
|
113
113
|
zod: "^4.4.3"
|
|
114
114
|
},
|
|
115
115
|
devDependencies: {
|
|
@@ -158,12 +158,20 @@ var ProviderDeliveryOptionsToolSchema = z.object({
|
|
|
158
158
|
stitch: z.object({ available: z.boolean() }).strict()
|
|
159
159
|
}).strict().optional(),
|
|
160
160
|
maxVideoDurationMs: z.number().int().positive().nullable().optional(),
|
|
161
|
-
supportedPostTypes: z.array(z.enum(["TEXT", "SINGLE_IMAGE", "MULTI_IMAGE"])).optional(),
|
|
161
|
+
supportedPostTypes: z.array(z.enum(["TEXT", "SINGLE_IMAGE", "MULTI_IMAGE", "VIDEO"])).optional(),
|
|
162
162
|
image: z.object({
|
|
163
163
|
maxItems: z.number().int().positive(),
|
|
164
164
|
mimeTypes: z.array(z.enum(["image/jpeg", "image/png"])),
|
|
165
165
|
maxPixelsExclusive: z.number().int().positive(),
|
|
166
166
|
maxBytes: z.number().int().positive()
|
|
167
|
+
}).strict().optional(),
|
|
168
|
+
video: z.object({
|
|
169
|
+
maxItems: z.number().int().positive(),
|
|
170
|
+
mimeTypes: z.array(z.literal("video/mp4")),
|
|
171
|
+
minBytes: z.number().int().positive(),
|
|
172
|
+
maxBytes: z.number().int().positive(),
|
|
173
|
+
minDurationMs: z.number().int().positive(),
|
|
174
|
+
maxDurationMs: z.number().int().positive()
|
|
167
175
|
}).strict().optional()
|
|
168
176
|
}).strict().superRefine((value, context) => {
|
|
169
177
|
if (!import_contracts.ProviderDeliveryOptionsSchema.safeParse(value).success) {
|
|
@@ -178,7 +186,7 @@ var mcpDraftInputShape = {
|
|
|
178
186
|
...import_contracts.DraftPostInputSchema.shape,
|
|
179
187
|
platforms: import_contracts.DraftPostInputSchema.shape.platforms,
|
|
180
188
|
mediaAssetIds: import_contracts.DraftPostInputSchema.shape.mediaAssetIds.describe(
|
|
181
|
-
"Existing project media asset IDs. YouTube requires exactly one stored video; Bluesky accepts up to four stored JPEG, PNG, or WebP images."
|
|
189
|
+
"Existing project media asset IDs. YouTube requires exactly one stored video; LinkedIn accepts one MP4 video or up to ten JPEG/PNG images; Bluesky accepts up to four stored JPEG, PNG, or WebP images."
|
|
182
190
|
),
|
|
183
191
|
captionOverrides: import_contracts.DraftPostInputSchema.shape.captionOverrides.describe(
|
|
184
192
|
"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."
|
|
@@ -523,7 +531,7 @@ function createRolinoMcpServer(options = {}) {
|
|
|
523
531
|
});
|
|
524
532
|
server.registerTool("get_post_readiness", {
|
|
525
533
|
title: "Get Rolino post readiness",
|
|
526
|
-
description: "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.",
|
|
534
|
+
description: "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. LinkedIn checks allow text, JPEG/PNG images, or exactly one MP4 within its size and duration limits. This is a read-only evaluation and does not refresh providers or publish content.",
|
|
527
535
|
inputSchema: {
|
|
528
536
|
projectId: z.string().min(1).describe("Exact Rolino project ID."),
|
|
529
537
|
postId: z.string().min(1).describe("Exact Rolino post ID.")
|
|
@@ -599,7 +607,7 @@ function createRolinoMcpServer(options = {}) {
|
|
|
599
607
|
projectId: z.string().min(1).describe("Exact Rolino project ID."),
|
|
600
608
|
postId: z.string().min(1).describe("Exact Rolino post ID."),
|
|
601
609
|
expectedVersion: z.number().int().positive().describe("Current version returned by get_post."),
|
|
602
|
-
destinations: import_contracts.PostPublishInputSchema.shape.destinations.describe("Exact Instagram, TikTok, YouTube, and/or
|
|
610
|
+
destinations: import_contracts.PostPublishInputSchema.shape.destinations.describe("Exact Instagram, TikTok, YouTube, Bluesky, and/or LinkedIn destinations to publish now.")
|
|
603
611
|
},
|
|
604
612
|
outputSchema: import_contracts.PostPublishPreviewSchema,
|
|
605
613
|
annotations: publishPreviewAnnotations
|
|
@@ -617,7 +625,7 @@ function createRolinoMcpServer(options = {}) {
|
|
|
617
625
|
});
|
|
618
626
|
server.registerTool("execute_post_publish", {
|
|
619
627
|
title: "Execute confirmed immediate Rolino post publishing",
|
|
620
|
-
description: "Begin external publishing only after preview_post_publish. Pass the unchanged destinations, post version, and returned one-time confirmation token.
|
|
628
|
+
description: "Begin external publishing only after preview_post_publish. Pass the unchanged destinations, post version, and returned one-time confirmation token. Video execution remains PREPARING for YouTube and LinkedIn 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.",
|
|
621
629
|
inputSchema: {
|
|
622
630
|
projectId: z.string().min(1).describe("Exact Rolino project ID."),
|
|
623
631
|
postId: z.string().min(1).describe("Exact Rolino post ID."),
|
|
@@ -649,7 +657,7 @@ function createRolinoMcpServer(options = {}) {
|
|
|
649
657
|
});
|
|
650
658
|
server.registerTool("list_integration_health", {
|
|
651
659
|
title: "List Rolino publishing integration health",
|
|
652
|
-
description: "List secret-safe cached health for every enabled publishing connection (Instagram, TikTok, YouTube, or
|
|
660
|
+
description: "List secret-safe cached health for every enabled publishing connection (Instagram, TikTok, YouTube, Bluesky, or LinkedIn) in one exact project. This tool does not contact external providers or reveal social credentials.",
|
|
653
661
|
inputSchema: {
|
|
654
662
|
projectId: z.string().min(1).describe("Exact Rolino project ID.")
|
|
655
663
|
},
|
|
@@ -664,7 +672,7 @@ function createRolinoMcpServer(options = {}) {
|
|
|
664
672
|
});
|
|
665
673
|
server.registerTool("refresh_delivery_options", {
|
|
666
674
|
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
|
|
675
|
+
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 plus image and native-video policy. This refreshes cached provider health but never creates, schedules, or publishes a post.",
|
|
668
676
|
inputSchema: {
|
|
669
677
|
projectId: z.string().min(1).describe("Exact Rolino project ID."),
|
|
670
678
|
provider: import_contracts.ProviderDeliveryOptionsProviderSchema.describe("Provider whose delivery choices should be refreshed.")
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAA0B;AAC1B,mBAAqC;AACrC,qBAA2B;AAC3B,sBAAqB;AACrB,uBAA2C;AAC3C,uBA4CO;AACP,IAAAA,cAIO;AACP,QAAmB;;;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,EACA,UAAY;AAAA,EACZ,MAAQ;AAAA,IACN,KAAO;AAAA,EACT;AAAA,EACA,MAAQ;AAAA,EACR,QAAU;AAAA,EACV,OAAS;AAAA,EACT,KAAO;AAAA,IACL,cAAc;AAAA,EAChB;AAAA,EACA,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,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,kCAAqB;AAC3C,QAAM,OAAO,QAAQ,SAAS;AAC9B,SAAO;AACT;","names":["import_sdk"]}
|
|
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\", \"VIDEO\"])).optional(),\n image: z.object({\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(),\n video: z.object({\n maxItems: z.number().int().positive(),\n mimeTypes: z.array(z.literal(\"video/mp4\")),\n minBytes: z.number().int().positive(),\n maxBytes: z.number().int().positive(),\n minDurationMs: z.number().int().positive(),\n maxDurationMs: z.number().int().positive(),\n }).strict().optional(),\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; LinkedIn accepts one MP4 video or up to ten JPEG/PNG images; Bluesky accepts up to four stored JPEG, PNG, or WebP images.\",\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. LinkedIn checks allow text, JPEG/PNG images, or exactly one MP4 within its size and duration limits. This is a read-only evaluation and does not refresh providers or publish content.\",\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\n .describe(\"Exact Instagram, TikTok, YouTube, Bluesky, and/or LinkedIn destinations to publish now.\"),\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. Video execution remains PREPARING for YouTube and LinkedIn 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.\",\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\",\n description:\n \"List secret-safe cached health for every enabled publishing connection (Instagram, TikTok, YouTube, Bluesky, or LinkedIn) in one exact project. This tool does not contact external providers or reveal social credentials.\",\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 plus image and native-video policy. This refreshes cached provider health but never creates, schedules, or publishes a post.\",\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.4.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.4.0\",\n \"@rolino/local-auth\": \"0.4.0\",\n \"@rolino/sdk\": \"0.4.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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBA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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,kCAAqB;AAC3C,QAAM,OAAO,QAAQ,SAAS;AAC9B,SAAO;AACT;","names":["import_sdk"]}
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rolino/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Model Context Protocol server for Rolino",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@hono/node-server": "2.0.12",
|
|
61
61
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
62
|
-
"@rolino/contracts": "0.
|
|
63
|
-
"@rolino/local-auth": "0.
|
|
64
|
-
"@rolino/sdk": "0.
|
|
62
|
+
"@rolino/contracts": "0.4.0",
|
|
63
|
+
"@rolino/local-auth": "0.4.0",
|
|
64
|
+
"@rolino/sdk": "0.4.0",
|
|
65
65
|
"zod": "^4.4.3"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
@@ -1 +0,0 @@
|
|
|
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,S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