@agendapanda/mcp 0.2.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/README.md +183 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +819 -0
- package/dist/index.js.map +1 -0
- package/package.json +38 -0
package/README.md
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# @agendapanda/mcp
|
|
2
|
+
|
|
3
|
+
MCP (Model Context Protocol) server for [Agenda Panda](https://agendapanda.com) -- expose social media scheduling as tools for AI agents.
|
|
4
|
+
|
|
5
|
+
This server lets Claude, Cursor, Windsurf, and other MCP-compatible AI tools create posts, manage content calendars, and interact with your social media accounts through Agenda Panda.
|
|
6
|
+
|
|
7
|
+
## Available Tools (10)
|
|
8
|
+
|
|
9
|
+
| Tool | Description |
|
|
10
|
+
|------|-------------|
|
|
11
|
+
| `post_create` | Create and publish a social media post (content, connection, optional schedule, optional media) |
|
|
12
|
+
| `post_list` | List posts with optional status filter (`scheduled`, `published`, `failed`, `all`) and limit |
|
|
13
|
+
| `post_get` | Get details of a specific post by ID |
|
|
14
|
+
| `post_update` | Update a scheduled post's content, schedule time, or media |
|
|
15
|
+
| `post_delete` | Delete a scheduled post (cannot delete published posts) |
|
|
16
|
+
| `post_retry` | Retry publishing a failed post |
|
|
17
|
+
| `connections_list` | List connected social media accounts (needed to get connection IDs for posting) |
|
|
18
|
+
| `projects_list` | List projects/workspaces |
|
|
19
|
+
| `calendar_import` | Import multiple posts from a structured calendar array (supports `dry_run` validation) |
|
|
20
|
+
| `context_get` | Get brand context (voice, tone, connections, platform rules with media support info) |
|
|
21
|
+
|
|
22
|
+
## Prerequisites
|
|
23
|
+
|
|
24
|
+
1. An Agenda Panda account at [agendapanda.com](https://agendapanda.com)
|
|
25
|
+
2. An API key from Settings > Security > API Keys
|
|
26
|
+
3. At least one connected social account
|
|
27
|
+
4. Node.js 20+
|
|
28
|
+
|
|
29
|
+
## Setup
|
|
30
|
+
|
|
31
|
+
### Install
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm install -g @agendapanda/mcp
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Or run directly with npx:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npx @agendapanda/mcp
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Environment Variables
|
|
44
|
+
|
|
45
|
+
| Variable | Required | Description |
|
|
46
|
+
|----------|----------|-------------|
|
|
47
|
+
| `AP_API_KEY` | Yes | Your Agenda Panda API key (starts with `ap_`) |
|
|
48
|
+
| `AP_PROJECT` | No | Default project/workspace ID (auto-detected if you have only one) |
|
|
49
|
+
| `AP_API_URL` | No | API base URL (default: `https://agendapanda.com`) |
|
|
50
|
+
|
|
51
|
+
### Claude Code
|
|
52
|
+
|
|
53
|
+
Add to your Claude Code MCP configuration (`~/.claude/claude_desktop_config.json` or project-level `.mcp.json`):
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"mcpServers": {
|
|
58
|
+
"agendapanda": {
|
|
59
|
+
"command": "npx",
|
|
60
|
+
"args": ["@agendapanda/mcp"],
|
|
61
|
+
"env": {
|
|
62
|
+
"AP_API_KEY": "ap_your_key_here"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Or if installed globally:
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"mcpServers": {
|
|
74
|
+
"agendapanda": {
|
|
75
|
+
"command": "agendapanda-mcp",
|
|
76
|
+
"env": {
|
|
77
|
+
"AP_API_KEY": "ap_your_key_here"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Claude Desktop
|
|
85
|
+
|
|
86
|
+
Add to your Claude Desktop config file:
|
|
87
|
+
|
|
88
|
+
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
89
|
+
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
90
|
+
|
|
91
|
+
```json
|
|
92
|
+
{
|
|
93
|
+
"mcpServers": {
|
|
94
|
+
"agendapanda": {
|
|
95
|
+
"command": "npx",
|
|
96
|
+
"args": ["@agendapanda/mcp"],
|
|
97
|
+
"env": {
|
|
98
|
+
"AP_API_KEY": "ap_your_key_here"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Cursor
|
|
106
|
+
|
|
107
|
+
Add to your Cursor MCP settings (`.cursor/mcp.json` in your project or global settings):
|
|
108
|
+
|
|
109
|
+
```json
|
|
110
|
+
{
|
|
111
|
+
"mcpServers": {
|
|
112
|
+
"agendapanda": {
|
|
113
|
+
"command": "npx",
|
|
114
|
+
"args": ["@agendapanda/mcp"],
|
|
115
|
+
"env": {
|
|
116
|
+
"AP_API_KEY": "ap_your_key_here"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Windsurf
|
|
124
|
+
|
|
125
|
+
Add to your Windsurf MCP configuration (`~/.codeium/windsurf/mcp_config.json`):
|
|
126
|
+
|
|
127
|
+
```json
|
|
128
|
+
{
|
|
129
|
+
"mcpServers": {
|
|
130
|
+
"agendapanda": {
|
|
131
|
+
"command": "npx",
|
|
132
|
+
"args": ["@agendapanda/mcp"],
|
|
133
|
+
"env": {
|
|
134
|
+
"AP_API_KEY": "ap_your_key_here"
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Usage Examples
|
|
142
|
+
|
|
143
|
+
Once configured, you can ask your AI assistant things like:
|
|
144
|
+
|
|
145
|
+
- "Post 'Hello world' to Twitter"
|
|
146
|
+
- "Schedule a LinkedIn post for next Tuesday at 9am UTC"
|
|
147
|
+
- "Show me all my scheduled posts"
|
|
148
|
+
- "Show me my failed posts"
|
|
149
|
+
- "Update that post to say 'Updated content' instead"
|
|
150
|
+
- "Delete my scheduled Instagram post"
|
|
151
|
+
- "Retry the failed Bluesky post"
|
|
152
|
+
- "What social accounts do I have connected?"
|
|
153
|
+
- "Get my brand context and write 5 posts for this week"
|
|
154
|
+
- "Import this content calendar: [...]"
|
|
155
|
+
- "Dry-run import this calendar to check for errors before creating posts"
|
|
156
|
+
|
|
157
|
+
The AI will use the appropriate MCP tools to interact with Agenda Panda on your behalf.
|
|
158
|
+
|
|
159
|
+
## Workflow: Generate and Schedule Content
|
|
160
|
+
|
|
161
|
+
1. **Get context**: The AI calls `context_get` to understand your brand voice, connected accounts, and platform rules
|
|
162
|
+
2. **List connections**: The AI calls `connections_list` to know which accounts are available
|
|
163
|
+
3. **Generate content**: Using your brand context, the AI creates tailored posts
|
|
164
|
+
4. **Schedule posts**: The AI calls `post_create` or `calendar_import` to schedule them
|
|
165
|
+
|
|
166
|
+
## Development
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
git clone https://github.com/sushaantu/cloudflare-social-scheduler
|
|
170
|
+
cd cloudflare-social-scheduler/mcp
|
|
171
|
+
npm install
|
|
172
|
+
npm run build
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Test locally:
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
AP_API_KEY=ap_your_key_here node dist/index.js
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## License
|
|
182
|
+
|
|
183
|
+
MIT
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,819 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
// Configuration
|
|
7
|
+
// ---------------------------------------------------------------------------
|
|
8
|
+
const API_KEY = process.env.AP_API_KEY;
|
|
9
|
+
const API_URL = (process.env.AP_API_URL || 'https://agendapanda.com').replace(/\/$/, '');
|
|
10
|
+
const PROJECT_ID = process.env.AP_PROJECT;
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
// HTTP helpers
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
class ApiError extends Error {
|
|
15
|
+
statusCode;
|
|
16
|
+
code;
|
|
17
|
+
constructor(message, statusCode, code) {
|
|
18
|
+
super(message);
|
|
19
|
+
this.statusCode = statusCode;
|
|
20
|
+
this.code = code;
|
|
21
|
+
this.name = 'ApiError';
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function getHeaders() {
|
|
25
|
+
if (!API_KEY) {
|
|
26
|
+
throw new ApiError('AP_API_KEY environment variable is required. Get one at https://agendapanda.com/settings?tab=security', 0, 'NOT_AUTHENTICATED');
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
Authorization: `Bearer ${API_KEY}`,
|
|
30
|
+
'Content-Type': 'application/json',
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
async function handleResponse(res) {
|
|
34
|
+
const body = await res.text();
|
|
35
|
+
let data;
|
|
36
|
+
try {
|
|
37
|
+
data = JSON.parse(body);
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
throw new ApiError(`Invalid response from server: ${body.slice(0, 200)}`, res.status);
|
|
41
|
+
}
|
|
42
|
+
if (!res.ok) {
|
|
43
|
+
const d = data;
|
|
44
|
+
const errorField = d.error;
|
|
45
|
+
const message = (typeof errorField === 'object' && errorField !== null
|
|
46
|
+
? errorField.message
|
|
47
|
+
: errorField) ||
|
|
48
|
+
`Request failed with status ${res.status}`;
|
|
49
|
+
const code = d.code || undefined;
|
|
50
|
+
throw new ApiError(message, res.status, code);
|
|
51
|
+
}
|
|
52
|
+
return data;
|
|
53
|
+
}
|
|
54
|
+
async function apiGet(path) {
|
|
55
|
+
const res = await fetch(`${API_URL}${path}`, {
|
|
56
|
+
method: 'GET',
|
|
57
|
+
headers: getHeaders(),
|
|
58
|
+
});
|
|
59
|
+
return handleResponse(res);
|
|
60
|
+
}
|
|
61
|
+
async function apiPost(path, body) {
|
|
62
|
+
const res = await fetch(`${API_URL}${path}`, {
|
|
63
|
+
method: 'POST',
|
|
64
|
+
headers: getHeaders(),
|
|
65
|
+
body: body !== undefined ? JSON.stringify(body) : undefined,
|
|
66
|
+
});
|
|
67
|
+
return handleResponse(res);
|
|
68
|
+
}
|
|
69
|
+
async function apiPut(path, body) {
|
|
70
|
+
const res = await fetch(`${API_URL}${path}`, {
|
|
71
|
+
method: 'PUT',
|
|
72
|
+
headers: getHeaders(),
|
|
73
|
+
body: body !== undefined ? JSON.stringify(body) : undefined,
|
|
74
|
+
});
|
|
75
|
+
return handleResponse(res);
|
|
76
|
+
}
|
|
77
|
+
async function apiDelete(path) {
|
|
78
|
+
const res = await fetch(`${API_URL}${path}`, {
|
|
79
|
+
method: 'DELETE',
|
|
80
|
+
headers: getHeaders(),
|
|
81
|
+
});
|
|
82
|
+
return handleResponse(res);
|
|
83
|
+
}
|
|
84
|
+
// ---------------------------------------------------------------------------
|
|
85
|
+
// Project resolution
|
|
86
|
+
// ---------------------------------------------------------------------------
|
|
87
|
+
async function resolveProjectId(projectIdArg) {
|
|
88
|
+
if (projectIdArg) {
|
|
89
|
+
if (!/^[a-zA-Z0-9_-]+$/.test(projectIdArg)) {
|
|
90
|
+
throw new Error('Invalid project_id format');
|
|
91
|
+
}
|
|
92
|
+
return projectIdArg;
|
|
93
|
+
}
|
|
94
|
+
if (PROJECT_ID)
|
|
95
|
+
return PROJECT_ID;
|
|
96
|
+
// Auto-detect: if user has exactly one project, use it
|
|
97
|
+
const data = await apiGet('/api/projects');
|
|
98
|
+
if (data.projects.length === 1) {
|
|
99
|
+
return data.projects[0].id;
|
|
100
|
+
}
|
|
101
|
+
if (data.projects.length === 0) {
|
|
102
|
+
throw new Error('No projects found. Create a workspace at https://agendapanda.com first.');
|
|
103
|
+
}
|
|
104
|
+
throw new Error(`Multiple projects found. Set AP_PROJECT env var or pass project_id. Projects: ${data.projects.map((p) => `${p.name} (${p.id})`).join(', ')}`);
|
|
105
|
+
}
|
|
106
|
+
// ---------------------------------------------------------------------------
|
|
107
|
+
// MCP Server
|
|
108
|
+
// ---------------------------------------------------------------------------
|
|
109
|
+
const server = new McpServer({
|
|
110
|
+
name: 'agendapanda',
|
|
111
|
+
version: '0.2.0',
|
|
112
|
+
}, {
|
|
113
|
+
capabilities: {
|
|
114
|
+
tools: {},
|
|
115
|
+
},
|
|
116
|
+
instructions: 'Agenda Panda is a social media scheduling platform. Use these tools to create, schedule, and manage posts across Twitter/X, LinkedIn, Facebook, Instagram, Threads, Bluesky, and TikTok. All schedule times must be UTC ISO 8601 with Z suffix (e.g. 2026-03-15T14:00:00Z).',
|
|
117
|
+
});
|
|
118
|
+
// ---------------------------------------------------------------------------
|
|
119
|
+
// Tool: post_create
|
|
120
|
+
// ---------------------------------------------------------------------------
|
|
121
|
+
server.registerTool('post_create', {
|
|
122
|
+
title: 'Create Post',
|
|
123
|
+
description: 'Create and optionally publish a social media post. If no schedule_date is provided, the post is published immediately. All dates must be UTC ISO 8601 with Z suffix.',
|
|
124
|
+
inputSchema: {
|
|
125
|
+
content: z.string().describe('The text content of the post'),
|
|
126
|
+
connection_id: z.string().describe('The social connection ID to post to. Use connections_list to find available connections.'),
|
|
127
|
+
schedule_date: z.string().optional().describe('UTC ISO 8601 date to schedule the post (e.g. 2026-03-15T14:00:00Z). Omit to post immediately.'),
|
|
128
|
+
media_url: z.string().optional().describe('URL of media to attach to the post (must be a publicly accessible URL or a previously uploaded Agenda Panda media URL)'),
|
|
129
|
+
project_id: z.string().optional().describe('Project/workspace ID. Uses AP_PROJECT env var or auto-detects if omitted.'),
|
|
130
|
+
},
|
|
131
|
+
annotations: {
|
|
132
|
+
title: 'Create Post',
|
|
133
|
+
readOnlyHint: false,
|
|
134
|
+
destructiveHint: false,
|
|
135
|
+
openWorldHint: true,
|
|
136
|
+
},
|
|
137
|
+
}, async (args) => {
|
|
138
|
+
try {
|
|
139
|
+
const projectId = await resolveProjectId(args.project_id);
|
|
140
|
+
const postNow = !args.schedule_date;
|
|
141
|
+
const scheduledAt = args.schedule_date || new Date().toISOString();
|
|
142
|
+
const data = await apiPost(`/api/projects/${projectId}/posts`, {
|
|
143
|
+
content: args.content,
|
|
144
|
+
scheduled_at: scheduledAt,
|
|
145
|
+
social_connection_id: args.connection_id,
|
|
146
|
+
media_url: args.media_url || null,
|
|
147
|
+
post_now: postNow,
|
|
148
|
+
});
|
|
149
|
+
const post = data.post;
|
|
150
|
+
let summary;
|
|
151
|
+
if (post.posted) {
|
|
152
|
+
summary = `Post published successfully to ${post.platform}.`;
|
|
153
|
+
if (post.platform_post_id) {
|
|
154
|
+
summary += ` Platform post ID: ${post.platform_post_id}`;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
else if (post.error) {
|
|
158
|
+
summary = `Post created but failed to publish: ${post.error}`;
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
summary = `Post scheduled for ${post.scheduled_at}`;
|
|
162
|
+
}
|
|
163
|
+
return {
|
|
164
|
+
content: [
|
|
165
|
+
{
|
|
166
|
+
type: 'text',
|
|
167
|
+
text: JSON.stringify({
|
|
168
|
+
success: true,
|
|
169
|
+
summary,
|
|
170
|
+
post: {
|
|
171
|
+
id: post.id,
|
|
172
|
+
content: post.content,
|
|
173
|
+
platform: post.platform,
|
|
174
|
+
scheduled_at: post.scheduled_at,
|
|
175
|
+
posted: post.posted,
|
|
176
|
+
posted_at: post.posted_at,
|
|
177
|
+
error: post.error,
|
|
178
|
+
media_url: post.media_url,
|
|
179
|
+
platform_post_id: post.platform_post_id,
|
|
180
|
+
},
|
|
181
|
+
}, null, 2),
|
|
182
|
+
},
|
|
183
|
+
],
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
catch (err) {
|
|
187
|
+
const message = err instanceof ApiError ? err.message : String(err);
|
|
188
|
+
return {
|
|
189
|
+
content: [{ type: 'text', text: JSON.stringify({ error: message }) }],
|
|
190
|
+
isError: true,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
// ---------------------------------------------------------------------------
|
|
195
|
+
// Tool: post_list
|
|
196
|
+
// ---------------------------------------------------------------------------
|
|
197
|
+
server.registerTool('post_list', {
|
|
198
|
+
title: 'List Posts',
|
|
199
|
+
description: 'List posts for a project. Filter by status and limit results. Returns full content when 5 or fewer results, truncated otherwise.',
|
|
200
|
+
inputSchema: {
|
|
201
|
+
status: z
|
|
202
|
+
.enum(['scheduled', 'published', 'failed', 'all'])
|
|
203
|
+
.optional()
|
|
204
|
+
.describe('Filter by post status (default: all)'),
|
|
205
|
+
limit: z
|
|
206
|
+
.number()
|
|
207
|
+
.int()
|
|
208
|
+
.min(1)
|
|
209
|
+
.max(100)
|
|
210
|
+
.optional()
|
|
211
|
+
.describe('Maximum number of posts to return (default: 50, max: 100)'),
|
|
212
|
+
project_id: z.string().optional().describe('Project/workspace ID. Uses AP_PROJECT env var or auto-detects if omitted.'),
|
|
213
|
+
},
|
|
214
|
+
annotations: {
|
|
215
|
+
title: 'List Posts',
|
|
216
|
+
readOnlyHint: true,
|
|
217
|
+
destructiveHint: false,
|
|
218
|
+
openWorldHint: true,
|
|
219
|
+
},
|
|
220
|
+
}, async (args) => {
|
|
221
|
+
try {
|
|
222
|
+
const projectId = await resolveProjectId(args.project_id);
|
|
223
|
+
const data = await apiGet(`/api/projects/${projectId}/posts`);
|
|
224
|
+
const statusFilter = args.status || 'all';
|
|
225
|
+
const limit = args.limit || 50;
|
|
226
|
+
let filtered = data.posts;
|
|
227
|
+
if (statusFilter === 'scheduled') {
|
|
228
|
+
filtered = filtered.filter((p) => !p.posted && !p.error);
|
|
229
|
+
}
|
|
230
|
+
else if (statusFilter === 'published') {
|
|
231
|
+
filtered = filtered.filter((p) => p.posted);
|
|
232
|
+
}
|
|
233
|
+
else if (statusFilter === 'failed') {
|
|
234
|
+
filtered = filtered.filter((p) => !p.posted && p.error);
|
|
235
|
+
}
|
|
236
|
+
filtered = filtered.slice(0, limit);
|
|
237
|
+
const showFull = filtered.length <= 5;
|
|
238
|
+
return {
|
|
239
|
+
content: [
|
|
240
|
+
{
|
|
241
|
+
type: 'text',
|
|
242
|
+
text: JSON.stringify({
|
|
243
|
+
count: filtered.length,
|
|
244
|
+
filter: statusFilter,
|
|
245
|
+
posts: filtered.map((p) => ({
|
|
246
|
+
id: p.id,
|
|
247
|
+
content: showFull
|
|
248
|
+
? p.content
|
|
249
|
+
: p.content.length > 100
|
|
250
|
+
? p.content.slice(0, 97) + '...'
|
|
251
|
+
: p.content,
|
|
252
|
+
platform: p.platform,
|
|
253
|
+
scheduled_at: p.scheduled_at,
|
|
254
|
+
posted: p.posted,
|
|
255
|
+
error: p.error,
|
|
256
|
+
media_url: p.media_url,
|
|
257
|
+
platform_post_id: p.platform_post_id,
|
|
258
|
+
})),
|
|
259
|
+
}, null, 2),
|
|
260
|
+
},
|
|
261
|
+
],
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
catch (err) {
|
|
265
|
+
const message = err instanceof ApiError ? err.message : String(err);
|
|
266
|
+
return {
|
|
267
|
+
content: [{ type: 'text', text: JSON.stringify({ error: message }) }],
|
|
268
|
+
isError: true,
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
// ---------------------------------------------------------------------------
|
|
273
|
+
// Tool: post_get
|
|
274
|
+
// ---------------------------------------------------------------------------
|
|
275
|
+
server.registerTool('post_get', {
|
|
276
|
+
title: 'Get Post',
|
|
277
|
+
description: 'Get details of a specific post by its ID.',
|
|
278
|
+
inputSchema: {
|
|
279
|
+
post_id: z.string().regex(/^[a-zA-Z0-9_-]+$/, 'Invalid post_id format').describe('The post ID to retrieve'),
|
|
280
|
+
},
|
|
281
|
+
annotations: {
|
|
282
|
+
title: 'Get Post',
|
|
283
|
+
readOnlyHint: true,
|
|
284
|
+
destructiveHint: false,
|
|
285
|
+
openWorldHint: true,
|
|
286
|
+
},
|
|
287
|
+
}, async (args) => {
|
|
288
|
+
try {
|
|
289
|
+
const data = await apiGet(`/api/posts/${args.post_id}`);
|
|
290
|
+
return {
|
|
291
|
+
content: [
|
|
292
|
+
{
|
|
293
|
+
type: 'text',
|
|
294
|
+
text: JSON.stringify({ post: data.post }, null, 2),
|
|
295
|
+
},
|
|
296
|
+
],
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
catch (err) {
|
|
300
|
+
const message = err instanceof ApiError ? err.message : String(err);
|
|
301
|
+
return {
|
|
302
|
+
content: [{ type: 'text', text: JSON.stringify({ error: message }) }],
|
|
303
|
+
isError: true,
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
// ---------------------------------------------------------------------------
|
|
308
|
+
// Tool: post_update
|
|
309
|
+
// ---------------------------------------------------------------------------
|
|
310
|
+
server.registerTool('post_update', {
|
|
311
|
+
title: 'Update Post',
|
|
312
|
+
description: 'Update a scheduled post\'s content, schedule time, or media. Only works on posts that have not yet been published.',
|
|
313
|
+
inputSchema: {
|
|
314
|
+
post_id: z.string().regex(/^[a-zA-Z0-9_-]+$/, 'Invalid post_id format').describe('The post ID to update'),
|
|
315
|
+
content: z.string().optional().describe('New text content for the post'),
|
|
316
|
+
schedule_date: z.string().optional().describe('New UTC ISO 8601 schedule time (e.g. 2026-03-15T14:00:00Z)'),
|
|
317
|
+
media_url: z.string().optional().describe('New media URL (set to empty string to remove media)'),
|
|
318
|
+
},
|
|
319
|
+
annotations: {
|
|
320
|
+
title: 'Update Post',
|
|
321
|
+
readOnlyHint: false,
|
|
322
|
+
destructiveHint: false,
|
|
323
|
+
openWorldHint: true,
|
|
324
|
+
},
|
|
325
|
+
}, async (args) => {
|
|
326
|
+
try {
|
|
327
|
+
const body = {};
|
|
328
|
+
if (args.content !== undefined)
|
|
329
|
+
body.content = args.content;
|
|
330
|
+
if (args.schedule_date !== undefined)
|
|
331
|
+
body.scheduled_at = args.schedule_date;
|
|
332
|
+
if (args.media_url !== undefined)
|
|
333
|
+
body.media_url = args.media_url || null;
|
|
334
|
+
await apiPut(`/api/posts/${args.post_id}`, body);
|
|
335
|
+
// Fetch updated post to confirm
|
|
336
|
+
const data = await apiGet(`/api/posts/${args.post_id}`);
|
|
337
|
+
const post = data.post;
|
|
338
|
+
return {
|
|
339
|
+
content: [
|
|
340
|
+
{
|
|
341
|
+
type: 'text',
|
|
342
|
+
text: JSON.stringify({
|
|
343
|
+
success: true,
|
|
344
|
+
summary: `Post updated successfully. Scheduled for ${post.scheduled_at}`,
|
|
345
|
+
post: {
|
|
346
|
+
id: post.id,
|
|
347
|
+
content: post.content,
|
|
348
|
+
platform: post.platform,
|
|
349
|
+
scheduled_at: post.scheduled_at,
|
|
350
|
+
posted: post.posted,
|
|
351
|
+
error: post.error,
|
|
352
|
+
media_url: post.media_url,
|
|
353
|
+
},
|
|
354
|
+
}, null, 2),
|
|
355
|
+
},
|
|
356
|
+
],
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
catch (err) {
|
|
360
|
+
const message = err instanceof ApiError ? err.message : String(err);
|
|
361
|
+
return {
|
|
362
|
+
content: [{ type: 'text', text: JSON.stringify({ error: message }) }],
|
|
363
|
+
isError: true,
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
// ---------------------------------------------------------------------------
|
|
368
|
+
// Tool: post_delete
|
|
369
|
+
// ---------------------------------------------------------------------------
|
|
370
|
+
server.registerTool('post_delete', {
|
|
371
|
+
title: 'Delete Post',
|
|
372
|
+
description: 'Delete a scheduled post. Cannot delete posts that have already been published.',
|
|
373
|
+
inputSchema: {
|
|
374
|
+
post_id: z.string().regex(/^[a-zA-Z0-9_-]+$/, 'Invalid post_id format').describe('The post ID to delete'),
|
|
375
|
+
},
|
|
376
|
+
annotations: {
|
|
377
|
+
title: 'Delete Post',
|
|
378
|
+
readOnlyHint: false,
|
|
379
|
+
destructiveHint: true,
|
|
380
|
+
openWorldHint: true,
|
|
381
|
+
},
|
|
382
|
+
}, async (args) => {
|
|
383
|
+
try {
|
|
384
|
+
// Fetch post first for confirmation message
|
|
385
|
+
const data = await apiGet(`/api/posts/${args.post_id}`);
|
|
386
|
+
const post = data.post;
|
|
387
|
+
const preview = post.content.length > 80 ? post.content.slice(0, 77) + '...' : post.content;
|
|
388
|
+
await apiDelete(`/api/posts/${args.post_id}`);
|
|
389
|
+
return {
|
|
390
|
+
content: [
|
|
391
|
+
{
|
|
392
|
+
type: 'text',
|
|
393
|
+
text: JSON.stringify({
|
|
394
|
+
success: true,
|
|
395
|
+
summary: `Deleted ${post.platform} post: "${preview}"`,
|
|
396
|
+
deleted_post: {
|
|
397
|
+
id: post.id,
|
|
398
|
+
platform: post.platform,
|
|
399
|
+
content_preview: preview,
|
|
400
|
+
was_scheduled_for: post.scheduled_at,
|
|
401
|
+
},
|
|
402
|
+
}, null, 2),
|
|
403
|
+
},
|
|
404
|
+
],
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
catch (err) {
|
|
408
|
+
const message = err instanceof ApiError ? err.message : String(err);
|
|
409
|
+
return {
|
|
410
|
+
content: [{ type: 'text', text: JSON.stringify({ error: message }) }],
|
|
411
|
+
isError: true,
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
});
|
|
415
|
+
// ---------------------------------------------------------------------------
|
|
416
|
+
// Tool: post_retry
|
|
417
|
+
// ---------------------------------------------------------------------------
|
|
418
|
+
server.registerTool('post_retry', {
|
|
419
|
+
title: 'Retry Post',
|
|
420
|
+
description: 'Retry publishing a failed post. Only works on posts that have an error status.',
|
|
421
|
+
inputSchema: {
|
|
422
|
+
post_id: z.string().regex(/^[a-zA-Z0-9_-]+$/, 'Invalid post_id format').describe('The post ID to retry'),
|
|
423
|
+
},
|
|
424
|
+
annotations: {
|
|
425
|
+
title: 'Retry Post',
|
|
426
|
+
readOnlyHint: false,
|
|
427
|
+
destructiveHint: false,
|
|
428
|
+
openWorldHint: true,
|
|
429
|
+
},
|
|
430
|
+
}, async (args) => {
|
|
431
|
+
try {
|
|
432
|
+
const result = await apiPost(`/api/posts/${args.post_id}/retry`);
|
|
433
|
+
if (result.success) {
|
|
434
|
+
let summary = `Post published successfully to ${result.platform || 'platform'}.`;
|
|
435
|
+
if (result.platform_post_id) {
|
|
436
|
+
summary += ` Platform post ID: ${result.platform_post_id}`;
|
|
437
|
+
}
|
|
438
|
+
return {
|
|
439
|
+
content: [
|
|
440
|
+
{
|
|
441
|
+
type: 'text',
|
|
442
|
+
text: JSON.stringify({
|
|
443
|
+
success: true,
|
|
444
|
+
summary,
|
|
445
|
+
platform_post_id: result.platform_post_id,
|
|
446
|
+
platform_username: result.platform_username,
|
|
447
|
+
platform: result.platform,
|
|
448
|
+
}, null, 2),
|
|
449
|
+
},
|
|
450
|
+
],
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
else {
|
|
454
|
+
return {
|
|
455
|
+
content: [
|
|
456
|
+
{
|
|
457
|
+
type: 'text',
|
|
458
|
+
text: JSON.stringify({ success: false, error: result.error || 'Retry failed' }),
|
|
459
|
+
},
|
|
460
|
+
],
|
|
461
|
+
isError: true,
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
catch (err) {
|
|
466
|
+
const message = err instanceof ApiError ? err.message : String(err);
|
|
467
|
+
return {
|
|
468
|
+
content: [{ type: 'text', text: JSON.stringify({ error: message }) }],
|
|
469
|
+
isError: true,
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
});
|
|
473
|
+
// ---------------------------------------------------------------------------
|
|
474
|
+
// Tool: connections_list
|
|
475
|
+
// ---------------------------------------------------------------------------
|
|
476
|
+
server.registerTool('connections_list', {
|
|
477
|
+
title: 'List Connections',
|
|
478
|
+
description: 'List connected social media accounts for a project. Returns connection IDs needed for creating posts.',
|
|
479
|
+
inputSchema: {
|
|
480
|
+
project_id: z.string().optional().describe('Project/workspace ID. Uses AP_PROJECT env var or auto-detects if omitted.'),
|
|
481
|
+
},
|
|
482
|
+
annotations: {
|
|
483
|
+
title: 'List Connections',
|
|
484
|
+
readOnlyHint: true,
|
|
485
|
+
destructiveHint: false,
|
|
486
|
+
openWorldHint: true,
|
|
487
|
+
},
|
|
488
|
+
}, async (args) => {
|
|
489
|
+
try {
|
|
490
|
+
const projectId = await resolveProjectId(args.project_id);
|
|
491
|
+
const data = await apiGet(`/api/projects/${projectId}/connections`);
|
|
492
|
+
return {
|
|
493
|
+
content: [
|
|
494
|
+
{
|
|
495
|
+
type: 'text',
|
|
496
|
+
text: JSON.stringify({
|
|
497
|
+
count: data.connections.length,
|
|
498
|
+
connections: data.connections.map((c) => ({
|
|
499
|
+
id: c.id,
|
|
500
|
+
platform: c.platform,
|
|
501
|
+
username: c.platform_username,
|
|
502
|
+
display_name: c.platform_display_name,
|
|
503
|
+
})),
|
|
504
|
+
}, null, 2),
|
|
505
|
+
},
|
|
506
|
+
],
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
catch (err) {
|
|
510
|
+
const message = err instanceof ApiError ? err.message : String(err);
|
|
511
|
+
return {
|
|
512
|
+
content: [{ type: 'text', text: JSON.stringify({ error: message }) }],
|
|
513
|
+
isError: true,
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
});
|
|
517
|
+
// ---------------------------------------------------------------------------
|
|
518
|
+
// Tool: projects_list
|
|
519
|
+
// ---------------------------------------------------------------------------
|
|
520
|
+
server.registerTool('projects_list', {
|
|
521
|
+
title: 'List Projects',
|
|
522
|
+
description: 'List all projects/workspaces the authenticated user has access to.',
|
|
523
|
+
inputSchema: {},
|
|
524
|
+
annotations: {
|
|
525
|
+
title: 'List Projects',
|
|
526
|
+
readOnlyHint: true,
|
|
527
|
+
destructiveHint: false,
|
|
528
|
+
openWorldHint: true,
|
|
529
|
+
},
|
|
530
|
+
}, async () => {
|
|
531
|
+
try {
|
|
532
|
+
const data = await apiGet('/api/projects');
|
|
533
|
+
return {
|
|
534
|
+
content: [
|
|
535
|
+
{
|
|
536
|
+
type: 'text',
|
|
537
|
+
text: JSON.stringify({
|
|
538
|
+
count: data.projects.length,
|
|
539
|
+
projects: data.projects.map((p) => ({
|
|
540
|
+
id: p.id,
|
|
541
|
+
name: p.name,
|
|
542
|
+
website: p.website,
|
|
543
|
+
industry: p.industry,
|
|
544
|
+
default_timezone: p.default_timezone,
|
|
545
|
+
})),
|
|
546
|
+
}, null, 2),
|
|
547
|
+
},
|
|
548
|
+
],
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
catch (err) {
|
|
552
|
+
const message = err instanceof ApiError ? err.message : String(err);
|
|
553
|
+
return {
|
|
554
|
+
content: [{ type: 'text', text: JSON.stringify({ error: message }) }],
|
|
555
|
+
isError: true,
|
|
556
|
+
};
|
|
557
|
+
}
|
|
558
|
+
});
|
|
559
|
+
// ---------------------------------------------------------------------------
|
|
560
|
+
// Tool: calendar_import
|
|
561
|
+
// ---------------------------------------------------------------------------
|
|
562
|
+
server.registerTool('calendar_import', {
|
|
563
|
+
title: 'Import Calendar',
|
|
564
|
+
description: 'Import multiple posts from a structured calendar. Each item needs content, a connection ID, and a UTC schedule time. Duplicates are automatically skipped.',
|
|
565
|
+
inputSchema: {
|
|
566
|
+
posts: z
|
|
567
|
+
.array(z.object({
|
|
568
|
+
content: z.string().describe('Post text content'),
|
|
569
|
+
connection: z.string().describe('Connection ID to post to'),
|
|
570
|
+
schedule: z.string().describe('UTC ISO 8601 schedule time ending with Z (e.g. 2026-03-15T14:00:00Z)'),
|
|
571
|
+
external_id: z.string().optional().describe('Stable ID for sync/dedup'),
|
|
572
|
+
media: z.string().optional().describe('Media URL to attach'),
|
|
573
|
+
timezone: z.string().optional().describe('IANA timezone for display only (e.g. America/New_York)'),
|
|
574
|
+
}))
|
|
575
|
+
.max(100, 'Maximum 100 posts per import call')
|
|
576
|
+
.describe('Array of posts to import'),
|
|
577
|
+
dry_run: z.boolean().optional().describe('When true, validate all posts but do not create them. Returns what would happen for each post.'),
|
|
578
|
+
project_id: z.string().optional().describe('Project/workspace ID. Uses AP_PROJECT env var or auto-detects if omitted.'),
|
|
579
|
+
},
|
|
580
|
+
annotations: {
|
|
581
|
+
title: 'Import Calendar',
|
|
582
|
+
readOnlyHint: false,
|
|
583
|
+
destructiveHint: false,
|
|
584
|
+
openWorldHint: true,
|
|
585
|
+
},
|
|
586
|
+
}, async (args) => {
|
|
587
|
+
try {
|
|
588
|
+
const projectId = await resolveProjectId(args.project_id);
|
|
589
|
+
const isDryRun = args.dry_run === true;
|
|
590
|
+
// Validate all posts in a single pass
|
|
591
|
+
function validatePost(item) {
|
|
592
|
+
if (!item.content || item.content.trim().length === 0) {
|
|
593
|
+
return 'Post content is empty';
|
|
594
|
+
}
|
|
595
|
+
if (!/Z$/i.test(item.schedule)) {
|
|
596
|
+
return `schedule must be UTC ISO 8601 ending with Z (e.g. 2026-03-15T14:00:00Z). Got: "${item.schedule}"`;
|
|
597
|
+
}
|
|
598
|
+
if (isNaN(new Date(item.schedule).getTime())) {
|
|
599
|
+
return `invalid date "${item.schedule}"`;
|
|
600
|
+
}
|
|
601
|
+
return null;
|
|
602
|
+
}
|
|
603
|
+
if (isDryRun) {
|
|
604
|
+
const items = args.posts.map((item, i) => {
|
|
605
|
+
const validationError = validatePost(item);
|
|
606
|
+
return {
|
|
607
|
+
index: i,
|
|
608
|
+
status: (validationError ? 'would_fail' : 'would_create'),
|
|
609
|
+
content: item.content.slice(0, 50),
|
|
610
|
+
connection: item.connection,
|
|
611
|
+
schedule: item.schedule,
|
|
612
|
+
...(validationError ? { error: validationError } : {}),
|
|
613
|
+
};
|
|
614
|
+
});
|
|
615
|
+
const wouldCreate = items.filter((r) => r.status === 'would_create').length;
|
|
616
|
+
const wouldFail = items.filter((r) => r.status === 'would_fail').length;
|
|
617
|
+
return {
|
|
618
|
+
content: [
|
|
619
|
+
{
|
|
620
|
+
type: 'text',
|
|
621
|
+
text: JSON.stringify({
|
|
622
|
+
dry_run: true,
|
|
623
|
+
summary: `Validated ${args.posts.length} post(s): ${wouldCreate} would be created, ${wouldFail} would fail`,
|
|
624
|
+
would_create: wouldCreate,
|
|
625
|
+
would_fail: wouldFail,
|
|
626
|
+
items,
|
|
627
|
+
}, null, 2),
|
|
628
|
+
},
|
|
629
|
+
],
|
|
630
|
+
};
|
|
631
|
+
}
|
|
632
|
+
// Validate before creating (fail fast on first error)
|
|
633
|
+
for (let i = 0; i < args.posts.length; i++) {
|
|
634
|
+
const validationError = validatePost(args.posts[i]);
|
|
635
|
+
if (validationError) {
|
|
636
|
+
return {
|
|
637
|
+
content: [
|
|
638
|
+
{
|
|
639
|
+
type: 'text',
|
|
640
|
+
text: JSON.stringify({ error: `Post ${i}: ${validationError}` }),
|
|
641
|
+
},
|
|
642
|
+
],
|
|
643
|
+
isError: true,
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
// Create posts sequentially
|
|
648
|
+
const results = [];
|
|
649
|
+
let created = 0;
|
|
650
|
+
let skipped = 0;
|
|
651
|
+
let failed = 0;
|
|
652
|
+
for (const item of args.posts) {
|
|
653
|
+
try {
|
|
654
|
+
const payload = {
|
|
655
|
+
content: item.content,
|
|
656
|
+
scheduled_at: new Date(item.schedule).toISOString(),
|
|
657
|
+
social_connection_id: item.connection,
|
|
658
|
+
media_url: item.media || null,
|
|
659
|
+
post_now: false,
|
|
660
|
+
};
|
|
661
|
+
if (item.external_id) {
|
|
662
|
+
payload.external_id = item.external_id;
|
|
663
|
+
payload.source = 'calendar_import';
|
|
664
|
+
}
|
|
665
|
+
if (item.timezone) {
|
|
666
|
+
payload.timezone = item.timezone;
|
|
667
|
+
}
|
|
668
|
+
await apiPost(`/api/projects/${projectId}/posts`, payload);
|
|
669
|
+
results.push({
|
|
670
|
+
status: 'created',
|
|
671
|
+
content: item.content.slice(0, 50),
|
|
672
|
+
connection: item.connection,
|
|
673
|
+
schedule: item.schedule,
|
|
674
|
+
});
|
|
675
|
+
created++;
|
|
676
|
+
}
|
|
677
|
+
catch (err) {
|
|
678
|
+
const message = err instanceof ApiError ? err.message : String(err);
|
|
679
|
+
const statusCode = err instanceof ApiError ? err.statusCode : 0;
|
|
680
|
+
// Duplicate detection: prefer HTTP 409 status code, then fall back to
|
|
681
|
+
// string matching. String matching is needed because the API currently
|
|
682
|
+
// returns the error message in { error: "..." } without a structured
|
|
683
|
+
// error code field, so we match known D1/API messages as a safety net.
|
|
684
|
+
if (statusCode === 409 ||
|
|
685
|
+
message.includes('UNIQUE constraint') ||
|
|
686
|
+
message.includes('already exists')) {
|
|
687
|
+
results.push({
|
|
688
|
+
status: 'skipped',
|
|
689
|
+
content: item.content.slice(0, 50),
|
|
690
|
+
connection: item.connection,
|
|
691
|
+
schedule: item.schedule,
|
|
692
|
+
});
|
|
693
|
+
skipped++;
|
|
694
|
+
}
|
|
695
|
+
else {
|
|
696
|
+
results.push({
|
|
697
|
+
status: 'failed',
|
|
698
|
+
content: item.content.slice(0, 50),
|
|
699
|
+
connection: item.connection,
|
|
700
|
+
schedule: item.schedule,
|
|
701
|
+
error: message,
|
|
702
|
+
});
|
|
703
|
+
failed++;
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
return {
|
|
708
|
+
content: [
|
|
709
|
+
{
|
|
710
|
+
type: 'text',
|
|
711
|
+
text: JSON.stringify({
|
|
712
|
+
success: failed === 0,
|
|
713
|
+
summary: `Imported ${created} post(s), skipped ${skipped}, failed ${failed}`,
|
|
714
|
+
created,
|
|
715
|
+
skipped,
|
|
716
|
+
failed,
|
|
717
|
+
items: results,
|
|
718
|
+
}, null, 2),
|
|
719
|
+
},
|
|
720
|
+
],
|
|
721
|
+
};
|
|
722
|
+
}
|
|
723
|
+
catch (err) {
|
|
724
|
+
const message = err instanceof ApiError ? err.message : String(err);
|
|
725
|
+
return {
|
|
726
|
+
content: [{ type: 'text', text: JSON.stringify({ error: message }) }],
|
|
727
|
+
isError: true,
|
|
728
|
+
};
|
|
729
|
+
}
|
|
730
|
+
});
|
|
731
|
+
// ---------------------------------------------------------------------------
|
|
732
|
+
// Tool: context_get
|
|
733
|
+
// ---------------------------------------------------------------------------
|
|
734
|
+
server.registerTool('context_get', {
|
|
735
|
+
title: 'Get Brand Context',
|
|
736
|
+
description: 'Get brand context for a project including brand voice, tone, connected accounts, and platform rules. Use this before generating content to match the brand.',
|
|
737
|
+
inputSchema: {
|
|
738
|
+
project_id: z.string().optional().describe('Project/workspace ID. Uses AP_PROJECT env var or auto-detects if omitted.'),
|
|
739
|
+
},
|
|
740
|
+
annotations: {
|
|
741
|
+
title: 'Get Brand Context',
|
|
742
|
+
readOnlyHint: true,
|
|
743
|
+
destructiveHint: false,
|
|
744
|
+
openWorldHint: true,
|
|
745
|
+
},
|
|
746
|
+
}, async (args) => {
|
|
747
|
+
try {
|
|
748
|
+
const projectId = await resolveProjectId(args.project_id);
|
|
749
|
+
// Fetch project details and connections in parallel
|
|
750
|
+
const [projectData, connectionsData] = await Promise.all([
|
|
751
|
+
apiGet(`/api/projects/${projectId}`),
|
|
752
|
+
apiGet(`/api/projects/${projectId}/connections`).catch(() => ({ connections: [] })),
|
|
753
|
+
]);
|
|
754
|
+
const project = projectData.project;
|
|
755
|
+
const connections = connectionsData.connections;
|
|
756
|
+
// Duplicated from src/lib/platform-rules.ts (backend source of truth).
|
|
757
|
+
// The MCP server ships as a standalone npm package and can't import from the backend.
|
|
758
|
+
// TODO: Fetch from a /api/platform-rules endpoint once available.
|
|
759
|
+
const platformRules = {
|
|
760
|
+
twitter: { label: 'X (Twitter)', max_chars: 280, media_required: false, media_support: 'image_and_video', media_formats: 'JPEG, PNG, GIF, WebP, MP4, MOV, WebM', notes: 'Short and punchy' },
|
|
761
|
+
linkedin: { label: 'LinkedIn', max_chars: 3000, media_required: false, media_support: 'none', media_formats: 'Not supported yet', notes: 'Text only; professional tone' },
|
|
762
|
+
facebook: { label: 'Facebook Pages', max_chars: 63206, media_required: false, media_support: 'image_and_video', media_formats: 'JPEG, PNG, GIF, WebP, MP4, MOV, WebM', notes: 'Pages only' },
|
|
763
|
+
instagram: { label: 'Instagram', max_chars: 2200, media_required: true, media_support: 'image_and_video', media_formats: 'JPEG, PNG, GIF, WebP, MP4, MOV, WebM', notes: 'Media required; Reels for video; no clickable links in captions' },
|
|
764
|
+
threads: { label: 'Threads', max_chars: 500, media_required: false, media_support: 'image_and_video', media_formats: 'JPEG, PNG, GIF, WebP, MP4, MOV, WebM', notes: 'Text-first, conversational' },
|
|
765
|
+
bluesky: { label: 'Bluesky', max_chars: 300, media_required: false, media_support: 'image_and_video', media_formats: 'JPEG, PNG, GIF, WebP, MP4', notes: 'Decentralized; 300 char limit; max 4 images or 1 video' },
|
|
766
|
+
tiktok: { label: 'TikTok', max_chars: 2200, media_required: false, media_support: 'image_and_video', media_formats: 'MP4, WebM, MOV', notes: 'Video-first; direct post API' },
|
|
767
|
+
};
|
|
768
|
+
return {
|
|
769
|
+
content: [
|
|
770
|
+
{
|
|
771
|
+
type: 'text',
|
|
772
|
+
text: JSON.stringify({
|
|
773
|
+
project: {
|
|
774
|
+
id: project.id,
|
|
775
|
+
name: project.name,
|
|
776
|
+
website: project.website,
|
|
777
|
+
industry: project.industry,
|
|
778
|
+
target_audience: project.target_audience,
|
|
779
|
+
brand_voice: project.brand_voice,
|
|
780
|
+
default_timezone: project.default_timezone,
|
|
781
|
+
soul_md: project.soul_md,
|
|
782
|
+
art_md: project.art_md,
|
|
783
|
+
},
|
|
784
|
+
connections: connections.map((c) => ({
|
|
785
|
+
id: c.id,
|
|
786
|
+
platform: c.platform,
|
|
787
|
+
label: platformRules[c.platform]?.label || c.platform,
|
|
788
|
+
account: c.platform_display_name || c.platform_username || c.platform,
|
|
789
|
+
})),
|
|
790
|
+
platform_rules: platformRules,
|
|
791
|
+
scheduling: {
|
|
792
|
+
timezone: project.default_timezone,
|
|
793
|
+
note: 'schedule = execution time in UTC (ISO 8601, Z suffix). timezone = display/planning metadata only.',
|
|
794
|
+
},
|
|
795
|
+
}, null, 2),
|
|
796
|
+
},
|
|
797
|
+
],
|
|
798
|
+
};
|
|
799
|
+
}
|
|
800
|
+
catch (err) {
|
|
801
|
+
const message = err instanceof ApiError ? err.message : String(err);
|
|
802
|
+
return {
|
|
803
|
+
content: [{ type: 'text', text: JSON.stringify({ error: message }) }],
|
|
804
|
+
isError: true,
|
|
805
|
+
};
|
|
806
|
+
}
|
|
807
|
+
});
|
|
808
|
+
// ---------------------------------------------------------------------------
|
|
809
|
+
// Start the server
|
|
810
|
+
// ---------------------------------------------------------------------------
|
|
811
|
+
async function main() {
|
|
812
|
+
const transport = new StdioServerTransport();
|
|
813
|
+
await server.connect(transport);
|
|
814
|
+
}
|
|
815
|
+
main().catch((err) => {
|
|
816
|
+
process.stderr.write(`Fatal error starting Agenda Panda MCP server: ${err}\n`);
|
|
817
|
+
process.exit(1);
|
|
818
|
+
});
|
|
819
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8EAA8E;AAC9E,gBAAgB;AAChB,8EAA8E;AAE9E,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;AACvC,MAAM,OAAO,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,yBAAyB,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACzF,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p",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Agenda Panda MCP server — expose social media scheduling tools to AI agents via Model Context Protocol",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Agenda Panda <hello@agendapanda.com> (https://agendapanda.com)",
|
|
7
|
+
"homepage": "https://agendapanda.com",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/sushaantu/cloudflare-social-scheduler",
|
|
11
|
+
"directory": "mcp"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": ">=20.0.0"
|
|
16
|
+
},
|
|
17
|
+
"bin": {
|
|
18
|
+
"agendapanda-mcp": "dist/index.js"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist/",
|
|
22
|
+
"README.md"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsc",
|
|
26
|
+
"dev": "tsc --watch",
|
|
27
|
+
"test": "tsc --noEmit",
|
|
28
|
+
"prepublishOnly": "npm run build"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
32
|
+
"zod": "^3.23.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@types/node": "^20.0.0",
|
|
36
|
+
"typescript": "^5.5.0"
|
|
37
|
+
}
|
|
38
|
+
}
|