@rolino/mcp 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,719 +0,0 @@
1
- // src/index.ts
2
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
- import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
- import { openAsBlob } from "fs";
5
- import { stat } from "fs/promises";
6
- import { basename, extname, resolve } from "path";
7
- import {
8
- ActorSchema,
9
- CalendarListDataSchema,
10
- DraftPostInputSchema,
11
- DraftPostUpdateInputSchema,
12
- IntegrationHealthListDataSchema,
13
- MediaAssetListDataSchema,
14
- MediaAssetSchema,
15
- PostListDataSchema,
16
- PostPublishInputSchema,
17
- PostPublishPreviewSchema,
18
- PostReadinessSchema,
19
- PostScheduleInputSchema,
20
- PostSchedulePendingSchema,
21
- PostSchedulePreviewSchema,
22
- PostSchema,
23
- ProjectCreateInputSchema,
24
- ProjectListDataSchema,
25
- ProjectSchema,
26
- ProviderDeliveryOptionsProviderSchema,
27
- ProviderDeliveryOptionsSchema
28
- } from "@rolino/contracts";
29
- import {
30
- RolinoApiError,
31
- RolinoClient,
32
- RolinoNetworkError
33
- } from "@rolino/sdk";
34
- import * as z from "zod/v4";
35
-
36
- // package.json
37
- var package_default = {
38
- name: "@rolino/mcp",
39
- version: "0.4.0",
40
- description: "Model Context Protocol server for Rolino",
41
- type: "module",
42
- license: "MIT",
43
- keywords: [
44
- "rolino",
45
- "mcp",
46
- "model-context-protocol",
47
- "social-media",
48
- "ai-agent"
49
- ],
50
- repository: {
51
- type: "git",
52
- url: "git+https://github.com/deifos/rolino.git",
53
- directory: "packages/mcp"
54
- },
55
- homepage: "https://github.com/deifos/rolino/tree/main/packages/mcp#readme",
56
- bugs: {
57
- url: "https://github.com/deifos/rolino/issues"
58
- },
59
- main: "./dist/index.cjs",
60
- module: "./dist/index.js",
61
- types: "./dist/index.d.ts",
62
- bin: {
63
- "rolino-mcp": "./dist/bin.js"
64
- },
65
- exports: {
66
- ".": {
67
- import: {
68
- types: "./dist/index.d.ts",
69
- default: "./dist/index.js"
70
- },
71
- require: {
72
- types: "./dist/index.d.cts",
73
- default: "./dist/index.cjs"
74
- }
75
- }
76
- },
77
- files: [
78
- "dist/**/*.js",
79
- "dist/**/*.cjs",
80
- "dist/**/*.map",
81
- "dist/**/*.d.ts",
82
- "dist/**/*.d.cts",
83
- "README.md",
84
- "CHANGELOG.md",
85
- "LICENSE"
86
- ],
87
- publishConfig: {
88
- access: "public"
89
- },
90
- scripts: {
91
- build: "tsup src/index.ts src/bin.ts --format esm,cjs --dts --sourcemap --clean",
92
- typecheck: "tsc --noEmit",
93
- dev: "tsx src/bin.ts"
94
- },
95
- dependencies: {
96
- "@hono/node-server": "2.0.12",
97
- "@modelcontextprotocol/sdk": "^1.30.0",
98
- "@rolino/contracts": "0.4.0",
99
- "@rolino/local-auth": "0.4.0",
100
- "@rolino/sdk": "0.4.0",
101
- zod: "^4.4.3"
102
- },
103
- devDependencies: {
104
- tsx: "^4.21.0"
105
- },
106
- engines: {
107
- node: ">=20.19.0"
108
- }
109
- };
110
-
111
- // src/configuration.ts
112
- import { resolveCredential } from "@rolino/local-auth";
113
- import { normalizeRolinoBaseUrl, parseRolinoTimeout } from "@rolino/sdk";
114
- function resolveMcpConfiguration(env = process.env) {
115
- const baseUrl = normalizeRolinoBaseUrl(
116
- env.ROLINO_URL ?? "https://getrolino.com"
117
- );
118
- const credential = resolveCredential(baseUrl, env);
119
- return {
120
- baseUrl,
121
- token: credential.token ?? void 0,
122
- timeoutMs: env.ROLINO_TIMEOUT ? parseRolinoTimeout(env.ROLINO_TIMEOUT) : void 0,
123
- credentialSource: credential.source
124
- };
125
- }
126
-
127
- // src/index.ts
128
- var ProviderDeliveryOptionsToolSchema = z.object({
129
- provider: ProviderDeliveryOptionsProviderSchema,
130
- account: z.object({
131
- username: z.string().nullable().optional(),
132
- displayName: z.string().nullable(),
133
- avatarUrl: z.string().url().nullable()
134
- }).strict(),
135
- health: z.object({
136
- status: z.enum(["pass", "blocking", "unknown"]),
137
- code: z.string().min(1),
138
- message: z.string().min(1)
139
- }).strict(),
140
- checkedAt: z.string().datetime(),
141
- allowedPostModes: z.array(z.enum(["DIRECT_POST", "MEDIA_UPLOAD"])).optional(),
142
- visibilityOptions: z.array(z.string()).optional(),
143
- interactions: z.object({
144
- comment: z.object({ available: z.boolean() }).strict(),
145
- duet: z.object({ available: z.boolean() }).strict(),
146
- stitch: z.object({ available: z.boolean() }).strict()
147
- }).strict().optional(),
148
- maxVideoDurationMs: z.number().int().positive().nullable().optional(),
149
- supportedPostTypes: z.array(z.enum(["TEXT", "SINGLE_IMAGE", "MULTI_IMAGE", "VIDEO"])).optional(),
150
- image: z.object({
151
- maxItems: z.number().int().positive(),
152
- mimeTypes: z.array(z.enum(["image/jpeg", "image/png"])),
153
- maxPixelsExclusive: z.number().int().positive(),
154
- maxBytes: z.number().int().positive()
155
- }).strict().optional(),
156
- 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()
163
- }).strict().optional()
164
- }).strict().superRefine((value, context) => {
165
- if (!ProviderDeliveryOptionsSchema.safeParse(value).success) {
166
- context.addIssue({
167
- code: "custom",
168
- message: "Provider delivery options do not match the canonical provider contract."
169
- });
170
- }
171
- });
172
- var ROLINO_MCP_VERSION = package_default.version;
173
- var mcpDraftInputShape = {
174
- ...DraftPostInputSchema.shape,
175
- platforms: DraftPostInputSchema.shape.platforms,
176
- mediaAssetIds: DraftPostInputSchema.shape.mediaAssetIds.describe(
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."
178
- ),
179
- captionOverrides: DraftPostInputSchema.shape.captionOverrides.describe(
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."
181
- ),
182
- tiktokSettings: DraftPostInputSchema.shape.tiktokSettings.describe(
183
- "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."
184
- ),
185
- youtubeSettings: DraftPostInputSchema.shape.youtubeSettings.describe(
186
- "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."
187
- )
188
- };
189
- var mcpDraftUpdateInputShape = {
190
- ...DraftPostUpdateInputSchema.shape,
191
- mediaAssetIds: DraftPostUpdateInputSchema.shape.mediaAssetIds.describe(
192
- "Replacement ordered media asset IDs. Omit to preserve current media; pass an empty array to remove all media."
193
- ),
194
- platforms: DraftPostUpdateInputSchema.shape.platforms.describe(
195
- "Replacement destinations. Omit to preserve current destinations; pass an empty array to remove them."
196
- ),
197
- tiktokSettings: DraftPostUpdateInputSchema.shape.tiktokSettings.describe(
198
- "Replacement TikTok delivery choices. Omit to preserve current settings. Set reviewed only after reviewing fresh account-specific delivery options."
199
- )
200
- };
201
- var mcpScheduleExecuteOutputSchema = z.object({
202
- status: z.union([PostSchema.shape.status, z.literal("PENDING")]),
203
- id: PostSchema.shape.id.optional(),
204
- postId: PostSchedulePendingSchema.shape.postId.optional(),
205
- provider: PostSchedulePendingSchema.shape.provider.optional(),
206
- mutationId: PostSchedulePendingSchema.shape.mutationId.optional(),
207
- operation: PostSchedulePendingSchema.shape.operation.optional(),
208
- message: PostSchedulePendingSchema.shape.message.optional()
209
- }).passthrough();
210
- function jsonResult(structuredContent) {
211
- return {
212
- content: [{ type: "text", text: JSON.stringify(structuredContent) }],
213
- structuredContent
214
- };
215
- }
216
- function errorResult(error) {
217
- let body;
218
- if (error instanceof RolinoApiError) {
219
- body = {
220
- error: {
221
- code: error.code,
222
- message: error.message,
223
- ...error.requestId ? { requestId: error.requestId } : {},
224
- ...error.retryAfterSeconds === null ? {} : { retryAfterSeconds: error.retryAfterSeconds }
225
- }
226
- };
227
- } else if (error instanceof RolinoNetworkError) {
228
- body = { error: { code: error.kind, message: error.message } };
229
- } else if (error instanceof TypeError) {
230
- body = { error: { code: "VALIDATION_ERROR", message: error.message } };
231
- } else {
232
- body = {
233
- error: {
234
- code: "INTERNAL_ERROR",
235
- message: "Rolino could not complete the tool call."
236
- }
237
- };
238
- }
239
- return {
240
- content: [{ type: "text", text: JSON.stringify(body) }],
241
- isError: true
242
- };
243
- }
244
- var readOnlyAnnotations = {
245
- readOnlyHint: true,
246
- destructiveHint: false,
247
- idempotentHint: true,
248
- openWorldHint: false
249
- };
250
- var createDraftAnnotations = {
251
- readOnlyHint: false,
252
- destructiveHint: false,
253
- idempotentHint: true,
254
- openWorldHint: false
255
- };
256
- var createProjectAnnotations = {
257
- readOnlyHint: false,
258
- destructiveHint: false,
259
- idempotentHint: true,
260
- openWorldHint: false
261
- };
262
- var uploadMediaAnnotations = {
263
- readOnlyHint: false,
264
- destructiveHint: false,
265
- idempotentHint: false,
266
- openWorldHint: true
267
- };
268
- var deliveryOptionsAnnotations = {
269
- readOnlyHint: false,
270
- destructiveHint: false,
271
- idempotentHint: true,
272
- openWorldHint: true
273
- };
274
- var ProjectCreateToolInputSchema = ProjectCreateInputSchema.safeExtend({
275
- idempotencyKey: z.string().min(1).max(200).describe("Stable caller-generated retry key for this exact creation.")
276
- });
277
- var updateDraftAnnotations = {
278
- readOnlyHint: false,
279
- destructiveHint: true,
280
- idempotentHint: true,
281
- openWorldHint: false
282
- };
283
- var schedulePreviewAnnotations = {
284
- readOnlyHint: false,
285
- destructiveHint: false,
286
- idempotentHint: false,
287
- openWorldHint: true
288
- };
289
- var scheduleExecuteAnnotations = {
290
- readOnlyHint: false,
291
- destructiveHint: true,
292
- idempotentHint: true,
293
- openWorldHint: true
294
- };
295
- var publishPreviewAnnotations = {
296
- readOnlyHint: false,
297
- destructiveHint: false,
298
- idempotentHint: false,
299
- openWorldHint: true
300
- };
301
- var publishExecuteAnnotations = {
302
- readOnlyHint: false,
303
- destructiveHint: true,
304
- idempotentHint: true,
305
- openWorldHint: true
306
- };
307
- function defaultClient(options) {
308
- return new RolinoClient({
309
- baseUrl: options.baseUrl ?? "https://getrolino.com",
310
- token: options.token,
311
- timeoutMs: options.timeoutMs,
312
- fetch: options.fetch
313
- });
314
- }
315
- function createRolinoMcpServer(options = {}) {
316
- const api = options.client ?? defaultClient(options);
317
- const server = new McpServer({
318
- name: "rolino",
319
- version: ROLINO_MCP_VERSION,
320
- description: "Read Rolino workspace and publishing state, prepare drafts, and schedule posts through an exact server-confirmed two-step workflow."
321
- });
322
- server.registerTool("whoami", {
323
- title: "Show Rolino identity",
324
- description: "Use this before project tools to identify the authenticated Rolino user, organization, and granted capabilities. This tool never changes Rolino data.",
325
- inputSchema: {},
326
- outputSchema: ActorSchema,
327
- annotations: readOnlyAnnotations
328
- }, async () => {
329
- try {
330
- return jsonResult(await api.whoami());
331
- } catch (error) {
332
- return errorResult(error);
333
- }
334
- });
335
- server.registerTool("list_projects", {
336
- title: "List Rolino projects",
337
- description: "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.",
338
- inputSchema: {
339
- limit: z.number().int().min(1).max(100).default(50).describe("Maximum number of projects to return, from 1 to 100."),
340
- cursor: z.string().min(1).optional().describe("Project cursor returned by a previous list_projects call.")
341
- },
342
- outputSchema: ProjectListDataSchema,
343
- annotations: readOnlyAnnotations
344
- }, async ({ limit, cursor }) => {
345
- try {
346
- return jsonResult(await api.projects.list({ limit, cursor }));
347
- } catch (error) {
348
- return errorResult(error);
349
- }
350
- });
351
- server.registerTool("get_project", {
352
- title: "Get a Rolino project",
353
- description: "Get one Rolino project by its exact ID after discovering it with list_projects. This tool never changes Rolino data.",
354
- inputSchema: {
355
- projectId: z.string().min(1).describe("Exact Rolino project ID.")
356
- },
357
- outputSchema: ProjectSchema,
358
- annotations: readOnlyAnnotations
359
- }, async ({ projectId }) => {
360
- try {
361
- return jsonResult(await api.projects.get(projectId));
362
- } catch (error) {
363
- return errorResult(error);
364
- }
365
- });
366
- server.registerTool("create_project", {
367
- title: "Create a Rolino project",
368
- description: "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.",
369
- inputSchema: ProjectCreateToolInputSchema,
370
- outputSchema: ProjectSchema,
371
- annotations: createProjectAnnotations
372
- }, async ({ idempotencyKey, ...input }) => {
373
- try {
374
- return jsonResult(await api.projects.create(input, {
375
- idempotencyKey
376
- }));
377
- } catch (error) {
378
- return errorResult(error);
379
- }
380
- });
381
- server.registerTool("list_media_assets", {
382
- title: "List Rolino media assets",
383
- 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.",
384
- inputSchema: {
385
- projectId: z.string().min(1).describe("Exact Rolino project ID."),
386
- limit: z.number().int().min(1).max(100).default(50),
387
- cursor: z.string().min(1).optional(),
388
- type: z.enum(["IMAGE", "VIDEO"]).optional(),
389
- query: z.string().trim().min(1).max(100).optional()
390
- },
391
- outputSchema: MediaAssetListDataSchema,
392
- annotations: readOnlyAnnotations
393
- }, async ({ projectId, limit, cursor, type, query }) => {
394
- try {
395
- if (!api.media) throw new TypeError("This Rolino client does not support media operations.");
396
- return jsonResult(await api.media.list(projectId, { limit, cursor, type, query }));
397
- } catch (error) {
398
- return errorResult(error);
399
- }
400
- });
401
- server.registerTool("upload_media_asset", {
402
- title: "Upload local media to Rolino",
403
- 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.",
404
- inputSchema: {
405
- projectId: z.string().min(1).describe("Exact Rolino project ID."),
406
- filePath: z.string().min(1).describe("Exact local path of the user-approved media file.")
407
- },
408
- outputSchema: MediaAssetSchema,
409
- annotations: uploadMediaAnnotations
410
- }, async ({ projectId, filePath }) => {
411
- try {
412
- if (!api.media) throw new TypeError("This Rolino client does not support media operations.");
413
- const absolutePath = resolve(filePath);
414
- const details = await stat(absolutePath).catch(() => null);
415
- if (!details?.isFile()) throw new TypeError("The media path must point to a readable file.");
416
- const contentTypes = { ".jpg": "image/jpeg", ".jpeg": "image/jpeg", ".png": "image/png", ".webp": "image/webp", ".mp4": "video/mp4", ".mov": "video/quicktime" };
417
- const contentType = contentTypes[extname(absolutePath).toLowerCase()];
418
- if (!contentType) throw new TypeError("Use a JPEG, PNG, WebP, MP4, or MOV file.");
419
- const body = await openAsBlob(absolutePath, { type: contentType });
420
- return jsonResult(await api.media.upload(projectId, { fileName: basename(absolutePath), contentType, fileSize: details.size, body }));
421
- } catch (error) {
422
- return errorResult(error);
423
- }
424
- });
425
- server.registerTool("list_posts", {
426
- title: "List Rolino posts",
427
- description: "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.",
428
- inputSchema: {
429
- projectId: z.string().min(1).describe("Exact Rolino project ID."),
430
- limit: z.number().int().min(1).max(100).default(50).describe("Maximum number of posts to return, from 1 to 100."),
431
- cursor: z.string().min(1).optional().describe("Post cursor returned by a previous list_posts call."),
432
- status: z.enum([
433
- "DRAFT",
434
- "SCHEDULED",
435
- "ACTION_REQUIRED",
436
- "PUBLISHING",
437
- "PUBLISHED",
438
- "PARTIALLY_PUBLISHED",
439
- "FAILED"
440
- ]).optional().describe("Optional exact post status filter.")
441
- },
442
- outputSchema: PostListDataSchema,
443
- annotations: readOnlyAnnotations
444
- }, async ({ projectId, limit, cursor, status }) => {
445
- try {
446
- return jsonResult(await api.posts.list(projectId, {
447
- limit,
448
- cursor,
449
- status
450
- }));
451
- } catch (error) {
452
- return errorResult(error);
453
- }
454
- });
455
- server.registerTool("get_post", {
456
- title: "Get a Rolino post",
457
- description: "Get one Rolino post, including its ordered media and publication-destination status, by exact project and post IDs. This tool never changes Rolino data.",
458
- inputSchema: {
459
- projectId: z.string().min(1).describe("Exact Rolino project ID."),
460
- postId: z.string().min(1).describe("Exact Rolino post ID.")
461
- },
462
- outputSchema: PostSchema,
463
- annotations: readOnlyAnnotations
464
- }, async ({ projectId, postId }) => {
465
- try {
466
- return jsonResult(await api.posts.get(projectId, postId));
467
- } catch (error) {
468
- return errorResult(error);
469
- }
470
- });
471
- server.registerTool("create_draft_post", {
472
- title: "Create Rolino draft post",
473
- description: "Create a draft in one exact project. This changes Rolino data but never schedules or publishes. Before a TikTok draft, refresh account-specific delivery options and mark the exact choices reviewed separately from mutation consent. A YouTube draft requires exactly one stored video plus explicit title, category, visibility, audience, disclosure, notification, and tag settings; its description uses the YOUTUBE caption override or shared caption. Unaudited Google API projects may be limited to Private uploads. Supply a stable idempotency key so retrying the same input cannot create a duplicate.",
474
- inputSchema: {
475
- projectId: z.string().min(1).describe("Exact Rolino project ID."),
476
- idempotencyKey: z.string().min(1).max(200).describe("Stable caller-generated retry key for this exact creation."),
477
- ...mcpDraftInputShape
478
- },
479
- outputSchema: PostSchema,
480
- annotations: createDraftAnnotations
481
- }, async ({ projectId, idempotencyKey, ...input }) => {
482
- try {
483
- const draft = DraftPostInputSchema.parse(input);
484
- return jsonResult(await api.posts.create(projectId, draft, {
485
- idempotencyKey
486
- }));
487
- } catch (error) {
488
- return errorResult(error);
489
- }
490
- });
491
- server.registerTool("update_draft_post", {
492
- title: "Update Rolino draft post",
493
- description: "Update only the supplied draft fields without scheduling or publishing it; omitted caption, destinations, media, and provider settings are preserved. Read the post first and pass its current version; stale versions fail instead of overwriting another change. Editing TikTok content clears its prior review unless replacement settings are explicitly reviewed again. A stable idempotency key makes exact retries safe.",
494
- inputSchema: {
495
- projectId: z.string().min(1).describe("Exact Rolino project ID."),
496
- postId: z.string().min(1).describe("Exact Rolino draft post ID."),
497
- expectedVersion: z.number().int().positive().describe("Current version returned by get_post."),
498
- idempotencyKey: z.string().min(1).max(200).describe("Stable caller-generated retry key for this exact update."),
499
- ...mcpDraftUpdateInputShape
500
- },
501
- outputSchema: PostSchema,
502
- annotations: updateDraftAnnotations
503
- }, async ({
504
- projectId,
505
- postId,
506
- expectedVersion,
507
- idempotencyKey,
508
- ...input
509
- }) => {
510
- try {
511
- const draft = DraftPostUpdateInputSchema.parse(input);
512
- return jsonResult(await api.posts.update(projectId, postId, draft, {
513
- expectedVersion,
514
- idempotencyKey
515
- }));
516
- } catch (error) {
517
- return errorResult(error);
518
- }
519
- });
520
- server.registerTool("get_post_readiness", {
521
- title: "Get Rolino post readiness",
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.",
523
- inputSchema: {
524
- projectId: z.string().min(1).describe("Exact Rolino project ID."),
525
- postId: z.string().min(1).describe("Exact Rolino post ID.")
526
- },
527
- outputSchema: PostReadinessSchema,
528
- annotations: readOnlyAnnotations
529
- }, async ({ projectId, postId }) => {
530
- try {
531
- return jsonResult(await api.posts.readiness(projectId, postId));
532
- } catch (error) {
533
- return errorResult(error);
534
- }
535
- });
536
- server.registerTool("preview_post_schedule", {
537
- title: "Preview a Rolino post schedule",
538
- description: "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.",
539
- inputSchema: {
540
- projectId: z.string().min(1).describe("Exact Rolino project ID."),
541
- postId: z.string().min(1).describe("Exact Rolino post ID."),
542
- expectedVersion: z.number().int().positive().describe("Current version returned by get_post."),
543
- ...PostScheduleInputSchema.shape
544
- },
545
- outputSchema: PostSchedulePreviewSchema,
546
- annotations: schedulePreviewAnnotations
547
- }, async ({ projectId, postId, expectedVersion, ...input }) => {
548
- try {
549
- return jsonResult(await api.posts.previewSchedule(
550
- projectId,
551
- postId,
552
- input,
553
- { expectedVersion }
554
- ));
555
- } catch (error) {
556
- return errorResult(error);
557
- }
558
- });
559
- server.registerTool("execute_post_schedule", {
560
- title: "Execute a confirmed Rolino post schedule",
561
- description: "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.",
562
- inputSchema: {
563
- projectId: z.string().min(1).describe("Exact Rolino project ID."),
564
- postId: z.string().min(1).describe("Exact Rolino post ID."),
565
- expectedVersion: z.number().int().positive().describe("Same post version used by preview_post_schedule."),
566
- idempotencyKey: z.string().min(1).max(200).describe("Stable caller-generated retry key for this exact execution."),
567
- confirmationToken: z.string().min(1).max(200).describe("Single-use token returned by preview_post_schedule."),
568
- ...PostScheduleInputSchema.shape
569
- },
570
- outputSchema: mcpScheduleExecuteOutputSchema,
571
- annotations: scheduleExecuteAnnotations
572
- }, async ({
573
- projectId,
574
- postId,
575
- expectedVersion,
576
- idempotencyKey,
577
- confirmationToken,
578
- ...input
579
- }) => {
580
- try {
581
- return jsonResult(await api.posts.executeSchedule(
582
- projectId,
583
- postId,
584
- { ...input, confirmationToken },
585
- { expectedVersion, idempotencyKey }
586
- ));
587
- } catch (error) {
588
- return errorResult(error);
589
- }
590
- });
591
- server.registerTool("preview_post_publish", {
592
- title: "Preview immediate Rolino post publishing",
593
- description: "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.",
594
- inputSchema: {
595
- projectId: z.string().min(1).describe("Exact Rolino project ID."),
596
- postId: z.string().min(1).describe("Exact Rolino post ID."),
597
- expectedVersion: z.number().int().positive().describe("Current version returned by get_post."),
598
- destinations: PostPublishInputSchema.shape.destinations.describe("Exact Instagram, TikTok, YouTube, Bluesky, and/or LinkedIn destinations to publish now.")
599
- },
600
- outputSchema: PostPublishPreviewSchema,
601
- annotations: publishPreviewAnnotations
602
- }, async ({ projectId, postId, expectedVersion, destinations }) => {
603
- try {
604
- return jsonResult(await api.posts.previewPublish(
605
- projectId,
606
- postId,
607
- { destinations },
608
- { expectedVersion }
609
- ));
610
- } catch (error) {
611
- return errorResult(error);
612
- }
613
- });
614
- server.registerTool("execute_post_publish", {
615
- title: "Execute confirmed immediate Rolino post publishing",
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.",
617
- inputSchema: {
618
- projectId: z.string().min(1).describe("Exact Rolino project ID."),
619
- postId: z.string().min(1).describe("Exact Rolino post ID."),
620
- expectedVersion: z.number().int().positive().describe("Same post version used by preview_post_publish."),
621
- idempotencyKey: z.string().min(1).max(200).describe("Stable caller-generated retry key for this exact execution."),
622
- confirmationToken: z.string().min(1).max(200).describe("Single-use token returned by preview_post_publish."),
623
- destinations: PostPublishInputSchema.shape.destinations.describe("Exact unchanged destinations returned by preview_post_publish.")
624
- },
625
- outputSchema: PostSchema,
626
- annotations: publishExecuteAnnotations
627
- }, async ({
628
- projectId,
629
- postId,
630
- expectedVersion,
631
- idempotencyKey,
632
- confirmationToken,
633
- destinations
634
- }) => {
635
- try {
636
- return jsonResult(await api.posts.executePublish(
637
- projectId,
638
- postId,
639
- { destinations, confirmationToken },
640
- { expectedVersion, idempotencyKey }
641
- ));
642
- } catch (error) {
643
- return errorResult(error);
644
- }
645
- });
646
- server.registerTool("list_integration_health", {
647
- title: "List Rolino publishing integration health",
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.",
649
- inputSchema: {
650
- projectId: z.string().min(1).describe("Exact Rolino project ID.")
651
- },
652
- outputSchema: IntegrationHealthListDataSchema,
653
- annotations: readOnlyAnnotations
654
- }, async ({ projectId }) => {
655
- try {
656
- return jsonResult(await api.integrations.health(projectId));
657
- } catch (error) {
658
- return errorResult(error);
659
- }
660
- });
661
- server.registerTool("refresh_delivery_options", {
662
- title: "Refresh provider delivery options",
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.",
664
- inputSchema: {
665
- projectId: z.string().min(1).describe("Exact Rolino project ID."),
666
- provider: ProviderDeliveryOptionsProviderSchema.describe("Provider whose delivery choices should be refreshed.")
667
- },
668
- outputSchema: ProviderDeliveryOptionsToolSchema,
669
- annotations: deliveryOptionsAnnotations
670
- }, async ({ projectId, provider }) => {
671
- try {
672
- if (!api.integrations.deliveryOptions) {
673
- throw new TypeError("This Rolino client does not support provider delivery options.");
674
- }
675
- return jsonResult(await api.integrations.deliveryOptions(projectId, provider));
676
- } catch (error) {
677
- return errorResult(error);
678
- }
679
- });
680
- server.registerTool("list_calendar_events", {
681
- title: "List Rolino calendar events",
682
- description: "List scheduled posts and their enabled destinations in one exact project, including YouTube posts whose private early preparation has started. By default the bounded window spans 30 days in the past through 90 days ahead; provide both from and to for another range and paginate with nextCursor.",
683
- inputSchema: {
684
- projectId: z.string().min(1).describe("Exact Rolino project ID."),
685
- limit: z.number().int().min(1).max(100).default(50).describe("Maximum number of calendar events to return, from 1 to 100."),
686
- cursor: z.string().min(1).optional().describe("Opaque cursor returned by a previous list_calendar_events call."),
687
- from: z.iso.datetime().optional().describe("Inclusive ISO-8601 window start; provide together with to."),
688
- to: z.iso.datetime().optional().describe("Exclusive ISO-8601 window end; provide together with from.")
689
- },
690
- outputSchema: CalendarListDataSchema,
691
- annotations: readOnlyAnnotations
692
- }, async ({ projectId, limit, cursor, from, to }) => {
693
- try {
694
- return jsonResult(await api.calendar.list(projectId, {
695
- limit,
696
- cursor,
697
- from,
698
- to
699
- }));
700
- } catch (error) {
701
- return errorResult(error);
702
- }
703
- });
704
- return server;
705
- }
706
- async function startStdioServer(options = {}) {
707
- const server = createRolinoMcpServer(options);
708
- const transport = new StdioServerTransport();
709
- await server.connect(transport);
710
- return server;
711
- }
712
-
713
- export {
714
- resolveMcpConfiguration,
715
- ROLINO_MCP_VERSION,
716
- createRolinoMcpServer,
717
- startStdioServer
718
- };
719
- //# sourceMappingURL=chunk-SMMHU6JG.js.map