@buzzposter/mcp 0.2.3 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/tools.d.ts CHANGED
@@ -31,6 +31,8 @@ declare class BuzzPosterClient {
31
31
  }): Promise<unknown>;
32
32
  listMedia(): Promise<unknown>;
33
33
  deleteMedia(key: string): Promise<unknown>;
34
+ createPreview(data: Record<string, unknown>): Promise<unknown>;
35
+ updatePreview(id: string, data: Record<string, unknown>): Promise<unknown>;
34
36
  listSubscribers(params?: Record<string, string>): Promise<unknown>;
35
37
  addSubscriber(data: Record<string, unknown>): Promise<unknown>;
36
38
  listBroadcasts(params?: Record<string, string>): Promise<unknown>;
package/dist/tools.js CHANGED
@@ -101,6 +101,13 @@ var BuzzPosterClient = class {
101
101
  async deleteMedia(key) {
102
102
  return this.request("DELETE", `/api/v1/media/${encodeURIComponent(key)}`);
103
103
  }
104
+ // Newsletter Preview (no ESP required)
105
+ async createPreview(data) {
106
+ return this.request("POST", "/api/v1/newsletters/preview", data);
107
+ }
108
+ async updatePreview(id, data) {
109
+ return this.request("PUT", `/api/v1/newsletters/preview/${id}`, data);
110
+ }
104
111
  // Newsletter
105
112
  async listSubscribers(params) {
106
113
  return this.request(
@@ -1134,8 +1141,8 @@ function registerNewsletterTools(server, client, options = {}) {
1134
1141
  server,
1135
1142
  "create_newsletter",
1136
1143
  {
1137
- title: "Create Newsletter Draft",
1138
- description: "Push a newsletter to the user's ESP as a draft. Always call get_brand_voice first. Show an HTML preview to the user before calling this. Use table-based layouts, inline CSS only, 600px max width, email-safe fonts only (Arial, Helvetica, Georgia, Verdana), all images must use absolute URLs, keep under 102KB to avoid Gmail clipping. Optionally pass template_id to use an ESP-native template. Use list_esp_templates to discover available templates.",
1144
+ title: "Create Newsletter Preview",
1145
+ description: "Create a newsletter preview. Uploads HTML to a preview URL for review in Newsletter Studio. Does NOT push to ESP \u2014 use push_newsletter_to_esp for that. Always call get_brand_voice first. Use table-based layouts, inline CSS only, 600px max width, email-safe fonts only (Arial, Helvetica, Georgia, Verdana), all images must use absolute URLs, keep under 102KB to avoid Gmail clipping.",
1139
1146
  inputSchema: {
1140
1147
  subject: z5.string().describe("Email subject line"),
1141
1148
  content: z5.string().describe("HTML content of the newsletter"),
@@ -1169,7 +1176,7 @@ function registerNewsletterTools(server, client, options = {}) {
1169
1176
  previewText: args.preview_text
1170
1177
  };
1171
1178
  if (args.template_id) payload.templateId = args.template_id;
1172
- const result = await client.createBroadcast(payload);
1179
+ const result = await client.createPreview(payload);
1173
1180
  const response = {
1174
1181
  ...result,
1175
1182
  subject: args.subject,
@@ -1185,15 +1192,15 @@ function registerNewsletterTools(server, client, options = {}) {
1185
1192
  );
1186
1193
  server.tool(
1187
1194
  "update_newsletter",
1188
- "Update an existing newsletter draft.",
1195
+ "Update an existing newsletter preview.",
1189
1196
  {
1190
- broadcast_id: z5.string().describe("The broadcast/newsletter ID to update"),
1197
+ preview_id: z5.string().describe("The preview ID to update"),
1191
1198
  subject: z5.string().optional().describe("Updated subject line"),
1192
1199
  content: z5.string().optional().describe("Updated HTML content"),
1193
1200
  preview_text: z5.string().optional().describe("Updated preview text")
1194
1201
  },
1195
1202
  {
1196
- title: "Update Newsletter Draft",
1203
+ title: "Update Newsletter Preview",
1197
1204
  readOnlyHint: false,
1198
1205
  destructiveHint: false,
1199
1206
  idempotentHint: true,
@@ -1204,7 +1211,44 @@ function registerNewsletterTools(server, client, options = {}) {
1204
1211
  if (args.subject) data.subject = args.subject;
1205
1212
  if (args.content) data.content = args.content;
1206
1213
  if (args.preview_text) data.previewText = args.preview_text;
1207
- const result = await client.updateBroadcast(args.broadcast_id, data);
1214
+ const result = await client.updatePreview(args.preview_id, data);
1215
+ const response = {
1216
+ ...result,
1217
+ subject: args.subject,
1218
+ content: args.content,
1219
+ previewText: args.preview_text
1220
+ };
1221
+ return {
1222
+ content: [
1223
+ { type: "text", text: JSON.stringify(response, null, 2) }
1224
+ ]
1225
+ };
1226
+ }
1227
+ );
1228
+ server.tool(
1229
+ "push_newsletter_to_esp",
1230
+ "Push a newsletter to the user's ESP as a draft broadcast. Requires ESP to be configured. Use create_newsletter first for preview, then push when the user is happy with the content.",
1231
+ {
1232
+ subject: z5.string().describe("Email subject line"),
1233
+ content: z5.string().describe("HTML content of the newsletter"),
1234
+ preview_text: z5.string().optional().describe("Preview text shown in email clients"),
1235
+ template_id: z5.string().optional().describe("ESP-native template ID")
1236
+ },
1237
+ {
1238
+ title: "Push Newsletter to ESP",
1239
+ readOnlyHint: false,
1240
+ destructiveHint: false,
1241
+ idempotentHint: false,
1242
+ openWorldHint: true
1243
+ },
1244
+ async (args) => {
1245
+ const payload = {
1246
+ subject: args.subject,
1247
+ content: args.content,
1248
+ previewText: args.preview_text
1249
+ };
1250
+ if (args.template_id) payload.templateId = args.template_id;
1251
+ const result = await client.createBroadcast(payload);
1208
1252
  const response = {
1209
1253
  ...result,
1210
1254
  subject: args.subject,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buzzposter/mcp",
3
- "version": "0.2.3",
3
+ "version": "0.3.0",
4
4
  "description": "BuzzPoster MCP server - Social media, newsletters, and media hosting for any AI chatbot",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -42,10 +42,29 @@
42
42
  "zod": "^3.24.0"
43
43
  },
44
44
  "devDependencies": {
45
+ "@blocknote/core": "^0.47.0",
46
+ "@blocknote/mantine": "^0.47.0",
47
+ "@blocknote/react": "^0.47.0",
48
+ "@mantine/core": "^8.3.11",
49
+ "@mantine/hooks": "^8.3.11",
50
+ "@mantine/utils": "^6.0.22",
51
+ "@tiptap/core": "^3.13.0",
52
+ "@tiptap/pm": "^3.13.0",
45
53
  "@types/node": "^22.0.0",
46
54
  "@types/react": "^18.3.0",
47
55
  "@types/react-dom": "^18.3.0",
48
56
  "@vitejs/plugin-react": "^5.1.4",
57
+ "prosemirror-commands": "^1.6.0",
58
+ "prosemirror-dropcursor": "^1.8.0",
59
+ "prosemirror-history": "^1.4.0",
60
+ "prosemirror-inputrules": "^1.4.0",
61
+ "prosemirror-keymap": "^1.2.0",
62
+ "prosemirror-model": "^1.25.0",
63
+ "prosemirror-schema-list": "^1.4.0",
64
+ "prosemirror-state": "^1.4.0",
65
+ "prosemirror-tables": "^1.8.0",
66
+ "prosemirror-transform": "^1.10.0",
67
+ "prosemirror-view": "^1.41.0",
49
68
  "react": "^18.3.0",
50
69
  "react-dom": "^18.3.0",
51
70
  "tsup": "^8.3.0",