@pegasusheavy/threads-mcp 1.0.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/.cursorrules/no-summaries.mdc +1 -0
- package/.cursorrules/update-website.mdc +8 -0
- package/.husky/README.md +37 -0
- package/.husky/commit-msg +3 -0
- package/.husky/pre-commit +12 -0
- package/.husky/pre-push +31 -0
- package/CHANGELOG.md +49 -0
- package/LICENSE +22 -0
- package/README.md +336 -0
- package/commitlint.config.js +27 -0
- package/dist/client/enhanced-threads-client.d.ts +49 -0
- package/dist/client/enhanced-threads-client.d.ts.map +1 -0
- package/dist/client/enhanced-threads-client.js +175 -0
- package/dist/client/enhanced-threads-client.js.map +1 -0
- package/dist/client/threads-client.d.ts +23 -0
- package/dist/client/threads-client.d.ts.map +1 -0
- package/dist/client/threads-client.js +208 -0
- package/dist/client/threads-client.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +41 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +10 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +382 -0
- package/dist/server.js.map +1 -0
- package/dist/types/threads.d.ts +298 -0
- package/dist/types/threads.d.ts.map +1 -0
- package/dist/types/threads.js +76 -0
- package/dist/types/threads.js.map +1 -0
- package/dist/utils/cache.d.ts +42 -0
- package/dist/utils/cache.d.ts.map +1 -0
- package/dist/utils/cache.js +147 -0
- package/dist/utils/cache.js.map +1 -0
- package/dist/utils/rate-limiter.d.ts +31 -0
- package/dist/utils/rate-limiter.d.ts.map +1 -0
- package/dist/utils/rate-limiter.js +99 -0
- package/dist/utils/rate-limiter.js.map +1 -0
- package/dist/utils/webhook.d.ts +67 -0
- package/dist/utils/webhook.d.ts.map +1 -0
- package/dist/utils/webhook.js +187 -0
- package/dist/utils/webhook.js.map +1 -0
- package/llms.txt +197 -0
- package/package.json +65 -0
package/dist/server.js
ADDED
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
2
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
3
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
const GetProfileSchema = z.object({
|
|
6
|
+
fields: z.array(z.string()).optional(),
|
|
7
|
+
});
|
|
8
|
+
const GetThreadsSchema = z.object({
|
|
9
|
+
limit: z.number().min(1).max(100).optional(),
|
|
10
|
+
fields: z.array(z.string()).optional(),
|
|
11
|
+
});
|
|
12
|
+
const GetThreadSchema = z.object({
|
|
13
|
+
threadId: z.string().min(1),
|
|
14
|
+
fields: z.array(z.string()).optional(),
|
|
15
|
+
});
|
|
16
|
+
const CreateThreadSchema = z.object({
|
|
17
|
+
text: z.string().optional(),
|
|
18
|
+
imageUrl: z.string().url().optional(),
|
|
19
|
+
videoUrl: z.string().url().optional(),
|
|
20
|
+
replyToId: z.string().optional(),
|
|
21
|
+
replyControl: z.enum(['everyone', 'accounts_you_follow', 'mentioned_only']).optional(),
|
|
22
|
+
});
|
|
23
|
+
const GetInsightsSchema = z.object({
|
|
24
|
+
threadId: z.string().optional(),
|
|
25
|
+
metrics: z.array(z.string()).min(1),
|
|
26
|
+
since: z.number().optional(),
|
|
27
|
+
until: z.number().optional(),
|
|
28
|
+
});
|
|
29
|
+
const GetRepliesSchema = z.object({
|
|
30
|
+
threadId: z.string().min(1),
|
|
31
|
+
fields: z.array(z.string()).optional(),
|
|
32
|
+
reverse: z.boolean().optional(),
|
|
33
|
+
});
|
|
34
|
+
const GetConversationSchema = z.object({
|
|
35
|
+
threadId: z.string().min(1),
|
|
36
|
+
fields: z.array(z.string()).optional(),
|
|
37
|
+
reverse: z.boolean().optional(),
|
|
38
|
+
});
|
|
39
|
+
const ReplyToThreadSchema = z.object({
|
|
40
|
+
threadId: z.string().min(1),
|
|
41
|
+
text: z.string().min(1),
|
|
42
|
+
replyControl: z.enum(['everyone', 'accounts_you_follow', 'mentioned_only']).optional(),
|
|
43
|
+
});
|
|
44
|
+
export class ThreadsMCPServer {
|
|
45
|
+
server;
|
|
46
|
+
client = null;
|
|
47
|
+
constructor() {
|
|
48
|
+
this.server = new Server({
|
|
49
|
+
name: 'threads-mcp',
|
|
50
|
+
version: '1.0.0',
|
|
51
|
+
}, {
|
|
52
|
+
capabilities: {
|
|
53
|
+
tools: {},
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
this.setupHandlers();
|
|
57
|
+
}
|
|
58
|
+
setupHandlers() {
|
|
59
|
+
this.server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
60
|
+
const tools = [
|
|
61
|
+
{
|
|
62
|
+
name: 'threads_get_profile',
|
|
63
|
+
description: 'Get the authenticated user\'s Threads profile including username, name, bio, and profile picture',
|
|
64
|
+
inputSchema: {
|
|
65
|
+
type: 'object',
|
|
66
|
+
properties: {
|
|
67
|
+
fields: {
|
|
68
|
+
type: 'array',
|
|
69
|
+
items: { type: 'string' },
|
|
70
|
+
description: 'Optional fields to retrieve. Defaults to id, username, name, threads_profile_picture_url, threads_biography',
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: 'threads_get_threads',
|
|
77
|
+
description: 'Get the authenticated user\'s threads (posts) with pagination support',
|
|
78
|
+
inputSchema: {
|
|
79
|
+
type: 'object',
|
|
80
|
+
properties: {
|
|
81
|
+
limit: {
|
|
82
|
+
type: 'number',
|
|
83
|
+
description: 'Number of threads to retrieve (1-100, default: 25)',
|
|
84
|
+
minimum: 1,
|
|
85
|
+
maximum: 100,
|
|
86
|
+
},
|
|
87
|
+
fields: {
|
|
88
|
+
type: 'array',
|
|
89
|
+
items: { type: 'string' },
|
|
90
|
+
description: 'Optional fields to retrieve for each thread',
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: 'threads_get_thread',
|
|
97
|
+
description: 'Get a specific thread by its ID',
|
|
98
|
+
inputSchema: {
|
|
99
|
+
type: 'object',
|
|
100
|
+
properties: {
|
|
101
|
+
threadId: {
|
|
102
|
+
type: 'string',
|
|
103
|
+
description: 'The ID of the thread to retrieve',
|
|
104
|
+
},
|
|
105
|
+
fields: {
|
|
106
|
+
type: 'array',
|
|
107
|
+
items: { type: 'string' },
|
|
108
|
+
description: 'Optional fields to retrieve',
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
required: ['threadId'],
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: 'threads_create_thread',
|
|
116
|
+
description: 'Create a new thread (post) with text, image, or video. Can also be used to reply to another thread.',
|
|
117
|
+
inputSchema: {
|
|
118
|
+
type: 'object',
|
|
119
|
+
properties: {
|
|
120
|
+
text: {
|
|
121
|
+
type: 'string',
|
|
122
|
+
description: 'The text content of the thread',
|
|
123
|
+
},
|
|
124
|
+
imageUrl: {
|
|
125
|
+
type: 'string',
|
|
126
|
+
description: 'URL of an image to include (must be publicly accessible)',
|
|
127
|
+
},
|
|
128
|
+
videoUrl: {
|
|
129
|
+
type: 'string',
|
|
130
|
+
description: 'URL of a video to include (must be publicly accessible)',
|
|
131
|
+
},
|
|
132
|
+
replyToId: {
|
|
133
|
+
type: 'string',
|
|
134
|
+
description: 'ID of the thread to reply to',
|
|
135
|
+
},
|
|
136
|
+
replyControl: {
|
|
137
|
+
type: 'string',
|
|
138
|
+
enum: ['everyone', 'accounts_you_follow', 'mentioned_only'],
|
|
139
|
+
description: 'Who can reply to this thread',
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: 'threads_get_insights',
|
|
146
|
+
description: 'Get insights (analytics) for a specific thread or for the user account',
|
|
147
|
+
inputSchema: {
|
|
148
|
+
type: 'object',
|
|
149
|
+
properties: {
|
|
150
|
+
threadId: {
|
|
151
|
+
type: 'string',
|
|
152
|
+
description: 'The ID of the thread (omit for user-level insights)',
|
|
153
|
+
},
|
|
154
|
+
metrics: {
|
|
155
|
+
type: 'array',
|
|
156
|
+
items: { type: 'string' },
|
|
157
|
+
description: 'Metrics to retrieve (e.g., views, likes, replies, reposts, quotes)',
|
|
158
|
+
},
|
|
159
|
+
since: {
|
|
160
|
+
type: 'number',
|
|
161
|
+
description: 'Unix timestamp for start of time range',
|
|
162
|
+
},
|
|
163
|
+
until: {
|
|
164
|
+
type: 'number',
|
|
165
|
+
description: 'Unix timestamp for end of time range',
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
required: ['metrics'],
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
name: 'threads_get_replies',
|
|
173
|
+
description: 'Get replies to a specific thread',
|
|
174
|
+
inputSchema: {
|
|
175
|
+
type: 'object',
|
|
176
|
+
properties: {
|
|
177
|
+
threadId: {
|
|
178
|
+
type: 'string',
|
|
179
|
+
description: 'The ID of the thread',
|
|
180
|
+
},
|
|
181
|
+
fields: {
|
|
182
|
+
type: 'array',
|
|
183
|
+
items: { type: 'string' },
|
|
184
|
+
description: 'Optional fields to retrieve for each reply',
|
|
185
|
+
},
|
|
186
|
+
reverse: {
|
|
187
|
+
type: 'boolean',
|
|
188
|
+
description: 'Whether to reverse the order of replies',
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
required: ['threadId'],
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: 'threads_get_conversation',
|
|
196
|
+
description: 'Get the full conversation thread including the original post and all replies',
|
|
197
|
+
inputSchema: {
|
|
198
|
+
type: 'object',
|
|
199
|
+
properties: {
|
|
200
|
+
threadId: {
|
|
201
|
+
type: 'string',
|
|
202
|
+
description: 'The ID of the thread',
|
|
203
|
+
},
|
|
204
|
+
fields: {
|
|
205
|
+
type: 'array',
|
|
206
|
+
items: { type: 'string' },
|
|
207
|
+
description: 'Optional fields to retrieve',
|
|
208
|
+
},
|
|
209
|
+
reverse: {
|
|
210
|
+
type: 'boolean',
|
|
211
|
+
description: 'Whether to reverse the order',
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
required: ['threadId'],
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
name: 'threads_reply_to_thread',
|
|
219
|
+
description: 'Reply to an existing thread',
|
|
220
|
+
inputSchema: {
|
|
221
|
+
type: 'object',
|
|
222
|
+
properties: {
|
|
223
|
+
threadId: {
|
|
224
|
+
type: 'string',
|
|
225
|
+
description: 'The ID of the thread to reply to',
|
|
226
|
+
},
|
|
227
|
+
text: {
|
|
228
|
+
type: 'string',
|
|
229
|
+
description: 'The text content of the reply',
|
|
230
|
+
},
|
|
231
|
+
replyControl: {
|
|
232
|
+
type: 'string',
|
|
233
|
+
enum: ['everyone', 'accounts_you_follow', 'mentioned_only'],
|
|
234
|
+
description: 'Who can reply to this reply',
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
required: ['threadId', 'text'],
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
];
|
|
241
|
+
return { tools };
|
|
242
|
+
});
|
|
243
|
+
this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
244
|
+
if (!this.client) {
|
|
245
|
+
throw new Error('Threads client not initialized. Please configure access token and user ID.');
|
|
246
|
+
}
|
|
247
|
+
const { name, arguments: args } = request.params;
|
|
248
|
+
try {
|
|
249
|
+
switch (name) {
|
|
250
|
+
case 'threads_get_profile': {
|
|
251
|
+
const params = GetProfileSchema.parse(args);
|
|
252
|
+
const profile = await this.client.getProfile(params.fields);
|
|
253
|
+
return {
|
|
254
|
+
content: [
|
|
255
|
+
{
|
|
256
|
+
type: 'text',
|
|
257
|
+
text: JSON.stringify(profile, null, 2),
|
|
258
|
+
},
|
|
259
|
+
],
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
case 'threads_get_threads': {
|
|
263
|
+
const params = GetThreadsSchema.parse(args);
|
|
264
|
+
const threads = await this.client.getThreads(params);
|
|
265
|
+
return {
|
|
266
|
+
content: [
|
|
267
|
+
{
|
|
268
|
+
type: 'text',
|
|
269
|
+
text: JSON.stringify(threads, null, 2),
|
|
270
|
+
},
|
|
271
|
+
],
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
case 'threads_get_thread': {
|
|
275
|
+
const params = GetThreadSchema.parse(args);
|
|
276
|
+
const thread = await this.client.getThread(params.threadId, params.fields);
|
|
277
|
+
return {
|
|
278
|
+
content: [
|
|
279
|
+
{
|
|
280
|
+
type: 'text',
|
|
281
|
+
text: JSON.stringify(thread, null, 2),
|
|
282
|
+
},
|
|
283
|
+
],
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
case 'threads_create_thread': {
|
|
287
|
+
const params = CreateThreadSchema.parse(args);
|
|
288
|
+
const result = await this.client.createThread(params);
|
|
289
|
+
return {
|
|
290
|
+
content: [
|
|
291
|
+
{
|
|
292
|
+
type: 'text',
|
|
293
|
+
text: JSON.stringify(result, null, 2),
|
|
294
|
+
},
|
|
295
|
+
],
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
case 'threads_get_insights': {
|
|
299
|
+
const params = GetInsightsSchema.parse(args);
|
|
300
|
+
const insights = params.threadId
|
|
301
|
+
? await this.client.getThreadInsights(params.threadId, {
|
|
302
|
+
metric: params.metrics,
|
|
303
|
+
since: params.since,
|
|
304
|
+
until: params.until,
|
|
305
|
+
})
|
|
306
|
+
: await this.client.getUserInsights({
|
|
307
|
+
metric: params.metrics,
|
|
308
|
+
since: params.since,
|
|
309
|
+
until: params.until,
|
|
310
|
+
});
|
|
311
|
+
return {
|
|
312
|
+
content: [
|
|
313
|
+
{
|
|
314
|
+
type: 'text',
|
|
315
|
+
text: JSON.stringify(insights, null, 2),
|
|
316
|
+
},
|
|
317
|
+
],
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
case 'threads_get_replies': {
|
|
321
|
+
const params = GetRepliesSchema.parse(args);
|
|
322
|
+
const replies = await this.client.getReplies(params.threadId, {
|
|
323
|
+
fields: params.fields,
|
|
324
|
+
reverse: params.reverse,
|
|
325
|
+
});
|
|
326
|
+
return {
|
|
327
|
+
content: [
|
|
328
|
+
{
|
|
329
|
+
type: 'text',
|
|
330
|
+
text: JSON.stringify(replies, null, 2),
|
|
331
|
+
},
|
|
332
|
+
],
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
case 'threads_get_conversation': {
|
|
336
|
+
const params = GetConversationSchema.parse(args);
|
|
337
|
+
const conversation = await this.client.getConversation(params.threadId, {
|
|
338
|
+
fields: params.fields,
|
|
339
|
+
reverse: params.reverse,
|
|
340
|
+
});
|
|
341
|
+
return {
|
|
342
|
+
content: [
|
|
343
|
+
{
|
|
344
|
+
type: 'text',
|
|
345
|
+
text: JSON.stringify(conversation, null, 2),
|
|
346
|
+
},
|
|
347
|
+
],
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
case 'threads_reply_to_thread': {
|
|
351
|
+
const params = ReplyToThreadSchema.parse(args);
|
|
352
|
+
const result = await this.client.replyToThread(params.threadId, params.text, params.replyControl);
|
|
353
|
+
return {
|
|
354
|
+
content: [
|
|
355
|
+
{
|
|
356
|
+
type: 'text',
|
|
357
|
+
text: JSON.stringify(result, null, 2),
|
|
358
|
+
},
|
|
359
|
+
],
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
default:
|
|
363
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
catch (error) {
|
|
367
|
+
if (error instanceof z.ZodError) {
|
|
368
|
+
throw new Error(`Invalid parameters: ${JSON.stringify(error.errors)}`);
|
|
369
|
+
}
|
|
370
|
+
throw error;
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
setClient(client) {
|
|
375
|
+
this.client = client;
|
|
376
|
+
}
|
|
377
|
+
async run() {
|
|
378
|
+
const transport = new StdioServerTransport();
|
|
379
|
+
await this.server.connect(transport);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GAEvB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CACvC,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IAC5C,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CACvC,CAAC,CAAC;AAEH,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CACvC,CAAC,CAAC;AAEH,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,IAAI,EAAE,CAA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