@xreplyai/mcp 0.3.16 → 0.3.19
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/README.md +51 -20
- package/dist/auth.d.ts +2 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +2 -0
- package/dist/auth.js.map +1 -0
- package/dist/index.js +0 -0
- package/dist/server.d.ts +2 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +4 -2
- package/dist/server.js.map +1 -1
- package/dist/tools/context.d.ts.map +1 -1
- package/dist/tools/context.js +102 -0
- package/dist/tools/context.js.map +1 -1
- package/dist/tools/media.d.ts.map +1 -1
- package/dist/tools/media.js +57 -49
- package/dist/tools/media.js.map +1 -1
- package/dist/tools/pinterest.d.ts +3 -0
- package/dist/tools/pinterest.d.ts.map +1 -0
- package/dist/tools/pinterest.js +31 -0
- package/dist/tools/pinterest.js.map +1 -0
- package/dist/tools/posts.d.ts.map +1 -1
- package/dist/tools/posts.js +71 -19
- package/dist/tools/posts.js.map +1 -1
- package/dist/tools/viral-library.d.ts +3 -0
- package/dist/tools/viral-library.d.ts.map +1 -0
- package/dist/tools/viral-library.js +86 -0
- package/dist/tools/viral-library.js.map +1 -0
- package/dist/types.d.ts +3 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/worker.d.ts +10 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +71 -0
- package/dist/worker.js.map +1 -0
- package/package.json +8 -2
package/README.md
CHANGED
|
@@ -4,12 +4,14 @@ MCP server for [XreplyAI](https://xreplyai.com) — plan, generate, and schedule
|
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
31 tools covering the full posts workflow across 8 platforms:
|
|
8
8
|
|
|
9
|
-
- **Generation** — Generate single posts
|
|
10
|
-
- **Post management** — Create, edit, delete posts
|
|
11
|
-
- **Publishing** — Publish immediately or schedule to
|
|
12
|
-
- **
|
|
9
|
+
- **Generation** — Generate single posts, threads, batches, or LinkedIn carousels in your voice
|
|
10
|
+
- **Post management** — Create, edit, delete, and list posts
|
|
11
|
+
- **Publishing** — Publish immediately or schedule to any connected platform
|
|
12
|
+
- **Media uploads** — Images and video for X, LinkedIn, Instagram, Threads, Bluesky, Pinterest, TikTok, and YouTube
|
|
13
|
+
- **Context** — Billing status, voice profile, preferences, platform styles, and custom rules
|
|
14
|
+
- **Accounts & communities** — List connected social accounts, X communities, and Pinterest boards
|
|
13
15
|
|
|
14
16
|
## Requirements
|
|
15
17
|
|
|
@@ -36,7 +38,7 @@ Add to your Claude Desktop config file:
|
|
|
36
38
|
"mcpServers": {
|
|
37
39
|
"xreply": {
|
|
38
40
|
"command": "npx",
|
|
39
|
-
"args": ["@xreplyai/mcp@0.3.
|
|
41
|
+
"args": ["@xreplyai/mcp@0.3.17"],
|
|
40
42
|
"env": {
|
|
41
43
|
"XREPLY_TOKEN": "your-jwt-token-here"
|
|
42
44
|
}
|
|
@@ -50,7 +52,7 @@ Add to your Claude Desktop config file:
|
|
|
50
52
|
Run this command:
|
|
51
53
|
|
|
52
54
|
```bash
|
|
53
|
-
claude mcp add xreply -e XREPLY_TOKEN=your-jwt-token-here -- npx @xreplyai/mcp@0.3.
|
|
55
|
+
claude mcp add xreply -e XREPLY_TOKEN=your-jwt-token-here -- npx @xreplyai/mcp@0.3.17
|
|
54
56
|
```
|
|
55
57
|
|
|
56
58
|
Then run `claude mcp list` to confirm it's registered.
|
|
@@ -62,7 +64,7 @@ Or add manually to `~/.claude/mcp.json`:
|
|
|
62
64
|
"mcpServers": {
|
|
63
65
|
"xreply": {
|
|
64
66
|
"command": "npx",
|
|
65
|
-
"args": ["@xreplyai/mcp@0.3.
|
|
67
|
+
"args": ["@xreplyai/mcp@0.3.17"],
|
|
66
68
|
"env": {
|
|
67
69
|
"XREPLY_TOKEN": "your-jwt-token-here"
|
|
68
70
|
}
|
|
@@ -84,7 +86,7 @@ Or add manually to `.cursor/mcp.json` in your project (or `~/.cursor/mcp.json` g
|
|
|
84
86
|
"mcpServers": {
|
|
85
87
|
"xreply": {
|
|
86
88
|
"command": "npx",
|
|
87
|
-
"args": ["@xreplyai/mcp@0.3.
|
|
89
|
+
"args": ["@xreplyai/mcp@0.3.17"],
|
|
88
90
|
"env": {
|
|
89
91
|
"XREPLY_TOKEN": "your-jwt-token-here"
|
|
90
92
|
}
|
|
@@ -102,7 +104,7 @@ Open Windsurf and go to **Plugins → Manage plugins → View raw config**, then
|
|
|
102
104
|
"mcpServers": {
|
|
103
105
|
"xreply": {
|
|
104
106
|
"command": "npx",
|
|
105
|
-
"args": ["@xreplyai/mcp@0.3.
|
|
107
|
+
"args": ["@xreplyai/mcp@0.3.17"],
|
|
106
108
|
"env": {
|
|
107
109
|
"XREPLY_TOKEN": "your-jwt-token-here"
|
|
108
110
|
}
|
|
@@ -161,33 +163,62 @@ openclaw skills list --eligible
|
|
|
161
163
|
|
|
162
164
|
| Tool | Description |
|
|
163
165
|
|------|-------------|
|
|
164
|
-
| `xreply_posts_generate` | Generate a single post in your voice |
|
|
165
|
-
| `xreply_posts_generate_batch` | Generate 1
|
|
166
|
+
| `xreply_posts_generate` | Generate a single post in your voice (all platforms) |
|
|
167
|
+
| `xreply_posts_generate_batch` | Generate 1–9 posts at once by category (Personalized/Trending/Viral) |
|
|
168
|
+
| `xreply_posts_generate_thread` | Generate a 2–10 tweet X thread in your voice |
|
|
169
|
+
| `xreply_carousel_generate` | Generate a LinkedIn PDF carousel (3–12 slides) |
|
|
166
170
|
|
|
167
171
|
### Post Management
|
|
168
172
|
|
|
169
173
|
| Tool | Description |
|
|
170
174
|
|------|-------------|
|
|
171
175
|
| `xreply_posts_list` | List all posts in your queue |
|
|
172
|
-
| `xreply_posts_create` | Save a post draft |
|
|
173
|
-
| `xreply_posts_edit` | Edit body
|
|
176
|
+
| `xreply_posts_create` | Save a post draft (per-platform content) |
|
|
177
|
+
| `xreply_posts_edit` | Edit body, scheduled time, or metadata |
|
|
174
178
|
| `xreply_posts_delete` | Delete a post |
|
|
175
179
|
|
|
176
180
|
### Publishing
|
|
177
181
|
|
|
178
182
|
| Tool | Description |
|
|
179
183
|
|------|-------------|
|
|
180
|
-
| `xreply_posts_publish` | Publish now or schedule to
|
|
184
|
+
| `xreply_posts_publish` | Publish now or schedule to any connected platform |
|
|
181
185
|
|
|
182
|
-
###
|
|
186
|
+
### Media Uploads
|
|
183
187
|
|
|
184
188
|
| Tool | Description |
|
|
185
189
|
|------|-------------|
|
|
186
|
-
| `
|
|
190
|
+
| `xreply_media_upload` | Upload an image for X or LinkedIn |
|
|
191
|
+
| `xreply_video_upload` | Upload a video for LinkedIn |
|
|
192
|
+
| `xreply_youtube_upload` | Upload a video for YouTube (presigned R2) |
|
|
193
|
+
| `xreply_instagram_media_upload` | Upload an image or video for Instagram |
|
|
194
|
+
| `xreply_threads_media_upload` | Upload an image for Threads |
|
|
195
|
+
| `xreply_bluesky_media_upload` | Upload an image for Bluesky (returns blob ref) |
|
|
196
|
+
| `xreply_pinterest_media_upload` | Upload an image for Pinterest |
|
|
197
|
+
| `xreply_linkedin_document_upload` | Upload a PDF for LinkedIn carousels |
|
|
198
|
+
|
|
199
|
+
### Context & Config
|
|
200
|
+
|
|
201
|
+
| Tool | Description |
|
|
202
|
+
|------|-------------|
|
|
203
|
+
| `xreply_billing_status` | Check subscription tier, quota, and limits |
|
|
187
204
|
| `xreply_voice_status` | Check voice profile analysis status |
|
|
188
|
-
| `xreply_preferences_get` | Get generation preferences |
|
|
189
|
-
| `xreply_preferences_set` | Update tone, emoji, structure preferences |
|
|
190
|
-
| `
|
|
205
|
+
| `xreply_preferences_get` | Get generation preferences (tone, emoji, structure) |
|
|
206
|
+
| `xreply_preferences_set` | Update tone, emoji, and structure preferences |
|
|
207
|
+
| `xreply_platform_styles_get` | Get per-platform style profiles |
|
|
208
|
+
| `xreply_platform_styles_set` | Override style settings for a specific platform |
|
|
209
|
+
| `xreply_rules_list` | List custom writing rules (Pro/BYOK) |
|
|
210
|
+
| `xreply_rules_create` | Add a new custom writing rule |
|
|
211
|
+
| `xreply_rules_update` | Edit an existing custom writing rule |
|
|
212
|
+
| `xreply_rules_delete` | Delete a custom writing rule |
|
|
213
|
+
| `xreply_list_social_accounts` | List connected social accounts with IDs |
|
|
214
|
+
| `xreply_content_plan_list` | List content plans (automated weekly schedule) |
|
|
215
|
+
|
|
216
|
+
### Communities & Boards
|
|
217
|
+
|
|
218
|
+
| Tool | Description |
|
|
219
|
+
|------|-------------|
|
|
220
|
+
| `xreply_list_twitter_communities` | List recently-used X communities |
|
|
221
|
+
| `xreply_pinterest_boards` | List the user's Pinterest boards (with `force_refresh`) |
|
|
191
222
|
|
|
192
223
|
## Example workflows
|
|
193
224
|
|
package/dist/auth.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC"}
|
package/dist/auth.js
ADDED
package/dist/auth.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":""}
|
package/dist/index.js
CHANGED
|
File without changes
|
package/dist/server.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
2
|
-
|
|
2
|
+
import { type XReplyClient } from "./client.js";
|
|
3
|
+
export declare function createServer(getRequestClient?: () => XReplyClient): Server;
|
|
3
4
|
//# sourceMappingURL=server.d.ts.map
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAMnE,OAAO,EAAa,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAsB3D,wBAAgB,YAAY,CAAC,gBAAgB,CAAC,EAAE,MAAM,YAAY,GAAG,MAAM,CA8B1E"}
|
package/dist/server.js
CHANGED
|
@@ -6,15 +6,17 @@ import { publishTools } from "./tools/publish.js";
|
|
|
6
6
|
import { contextTools } from "./tools/context.js";
|
|
7
7
|
import { communityTools } from "./tools/communities.js";
|
|
8
8
|
import { mediaTools } from "./tools/media.js";
|
|
9
|
+
import { pinterestTools } from "./tools/pinterest.js";
|
|
9
10
|
const ALL_TOOLS = [
|
|
10
11
|
...postTools,
|
|
11
12
|
...publishTools,
|
|
12
13
|
...contextTools,
|
|
13
14
|
...communityTools,
|
|
14
15
|
...mediaTools,
|
|
16
|
+
...pinterestTools,
|
|
15
17
|
];
|
|
16
18
|
const TOOL_MAP = new Map(ALL_TOOLS.map((t) => [t.name, t]));
|
|
17
|
-
export function createServer() {
|
|
19
|
+
export function createServer(getRequestClient) {
|
|
18
20
|
const server = new Server({ name: "xreply-mcp", version: "0.1.0" }, { capabilities: { tools: {} } });
|
|
19
21
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
20
22
|
tools: ALL_TOOLS.map((t) => ({
|
|
@@ -32,7 +34,7 @@ export function createServer() {
|
|
|
32
34
|
isError: true,
|
|
33
35
|
};
|
|
34
36
|
}
|
|
35
|
-
const client = getClient();
|
|
37
|
+
const client = getRequestClient ? getRequestClient() : getClient();
|
|
36
38
|
return tool.handler((args ?? {}), client);
|
|
37
39
|
});
|
|
38
40
|
return server;
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EACL,qBAAqB,EACrB,sBAA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AC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC3B,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,WAAW,EAAE,CAAC,CAAC,WAAW;YAC1B,WAAW,EAAE,CAAC,CAAC,WAAW;SAC3B,CAAC,CAAC;KACJ,CAAC,CAAC,CAAC;IAEJ,MAAM,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,KAAK,EAAE,OAAO,EAA2B,EAAE;QACzF,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;QACjD,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAEhC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,IAAI,EAAE,EAAE,CAAC;gBAC1D,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;QAED,MAAM,MAAM,GAAG,gBAAgB,CAAC,CAAC,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;QACnE,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,IAAI,EAAE,CAA4B,EAAE,MAAM,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/tools/context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/tools/context.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,cAAc,EAAc,MAAM,YAAY,CAAC;AA8B7D,eAAO,MAAM,YAAY,EAAE,cAAc,EA8UxC,CAAC"}
|
package/dist/tools/context.js
CHANGED
|
@@ -234,5 +234,107 @@ export const contextTools = [
|
|
|
234
234
|
}
|
|
235
235
|
},
|
|
236
236
|
},
|
|
237
|
+
{
|
|
238
|
+
name: "xreply_rules_create",
|
|
239
|
+
description: "Create a custom writing rule that will be applied during post generation — e.g., 'never use hashtags', 'always end with a question'. Requires Pro or BYOK subscription.",
|
|
240
|
+
inputSchema: {
|
|
241
|
+
type: "object",
|
|
242
|
+
properties: {
|
|
243
|
+
title: { type: "string", description: "Short label for the rule (e.g., 'No hashtags')" },
|
|
244
|
+
content: { type: "string", description: "The rule instruction applied during generation (e.g., 'Never use hashtags in any post')" },
|
|
245
|
+
active: { type: "boolean", description: "Whether the rule is active (default: true)" },
|
|
246
|
+
},
|
|
247
|
+
required: ["title", "content"],
|
|
248
|
+
},
|
|
249
|
+
async handler(args, client) {
|
|
250
|
+
try {
|
|
251
|
+
const parsed = z.object({
|
|
252
|
+
title: z.string().min(1),
|
|
253
|
+
content: z.string().min(1),
|
|
254
|
+
active: z.boolean().optional().default(true),
|
|
255
|
+
}).parse(args);
|
|
256
|
+
const result = await client.post("/api/v1/custom_rules", {
|
|
257
|
+
custom_rule: parsed,
|
|
258
|
+
});
|
|
259
|
+
return ok(result);
|
|
260
|
+
}
|
|
261
|
+
catch (e) {
|
|
262
|
+
return err(e);
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
name: "xreply_rules_update",
|
|
268
|
+
description: "Update an existing custom writing rule. Only the fields you provide are changed. Use xreply_rules_list to get rule IDs. Requires Pro or BYOK subscription.",
|
|
269
|
+
inputSchema: {
|
|
270
|
+
type: "object",
|
|
271
|
+
properties: {
|
|
272
|
+
id: { type: "number", description: "ID of the rule to update (from xreply_rules_list)" },
|
|
273
|
+
title: { type: "string", description: "New label for the rule" },
|
|
274
|
+
content: { type: "string", description: "New rule instruction" },
|
|
275
|
+
active: { type: "boolean", description: "Enable or disable the rule" },
|
|
276
|
+
},
|
|
277
|
+
required: ["id"],
|
|
278
|
+
},
|
|
279
|
+
async handler(args, client) {
|
|
280
|
+
try {
|
|
281
|
+
const parsed = z.object({
|
|
282
|
+
id: z.number().int().positive(),
|
|
283
|
+
title: z.string().min(1).optional(),
|
|
284
|
+
content: z.string().min(1).optional(),
|
|
285
|
+
active: z.boolean().optional(),
|
|
286
|
+
}).parse(args);
|
|
287
|
+
const { id, ...fields } = parsed;
|
|
288
|
+
const result = await client.patch(`/api/v1/custom_rules/${id}`, {
|
|
289
|
+
custom_rule: fields,
|
|
290
|
+
});
|
|
291
|
+
return ok(result);
|
|
292
|
+
}
|
|
293
|
+
catch (e) {
|
|
294
|
+
return err(e);
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
name: "xreply_rules_delete",
|
|
300
|
+
description: "Delete a custom writing rule permanently. Use xreply_rules_list to get rule IDs. Requires Pro or BYOK subscription.",
|
|
301
|
+
inputSchema: {
|
|
302
|
+
type: "object",
|
|
303
|
+
properties: {
|
|
304
|
+
id: { type: "number", description: "ID of the rule to delete (from xreply_rules_list)" },
|
|
305
|
+
},
|
|
306
|
+
required: ["id"],
|
|
307
|
+
},
|
|
308
|
+
async handler(args, client) {
|
|
309
|
+
try {
|
|
310
|
+
const parsed = z.object({
|
|
311
|
+
id: z.number().int().positive(),
|
|
312
|
+
}).parse(args);
|
|
313
|
+
await client.delete(`/api/v1/custom_rules/${parsed.id}`);
|
|
314
|
+
return ok({ message: `Rule ${parsed.id} deleted.` });
|
|
315
|
+
}
|
|
316
|
+
catch (e) {
|
|
317
|
+
return err(e);
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
name: "xreply_content_plan_list",
|
|
323
|
+
description: "List your weekly content plans — name, active status, platform configs, topics, schedule day/time, and when each plan last ran and is next due. Use this to check what automated content is already configured before generating posts manually.",
|
|
324
|
+
inputSchema: {
|
|
325
|
+
type: "object",
|
|
326
|
+
properties: {},
|
|
327
|
+
required: [],
|
|
328
|
+
},
|
|
329
|
+
async handler(_args, client) {
|
|
330
|
+
try {
|
|
331
|
+
const result = await client.get("/api/v1/content_plans");
|
|
332
|
+
return ok(result);
|
|
333
|
+
}
|
|
334
|
+
catch (e) {
|
|
335
|
+
return err(e);
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
},
|
|
237
339
|
];
|
|
238
340
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/tools/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/tools/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,iBAAiB,CAAC,CAAC,CAAC,QAAQ,EAAE;CAClI,CAAC,CAAC;AAEH,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,iBAAiB,CAAC,CAAC;IACtH,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,QAAQ,EAAE;IAClF,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC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AM,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC;YACvD,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC;YAChB,CAAC;QACH,CAAC;KACF;IAED;QACE,IAAI,EAAE,0BAA0B;QAChC,WAAW,EACT,kPAAkP;QACpP,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE;YACd,QAAQ,EAAE,EAAE;SACb;QACD,KAAK,CAAC,OAAO,CAAC,KAA8B,EAAE,MAAoB;YAChE,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;gBACzD,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC;YACpB,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC;YAChB,CAAC;QACH,CAAC;KACF;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../src/tools/media.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAGjD,eAAO,MAAM,GAAG;qBAAsB,MAAM,KAAG,MAAM;CAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../src/tools/media.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAGjD,eAAO,MAAM,GAAG;qBAAsB,MAAM,KAAG,MAAM;CAAkC,CAAC;AAuBxF,eAAO,MAAM,UAAU,EAAE,cAAc,EA+MtC,CAAC"}
|
package/dist/tools/media.js
CHANGED
|
@@ -3,8 +3,7 @@ import { readFileSync } from "fs";
|
|
|
3
3
|
import { ok, err } from "./helpers.js";
|
|
4
4
|
export const _fs = { readFile: (path) => readFileSync(path) };
|
|
5
5
|
const ALLOWED_CONTENT_TYPES = ["image/jpeg", "image/png", "video/mp4", "video/quicktime"];
|
|
6
|
-
const
|
|
7
|
-
const TIKTOK_VIDEO_CONTENT_TYPES = ["video/mp4", "video/quicktime"];
|
|
6
|
+
const IMAGE_ONLY_CONTENT_TYPES = ["image/jpeg", "image/png"];
|
|
8
7
|
const LinkedInDocumentUploadSchema = z.object({
|
|
9
8
|
file_path: z.string().describe("Absolute path to the PDF file on disk"),
|
|
10
9
|
});
|
|
@@ -14,23 +13,18 @@ const InstagramMediaUploadSchema = z.object({
|
|
|
14
13
|
.enum(ALLOWED_CONTENT_TYPES)
|
|
15
14
|
.describe("MIME type of the file (image/jpeg, image/png, video/mp4, video/quicktime)"),
|
|
16
15
|
});
|
|
17
|
-
const
|
|
16
|
+
const ImageOnlyUploadSchema = z.object({
|
|
18
17
|
file_path: z.string().describe("Absolute path to the image file on disk"),
|
|
19
18
|
content_type: z
|
|
20
|
-
.enum(
|
|
21
|
-
.describe("MIME type of the file (image/jpeg
|
|
22
|
-
});
|
|
23
|
-
const TikTokVideoUploadSchema = z.object({
|
|
24
|
-
file_path: z.string().describe("Absolute path to the video file on disk"),
|
|
25
|
-
content_type: z
|
|
26
|
-
.enum(TIKTOK_VIDEO_CONTENT_TYPES)
|
|
27
|
-
.describe("MIME type of the file (video/mp4, video/quicktime)"),
|
|
19
|
+
.enum(IMAGE_ONLY_CONTENT_TYPES)
|
|
20
|
+
.describe("MIME type of the file (image/jpeg or image/png)"),
|
|
28
21
|
});
|
|
29
22
|
export const mediaTools = [
|
|
30
23
|
{
|
|
31
24
|
name: "xreply_instagram_media_upload",
|
|
32
25
|
description: "Upload a local image or video file to R2 storage and get back a public URL to use in Instagram posts. " +
|
|
33
26
|
"Pass the returned url in post_contents[].metadata.image_url (single image), image_urls (carousel), or video_url (reel). " +
|
|
27
|
+
"Also pass the returned r2_key in post_contents[].metadata.r2_key (single) or r2_keys[] (carousel) — required for cleanup to preserve the file. " +
|
|
34
28
|
"Supports JPEG, PNG (images up to 8 MB) and MP4, MOV (videos up to 100 MB).",
|
|
35
29
|
inputSchema: {
|
|
36
30
|
type: "object",
|
|
@@ -55,7 +49,7 @@ export const mediaTools = [
|
|
|
55
49
|
return err(`Could not read file at ${file_path}`);
|
|
56
50
|
}
|
|
57
51
|
const result = await client.post("/api/v1/instagram/media_uploads", { media: fileData.toString("base64"), content_type });
|
|
58
|
-
return ok({ url: result.url });
|
|
52
|
+
return ok({ url: result.url, r2_key: result.r2_key });
|
|
59
53
|
}
|
|
60
54
|
catch (e) {
|
|
61
55
|
return err(e);
|
|
@@ -98,9 +92,10 @@ export const mediaTools = [
|
|
|
98
92
|
},
|
|
99
93
|
},
|
|
100
94
|
{
|
|
101
|
-
name: "
|
|
102
|
-
description: "Upload a local image file to R2 storage and get back a public URL to use in
|
|
103
|
-
"Pass the returned url in post_contents[].metadata.image_url (
|
|
95
|
+
name: "xreply_threads_media_upload",
|
|
96
|
+
description: "Upload a local image file to R2 storage and get back a public URL to use in Threads posts. " +
|
|
97
|
+
"Pass the returned url in post_contents[].metadata.image_url (required for single_image content_type on Threads). " +
|
|
98
|
+
"Also pass the returned r2_key in post_contents[].metadata.r2_key — required for cleanup to preserve the file. " +
|
|
104
99
|
"Supports JPEG and PNG images up to 8 MB.",
|
|
105
100
|
inputSchema: {
|
|
106
101
|
type: "object",
|
|
@@ -108,7 +103,7 @@ export const mediaTools = [
|
|
|
108
103
|
file_path: { type: "string", description: "Absolute path to the image file on disk" },
|
|
109
104
|
content_type: {
|
|
110
105
|
type: "string",
|
|
111
|
-
enum: [...
|
|
106
|
+
enum: [...IMAGE_ONLY_CONTENT_TYPES],
|
|
112
107
|
description: "MIME type of the file (image/jpeg or image/png)",
|
|
113
108
|
},
|
|
114
109
|
},
|
|
@@ -116,7 +111,7 @@ export const mediaTools = [
|
|
|
116
111
|
},
|
|
117
112
|
async handler(args, client) {
|
|
118
113
|
try {
|
|
119
|
-
const { file_path, content_type } =
|
|
114
|
+
const { file_path, content_type } = ImageOnlyUploadSchema.parse(args);
|
|
120
115
|
let fileData;
|
|
121
116
|
try {
|
|
122
117
|
fileData = _fs.readFile(file_path);
|
|
@@ -124,7 +119,7 @@ export const mediaTools = [
|
|
|
124
119
|
catch {
|
|
125
120
|
return err(`Could not read file at ${file_path}`);
|
|
126
121
|
}
|
|
127
|
-
const result = await client.post("/api/v1/
|
|
122
|
+
const result = await client.post("/api/v1/threads/media_uploads", { media: fileData.toString("base64"), content_type });
|
|
128
123
|
return ok({ url: result.url, r2_key: result.r2_key });
|
|
129
124
|
}
|
|
130
125
|
catch (e) {
|
|
@@ -133,26 +128,26 @@ export const mediaTools = [
|
|
|
133
128
|
},
|
|
134
129
|
},
|
|
135
130
|
{
|
|
136
|
-
name: "
|
|
137
|
-
description: "Upload a local
|
|
138
|
-
"
|
|
139
|
-
"
|
|
140
|
-
"
|
|
131
|
+
name: "xreply_bluesky_media_upload",
|
|
132
|
+
description: "Upload a local image file to Bluesky (uploads directly to the user's PDS via AT Protocol) and get back a blob reference. " +
|
|
133
|
+
"Pass the returned blob in post_contents[].metadata.blob for single_image posts on Bluesky. " +
|
|
134
|
+
"Supports JPEG and PNG images up to 1 MB (Bluesky's limit is much stricter than other platforms). " +
|
|
135
|
+
"Unlike other platforms, Bluesky media is stored on the user's PDS, not R2 — there is no r2_key.",
|
|
141
136
|
inputSchema: {
|
|
142
137
|
type: "object",
|
|
143
138
|
properties: {
|
|
144
|
-
file_path: { type: "string", description: "Absolute path to the
|
|
139
|
+
file_path: { type: "string", description: "Absolute path to the image file on disk" },
|
|
145
140
|
content_type: {
|
|
146
141
|
type: "string",
|
|
147
|
-
enum: [...
|
|
148
|
-
description: "MIME type of the file (
|
|
142
|
+
enum: [...IMAGE_ONLY_CONTENT_TYPES],
|
|
143
|
+
description: "MIME type of the file (image/jpeg or image/png)",
|
|
149
144
|
},
|
|
150
145
|
},
|
|
151
146
|
required: ["file_path", "content_type"],
|
|
152
147
|
},
|
|
153
148
|
async handler(args, client) {
|
|
154
149
|
try {
|
|
155
|
-
const { file_path, content_type } =
|
|
150
|
+
const { file_path, content_type } = ImageOnlyUploadSchema.parse(args);
|
|
156
151
|
let fileData;
|
|
157
152
|
try {
|
|
158
153
|
fileData = _fs.readFile(file_path);
|
|
@@ -160,31 +155,44 @@ export const mediaTools = [
|
|
|
160
155
|
catch {
|
|
161
156
|
return err(`Could not read file at ${file_path}`);
|
|
162
157
|
}
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
158
|
+
const result = await client.post("/api/v1/bluesky/media_uploads", { media: fileData.toString("base64"), content_type });
|
|
159
|
+
return ok({ blob: result.blob });
|
|
160
|
+
}
|
|
161
|
+
catch (e) {
|
|
162
|
+
return err(e);
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
name: "xreply_pinterest_media_upload",
|
|
168
|
+
description: "Upload a local image file to R2 storage and get back a public URL to use in Pinterest posts. " +
|
|
169
|
+
"Pass the returned url in post_contents[].metadata.image_url. " +
|
|
170
|
+
"Also pass the returned r2_key in post_contents[].metadata.r2_key — required for cleanup to preserve the file. " +
|
|
171
|
+
"Supports JPEG and PNG images up to 8 MB.",
|
|
172
|
+
inputSchema: {
|
|
173
|
+
type: "object",
|
|
174
|
+
properties: {
|
|
175
|
+
file_path: { type: "string", description: "Absolute path to the image file on disk" },
|
|
176
|
+
content_type: {
|
|
177
|
+
type: "string",
|
|
178
|
+
enum: [...IMAGE_ONLY_CONTENT_TYPES],
|
|
179
|
+
description: "MIME type of the file (image/jpeg or image/png)",
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
required: ["file_path", "content_type"],
|
|
183
|
+
},
|
|
184
|
+
async handler(args, client) {
|
|
185
|
+
try {
|
|
186
|
+
const { file_path, content_type } = ImageOnlyUploadSchema.parse(args);
|
|
187
|
+
let fileData;
|
|
167
188
|
try {
|
|
168
|
-
|
|
169
|
-
method: "PUT",
|
|
170
|
-
headers: { "Content-Type": content_type, "Content-Length": String(fileData.byteLength) },
|
|
171
|
-
body: fileData,
|
|
172
|
-
signal: uploadController.signal,
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
catch (e) {
|
|
176
|
-
clearTimeout(uploadTimer);
|
|
177
|
-
if (e instanceof Error && e.name === "AbortError") {
|
|
178
|
-
return err("Video upload timed out after 5 minutes. Try a smaller file or check your connection.");
|
|
179
|
-
}
|
|
180
|
-
return err(`Video upload failed: ${e instanceof Error ? e.message : String(e)}`);
|
|
189
|
+
fileData = _fs.readFile(file_path);
|
|
181
190
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
const body = await uploadResponse.text().catch(() => "");
|
|
185
|
-
return err(`Video upload failed with HTTP ${uploadResponse.status}: ${body}`);
|
|
191
|
+
catch {
|
|
192
|
+
return err(`Could not read file at ${file_path}`);
|
|
186
193
|
}
|
|
187
|
-
|
|
194
|
+
const result = await client.post("/api/v1/pinterest/media_uploads", { media: fileData.toString("base64"), content_type });
|
|
195
|
+
return ok({ url: result.url, r2_key: result.r2_key });
|
|
188
196
|
}
|
|
189
197
|
catch (e) {
|
|
190
198
|
return err(e);
|
package/dist/tools/media.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.js","sourceRoot":"","sources":["../../src/tools/media.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAGlC,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,CAAC,MAAM,GAAG,GAAG,EAAE,QAAQ,EAAE,CAAC,IAAY,EAAU,EAAE,CAAC,YAAY,CAAC,IAAI,CAAW,EAAE,CAAC;AAExF,MAAM,qBAAqB,GAAG,CAAC,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,iBAAiB,CAAU,CAAC;AACnG,MAAM,
|
|
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a7D,eAAO,MAAM,cAAc,EAAE,cAAc,EA4B1C,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ok, err } from "./helpers.js";
|
|
2
|
+
export const pinterestTools = [
|
|
3
|
+
{
|
|
4
|
+
name: "xreply_pinterest_boards",
|
|
5
|
+
description: "List the user's Pinterest boards. Returns board IDs, names, and privacy settings — use the returned id as board_id in post_contents[].metadata when creating a Pinterest post. Results are cached; pass force_refresh to re-fetch from the Pinterest API.",
|
|
6
|
+
inputSchema: {
|
|
7
|
+
type: "object",
|
|
8
|
+
properties: {
|
|
9
|
+
force_refresh: {
|
|
10
|
+
type: "boolean",
|
|
11
|
+
description: "Force a fresh fetch from the Pinterest API instead of using cached data (default: false).",
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
required: [],
|
|
15
|
+
},
|
|
16
|
+
async handler(args, client) {
|
|
17
|
+
try {
|
|
18
|
+
const forceRefresh = args.force_refresh === true;
|
|
19
|
+
const path = forceRefresh
|
|
20
|
+
? "/api/v1/pinterest/boards?force_refresh=true"
|
|
21
|
+
: "/api/v1/pinterest/boards";
|
|
22
|
+
const result = await client.get(path);
|
|
23
|
+
return ok(result);
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
return err(e);
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
//# sourceMappingURL=pinterest.js.map
|