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