@netsendo/mcp-client 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +224 -0
- package/dist/api-client.d.ts +68 -0
- package/dist/api-client.d.ts.map +1 -0
- package/dist/api-client.js +173 -0
- package/dist/api-client.js.map +1 -0
- package/dist/config.d.ts +38 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +55 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +221 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/index.d.ts +15 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +60 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/lists.d.ts +9 -0
- package/dist/tools/lists.d.ts.map +1 -0
- package/dist/tools/lists.js +170 -0
- package/dist/tools/lists.js.map +1 -0
- package/dist/tools/messaging.d.ts +9 -0
- package/dist/tools/messaging.d.ts.map +1 -0
- package/dist/tools/messaging.js +194 -0
- package/dist/tools/messaging.js.map +1 -0
- package/dist/tools/subscribers.d.ts +9 -0
- package/dist/tools/subscribers.d.ts.map +1 -0
- package/dist/tools/subscribers.js +231 -0
- package/dist/tools/subscribers.js.map +1 -0
- package/dist/types.d.ts +246 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/package.json +64 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* NetSendo MCP Server
|
|
4
|
+
*
|
|
5
|
+
* Model Context Protocol server for NetSendo email marketing platform.
|
|
6
|
+
* Enables AI assistants (Claude, Cursor, VS Code) to interact with NetSendo.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* # With environment variables (Docker/local):
|
|
10
|
+
* NETSENDO_API_URL=http://localhost:8080 NETSENDO_API_KEY=xxx node dist/index.js
|
|
11
|
+
*
|
|
12
|
+
* # With CLI arguments (remote):
|
|
13
|
+
* npx @netsendo/mcp-client --url https://app.example.com --api-key xxx
|
|
14
|
+
*
|
|
15
|
+
* @author NetSendo Team
|
|
16
|
+
* @license MIT
|
|
17
|
+
*/
|
|
18
|
+
import { program } from 'commander';
|
|
19
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
20
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
21
|
+
import { z } from 'zod';
|
|
22
|
+
import { loadConfig, validateConfig } from './config.js';
|
|
23
|
+
import { NetSendoApiClient } from './api-client.js';
|
|
24
|
+
import { registerAllTools } from './tools/index.js';
|
|
25
|
+
const SERVER_NAME = 'netsendo-mcp';
|
|
26
|
+
const SERVER_VERSION = '1.0.0';
|
|
27
|
+
// Parse CLI arguments
|
|
28
|
+
program
|
|
29
|
+
.name('netsendo-mcp')
|
|
30
|
+
.description('NetSendo MCP Server - Connect AI assistants to your NetSendo instance')
|
|
31
|
+
.version(SERVER_VERSION)
|
|
32
|
+
.option('--url <url>', 'NetSendo API URL (e.g., https://app.netsendo.com)')
|
|
33
|
+
.option('--api-key <key>', 'NetSendo API key')
|
|
34
|
+
.option('--debug', 'Enable debug logging')
|
|
35
|
+
.parse(process.argv);
|
|
36
|
+
const cliOpts = program.opts();
|
|
37
|
+
const cliArgs = {
|
|
38
|
+
url: cliOpts.url,
|
|
39
|
+
apiKey: cliOpts.apiKey,
|
|
40
|
+
debug: cliOpts.debug,
|
|
41
|
+
};
|
|
42
|
+
async function main() {
|
|
43
|
+
// Validate configuration before starting
|
|
44
|
+
const validation = validateConfig(cliArgs);
|
|
45
|
+
if (!validation.valid) {
|
|
46
|
+
console.error('Configuration Error:');
|
|
47
|
+
validation.errors.forEach(err => console.error(` - ${err}`));
|
|
48
|
+
console.error('\nUsage:');
|
|
49
|
+
console.error(' npx @netsendo/mcp-client --url <url> --api-key <key>');
|
|
50
|
+
console.error('\nExamples:');
|
|
51
|
+
console.error(' # Remote NetSendo instance:');
|
|
52
|
+
console.error(' npx @netsendo/mcp-client --url https://app.netsendo.com --api-key ns_live_xxx');
|
|
53
|
+
console.error('\n # Local development (Docker):');
|
|
54
|
+
console.error(' docker compose run --rm mcp');
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
// Load configuration (CLI args take priority over env vars)
|
|
58
|
+
const config = loadConfig(cliArgs);
|
|
59
|
+
// Create API client
|
|
60
|
+
const api = new NetSendoApiClient(config);
|
|
61
|
+
// Create MCP server
|
|
62
|
+
const server = new McpServer({
|
|
63
|
+
name: SERVER_NAME,
|
|
64
|
+
version: SERVER_VERSION,
|
|
65
|
+
});
|
|
66
|
+
// Register all tools
|
|
67
|
+
registerAllTools(server, api);
|
|
68
|
+
// Set up resources (informational data for AI context)
|
|
69
|
+
server.resource('netsendo://info', 'NetSendo instance information', async () => {
|
|
70
|
+
try {
|
|
71
|
+
const info = await api.getAccountInfo();
|
|
72
|
+
return {
|
|
73
|
+
contents: [{
|
|
74
|
+
uri: 'netsendo://info',
|
|
75
|
+
mimeType: 'application/json',
|
|
76
|
+
text: JSON.stringify({
|
|
77
|
+
name: 'NetSendo Instance',
|
|
78
|
+
description: 'Email marketing and automation platform',
|
|
79
|
+
version: info.version,
|
|
80
|
+
api_url: config.apiUrl,
|
|
81
|
+
capabilities: [
|
|
82
|
+
'Subscriber management',
|
|
83
|
+
'Contact lists',
|
|
84
|
+
'Tags',
|
|
85
|
+
'Email campaigns',
|
|
86
|
+
'SMS messaging',
|
|
87
|
+
'CRM contacts',
|
|
88
|
+
'Automations',
|
|
89
|
+
],
|
|
90
|
+
}, null, 2),
|
|
91
|
+
}],
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
return {
|
|
96
|
+
contents: [{
|
|
97
|
+
uri: 'netsendo://info',
|
|
98
|
+
mimeType: 'text/plain',
|
|
99
|
+
text: `Error fetching NetSendo info: ${error.message}`,
|
|
100
|
+
}],
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
// Quick stats resource
|
|
105
|
+
server.resource('netsendo://stats', 'Quick statistics overview', async () => {
|
|
106
|
+
try {
|
|
107
|
+
// Fetch basic stats from multiple endpoints
|
|
108
|
+
const [lists, tags] = await Promise.all([
|
|
109
|
+
api.listContactLists({ per_page: 100 }),
|
|
110
|
+
api.listTags(),
|
|
111
|
+
]);
|
|
112
|
+
const totalSubscribers = lists.data.reduce((sum, list) => sum + list.subscribers_count, 0);
|
|
113
|
+
return {
|
|
114
|
+
contents: [{
|
|
115
|
+
uri: 'netsendo://stats',
|
|
116
|
+
mimeType: 'application/json',
|
|
117
|
+
text: JSON.stringify({
|
|
118
|
+
contact_lists: lists.meta.total,
|
|
119
|
+
total_subscribers: totalSubscribers,
|
|
120
|
+
tags: tags.length,
|
|
121
|
+
top_lists: lists.data
|
|
122
|
+
.sort((a, b) => b.subscribers_count - a.subscribers_count)
|
|
123
|
+
.slice(0, 5)
|
|
124
|
+
.map(l => ({ name: l.name, subscribers: l.subscribers_count })),
|
|
125
|
+
}, null, 2),
|
|
126
|
+
}],
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
return {
|
|
131
|
+
contents: [{
|
|
132
|
+
uri: 'netsendo://stats',
|
|
133
|
+
mimeType: 'text/plain',
|
|
134
|
+
text: `Error fetching stats: ${error.message}`,
|
|
135
|
+
}],
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
// Add prompts for common tasks
|
|
140
|
+
server.prompt('analyze_subscribers', 'Analyze subscriber list for quality and engagement patterns', {
|
|
141
|
+
list_id: z.string().optional().describe('Optional: specific list ID to analyze'),
|
|
142
|
+
}, async ({ list_id }) => ({
|
|
143
|
+
messages: [{
|
|
144
|
+
role: 'user',
|
|
145
|
+
content: {
|
|
146
|
+
type: 'text',
|
|
147
|
+
text: `Please analyze the subscriber ${list_id ? `list (ID: ${list_id})` : 'database'} in NetSendo.
|
|
148
|
+
|
|
149
|
+
Use the available tools to:
|
|
150
|
+
1. First, use list_contact_lists to get an overview of all lists
|
|
151
|
+
2. Use list_subscribers to sample subscriber data
|
|
152
|
+
3. Check for patterns in subscription sources, status distribution, and engagement
|
|
153
|
+
|
|
154
|
+
Provide insights on:
|
|
155
|
+
- Total subscriber count and status breakdown
|
|
156
|
+
- Quality indicators (bounced rate, unsubscribe rate)
|
|
157
|
+
- Recommendations for list hygiene
|
|
158
|
+
- Suggested segmentation strategies`,
|
|
159
|
+
},
|
|
160
|
+
}],
|
|
161
|
+
}));
|
|
162
|
+
server.prompt('send_newsletter', 'Help compose and send a newsletter to subscribers', {
|
|
163
|
+
topic: z.string().describe('Newsletter topic or theme'),
|
|
164
|
+
list_id: z.string().optional().describe('Target contact list ID'),
|
|
165
|
+
}, async ({ topic, list_id }) => ({
|
|
166
|
+
messages: [{
|
|
167
|
+
role: 'user',
|
|
168
|
+
content: {
|
|
169
|
+
type: 'text',
|
|
170
|
+
text: `Help me create and send a newsletter about: ${topic}
|
|
171
|
+
|
|
172
|
+
${list_id ? `Target list ID: ${list_id}` : 'First, help me select the right contact list.'}
|
|
173
|
+
|
|
174
|
+
Steps:
|
|
175
|
+
1. Use list_mailboxes to see available sender addresses
|
|
176
|
+
2. Use list_contact_lists to confirm the target audience
|
|
177
|
+
3. Help me write compelling subject line and content
|
|
178
|
+
4. Use send_email (for individual) or prepare batch send instructions
|
|
179
|
+
|
|
180
|
+
Requirements:
|
|
181
|
+
- Engaging subject line
|
|
182
|
+
- Clear call-to-action
|
|
183
|
+
- Mobile-friendly HTML content
|
|
184
|
+
- Professional but friendly tone`,
|
|
185
|
+
},
|
|
186
|
+
}],
|
|
187
|
+
}));
|
|
188
|
+
server.prompt('cleanup_list', 'Identify and clean up inactive or problematic subscribers', {}, async () => ({
|
|
189
|
+
messages: [{
|
|
190
|
+
role: 'user',
|
|
191
|
+
content: {
|
|
192
|
+
type: 'text',
|
|
193
|
+
text: `Help me clean up my subscriber lists in NetSendo.
|
|
194
|
+
|
|
195
|
+
Use the available tools to:
|
|
196
|
+
1. List all contact lists and their subscriber counts
|
|
197
|
+
2. Identify subscribers with status 'bounced' or 'complained'
|
|
198
|
+
3. Find subscribers who haven't engaged (if engagement data available)
|
|
199
|
+
|
|
200
|
+
Then provide recommendations for:
|
|
201
|
+
- Subscribers to remove or unsubscribe
|
|
202
|
+
- Lists that might need attention
|
|
203
|
+
- Best practices for maintaining list hygiene
|
|
204
|
+
|
|
205
|
+
Important: Only suggest deletions, don't execute them without my confirmation.`,
|
|
206
|
+
},
|
|
207
|
+
}],
|
|
208
|
+
}));
|
|
209
|
+
// Connect with stdio transport
|
|
210
|
+
const transport = new StdioServerTransport();
|
|
211
|
+
await server.connect(transport);
|
|
212
|
+
// Log startup (to stderr so it doesn't interfere with MCP protocol)
|
|
213
|
+
console.error(`${SERVER_NAME} v${SERVER_VERSION} started`);
|
|
214
|
+
console.error(`Connected to: ${config.apiUrl}`);
|
|
215
|
+
}
|
|
216
|
+
// Run the server
|
|
217
|
+
main().catch((error) => {
|
|
218
|
+
console.error('Fatal error:', error);
|
|
219
|
+
process.exit(1);
|
|
220
|
+
});
|
|
221
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,cAAc,EAAW,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,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,CAAC,CAAC,+CAA+C;;;;;;;;;;;;iCAYzD;iBACxB;aACF,CAAC;KACH,CAAC,CACH,CAAC;IAEF,MAAM,CAAC,MAAM,CACX,cAAc,EACd,2DAA2D,EAC3D,EAAE,EACF,KAAK,IAAI,EAAE,CAAC,CAAC;QACX,QAAQ,EAAE,CAAC;gBACT,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;;;;;;;;;;;;+EAY+D;iBACtE;aACF,CAAC;KACH,CAAC,CACH,CAAC;IAEF,+BAA+B;IAC/B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEhC,oEAAoE;IACpE,OAAO,CAAC,KAAK,CAAC,GAAG,WAAW,KAAK,cAAc,UAAU,CAAC,CAAC;IAC3D,OAAO,CAAC,KAAK,CAAC,iBAAiB,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;AAClD,CAAC;AAED,iBAAiB;AACjB,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NetSendo MCP Server - Tools Registry
|
|
3
|
+
*
|
|
4
|
+
* Registers all available tools with the MCP server
|
|
5
|
+
*/
|
|
6
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
7
|
+
import type { NetSendoApiClient } from '../api-client.js';
|
|
8
|
+
/**
|
|
9
|
+
* Register all tools with the MCP server
|
|
10
|
+
*/
|
|
11
|
+
export declare function registerAllTools(server: McpServer, api: NetSendoApiClient): void;
|
|
12
|
+
export { registerSubscriberTools } from './subscribers.js';
|
|
13
|
+
export { registerListTools } from './lists.js';
|
|
14
|
+
export { registerMessagingTools } from './messaging.js';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAM1D;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,iBAAiB,QA2DzE;AAED,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NetSendo MCP Server - Tools Registry
|
|
3
|
+
*
|
|
4
|
+
* Registers all available tools with the MCP server
|
|
5
|
+
*/
|
|
6
|
+
import { registerSubscriberTools } from './subscribers.js';
|
|
7
|
+
import { registerListTools } from './lists.js';
|
|
8
|
+
import { registerMessagingTools } from './messaging.js';
|
|
9
|
+
/**
|
|
10
|
+
* Register all tools with the MCP server
|
|
11
|
+
*/
|
|
12
|
+
export function registerAllTools(server, api) {
|
|
13
|
+
// Subscriber management tools
|
|
14
|
+
registerSubscriberTools(server, api);
|
|
15
|
+
// Contact lists and tags tools
|
|
16
|
+
registerListTools(server, api);
|
|
17
|
+
// Email and SMS messaging tools
|
|
18
|
+
registerMessagingTools(server, api);
|
|
19
|
+
// Account / Connection test tool
|
|
20
|
+
server.tool('test_connection', 'Test the connection to NetSendo API. Use this to verify credentials are working.', {}, async () => {
|
|
21
|
+
const result = await api.testConnection();
|
|
22
|
+
return {
|
|
23
|
+
content: [{
|
|
24
|
+
type: 'text',
|
|
25
|
+
text: JSON.stringify({
|
|
26
|
+
connected: result.success,
|
|
27
|
+
message: result.message,
|
|
28
|
+
version: result.version ?? null,
|
|
29
|
+
}, null, 2),
|
|
30
|
+
}],
|
|
31
|
+
isError: !result.success,
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
// Get Account Info
|
|
35
|
+
server.tool('get_account_info', 'Get information about the connected NetSendo account.', {}, async () => {
|
|
36
|
+
try {
|
|
37
|
+
const info = await api.getAccountInfo();
|
|
38
|
+
return {
|
|
39
|
+
content: [{
|
|
40
|
+
type: 'text',
|
|
41
|
+
text: JSON.stringify({
|
|
42
|
+
name: info.name,
|
|
43
|
+
email: info.email,
|
|
44
|
+
version: info.version,
|
|
45
|
+
}, null, 2),
|
|
46
|
+
}],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
return {
|
|
51
|
+
content: [{ type: 'text', text: `Error: ${error.message}` }],
|
|
52
|
+
isError: true,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
export { registerSubscriberTools } from './subscribers.js';
|
|
58
|
+
export { registerListTools } from './lists.js';
|
|
59
|
+
export { registerMessagingTools } from './messaging.js';
|
|
60
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAiB,EAAE,GAAsB;IACxE,8BAA8B;IAC9B,uBAAuB,CAAC,MAAM,EAAE,GAAG,CAA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,KAAe,CAAC,OAAO,EAAE,EAAE,CAAC;gBAChF,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NetSendo MCP Server - List & Tag Tools
|
|
3
|
+
*
|
|
4
|
+
* Tools for managing contact lists and tags
|
|
5
|
+
*/
|
|
6
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
7
|
+
import type { NetSendoApiClient } from '../api-client.js';
|
|
8
|
+
export declare function registerListTools(server: McpServer, api: NetSendoApiClient): void;
|
|
9
|
+
//# sourceMappingURL=lists.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lists.d.ts","sourceRoot":"","sources":["../../src/tools/lists.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,iBAAiB,QAkM1E"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NetSendo MCP Server - List & Tag Tools
|
|
3
|
+
*
|
|
4
|
+
* Tools for managing contact lists and tags
|
|
5
|
+
*/
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
export function registerListTools(server, api) {
|
|
8
|
+
// List Contact Lists
|
|
9
|
+
server.tool('list_contact_lists', 'Get all contact lists with subscriber counts. Use this to see available lists for filtering subscribers.', {
|
|
10
|
+
page: z.number().optional().describe('Page number (default: 1)'),
|
|
11
|
+
per_page: z.number().min(1).max(100).optional().describe('Results per page (1-100, default: 50)'),
|
|
12
|
+
}, async ({ page, per_page }) => {
|
|
13
|
+
try {
|
|
14
|
+
const result = await api.listContactLists({
|
|
15
|
+
page: page ?? 1,
|
|
16
|
+
per_page: per_page ?? 50,
|
|
17
|
+
});
|
|
18
|
+
const lists = result.data.map(l => ({
|
|
19
|
+
id: l.id,
|
|
20
|
+
name: l.name,
|
|
21
|
+
description: l.description,
|
|
22
|
+
subscribers_count: l.subscribers_count,
|
|
23
|
+
double_opt_in: l.double_opt_in,
|
|
24
|
+
created_at: l.created_at,
|
|
25
|
+
}));
|
|
26
|
+
return {
|
|
27
|
+
content: [{
|
|
28
|
+
type: 'text',
|
|
29
|
+
text: JSON.stringify({
|
|
30
|
+
lists,
|
|
31
|
+
pagination: {
|
|
32
|
+
page: result.meta.current_page,
|
|
33
|
+
total_pages: result.meta.last_page,
|
|
34
|
+
total: result.meta.total,
|
|
35
|
+
},
|
|
36
|
+
}, null, 2),
|
|
37
|
+
}],
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
return {
|
|
42
|
+
content: [{ type: 'text', text: `Error: ${error.message}` }],
|
|
43
|
+
isError: true,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
// Get Contact List Details
|
|
48
|
+
server.tool('get_contact_list', 'Get detailed information about a specific contact list.', {
|
|
49
|
+
id: z.number().describe('Contact list ID'),
|
|
50
|
+
}, async ({ id }) => {
|
|
51
|
+
try {
|
|
52
|
+
const list = await api.getContactList(id);
|
|
53
|
+
return {
|
|
54
|
+
content: [{
|
|
55
|
+
type: 'text',
|
|
56
|
+
text: JSON.stringify({
|
|
57
|
+
id: list.id,
|
|
58
|
+
name: list.name,
|
|
59
|
+
description: list.description,
|
|
60
|
+
subscribers_count: list.subscribers_count,
|
|
61
|
+
double_opt_in: list.double_opt_in,
|
|
62
|
+
created_at: list.created_at,
|
|
63
|
+
updated_at: list.updated_at,
|
|
64
|
+
}, null, 2),
|
|
65
|
+
}],
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
return {
|
|
70
|
+
content: [{ type: 'text', text: `Error: ${error.message}` }],
|
|
71
|
+
isError: true,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
// Get List Subscribers
|
|
76
|
+
server.tool('get_list_subscribers', 'Get subscribers belonging to a specific contact list.', {
|
|
77
|
+
list_id: z.number().describe('Contact list ID'),
|
|
78
|
+
page: z.number().optional().describe('Page number (default: 1)'),
|
|
79
|
+
per_page: z.number().min(1).max(100).optional().describe('Results per page (1-100, default: 20)'),
|
|
80
|
+
}, async ({ list_id, page, per_page }) => {
|
|
81
|
+
try {
|
|
82
|
+
const result = await api.getListSubscribers(list_id, {
|
|
83
|
+
page: page ?? 1,
|
|
84
|
+
per_page: per_page ?? 20,
|
|
85
|
+
});
|
|
86
|
+
const subscribers = result.data.map(s => ({
|
|
87
|
+
id: s.id,
|
|
88
|
+
email: s.email,
|
|
89
|
+
name: [s.first_name, s.last_name].filter(Boolean).join(' ') || null,
|
|
90
|
+
status: s.status,
|
|
91
|
+
created_at: s.created_at,
|
|
92
|
+
}));
|
|
93
|
+
return {
|
|
94
|
+
content: [{
|
|
95
|
+
type: 'text',
|
|
96
|
+
text: JSON.stringify({
|
|
97
|
+
list_id,
|
|
98
|
+
subscribers,
|
|
99
|
+
pagination: {
|
|
100
|
+
page: result.meta.current_page,
|
|
101
|
+
total_pages: result.meta.last_page,
|
|
102
|
+
total: result.meta.total,
|
|
103
|
+
},
|
|
104
|
+
}, null, 2),
|
|
105
|
+
}],
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
return {
|
|
110
|
+
content: [{ type: 'text', text: `Error: ${error.message}` }],
|
|
111
|
+
isError: true,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
// List Tags
|
|
116
|
+
server.tool('list_tags', 'Get all available tags. Use this to see what tags can be assigned to subscribers.', {}, async () => {
|
|
117
|
+
try {
|
|
118
|
+
const tags = await api.listTags();
|
|
119
|
+
return {
|
|
120
|
+
content: [{
|
|
121
|
+
type: 'text',
|
|
122
|
+
text: JSON.stringify({
|
|
123
|
+
tags: tags.map(t => ({
|
|
124
|
+
id: t.id,
|
|
125
|
+
name: t.name,
|
|
126
|
+
color: t.color,
|
|
127
|
+
subscribers_count: t.subscribers_count ?? null,
|
|
128
|
+
})),
|
|
129
|
+
total: tags.length,
|
|
130
|
+
}, null, 2),
|
|
131
|
+
}],
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
return {
|
|
136
|
+
content: [{ type: 'text', text: `Error: ${error.message}` }],
|
|
137
|
+
isError: true,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
// List Custom Fields
|
|
142
|
+
server.tool('list_custom_fields', 'Get all available custom fields. Custom fields allow storing additional subscriber information.', {}, async () => {
|
|
143
|
+
try {
|
|
144
|
+
const fields = await api.listCustomFields();
|
|
145
|
+
return {
|
|
146
|
+
content: [{
|
|
147
|
+
type: 'text',
|
|
148
|
+
text: JSON.stringify({
|
|
149
|
+
custom_fields: fields.map(f => ({
|
|
150
|
+
id: f.id,
|
|
151
|
+
name: f.name,
|
|
152
|
+
slug: f.slug,
|
|
153
|
+
type: f.type,
|
|
154
|
+
required: f.required,
|
|
155
|
+
options: f.options,
|
|
156
|
+
})),
|
|
157
|
+
total: fields.length,
|
|
158
|
+
}, null, 2),
|
|
159
|
+
}],
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
return {
|
|
164
|
+
content: [{ type: 'text', text: `Error: ${error.message}` }],
|
|
165
|
+
isError: true,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
}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|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NetSendo MCP Server - Messaging Tools
|
|
3
|
+
*
|
|
4
|
+
* Tools for sending emails and SMS
|
|
5
|
+
*/
|
|
6
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
7
|
+
import type { NetSendoApiClient } from '../api-client.js';
|
|
8
|
+
export declare function registerMessagingTools(server: McpServer, api: NetSendoApiClient): void;
|
|
9
|
+
//# sourceMappingURL=messaging.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messaging.d.ts","sourceRoot":"","sources":["../../src/tools/messaging.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,iBAAiB,QAgO/E"}
|