@voxburst/mcp-server 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/README.md +293 -0
- package/dist/client.d.ts +98 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +116 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +184 -0
- package/dist/index.js.map +1 -0
- package/dist/resources/accounts.d.ts +41 -0
- package/dist/resources/accounts.d.ts.map +1 -0
- package/dist/resources/accounts.js +82 -0
- package/dist/resources/accounts.js.map +1 -0
- package/dist/resources/index.d.ts +24 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +45 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/posts.d.ts +41 -0
- package/dist/resources/posts.d.ts.map +1 -0
- package/dist/resources/posts.js +97 -0
- package/dist/resources/posts.js.map +1 -0
- package/dist/tools/accounts.d.ts +39 -0
- package/dist/tools/accounts.d.ts.map +1 -0
- package/dist/tools/accounts.js +51 -0
- package/dist/tools/accounts.js.map +1 -0
- package/dist/tools/analytics.d.ts +51 -0
- package/dist/tools/analytics.d.ts.map +1 -0
- package/dist/tools/analytics.js +60 -0
- package/dist/tools/analytics.js.map +1 -0
- package/dist/tools/index.d.ts +111 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +36 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/posts.d.ts +186 -0
- package/dist/tools/posts.d.ts.map +1 -0
- package/dist/tools/posts.js +176 -0
- package/dist/tools/posts.js.map +1 -0
- package/package.json +54 -0
package/README.md
ADDED
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
# @voxburst/mcp-server
|
|
2
|
+
|
|
3
|
+
Model Context Protocol (MCP) server for VoxBurst — enables AI agents to manage social media posts.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 🚀 **Post Management** — Create, schedule, list, and delete social media posts
|
|
8
|
+
- 👥 **Account Access** — List and inspect connected social media accounts
|
|
9
|
+
- 📊 **Analytics** — Retrieve engagement metrics for posts and accounts
|
|
10
|
+
- 🔍 **Content Validation** — Validate content against platform-specific rules before posting
|
|
11
|
+
- 🤖 **AI-Native** — Designed for Claude, GPT, and other LLM agents
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @voxburst/mcp-server
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Or run directly with npx:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npx @voxburst/mcp-server
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Configuration
|
|
26
|
+
|
|
27
|
+
### Environment Variables
|
|
28
|
+
|
|
29
|
+
| Variable | Required | Default | Description |
|
|
30
|
+
|----------|----------|---------|-------------|
|
|
31
|
+
| `VOXBURST_API_KEY` | Yes | — | Your VoxBurst API key |
|
|
32
|
+
| `VOXBURST_API_URL` | No | `https://api.voxburst.io` | API base URL |
|
|
33
|
+
|
|
34
|
+
Get your API key from [VoxBurst Settings](https://app.voxburst.io/settings/api).
|
|
35
|
+
|
|
36
|
+
### Claude Desktop
|
|
37
|
+
|
|
38
|
+
Add to your Claude Desktop configuration (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
|
|
39
|
+
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"mcpServers": {
|
|
43
|
+
"voxburst": {
|
|
44
|
+
"command": "npx",
|
|
45
|
+
"args": ["@voxburst/mcp-server"],
|
|
46
|
+
"env": {
|
|
47
|
+
"VOXBURST_API_KEY": "sk_your_api_key_here"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Cursor
|
|
55
|
+
|
|
56
|
+
Add to your Cursor MCP settings:
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"mcpServers": {
|
|
61
|
+
"voxburst": {
|
|
62
|
+
"command": "npx",
|
|
63
|
+
"args": ["@voxburst/mcp-server"],
|
|
64
|
+
"env": {
|
|
65
|
+
"VOXBURST_API_KEY": "sk_your_api_key_here"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Windsurf / VS Code with MCP Extension
|
|
73
|
+
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"mcp.servers": {
|
|
77
|
+
"voxburst": {
|
|
78
|
+
"command": "npx",
|
|
79
|
+
"args": ["@voxburst/mcp-server"],
|
|
80
|
+
"env": {
|
|
81
|
+
"VOXBURST_API_KEY": "sk_your_api_key_here"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Available Tools
|
|
89
|
+
|
|
90
|
+
### Post Management
|
|
91
|
+
|
|
92
|
+
#### `create_post`
|
|
93
|
+
Create a new social media post, optionally scheduled for later.
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
{
|
|
97
|
+
content: string, // Post content (required)
|
|
98
|
+
accountIds: string[], // Target account IDs (required)
|
|
99
|
+
mediaUrls?: string[], // Optional media attachments
|
|
100
|
+
scheduledFor?: string // ISO 8601 datetime for scheduling
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Example:**
|
|
105
|
+
```
|
|
106
|
+
Create a post saying "Excited to announce our new feature! 🚀"
|
|
107
|
+
and schedule it for tomorrow at 9 AM on my Twitter account.
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
#### `list_posts`
|
|
111
|
+
List posts with optional filtering.
|
|
112
|
+
|
|
113
|
+
```typescript
|
|
114
|
+
{
|
|
115
|
+
status?: 'draft' | 'scheduled' | 'published' | 'failed',
|
|
116
|
+
accountId?: string,
|
|
117
|
+
limit?: number, // 1-100, default 20
|
|
118
|
+
offset?: number // Pagination offset
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
#### `get_post`
|
|
123
|
+
Get details of a specific post.
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
{
|
|
127
|
+
postId: string // Post ID (required)
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
#### `delete_post`
|
|
132
|
+
Delete a draft or scheduled post.
|
|
133
|
+
|
|
134
|
+
```typescript
|
|
135
|
+
{
|
|
136
|
+
postId: string // Post ID (required)
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
#### `validate_content`
|
|
141
|
+
Validate content against platform rules before posting.
|
|
142
|
+
|
|
143
|
+
```typescript
|
|
144
|
+
{
|
|
145
|
+
content: string, // Content to validate
|
|
146
|
+
accountIds: string[] // Account IDs for platform-specific rules
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Account Management
|
|
151
|
+
|
|
152
|
+
#### `list_accounts`
|
|
153
|
+
List all connected social media accounts.
|
|
154
|
+
|
|
155
|
+
```typescript
|
|
156
|
+
// No parameters required
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
#### `get_account`
|
|
160
|
+
Get details of a specific account.
|
|
161
|
+
|
|
162
|
+
```typescript
|
|
163
|
+
{
|
|
164
|
+
accountId: string // Account ID (required)
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Analytics
|
|
169
|
+
|
|
170
|
+
#### `get_post_metrics`
|
|
171
|
+
Get engagement metrics for a post.
|
|
172
|
+
|
|
173
|
+
```typescript
|
|
174
|
+
{
|
|
175
|
+
postId: string // Post ID (required)
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Returns: impressions, engagements, likes, shares, comments, clicks.
|
|
180
|
+
|
|
181
|
+
#### `get_account_metrics`
|
|
182
|
+
Get metrics for an account.
|
|
183
|
+
|
|
184
|
+
```typescript
|
|
185
|
+
{
|
|
186
|
+
accountId: string // Account ID (required)
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Returns: followers, following, total posts, average engagement rate.
|
|
191
|
+
|
|
192
|
+
## Available Resources
|
|
193
|
+
|
|
194
|
+
Resources provide read-only access to VoxBurst data:
|
|
195
|
+
|
|
196
|
+
| URI | Description |
|
|
197
|
+
|-----|-------------|
|
|
198
|
+
| `accounts://list` | All connected accounts |
|
|
199
|
+
| `accounts://{id}` | Single account details |
|
|
200
|
+
| `posts://recent` | Recent posts (last 20) |
|
|
201
|
+
| `posts://{id}` | Single post details |
|
|
202
|
+
|
|
203
|
+
## Example Conversations
|
|
204
|
+
|
|
205
|
+
### Creating a Post
|
|
206
|
+
|
|
207
|
+
**User:** Post "Just shipped a major update! Check out the new dashboard features." to my Twitter and LinkedIn accounts.
|
|
208
|
+
|
|
209
|
+
**Claude:** I'll create that post for you. Let me first check your connected accounts...
|
|
210
|
+
|
|
211
|
+
*[Uses list_accounts tool]*
|
|
212
|
+
|
|
213
|
+
I found your Twitter (@yourhandle) and LinkedIn (Your Name) accounts. Creating the post now...
|
|
214
|
+
|
|
215
|
+
*[Uses create_post tool]*
|
|
216
|
+
|
|
217
|
+
Done! Your post has been published to both platforms.
|
|
218
|
+
|
|
219
|
+
### Scheduling Content
|
|
220
|
+
|
|
221
|
+
**User:** Schedule a post for next Monday at 10 AM saying "Monday motivation: Every expert was once a beginner."
|
|
222
|
+
|
|
223
|
+
**Claude:** I'll schedule that post for Monday at 10 AM...
|
|
224
|
+
|
|
225
|
+
*[Uses create_post with scheduledFor parameter]*
|
|
226
|
+
|
|
227
|
+
Your post is scheduled for Monday, February 24th at 10:00 AM.
|
|
228
|
+
|
|
229
|
+
### Checking Analytics
|
|
230
|
+
|
|
231
|
+
**User:** How did my last post perform?
|
|
232
|
+
|
|
233
|
+
**Claude:** Let me check the metrics for your most recent post...
|
|
234
|
+
|
|
235
|
+
*[Uses list_posts, then get_post_metrics]*
|
|
236
|
+
|
|
237
|
+
Your post from yesterday received:
|
|
238
|
+
- 1,234 impressions
|
|
239
|
+
- 89 engagements
|
|
240
|
+
- 45 likes
|
|
241
|
+
- 12 shares
|
|
242
|
+
- 8 comments
|
|
243
|
+
|
|
244
|
+
That's a 7.2% engagement rate — above your average!
|
|
245
|
+
|
|
246
|
+
## Development
|
|
247
|
+
|
|
248
|
+
### Building from Source
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
git clone https://github.com/voxburst/voxburst.git
|
|
252
|
+
cd voxburst/packages/mcp-server
|
|
253
|
+
npm install
|
|
254
|
+
npm run build
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### Running Locally
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
VOXBURST_API_KEY=sk_test_xxx npm start
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### Testing
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
npm test
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
## Error Handling
|
|
270
|
+
|
|
271
|
+
The server provides clear error messages:
|
|
272
|
+
|
|
273
|
+
- **Missing API Key:** `VOXBURST_API_KEY environment variable is required`
|
|
274
|
+
- **Authentication Error:** `VoxBurst API Error (401): Invalid API key`
|
|
275
|
+
- **Rate Limiting:** `VoxBurst API Error (429): Rate limit exceeded`
|
|
276
|
+
- **Validation Error:** `VoxBurst API Error (400): Content exceeds platform limit`
|
|
277
|
+
|
|
278
|
+
## Security
|
|
279
|
+
|
|
280
|
+
- API keys are passed via environment variables, never logged
|
|
281
|
+
- All communication uses HTTPS
|
|
282
|
+
- The server has no persistent state
|
|
283
|
+
- Runs in stdio mode (no network server)
|
|
284
|
+
|
|
285
|
+
## Support
|
|
286
|
+
|
|
287
|
+
- [VoxBurst Documentation](https://docs.voxburst.io)
|
|
288
|
+
- [MCP Specification](https://modelcontextprotocol.io)
|
|
289
|
+
- [GitHub Issues](https://github.com/voxburst/voxburst/issues)
|
|
290
|
+
|
|
291
|
+
## License
|
|
292
|
+
|
|
293
|
+
MIT
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VoxBurst API Client Wrapper
|
|
3
|
+
* Handles authentication and HTTP requests to the VoxBurst API
|
|
4
|
+
*/
|
|
5
|
+
export interface VoxBurstConfig {
|
|
6
|
+
apiKey: string;
|
|
7
|
+
apiUrl: string;
|
|
8
|
+
}
|
|
9
|
+
export interface Account {
|
|
10
|
+
id: string;
|
|
11
|
+
platform: 'twitter' | 'linkedin' | 'instagram' | 'facebook' | 'tiktok' | 'threads' | 'bluesky';
|
|
12
|
+
handle: string;
|
|
13
|
+
displayName: string;
|
|
14
|
+
avatarUrl?: string;
|
|
15
|
+
connected: boolean;
|
|
16
|
+
lastSync?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface Post {
|
|
19
|
+
id: string;
|
|
20
|
+
content: string;
|
|
21
|
+
mediaUrls?: string[];
|
|
22
|
+
status: 'draft' | 'scheduled' | 'published' | 'failed';
|
|
23
|
+
scheduledFor?: string;
|
|
24
|
+
publishedAt?: string;
|
|
25
|
+
accounts: string[];
|
|
26
|
+
createdAt: string;
|
|
27
|
+
updatedAt: string;
|
|
28
|
+
}
|
|
29
|
+
export interface PostMetrics {
|
|
30
|
+
postId: string;
|
|
31
|
+
impressions: number;
|
|
32
|
+
engagements: number;
|
|
33
|
+
likes: number;
|
|
34
|
+
shares: number;
|
|
35
|
+
comments: number;
|
|
36
|
+
clicks: number;
|
|
37
|
+
collectedAt: string;
|
|
38
|
+
}
|
|
39
|
+
export interface AccountMetrics {
|
|
40
|
+
accountId: string;
|
|
41
|
+
followers: number;
|
|
42
|
+
following: number;
|
|
43
|
+
totalPosts: number;
|
|
44
|
+
avgEngagementRate: number;
|
|
45
|
+
collectedAt: string;
|
|
46
|
+
}
|
|
47
|
+
export interface CreatePostRequest {
|
|
48
|
+
content: string;
|
|
49
|
+
mediaUrls?: string[];
|
|
50
|
+
accountIds: string[];
|
|
51
|
+
scheduledFor?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface ListPostsRequest {
|
|
54
|
+
status?: Post['status'];
|
|
55
|
+
accountId?: string;
|
|
56
|
+
limit?: number;
|
|
57
|
+
offset?: number;
|
|
58
|
+
}
|
|
59
|
+
export interface ValidationResult {
|
|
60
|
+
valid: boolean;
|
|
61
|
+
errors: ValidationError[];
|
|
62
|
+
warnings: ValidationWarning[];
|
|
63
|
+
}
|
|
64
|
+
export interface ValidationError {
|
|
65
|
+
code: string;
|
|
66
|
+
message: string;
|
|
67
|
+
platform?: string;
|
|
68
|
+
}
|
|
69
|
+
export interface ValidationWarning {
|
|
70
|
+
code: string;
|
|
71
|
+
message: string;
|
|
72
|
+
platform?: string;
|
|
73
|
+
}
|
|
74
|
+
export declare class VoxBurstAPIError extends Error {
|
|
75
|
+
statusCode: number;
|
|
76
|
+
code?: string | undefined;
|
|
77
|
+
constructor(message: string, statusCode: number, code?: string | undefined);
|
|
78
|
+
}
|
|
79
|
+
export declare class VoxBurstClient {
|
|
80
|
+
private apiKey;
|
|
81
|
+
private apiUrl;
|
|
82
|
+
constructor(config: VoxBurstConfig);
|
|
83
|
+
private request;
|
|
84
|
+
listAccounts(): Promise<Account[]>;
|
|
85
|
+
getAccount(accountId: string): Promise<Account>;
|
|
86
|
+
createPost(request: CreatePostRequest): Promise<Post>;
|
|
87
|
+
listPosts(params?: ListPostsRequest): Promise<Post[]>;
|
|
88
|
+
getPost(postId: string): Promise<Post>;
|
|
89
|
+
deletePost(postId: string): Promise<void>;
|
|
90
|
+
validateContent(content: string, accountIds: string[]): Promise<ValidationResult>;
|
|
91
|
+
getPostMetrics(postId: string): Promise<PostMetrics>;
|
|
92
|
+
getAccountMetrics(accountId: string): Promise<AccountMetrics>;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Create a VoxBurst client from environment variables
|
|
96
|
+
*/
|
|
97
|
+
export declare function createClientFromEnv(): VoxBurstClient;
|
|
98
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;IAC/F,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,OAAO,GAAG,WAAW,GAAG,WAAW,GAAG,QAAQ,CAAC;IACvD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAA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S;IACvB,OAAO,CAAC,MAAM,CAAS;gBAEX,MAAM,EAAE,cAAc;YAKpB,OAAO;IA4Cf,YAAY,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAIlC,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAK/C,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrD,SAAS,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAYrD,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAItC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzC,eAAe,CACnB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAAE,GACnB,OAAO,CAAC,gBAAgB,CAAC;IAQtB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAIpD,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;CAGpE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,cAAc,CAYpD"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* VoxBurst API Client Wrapper
|
|
4
|
+
* Handles authentication and HTTP requests to the VoxBurst API
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.VoxBurstClient = exports.VoxBurstAPIError = void 0;
|
|
8
|
+
exports.createClientFromEnv = createClientFromEnv;
|
|
9
|
+
class VoxBurstAPIError extends Error {
|
|
10
|
+
statusCode;
|
|
11
|
+
code;
|
|
12
|
+
constructor(message, statusCode, code) {
|
|
13
|
+
super(message);
|
|
14
|
+
this.statusCode = statusCode;
|
|
15
|
+
this.code = code;
|
|
16
|
+
this.name = 'VoxBurstAPIError';
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.VoxBurstAPIError = VoxBurstAPIError;
|
|
20
|
+
class VoxBurstClient {
|
|
21
|
+
apiKey;
|
|
22
|
+
apiUrl;
|
|
23
|
+
constructor(config) {
|
|
24
|
+
this.apiKey = config.apiKey;
|
|
25
|
+
this.apiUrl = config.apiUrl.replace(/\/$/, ''); // Remove trailing slash
|
|
26
|
+
}
|
|
27
|
+
async request(method, path, body) {
|
|
28
|
+
const url = `${this.apiUrl}${path}`;
|
|
29
|
+
const headers = {
|
|
30
|
+
'Authorization': `Bearer ${this.apiKey}`,
|
|
31
|
+
'Content-Type': 'application/json',
|
|
32
|
+
'User-Agent': 'VoxBurst-MCP-Server/0.1.0',
|
|
33
|
+
};
|
|
34
|
+
const options = {
|
|
35
|
+
method,
|
|
36
|
+
headers,
|
|
37
|
+
};
|
|
38
|
+
if (body) {
|
|
39
|
+
options.body = JSON.stringify(body);
|
|
40
|
+
}
|
|
41
|
+
const response = await fetch(url, options);
|
|
42
|
+
if (!response.ok) {
|
|
43
|
+
const errorBody = await response.text();
|
|
44
|
+
let errorMessage = `API request failed: ${response.status}`;
|
|
45
|
+
let errorCode;
|
|
46
|
+
try {
|
|
47
|
+
const errorJson = JSON.parse(errorBody);
|
|
48
|
+
errorMessage = errorJson.message || errorMessage;
|
|
49
|
+
errorCode = errorJson.code;
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
// Use default error message
|
|
53
|
+
}
|
|
54
|
+
throw new VoxBurstAPIError(errorMessage, response.status, errorCode);
|
|
55
|
+
}
|
|
56
|
+
return response.json();
|
|
57
|
+
}
|
|
58
|
+
// Account Methods
|
|
59
|
+
async listAccounts() {
|
|
60
|
+
return this.request('GET', '/api/v1/accounts');
|
|
61
|
+
}
|
|
62
|
+
async getAccount(accountId) {
|
|
63
|
+
return this.request('GET', `/api/v1/accounts/${accountId}`);
|
|
64
|
+
}
|
|
65
|
+
// Post Methods
|
|
66
|
+
async createPost(request) {
|
|
67
|
+
return this.request('POST', '/api/v1/posts', request);
|
|
68
|
+
}
|
|
69
|
+
async listPosts(params) {
|
|
70
|
+
const queryParams = new URLSearchParams();
|
|
71
|
+
if (params?.status)
|
|
72
|
+
queryParams.set('status', params.status);
|
|
73
|
+
if (params?.accountId)
|
|
74
|
+
queryParams.set('accountId', params.accountId);
|
|
75
|
+
if (params?.limit)
|
|
76
|
+
queryParams.set('limit', params.limit.toString());
|
|
77
|
+
if (params?.offset)
|
|
78
|
+
queryParams.set('offset', params.offset.toString());
|
|
79
|
+
const query = queryParams.toString();
|
|
80
|
+
const path = query ? `/api/v1/posts?${query}` : '/api/v1/posts';
|
|
81
|
+
return this.request('GET', path);
|
|
82
|
+
}
|
|
83
|
+
async getPost(postId) {
|
|
84
|
+
return this.request('GET', `/api/v1/posts/${postId}`);
|
|
85
|
+
}
|
|
86
|
+
async deletePost(postId) {
|
|
87
|
+
await this.request('DELETE', `/api/v1/posts/${postId}`);
|
|
88
|
+
}
|
|
89
|
+
async validateContent(content, accountIds) {
|
|
90
|
+
return this.request('POST', '/api/v1/posts/validate', {
|
|
91
|
+
content,
|
|
92
|
+
accountIds,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
// Analytics Methods
|
|
96
|
+
async getPostMetrics(postId) {
|
|
97
|
+
return this.request('GET', `/api/v1/analytics/posts/${postId}`);
|
|
98
|
+
}
|
|
99
|
+
async getAccountMetrics(accountId) {
|
|
100
|
+
return this.request('GET', `/api/v1/analytics/accounts/${accountId}`);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
exports.VoxBurstClient = VoxBurstClient;
|
|
104
|
+
/**
|
|
105
|
+
* Create a VoxBurst client from environment variables
|
|
106
|
+
*/
|
|
107
|
+
function createClientFromEnv() {
|
|
108
|
+
const apiKey = process.env.VOXBURST_API_KEY;
|
|
109
|
+
const apiUrl = process.env.VOXBURST_API_URL || 'https://api.voxburst.io';
|
|
110
|
+
if (!apiKey) {
|
|
111
|
+
throw new Error('VOXBURST_API_KEY environment variable is required. ' +
|
|
112
|
+
'Get your API key from https://app.voxburst.io/settings/api');
|
|
113
|
+
}
|
|
114
|
+
return new VoxBurstClient({ apiKey, apiUrl });
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAyMH,kDAYC;AApID,MAAa,gBAAiB,SAAQ,KAAK;IAGhC;IACA;IAHT,YACE,OAAe,EACR,UAAkB,EAClB,IAAa;QAEpB,KAAK,CAAC,OAAO,CAAC,CAAC;QAHR,eAAU,GAAV,UAAU,CAAQ;QAClB,SAAI,GAAJ,IAAI,CAAS;QAGpB,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;IACjC,CAAC;CACF;AATD,4CASC;AAED,MAAa,cAAc;IACjB,MAAM,CAAS;IACf,MAAM,CAAS;IAEvB,YAAY,MAAsB;QAChC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,wBAAwB;IAC1E,CAAC;IAEO,KAAK,CAAC,OAAO,CACnB,MAAc,EACd,IAAY,EACZ,IAAc;QAEd,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,EAAE,CAAC;QAEpC,MAAM,OAAO,GAA2B;YACtC,eAAe,EAAE,UAAU,IAAI,CAAC,MAAM,EAAE;YACxC,cAAc,EAAE,kBAAkB;YAClC,YAAY,EAAE,2BAA2B;SAC1C,CAAC;QAEF,MAAM,OAAO,GAAgB;YAC3B,MAAM;YACN,OAAO;SACR,CAAC;QAEF,IAAI,IAAI,EAAE,CAAC;YACT,OAAO,CAAC,IAAI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CAAC,iBAAiB,CAAC,SAAiB;QACvC,OAAO,IAAI,CAAC,OAAO,CAAiB,KAAK,EAAE,8BAA8B,SAAS,EAAE,CAAC,CAAC;IACxF,CAAC;CACF;AAxGD,wCAwGC;AAED;;GAEG;AACH,SAAgB,mBAAmB;IACjC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;IAC5C,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,yBAAyB,CAAC;IAEzE,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,qDAAqD;YACrD,4DAA4D,CAC7D,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,cAAc,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;AAChD,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* VoxBurst MCP Server
|
|
4
|
+
*
|
|
5
|
+
* Model Context Protocol server that enables AI agents to manage
|
|
6
|
+
* social media posts through VoxBurst.
|
|
7
|
+
*
|
|
8
|
+
* @see https://modelcontextprotocol.io
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;GAOG"}
|