postproxy-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.
- package/LICENSE +21 -0
- package/README.md +635 -0
- package/dist/api/client.d.ts +71 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +432 -0
- package/dist/api/client.js.map +1 -0
- package/dist/auth/credentials.d.ts +19 -0
- package/dist/auth/credentials.d.ts.map +1 -0
- package/dist/auth/credentials.js +40 -0
- package/dist/auth/credentials.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +162 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +220 -0
- package/dist/server.js.map +1 -0
- package/dist/setup-cli.d.ts +6 -0
- package/dist/setup-cli.d.ts.map +1 -0
- package/dist/setup-cli.js +10 -0
- package/dist/setup-cli.js.map +1 -0
- package/dist/setup.d.ts +8 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +143 -0
- package/dist/setup.js.map +1 -0
- package/dist/tools/accounts.d.ts +11 -0
- package/dist/tools/accounts.d.ts.map +1 -0
- package/dist/tools/accounts.js +53 -0
- package/dist/tools/accounts.js.map +1 -0
- package/dist/tools/auth.d.ts +11 -0
- package/dist/tools/auth.d.ts.map +1 -0
- package/dist/tools/auth.js +35 -0
- package/dist/tools/auth.js.map +1 -0
- package/dist/tools/history.d.ts +13 -0
- package/dist/tools/history.d.ts.map +1 -0
- package/dist/tools/history.js +79 -0
- package/dist/tools/history.js.map +1 -0
- package/dist/tools/post.d.ts +44 -0
- package/dist/tools/post.d.ts.map +1 -0
- package/dist/tools/post.js +251 -0
- package/dist/tools/post.js.map +1 -0
- package/dist/tools/profiles.d.ts +11 -0
- package/dist/tools/profiles.d.ts.map +1 -0
- package/dist/tools/profiles.js +52 -0
- package/dist/tools/profiles.js.map +1 -0
- package/dist/types/index.d.ts +147 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +5 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/errors.d.ts +21 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +33 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/idempotency.d.ts +8 -0
- package/dist/utils/idempotency.d.ts.map +1 -0
- package/dist/utils/idempotency.js +23 -0
- package/dist/utils/idempotency.js.map +1 -0
- package/dist/utils/logger.d.ts +20 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +68 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/validation.d.ts +555 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +145 -0
- package/dist/utils/validation.js.map +1 -0
- package/package.json +39 -0
- package/src/api/client.ts +497 -0
- package/src/auth/credentials.ts +43 -0
- package/src/index.ts +57 -0
- package/src/server.ts +235 -0
- package/src/setup-cli.ts +11 -0
- package/src/setup.ts +187 -0
- package/src/tools/auth.ts +45 -0
- package/src/tools/history.ts +89 -0
- package/src/tools/post.ts +338 -0
- package/src/tools/profiles.ts +69 -0
- package/src/types/index.ts +161 -0
- package/src/utils/errors.ts +38 -0
- package/src/utils/idempotency.ts +31 -0
- package/src/utils/logger.ts +75 -0
- package/src/utils/validation.ts +171 -0
- package/tsconfig.json +19 -0
- package/worker/index.ts +901 -0
- package/wrangler.toml +11 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Postproxy
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,635 @@
|
|
|
1
|
+
# PostProxy MCP Server
|
|
2
|
+
|
|
3
|
+
MCP (Model Context Protocol) server for integrating PostProxy API with Claude Code. This server provides tools for publishing posts, checking statuses, and managing social media profiles through Claude Code.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
### Global Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g postproxy-mcp
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Local Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install postproxy-mcp
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Claude Code stores MCP server configuration under `~/.claude/plugins/`.
|
|
20
|
+
After installing postproxy-mcp, Claude will automatically detect the server on restart.
|
|
21
|
+
|
|
22
|
+
## Configuration
|
|
23
|
+
|
|
24
|
+
### Register MCP Server
|
|
25
|
+
|
|
26
|
+
After installing postproxy-mcp, register it with Claude Code using the `claude mcp add` command:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
claude mcp add --transport stdio postproxy-mcp --env POSTPROXY_API_KEY=your-api-key --env POSTPROXY_BASE_URL=https://api.postproxy.dev/api -- postproxy-mcp
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Replace `your-api-key` with your actual PostProxy API key.
|
|
33
|
+
|
|
34
|
+
The configuration will be automatically saved to `~/.claude/plugins/`. After running this command:
|
|
35
|
+
|
|
36
|
+
1. Restart your Claude Code session
|
|
37
|
+
2. Test the connection by asking Claude: "Check my PostProxy authentication status"
|
|
38
|
+
3. If tools are available, Claude will be able to use them automatically
|
|
39
|
+
|
|
40
|
+
### Alternative: Interactive Setup
|
|
41
|
+
|
|
42
|
+
For non-technical users, you can use the interactive setup command:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
postproxy-mcp setup
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
or
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
postproxy-mcp-setup
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
This will guide you through the setup process step by step and register the server using `claude mcp add` automatically.
|
|
55
|
+
|
|
56
|
+
## Available Tools
|
|
57
|
+
|
|
58
|
+
### Authentication Tools
|
|
59
|
+
|
|
60
|
+
#### `auth.status`
|
|
61
|
+
|
|
62
|
+
Check authentication status, API configuration, and workspace information.
|
|
63
|
+
|
|
64
|
+
**Parameters**: None
|
|
65
|
+
|
|
66
|
+
**Returns**:
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"authenticated": true,
|
|
70
|
+
"base_url": "https://api.postproxy.dev/api",
|
|
71
|
+
"profile_groups_count": 2
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Profile Management
|
|
76
|
+
|
|
77
|
+
#### `profiles.list`
|
|
78
|
+
|
|
79
|
+
List all available social media profiles (targets) for posting.
|
|
80
|
+
|
|
81
|
+
**Parameters**: None
|
|
82
|
+
|
|
83
|
+
**Returns**:
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"targets": [
|
|
87
|
+
{
|
|
88
|
+
"id": "profile-123",
|
|
89
|
+
"name": "My Twitter Account",
|
|
90
|
+
"platform": "twitter",
|
|
91
|
+
"profile_group_id": 1
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Post Management
|
|
98
|
+
|
|
99
|
+
#### `post.publish`
|
|
100
|
+
|
|
101
|
+
Publish a post to specified targets.
|
|
102
|
+
|
|
103
|
+
**Parameters**:
|
|
104
|
+
- `content` (string, required): Post content text
|
|
105
|
+
- `targets` (string[], required): Array of target profile IDs (must belong to same profile group)
|
|
106
|
+
- `schedule` (string, optional): ISO 8601 scheduled time
|
|
107
|
+
- `media` (string[], optional): Array of media URLs
|
|
108
|
+
- `idempotency_key` (string, optional): Idempotency key for deduplication
|
|
109
|
+
- `require_confirmation` (boolean, optional): If true, return summary without publishing
|
|
110
|
+
- `draft` (boolean, optional): If true, creates a draft post that won't publish automatically
|
|
111
|
+
- `platforms` (object, optional): Platform-specific parameters. Key is platform name (e.g., "instagram", "youtube", "tiktok"), value is object with platform-specific options. See [Platform Parameters Reference](https://postproxy.dev/reference/platform-parameters/) for full documentation.
|
|
112
|
+
|
|
113
|
+
Example:
|
|
114
|
+
```json
|
|
115
|
+
{
|
|
116
|
+
"instagram": {
|
|
117
|
+
"format": "reel",
|
|
118
|
+
"collaborators": ["username1", "username2"],
|
|
119
|
+
"first_comment": "Link in bio!"
|
|
120
|
+
},
|
|
121
|
+
"youtube": {
|
|
122
|
+
"title": "My Video Title",
|
|
123
|
+
"privacy_status": "public"
|
|
124
|
+
},
|
|
125
|
+
"tiktok": {
|
|
126
|
+
"privacy_status": "PUBLIC_TO_EVERYONE",
|
|
127
|
+
"auto_add_music": true
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**Returns**:
|
|
133
|
+
```json
|
|
134
|
+
{
|
|
135
|
+
"job_id": "job-123",
|
|
136
|
+
"accepted_at": "2024-01-01T12:00:00Z",
|
|
137
|
+
"status": "pending",
|
|
138
|
+
"draft": true
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Note on draft posts**: If you request a draft post (`draft: true`) but the API returns `draft: false`, a `warning` field will be included in the response indicating that the API may have ignored the draft parameter. This can happen if the API does not support drafts with certain parameters (e.g., media attachments) or under specific conditions. Check the `warning` field in the response for details.
|
|
143
|
+
|
|
144
|
+
#### `post.status`
|
|
145
|
+
|
|
146
|
+
Get status of a published post by job ID.
|
|
147
|
+
|
|
148
|
+
**Parameters**:
|
|
149
|
+
- `job_id` (string, required): Job ID from post.publish response
|
|
150
|
+
|
|
151
|
+
**Returns**:
|
|
152
|
+
```json
|
|
153
|
+
{
|
|
154
|
+
"job_id": "job-123",
|
|
155
|
+
"overall_status": "complete",
|
|
156
|
+
"draft": false,
|
|
157
|
+
"status": "processed",
|
|
158
|
+
"platforms": [
|
|
159
|
+
{
|
|
160
|
+
"platform": "twitter",
|
|
161
|
+
"status": "published",
|
|
162
|
+
"url": "https://twitter.com/status/123",
|
|
163
|
+
"post_id": "123",
|
|
164
|
+
"error": null,
|
|
165
|
+
"attempted_at": "2024-01-01T12:00:00Z"
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
**Status values**:
|
|
172
|
+
- `overall_status`: `"draft"`, `"pending"`, `"processing"`, `"complete"`, `"failed"`
|
|
173
|
+
- Platform `status`: `"pending"`, `"processing"`, `"published"`, `"failed"`, `"deleted"`
|
|
174
|
+
- Platform `error`: Error message if publishing failed (null if successful)
|
|
175
|
+
|
|
176
|
+
#### `post.publish_draft`
|
|
177
|
+
|
|
178
|
+
Publish a draft post. Only posts with `draft: true` status can be published using this endpoint.
|
|
179
|
+
|
|
180
|
+
**Parameters**:
|
|
181
|
+
- `job_id` (string, required): Job ID of the draft post to publish
|
|
182
|
+
|
|
183
|
+
**Returns**:
|
|
184
|
+
```json
|
|
185
|
+
{
|
|
186
|
+
"job_id": "job-123",
|
|
187
|
+
"status": "processed",
|
|
188
|
+
"draft": false,
|
|
189
|
+
"scheduled_at": null,
|
|
190
|
+
"created_at": "2024-01-01T12:00:00Z",
|
|
191
|
+
"message": "Draft post published successfully"
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
#### `post.delete`
|
|
196
|
+
|
|
197
|
+
Delete a post by job ID.
|
|
198
|
+
|
|
199
|
+
**Parameters**:
|
|
200
|
+
- `job_id` (string, required): Job ID to delete
|
|
201
|
+
|
|
202
|
+
**Returns**:
|
|
203
|
+
```json
|
|
204
|
+
{
|
|
205
|
+
"job_id": "job-123",
|
|
206
|
+
"deleted": true
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### History
|
|
211
|
+
|
|
212
|
+
#### `history.list`
|
|
213
|
+
|
|
214
|
+
List recent post jobs.
|
|
215
|
+
|
|
216
|
+
**Parameters**:
|
|
217
|
+
- `limit` (number, optional): Maximum number of jobs to return (default: 10)
|
|
218
|
+
|
|
219
|
+
**Returns**:
|
|
220
|
+
```json
|
|
221
|
+
{
|
|
222
|
+
"jobs": [
|
|
223
|
+
{
|
|
224
|
+
"job_id": "job-123",
|
|
225
|
+
"content_preview": "Post content preview...",
|
|
226
|
+
"created_at": "2024-01-01T12:00:00Z",
|
|
227
|
+
"overall_status": "complete",
|
|
228
|
+
"draft": false,
|
|
229
|
+
"platforms_count": 2
|
|
230
|
+
}
|
|
231
|
+
]
|
|
232
|
+
}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## Example Prompts
|
|
236
|
+
|
|
237
|
+
Here are some example prompts you can use with Claude Code:
|
|
238
|
+
|
|
239
|
+
### Check Authentication
|
|
240
|
+
|
|
241
|
+
```
|
|
242
|
+
Check my PostProxy authentication status
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### List Profiles
|
|
246
|
+
|
|
247
|
+
```
|
|
248
|
+
Show me all my available social media profiles
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### Publish a Post
|
|
252
|
+
|
|
253
|
+
```
|
|
254
|
+
Publish this post: "Check out our new product!" to accounts ["profile-123"]
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### Publish with Platform Parameters
|
|
258
|
+
|
|
259
|
+
You can use platform-specific parameters to customize posts for each platform. The `platforms` parameter accepts an object where keys are platform names and values contain platform-specific options.
|
|
260
|
+
|
|
261
|
+
#### Instagram Examples
|
|
262
|
+
|
|
263
|
+
**Regular Post with Collaborators:**
|
|
264
|
+
```
|
|
265
|
+
Publish to Instagram: "Amazing content!" to my Instagram account with collaborators username1 and username2
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
Or with explicit parameters:
|
|
269
|
+
```json
|
|
270
|
+
{
|
|
271
|
+
"content": "Amazing content!",
|
|
272
|
+
"targets": ["instagram-profile-123"],
|
|
273
|
+
"media": ["https://example.com/image.jpg"],
|
|
274
|
+
"platforms": {
|
|
275
|
+
"instagram": {
|
|
276
|
+
"format": "post",
|
|
277
|
+
"collaborators": ["username1", "username2"],
|
|
278
|
+
"first_comment": "What do you think? 🔥"
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
**Instagram Reel:**
|
|
285
|
+
```json
|
|
286
|
+
{
|
|
287
|
+
"content": "Check out this reel! #viral",
|
|
288
|
+
"targets": ["instagram-profile-123"],
|
|
289
|
+
"media": ["https://example.com/video.mp4"],
|
|
290
|
+
"platforms": {
|
|
291
|
+
"instagram": {
|
|
292
|
+
"format": "reel",
|
|
293
|
+
"collaborators": ["collaborator_username"],
|
|
294
|
+
"cover_url": "https://example.com/thumbnail.jpg",
|
|
295
|
+
"audio_name": "Trending Audio",
|
|
296
|
+
"first_comment": "Link in bio!"
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
**Instagram Story:**
|
|
303
|
+
```json
|
|
304
|
+
{
|
|
305
|
+
"targets": ["instagram-profile-123"],
|
|
306
|
+
"media": ["https://example.com/story-image.jpg"],
|
|
307
|
+
"platforms": {
|
|
308
|
+
"instagram": {
|
|
309
|
+
"format": "story"
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
#### YouTube Examples
|
|
316
|
+
|
|
317
|
+
**YouTube Video with Title and Privacy:**
|
|
318
|
+
```
|
|
319
|
+
Upload this video to YouTube with title "My Tutorial" and make it public
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
Or with explicit parameters:
|
|
323
|
+
```json
|
|
324
|
+
{
|
|
325
|
+
"content": "This is the video description with links and details",
|
|
326
|
+
"targets": ["youtube-profile-123"],
|
|
327
|
+
"media": ["https://example.com/video.mp4"],
|
|
328
|
+
"platforms": {
|
|
329
|
+
"youtube": {
|
|
330
|
+
"title": "My Tutorial: How to Build an API",
|
|
331
|
+
"privacy_status": "public",
|
|
332
|
+
"cover_url": "https://example.com/custom-thumbnail.jpg"
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
**Unlisted YouTube Video:**
|
|
339
|
+
```json
|
|
340
|
+
{
|
|
341
|
+
"content": "Video description",
|
|
342
|
+
"targets": ["youtube-profile-123"],
|
|
343
|
+
"media": ["https://example.com/video.mp4"],
|
|
344
|
+
"platforms": {
|
|
345
|
+
"youtube": {
|
|
346
|
+
"title": "Private Tutorial",
|
|
347
|
+
"privacy_status": "unlisted"
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
#### TikTok Examples
|
|
354
|
+
|
|
355
|
+
**Public TikTok with Auto Music:**
|
|
356
|
+
```json
|
|
357
|
+
{
|
|
358
|
+
"content": "Check this out! #fyp",
|
|
359
|
+
"targets": ["tiktok-profile-123"],
|
|
360
|
+
"media": ["https://example.com/video.mp4"],
|
|
361
|
+
"platforms": {
|
|
362
|
+
"tiktok": {
|
|
363
|
+
"privacy_status": "PUBLIC_TO_EVERYONE",
|
|
364
|
+
"auto_add_music": true,
|
|
365
|
+
"disable_comment": false,
|
|
366
|
+
"disable_duet": false,
|
|
367
|
+
"disable_stitch": false
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
**TikTok for Followers Only with AI Label:**
|
|
374
|
+
```json
|
|
375
|
+
{
|
|
376
|
+
"content": "Special content for followers",
|
|
377
|
+
"targets": ["tiktok-profile-123"],
|
|
378
|
+
"media": ["https://example.com/video.mp4"],
|
|
379
|
+
"platforms": {
|
|
380
|
+
"tiktok": {
|
|
381
|
+
"privacy_status": "FOLLOWER_OF_CREATOR",
|
|
382
|
+
"made_with_ai": true,
|
|
383
|
+
"brand_content_toggle": false
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
#### Facebook Examples
|
|
390
|
+
|
|
391
|
+
**Facebook Post with First Comment:**
|
|
392
|
+
```json
|
|
393
|
+
{
|
|
394
|
+
"content": "Check out our new product!",
|
|
395
|
+
"targets": ["facebook-profile-123"],
|
|
396
|
+
"media": ["https://example.com/product.jpg"],
|
|
397
|
+
"platforms": {
|
|
398
|
+
"facebook": {
|
|
399
|
+
"format": "post",
|
|
400
|
+
"first_comment": "Link to purchase: https://example.com/shop"
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
**Facebook Story:**
|
|
407
|
+
```json
|
|
408
|
+
{
|
|
409
|
+
"targets": ["facebook-profile-123"],
|
|
410
|
+
"media": ["https://example.com/story-video.mp4"],
|
|
411
|
+
"platforms": {
|
|
412
|
+
"facebook": {
|
|
413
|
+
"format": "story"
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
**Facebook Page Post:**
|
|
420
|
+
```json
|
|
421
|
+
{
|
|
422
|
+
"content": "Company announcement",
|
|
423
|
+
"targets": ["facebook-profile-123"],
|
|
424
|
+
"platforms": {
|
|
425
|
+
"facebook": {
|
|
426
|
+
"page_id": "123456789",
|
|
427
|
+
"first_comment": "Visit our website for more details"
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
#### LinkedIn Examples
|
|
434
|
+
|
|
435
|
+
**Personal LinkedIn Post:**
|
|
436
|
+
```json
|
|
437
|
+
{
|
|
438
|
+
"content": "Excited to share my latest article on AI",
|
|
439
|
+
"targets": ["linkedin-profile-123"],
|
|
440
|
+
"media": ["https://example.com/article-cover.jpg"]
|
|
441
|
+
}
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
**Company LinkedIn Post:**
|
|
445
|
+
```json
|
|
446
|
+
{
|
|
447
|
+
"content": "We're hiring! Join our team",
|
|
448
|
+
"targets": ["linkedin-profile-123"],
|
|
449
|
+
"media": ["https://example.com/careers.jpg"],
|
|
450
|
+
"platforms": {
|
|
451
|
+
"linkedin": {
|
|
452
|
+
"organization_id": "company-id-12345"
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
#### Cross-Platform Examples
|
|
459
|
+
|
|
460
|
+
**Same Content, Different Platforms:**
|
|
461
|
+
```json
|
|
462
|
+
{
|
|
463
|
+
"content": "New product launch! 🚀",
|
|
464
|
+
"targets": ["instagram-profile", "twitter-profile", "linkedin-profile"],
|
|
465
|
+
"media": ["https://example.com/product.jpg"]
|
|
466
|
+
}
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
**Video Across Platforms with Specific Parameters:**
|
|
470
|
+
```json
|
|
471
|
+
{
|
|
472
|
+
"content": "Product launch video",
|
|
473
|
+
"targets": ["instagram-profile", "youtube-profile", "tiktok-profile"],
|
|
474
|
+
"media": ["https://example.com/video.mp4"],
|
|
475
|
+
"platforms": {
|
|
476
|
+
"instagram": {
|
|
477
|
+
"format": "reel",
|
|
478
|
+
"first_comment": "Link in bio!"
|
|
479
|
+
},
|
|
480
|
+
"youtube": {
|
|
481
|
+
"title": "Product Launch 2024",
|
|
482
|
+
"privacy_status": "public",
|
|
483
|
+
"cover_url": "https://example.com/yt-thumbnail.jpg"
|
|
484
|
+
},
|
|
485
|
+
"tiktok": {
|
|
486
|
+
"privacy_status": "PUBLIC_TO_EVERYONE",
|
|
487
|
+
"auto_add_music": true
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
#### Platform Parameters Reference
|
|
494
|
+
|
|
495
|
+
**Instagram:**
|
|
496
|
+
- `format`: "post" | "reel" | "story"
|
|
497
|
+
- `collaborators`: Array of usernames (max 10 for posts, 3 for reels)
|
|
498
|
+
- `first_comment`: String - comment to add after posting
|
|
499
|
+
- `cover_url`: String - thumbnail URL for reels
|
|
500
|
+
- `audio_name`: String - audio track name for reels
|
|
501
|
+
- `trial_strategy`: "MANUAL" | "SS_PERFORMANCE" - trial strategy for reels
|
|
502
|
+
- `thumb_offset`: String - thumbnail offset in milliseconds for reels
|
|
503
|
+
|
|
504
|
+
**YouTube:**
|
|
505
|
+
- `title`: String - video title
|
|
506
|
+
- `privacy_status`: "public" | "unlisted" | "private"
|
|
507
|
+
- `cover_url`: String - custom thumbnail URL
|
|
508
|
+
|
|
509
|
+
**TikTok:**
|
|
510
|
+
- `privacy_status`: "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY"
|
|
511
|
+
- `photo_cover_index`: Integer - index of photo to use as cover (0-based)
|
|
512
|
+
- `auto_add_music`: Boolean - enable automatic music
|
|
513
|
+
- `made_with_ai`: Boolean - mark content as AI-generated
|
|
514
|
+
- `disable_comment`: Boolean - disable comments
|
|
515
|
+
- `disable_duet`: Boolean - disable duets
|
|
516
|
+
- `disable_stitch`: Boolean - disable stitches
|
|
517
|
+
- `brand_content_toggle`: Boolean - mark as paid partnership (third-party)
|
|
518
|
+
- `brand_organic_toggle`: Boolean - mark as paid partnership (own brand)
|
|
519
|
+
|
|
520
|
+
**Facebook:**
|
|
521
|
+
- `format`: "post" | "story"
|
|
522
|
+
- `first_comment`: String - comment to add after posting
|
|
523
|
+
- `page_id`: String - page ID for posting to company pages
|
|
524
|
+
|
|
525
|
+
**LinkedIn:**
|
|
526
|
+
- `organization_id`: String - organization ID for company page posts
|
|
527
|
+
|
|
528
|
+
**Twitter/X & Threads:**
|
|
529
|
+
- No platform-specific parameters available
|
|
530
|
+
|
|
531
|
+
For complete documentation, see the [Platform Parameters Reference](https://postproxy.dev/reference/platform-parameters/).
|
|
532
|
+
|
|
533
|
+
### Create a Draft Post
|
|
534
|
+
|
|
535
|
+
```
|
|
536
|
+
Create a draft post: "Review this before publishing" to accounts ["profile-123"]
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
### Publish a Draft Post
|
|
540
|
+
|
|
541
|
+
```
|
|
542
|
+
Publish draft post job-123
|
|
543
|
+
```
|
|
544
|
+
|
|
545
|
+
### Check Post Status
|
|
546
|
+
|
|
547
|
+
```
|
|
548
|
+
What's the status of job job-123?
|
|
549
|
+
```
|
|
550
|
+
This will show detailed status including draft status, platform-specific errors, and publishing results.
|
|
551
|
+
|
|
552
|
+
### Delete a Post
|
|
553
|
+
|
|
554
|
+
```
|
|
555
|
+
Delete post job-123
|
|
556
|
+
```
|
|
557
|
+
|
|
558
|
+
### View History
|
|
559
|
+
|
|
560
|
+
```
|
|
561
|
+
Show me the last 5 posts I published
|
|
562
|
+
```
|
|
563
|
+
|
|
564
|
+
## Troubleshooting
|
|
565
|
+
|
|
566
|
+
### Server Won't Start
|
|
567
|
+
|
|
568
|
+
- **Check API Key**: Ensure `POSTPROXY_API_KEY` is set when registering with `claude mcp add`
|
|
569
|
+
- **Check Node Version**: Requires Node.js >= 18.0.0
|
|
570
|
+
- **Check Installation**: Verify `postproxy-mcp` is installed and in PATH
|
|
571
|
+
- **Check Registration**: Ensure the server is registered via `claude mcp add` and configuration is saved in `~/.claude/plugins/`
|
|
572
|
+
|
|
573
|
+
### Authentication Errors
|
|
574
|
+
|
|
575
|
+
- **AUTH_MISSING**: API key is not configured. Make sure you included `--env POSTPROXY_API_KEY=...` when running `claude mcp add`
|
|
576
|
+
- **AUTH_INVALID**: API key is invalid. Verify your API key is correct.
|
|
577
|
+
|
|
578
|
+
### Validation Errors
|
|
579
|
+
|
|
580
|
+
- **TARGET_NOT_FOUND**: One or more target profile IDs don't exist. Use `profiles.list` to see available targets.
|
|
581
|
+
- **VALIDATION_ERROR**: Post content or parameters are invalid. The API now returns detailed error messages:
|
|
582
|
+
- **400 errors**: `{"status":400,"error":"Bad Request","message":"..."}`
|
|
583
|
+
- **422 errors**: `{"errors": ["Error 1", "Error 2"]}` - Array of validation error messages
|
|
584
|
+
- Check the error message for specific validation issues
|
|
585
|
+
|
|
586
|
+
### API Errors
|
|
587
|
+
|
|
588
|
+
- **API_ERROR**: PostProxy API returned an error. Check the error message for details.
|
|
589
|
+
- **Timeout**: Request took longer than 30 seconds. Check your network connection and API status.
|
|
590
|
+
|
|
591
|
+
### Platform Errors
|
|
592
|
+
|
|
593
|
+
When checking post status with `post.status`, platform-specific errors are now available in the `error` field of each platform object:
|
|
594
|
+
- `error: null` - Post published successfully
|
|
595
|
+
- `error: "Error message"` - Detailed error message from the platform API
|
|
596
|
+
- Common errors include authentication issues, rate limits, content violations, etc.
|
|
597
|
+
|
|
598
|
+
### Draft Post Issues
|
|
599
|
+
|
|
600
|
+
If you create a draft post (`draft: true`) but receive `draft: false` in the response:
|
|
601
|
+
- The response will include a `warning` field explaining that the API may have ignored the draft parameter
|
|
602
|
+
- This can happen if:
|
|
603
|
+
- The API does not support drafts with media attachments
|
|
604
|
+
- The API has specific limitations for draft posts under certain conditions
|
|
605
|
+
- Check the `warning` field in the response for details
|
|
606
|
+
- Enable debug mode (`POSTPROXY_MCP_DEBUG=1`) to see detailed logging about draft parameter handling
|
|
607
|
+
|
|
608
|
+
### Debug Mode
|
|
609
|
+
|
|
610
|
+
Enable debug logging by setting `POSTPROXY_MCP_DEBUG=1` when registering the server:
|
|
611
|
+
|
|
612
|
+
```bash
|
|
613
|
+
claude mcp add --transport stdio postproxy-mcp --env POSTPROXY_API_KEY=your-api-key --env POSTPROXY_BASE_URL=https://api.postproxy.dev/api --env POSTPROXY_MCP_DEBUG=1 -- postproxy-mcp
|
|
614
|
+
```
|
|
615
|
+
|
|
616
|
+
## Development
|
|
617
|
+
|
|
618
|
+
### Building from Source
|
|
619
|
+
|
|
620
|
+
```bash
|
|
621
|
+
git clone https://github.com/postproxy/postproxy-mcp
|
|
622
|
+
cd postproxy-mcp
|
|
623
|
+
npm install
|
|
624
|
+
npm run build
|
|
625
|
+
```
|
|
626
|
+
|
|
627
|
+
### Running in Development Mode
|
|
628
|
+
|
|
629
|
+
```bash
|
|
630
|
+
npm run dev
|
|
631
|
+
```
|
|
632
|
+
|
|
633
|
+
## License
|
|
634
|
+
|
|
635
|
+
MIT
|