@motorical/mcp 1.1.1 → 1.1.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@motorical/mcp",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
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": {
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.0.5';
5
+ const PACKAGE_VERSION = '1.1.3';
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). Requires MOTORICAL_JWT.',
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 () => {
@@ -247,7 +251,9 @@ export function createMotoricalMcpServer(options = {}) {
247
251
  'motorical_sandbox_convert',
248
252
  {
249
253
  description:
250
- 'Convert sandbox Motor Block onto a verified customer domain. Requires active Motorical Plan + MOTORICAL_JWT.',
254
+ 'Convert sandbox Motor Block onto a verified customer domain. Requires active Motorical Plan + MOTORICAL_JWT. ' +
255
+ 'If no sandbox exists yet (check motorical_sandbox_status first — data.stage: "not_started"), call ' +
256
+ 'motorical_sandbox_provision instead; this endpoint returns 404 "No developer sandbox to convert" otherwise.',
251
257
  inputSchema: {
252
258
  domainId: z.string().uuid()
253
259
  }
@@ -266,7 +272,9 @@ export function createMotoricalMcpServer(options = {}) {
266
272
  {
267
273
  description:
268
274
  '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). Requires MOTORICAL_JWT.',
275
+ 'For cname_managed DKIM publish the CNAME in verification.records.dkim / dnsRecords (not a TXT p= key). ' +
276
+ 'On 409 (domain already registered), call motorical_domain_list first to check whether it is already on ' +
277
+ 'this account before asking the user to resolve the conflict. Requires MOTORICAL_JWT.',
270
278
  inputSchema: {
271
279
  domain: z.string().min(3),
272
280
  verificationMethod: z.enum(['dns', 'email']).optional()
@@ -281,6 +289,24 @@ export function createMotoricalMcpServer(options = {}) {
281
289
  }
282
290
  );
283
291
 
292
+ server.registerTool(
293
+ 'motorical_domain_list',
294
+ {
295
+ description:
296
+ 'List domains already on this account (GET /api/domains) — id, domain, verified, DNS auth flags. ' +
297
+ 'Call this before motorical_domain_add on a 409 conflict to self-diagnose whether the domain is already ' +
298
+ 'yours (proceed with the existing id) or genuinely owned by someone else (stop, do not guess). Requires MOTORICAL_JWT.',
299
+ inputSchema: {}
300
+ },
301
+ async () => {
302
+ try {
303
+ return jsonResult(await client.domainList());
304
+ } catch (err) {
305
+ return errorResult(err);
306
+ }
307
+ }
308
+ );
309
+
284
310
  server.registerTool(
285
311
  'motorical_domain_verify',
286
312
  {