@kieksme/mcp-hashnode 1.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,449 @@
1
+ import { z } from "zod";
2
+ import { gql } from "../services/hashnode.js";
3
+ var ResponseFormat;
4
+ (function (ResponseFormat) {
5
+ ResponseFormat["MARKDOWN"] = "markdown";
6
+ ResponseFormat["JSON"] = "json";
7
+ })(ResponseFormat || (ResponseFormat = {}));
8
+ const ResponseFormatSchema = z
9
+ .nativeEnum(ResponseFormat)
10
+ .default(ResponseFormat.MARKDOWN)
11
+ .describe("Output format: 'markdown' (default) or 'json'");
12
+ // Shared tag schema
13
+ const TagInputSchema = z.object({
14
+ name: z.string().describe("Tag display name, e.g. 'Cloud Computing'"),
15
+ slug: z
16
+ .string()
17
+ .describe("Tag slug (lowercase, hyphens), e.g. 'cloud-computing'"),
18
+ });
19
+ // ─── Queries & Mutations ──────────────────────────────────────────────────────
20
+ const LIST_DRAFTS_QUERY = `
21
+ query ($publicationId: ObjectId!, $first: Int!, $after: String) {
22
+ me {
23
+ drafts(first: $first, after: $after, filter: { publicationId: $publicationId }) {
24
+ edges {
25
+ node {
26
+ id
27
+ title
28
+ subtitle
29
+ updatedAt
30
+ tags { id name slug }
31
+ coverImage { url }
32
+ }
33
+ cursor
34
+ }
35
+ pageInfo { hasNextPage endCursor }
36
+ }
37
+ }
38
+ }
39
+ `;
40
+ const CREATE_DRAFT_MUTATION = `
41
+ mutation ($input: CreateDraftInput!) {
42
+ createDraft(input: $input) {
43
+ draft {
44
+ id
45
+ title
46
+ subtitle
47
+ slug
48
+ updatedAt
49
+ tags { id name slug }
50
+ }
51
+ }
52
+ }
53
+ `;
54
+ const UPDATE_DRAFT_MUTATION = `
55
+ mutation ($input: UpdateDraftInput!) {
56
+ updateDraft(input: $input) {
57
+ draft {
58
+ id
59
+ title
60
+ subtitle
61
+ slug
62
+ updatedAt
63
+ tags { id name slug }
64
+ }
65
+ }
66
+ }
67
+ `;
68
+ const PUBLISH_DRAFT_MUTATION = `
69
+ mutation ($input: PublishDraftInput!) {
70
+ publishDraft(input: $input) {
71
+ post {
72
+ id
73
+ title
74
+ slug
75
+ url
76
+ publishedAt
77
+ tags { id name slug }
78
+ }
79
+ }
80
+ }
81
+ `;
82
+ // ─── Helpers ──────────────────────────────────────────────────────────────────
83
+ function formatDraft(draft) {
84
+ const lines = [
85
+ `## ${draft.title ?? "(Untitled)"}`,
86
+ `**Draft ID**: \`${draft.id}\``,
87
+ ];
88
+ if (draft.subtitle)
89
+ lines.push(`**Subtitle**: ${draft.subtitle}`);
90
+ if (draft.updatedAt)
91
+ lines.push(`**Updated**: ${new Date(draft.updatedAt).toLocaleString()}`);
92
+ if (draft.tags?.length) {
93
+ lines.push(`**Tags**: ${draft.tags.map((t) => t.name).join(", ")}`);
94
+ }
95
+ if (draft.coverImage?.url)
96
+ lines.push(`**Cover**: ${draft.coverImage.url}`);
97
+ return lines.join("\n");
98
+ }
99
+ function formatPost(post) {
100
+ const lines = [
101
+ `## ${post.title}`,
102
+ `**Post ID**: \`${post.id}\``,
103
+ `**URL**: ${post.url}`,
104
+ ];
105
+ if (post.publishedAt)
106
+ lines.push(`**Published**: ${new Date(post.publishedAt).toLocaleString()}`);
107
+ if (post.tags?.length) {
108
+ lines.push(`**Tags**: ${post.tags.map((t) => t.name).join(", ")}`);
109
+ }
110
+ return lines.join("\n");
111
+ }
112
+ // ─── Register ─────────────────────────────────────────────────────────────────
113
+ export function registerDraftTools(server) {
114
+ // hashnode_list_drafts ─────────────────────────────────────────────────────
115
+ server.registerTool("hashnode_list_drafts", {
116
+ title: "List Hashnode drafts",
117
+ description: `List drafts in a Hashnode publication.
118
+
119
+ Args:
120
+ - publication_id (string): The publication ID (from hashnode_get_me)
121
+ - limit (number): Number of drafts to return (default 20, max 50)
122
+ - after (string): Pagination cursor from a previous call
123
+ - response_format: 'markdown' or 'json'
124
+
125
+ Returns: list of drafts with id, title, subtitle, tags, updated date`,
126
+ inputSchema: {
127
+ publication_id: z
128
+ .string()
129
+ .min(1)
130
+ .describe("Publication ID (from hashnode_get_me)"),
131
+ limit: z.number().int().min(1).max(50).default(20).describe("Number of drafts to return"),
132
+ after: z
133
+ .string()
134
+ .optional()
135
+ .describe("Pagination cursor from previous response"),
136
+ response_format: ResponseFormatSchema,
137
+ },
138
+ annotations: {
139
+ readOnlyHint: true,
140
+ destructiveHint: false,
141
+ idempotentHint: true,
142
+ openWorldHint: true,
143
+ },
144
+ }, async ({ publication_id, limit, after, response_format }) => {
145
+ try {
146
+ const data = await gql(LIST_DRAFTS_QUERY, {
147
+ publicationId: publication_id,
148
+ first: limit,
149
+ after: after ?? null,
150
+ });
151
+ const edges = data.me?.drafts?.edges ?? [];
152
+ const pageInfo = data.me?.drafts?.pageInfo;
153
+ const drafts = edges.map((e) => e.node);
154
+ if (response_format === ResponseFormat.JSON) {
155
+ const output = {
156
+ count: drafts.length,
157
+ drafts,
158
+ has_more: pageInfo?.hasNextPage ?? false,
159
+ next_cursor: pageInfo?.endCursor,
160
+ };
161
+ return {
162
+ content: [{ type: "text", text: JSON.stringify(output, null, 2) }],
163
+ structuredContent: output,
164
+ };
165
+ }
166
+ if (drafts.length === 0) {
167
+ return {
168
+ content: [{ type: "text", text: "No drafts found." }],
169
+ };
170
+ }
171
+ const lines = [
172
+ `# Drafts (${drafts.length})`,
173
+ "",
174
+ ...drafts.map(formatDraft),
175
+ "",
176
+ ];
177
+ if (pageInfo?.hasNextPage) {
178
+ lines.push(`_More drafts available. Use cursor: \`${pageInfo.endCursor}\`_`);
179
+ }
180
+ return { content: [{ type: "text", text: lines.join("\n") }] };
181
+ }
182
+ catch (error) {
183
+ return {
184
+ content: [
185
+ {
186
+ type: "text",
187
+ text: error instanceof Error ? error.message : String(error),
188
+ },
189
+ ],
190
+ };
191
+ }
192
+ });
193
+ // hashnode_create_draft ────────────────────────────────────────────────────
194
+ server.registerTool("hashnode_create_draft", {
195
+ title: "Create a Hashnode draft",
196
+ description: `Create a new draft in a Hashnode publication. Does NOT publish — use hashnode_publish_draft afterwards.
197
+
198
+ Args:
199
+ - publication_id (string, required): Publication ID
200
+ - title (string, required): Post title
201
+ - content_markdown (string, required): Post content in Markdown
202
+ - subtitle (string, optional): Short subtitle
203
+ - tags (array, optional): Tags as [{ name, slug }] — slug must be lowercase with hyphens
204
+ - cover_image_url (string, optional): URL of cover image
205
+ - slug (string, optional): Custom URL slug (auto-generated from title if omitted)
206
+ - original_article_url (string, optional): Canonical URL for cross-posted articles
207
+ - meta_title (string, optional): SEO meta title
208
+ - meta_description (string, optional): SEO meta description
209
+ - response_format: 'markdown' or 'json'
210
+
211
+ Returns: draft id, title, slug, tags, updatedAt`,
212
+ inputSchema: {
213
+ publication_id: z.string().min(1).describe("Publication ID"),
214
+ title: z.string().min(1).max(1000).describe("Post title"),
215
+ content_markdown: z
216
+ .string()
217
+ .min(1)
218
+ .describe("Post content in Markdown"),
219
+ subtitle: z.string().max(300).optional().describe("Short subtitle"),
220
+ tags: z
221
+ .array(TagInputSchema)
222
+ .max(5)
223
+ .optional()
224
+ .describe("Tags as [{ name: 'Cloud Computing', slug: 'cloud-computing' }]"),
225
+ cover_image_url: z
226
+ .string()
227
+ .url()
228
+ .optional()
229
+ .describe("URL of cover image"),
230
+ slug: z
231
+ .string()
232
+ .optional()
233
+ .describe("Custom URL slug (auto-generated if omitted)"),
234
+ original_article_url: z
235
+ .string()
236
+ .url()
237
+ .optional()
238
+ .describe("Canonical URL for cross-posted content"),
239
+ meta_title: z.string().max(250).optional().describe("SEO meta title"),
240
+ meta_description: z
241
+ .string()
242
+ .max(500)
243
+ .optional()
244
+ .describe("SEO meta description"),
245
+ response_format: ResponseFormatSchema,
246
+ },
247
+ annotations: {
248
+ readOnlyHint: false,
249
+ destructiveHint: false,
250
+ idempotentHint: false,
251
+ openWorldHint: true,
252
+ },
253
+ }, async ({ publication_id, title, content_markdown, subtitle, tags, cover_image_url, slug, original_article_url, meta_title, meta_description, response_format, }) => {
254
+ try {
255
+ const input = {
256
+ publicationId: publication_id,
257
+ title,
258
+ contentMarkdown: content_markdown,
259
+ };
260
+ if (subtitle)
261
+ input.subtitle = subtitle;
262
+ if (tags?.length)
263
+ input.tags = tags;
264
+ if (cover_image_url)
265
+ input.coverImageOptions = { coverImageURL: cover_image_url };
266
+ if (slug)
267
+ input.slug = slug;
268
+ if (original_article_url)
269
+ input.originalArticleURL = original_article_url;
270
+ if (meta_title || meta_description) {
271
+ input.metaTags = {
272
+ ...(meta_title ? { title: meta_title } : {}),
273
+ ...(meta_description ? { description: meta_description } : {}),
274
+ };
275
+ }
276
+ const data = await gql(CREATE_DRAFT_MUTATION, { input });
277
+ const draft = data.createDraft.draft;
278
+ if (response_format === ResponseFormat.JSON) {
279
+ return {
280
+ content: [{ type: "text", text: JSON.stringify(draft, null, 2) }],
281
+ structuredContent: draft,
282
+ };
283
+ }
284
+ const lines = [
285
+ "# ✅ Draft created",
286
+ "",
287
+ formatDraft(draft),
288
+ "",
289
+ `To publish: call **hashnode_publish_draft** with draftId \`${draft.id}\``,
290
+ ];
291
+ return { content: [{ type: "text", text: lines.join("\n") }] };
292
+ }
293
+ catch (error) {
294
+ return {
295
+ content: [
296
+ {
297
+ type: "text",
298
+ text: error instanceof Error ? error.message : String(error),
299
+ },
300
+ ],
301
+ };
302
+ }
303
+ });
304
+ // hashnode_update_draft ────────────────────────────────────────────────────
305
+ server.registerTool("hashnode_update_draft", {
306
+ title: "Update an existing Hashnode draft",
307
+ description: `Update fields of an existing draft. Only provided fields are changed.
308
+
309
+ Args:
310
+ - draft_id (string, required): Draft ID to update
311
+ - title (string, optional): New title
312
+ - content_markdown (string, optional): New content in Markdown
313
+ - subtitle (string, optional): New subtitle
314
+ - tags (array, optional): New tags as [{ name, slug }]
315
+ - cover_image_url (string, optional): New cover image URL
316
+ - response_format: 'markdown' or 'json'`,
317
+ inputSchema: {
318
+ draft_id: z.string().min(1).describe("Draft ID to update"),
319
+ title: z.string().min(1).max(1000).optional().describe("New title"),
320
+ content_markdown: z
321
+ .string()
322
+ .optional()
323
+ .describe("New content in Markdown"),
324
+ subtitle: z
325
+ .string()
326
+ .max(300)
327
+ .optional()
328
+ .describe("New subtitle"),
329
+ tags: z
330
+ .array(TagInputSchema)
331
+ .max(5)
332
+ .optional()
333
+ .describe("New tags as [{ name, slug }]"),
334
+ cover_image_url: z
335
+ .string()
336
+ .url()
337
+ .optional()
338
+ .describe("New cover image URL"),
339
+ response_format: ResponseFormatSchema,
340
+ },
341
+ annotations: {
342
+ readOnlyHint: false,
343
+ destructiveHint: false,
344
+ idempotentHint: false,
345
+ openWorldHint: true,
346
+ },
347
+ }, async ({ draft_id, title, content_markdown, subtitle, tags, cover_image_url, response_format, }) => {
348
+ try {
349
+ const input = { id: draft_id };
350
+ if (title !== undefined)
351
+ input.title = title;
352
+ if (content_markdown !== undefined)
353
+ input.contentMarkdown = content_markdown;
354
+ if (subtitle !== undefined)
355
+ input.subtitle = subtitle;
356
+ if (tags !== undefined)
357
+ input.tags = tags;
358
+ if (cover_image_url !== undefined)
359
+ input.coverImageOptions = { coverImageURL: cover_image_url };
360
+ const data = await gql(UPDATE_DRAFT_MUTATION, { input });
361
+ const draft = data.updateDraft.draft;
362
+ if (response_format === ResponseFormat.JSON) {
363
+ return {
364
+ content: [{ type: "text", text: JSON.stringify(draft, null, 2) }],
365
+ structuredContent: draft,
366
+ };
367
+ }
368
+ return {
369
+ content: [
370
+ {
371
+ type: "text",
372
+ text: ["# ✅ Draft updated", "", formatDraft(draft)].join("\n"),
373
+ },
374
+ ],
375
+ };
376
+ }
377
+ catch (error) {
378
+ return {
379
+ content: [
380
+ {
381
+ type: "text",
382
+ text: error instanceof Error ? error.message : String(error),
383
+ },
384
+ ],
385
+ };
386
+ }
387
+ });
388
+ // hashnode_publish_draft ───────────────────────────────────────────────────
389
+ server.registerTool("hashnode_publish_draft", {
390
+ title: "Publish a Hashnode draft",
391
+ description: `Publish an existing draft, making it a live blog post.
392
+
393
+ Args:
394
+ - draft_id (string, required): Draft ID to publish (from hashnode_create_draft or hashnode_list_drafts)
395
+ - response_format: 'markdown' or 'json'
396
+
397
+ Returns: post id, title, slug, url, publishedAt, tags
398
+
399
+ Examples:
400
+ - Create draft → publish: hashnode_create_draft → hashnode_publish_draft`,
401
+ inputSchema: {
402
+ draft_id: z
403
+ .string()
404
+ .min(1)
405
+ .describe("Draft ID to publish"),
406
+ response_format: ResponseFormatSchema,
407
+ },
408
+ annotations: {
409
+ readOnlyHint: false,
410
+ destructiveHint: false,
411
+ idempotentHint: false,
412
+ openWorldHint: true,
413
+ },
414
+ }, async ({ draft_id, response_format }) => {
415
+ try {
416
+ const data = await gql(PUBLISH_DRAFT_MUTATION, { input: { draftId: draft_id } });
417
+ const post = data.publishDraft.post;
418
+ if (response_format === ResponseFormat.JSON) {
419
+ return {
420
+ content: [{ type: "text", text: JSON.stringify(post, null, 2) }],
421
+ structuredContent: post,
422
+ };
423
+ }
424
+ return {
425
+ content: [
426
+ {
427
+ type: "text",
428
+ text: [
429
+ "# 🚀 Post published!",
430
+ "",
431
+ formatPost(post),
432
+ ].join("\n"),
433
+ },
434
+ ],
435
+ };
436
+ }
437
+ catch (error) {
438
+ return {
439
+ content: [
440
+ {
441
+ type: "text",
442
+ text: error instanceof Error ? error.message : String(error),
443
+ },
444
+ ],
445
+ };
446
+ }
447
+ });
448
+ }
449
+ //# sourceMappingURL=drafts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drafts.js","sourceRoot":"","sources":["../../src/tools/drafts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAG9C,IAAK,cAGJ;AAHD,WAAK,cAAc;IACjB,uCAAqB,CAAA;IACrB,+BAAa,CAAA;AACf,CAAC,EAHI,cAAc,KAAd,cAAc,QAGlB;AAED,MAAM,oBAAoB,GAAG,CAAC;KAC3B,UAAU,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pB,sBAAsB,EACtB,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,CACjC,CAAC;YACF,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;YAEpC,IAAI,eAAe,KAAK,cAAc,CAAC,IAAI,EAAE,CAAC;gBAC5C,OAAO;oBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;oBAChE,iBAAiB,EAAE,IAAI;iBACxB,CAAC;YACJ,CAAC;YAED,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE;4BACJ,sBAAsB;4BACtB,EAAE;4BACF,UAAU,CAAC,IAAI,CAAC;yBACjB,CAAC,IAAI,CAAC,IAAI,CAAC;qBACb;iBACF;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;qBAC7D;iBACF;aACF,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ export declare function registerPostTools(server: McpServer): void;
3
+ //# sourceMappingURL=posts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"posts.d.ts","sourceRoot":"","sources":["../../src/tools/posts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAoJpE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAqezD"}