@motorical/mcp 1.1.0 → 1.1.2
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/package.json +2 -2
- package/src/client.js +6 -0
- package/src/server.js +27 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@motorical/mcp",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "MCP server for Motorical transactional email API
|
|
3
|
+
"version": "1.1.2",
|
|
4
|
+
"description": "MCP server for Motorical transactional email API — dry-run/send, mint public tokens, list Motor Blocks, inspect delivery events",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"motorical-mcp": "./src/index.js"
|
package/src/client.js
CHANGED
|
@@ -218,6 +218,12 @@ export class MotoricalClient {
|
|
|
218
218
|
});
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
+
async domainList() {
|
|
222
|
+
return this.request('GET', '/api/domains', {
|
|
223
|
+
bearer: this.requireDashboardJwt()
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
|
|
221
227
|
async domainAdd({ domain, verificationMethod = 'dns' } = {}) {
|
|
222
228
|
if (!domain) throw new Error('domain is required');
|
|
223
229
|
return this.request('POST', '/api/domains', {
|
package/src/server.js
CHANGED
|
@@ -2,7 +2,7 @@ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { MotoricalClient, loadConfig } from './client.js';
|
|
4
4
|
|
|
5
|
-
const PACKAGE_VERSION = '1.
|
|
5
|
+
const PACKAGE_VERSION = '1.1.2';
|
|
6
6
|
|
|
7
7
|
function jsonResult(data, { isError = false } = {}) {
|
|
8
8
|
return {
|
|
@@ -170,7 +170,11 @@ export function createMotoricalMcpServer(options = {}) {
|
|
|
170
170
|
'motorical_sandbox_status',
|
|
171
171
|
{
|
|
172
172
|
description:
|
|
173
|
-
'Get developer sandbox status (domain, Motor Block, outbound lock, allowlist).
|
|
173
|
+
'Get developer sandbox status (domain, Motor Block, outbound lock, allowlist). ' +
|
|
174
|
+
'Check data.stage to determine provisioning state: "not_started" (no sandbox yet — call ' +
|
|
175
|
+
'motorical_sandbox_provision), "sandbox_active" (sandbox exists, outbound-locked), or "live" ' +
|
|
176
|
+
'(converted to production, no lock). allowlist/caps are always present in the response regardless ' +
|
|
177
|
+
'of stage — do not infer provisioning state from their presence. Requires MOTORICAL_JWT.',
|
|
174
178
|
inputSchema: {}
|
|
175
179
|
},
|
|
176
180
|
async () => {
|
|
@@ -266,7 +270,9 @@ export function createMotoricalMcpServer(options = {}) {
|
|
|
266
270
|
{
|
|
267
271
|
description:
|
|
268
272
|
'Add a customer domain (POST /api/domains). Returns verification DNS instructions. ' +
|
|
269
|
-
'For cname_managed DKIM publish the CNAME in verification.records.dkim / dnsRecords (not a TXT p= key).
|
|
273
|
+
'For cname_managed DKIM publish the CNAME in verification.records.dkim / dnsRecords (not a TXT p= key). ' +
|
|
274
|
+
'On 409 (domain already registered), call motorical_domain_list first to check whether it is already on ' +
|
|
275
|
+
'this account before asking the user to resolve the conflict. Requires MOTORICAL_JWT.',
|
|
270
276
|
inputSchema: {
|
|
271
277
|
domain: z.string().min(3),
|
|
272
278
|
verificationMethod: z.enum(['dns', 'email']).optional()
|
|
@@ -281,6 +287,24 @@ export function createMotoricalMcpServer(options = {}) {
|
|
|
281
287
|
}
|
|
282
288
|
);
|
|
283
289
|
|
|
290
|
+
server.registerTool(
|
|
291
|
+
'motorical_domain_list',
|
|
292
|
+
{
|
|
293
|
+
description:
|
|
294
|
+
'List domains already on this account (GET /api/domains) — id, domain, verified, DNS auth flags. ' +
|
|
295
|
+
'Call this before motorical_domain_add on a 409 conflict to self-diagnose whether the domain is already ' +
|
|
296
|
+
'yours (proceed with the existing id) or genuinely owned by someone else (stop, do not guess). Requires MOTORICAL_JWT.',
|
|
297
|
+
inputSchema: {}
|
|
298
|
+
},
|
|
299
|
+
async () => {
|
|
300
|
+
try {
|
|
301
|
+
return jsonResult(await client.domainList());
|
|
302
|
+
} catch (err) {
|
|
303
|
+
return errorResult(err);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
);
|
|
307
|
+
|
|
284
308
|
server.registerTool(
|
|
285
309
|
'motorical_domain_verify',
|
|
286
310
|
{
|