@sendinel/mcp-server 1.0.86 → 1.0.88

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 CHANGED
@@ -12,7 +12,7 @@ AI-controlled email operations control plane for campaigns, contacts, segments,
12
12
 
13
13
  ## Tool groups
14
14
 
15
- Sendinel currently exposes 35 tool groups and 336 tools (gateway mode exposes 4 meta-tools, sharing how_to with full mode). These counts are checked against the tool registry in CI, so this table matches what ships.
15
+ Sendinel currently exposes 35 tool groups and 337 tools (gateway mode exposes 4 meta-tools, sharing how_to with full mode). These counts are checked against the tool registry in CI, so this table matches what ships.
16
16
 
17
17
  | Group | Count | Purpose |
18
18
  |-------|-------|---------|
@@ -32,7 +32,7 @@ Sendinel currently exposes 35 tool groups and 336 tools (gateway mode exposes 4
32
32
  | `content` | 14 | Content blocks, gated asset links, blog ingest and auto-publish, sources |
33
33
  | `data` | 19 | Platform connectors, imports, API keys, migration jobs, notifications, tenant export |
34
34
  | `data-proposals` | 3 | Data-derived campaign proposal generation, listing, approval |
35
- | `delivery-ops` | 23 | Domains, DNSBL, deliverability diagnostics, queue, DLQ, exports, blackout dates |
35
+ | `delivery-ops` | 24 | Domains, DNSBL, deliverability diagnostics, queue, DLQ, exports, blackout dates |
36
36
  | `drafts` | 6 | Draft create/approve/reject and draft-to-campaign promotion |
37
37
  | `forms` | 3 | Form creation, listing, stats |
38
38
  | `gdpr` | 4 | Contact data deletion and GDPR log |
@@ -10,6 +10,7 @@ import { fireWebhookEvent } from './webhook-events.js';
10
10
  * Tier 2 (protected) — Requires dashboard approval + typed confirmation. Irreversible data ops.
11
11
  */
12
12
  const GATED_ACTIONS = new Set([
13
+ 'recheck_domain_dns', // live provider verification may request an EE certificate
13
14
  'draft_agent_reply',
14
15
  'create_agent_mailbox',
15
16
  'launch_campaign', // sends real emails
package/build/server.js CHANGED
@@ -80,6 +80,7 @@ export const ALL_TOOL_GROUPS = Object.keys(GROUP_REGISTRY);
80
80
  // ── Scope enforcement ─────────────────────────────────────────────────────
81
81
  // Maps tool names to required scope. Mirrors dashboard's WRITE_TOOLS/ADMIN_TOOLS.
82
82
  const WRITE_TOOLS = new Set([
83
+ 'recheck_domain_dns',
83
84
  'mark_agent_message', 'draft_agent_reply', 'create_agent_mailbox',
84
85
  'add_subscriber', 'import_subscribers', 'update_subscriber', 'bulk_update_subscribers',
85
86
  'create_subscriber_view', 'update_subscriber_view', 'delete_subscriber_view',
@@ -243,24 +243,30 @@ export function registerConnectorTools(server) {
243
243
  }),
244
244
  metadata_columns: z.array(z.string()).max(100).optional()
245
245
  .describe('Extra source columns copied into contact custom_properties.'),
246
+ signal_columns: z.record(z.string(), z.string().min(1).max(160)).optional()
247
+ .describe('Source timestamp columns mapped to signal-only event names. Shared names use the earliest timestamp. Requires a view reinstall.'),
248
+ signal_backfill: z.enum(['write', 'skip']).optional()
249
+ .describe('First sync of a signal column: write historical events (default), or record values without events.'),
246
250
  identity_merge: z.enum(['off', 'by_email']).optional()
247
251
  .describe('How the contact view treats a person found both in the source table and as a Sendinel-owned contact: off = two rows (default), by_email = one row per email (source wins the name, tags combined, unsubscribe and test flags kept from either side). Omit to leave it unchanged.'),
248
252
  ...approvalFields,
249
253
  },
250
- }, async ({ table_id, mapping, metadata_columns, identity_merge, confirmed, approval_id }) => {
251
- const approvalParams = { table_id, mapping, metadata_columns, ...(identity_merge ? { identity_merge } : {}) };
254
+ }, async ({ table_id, mapping, metadata_columns, signal_columns, signal_backfill, identity_merge, confirmed, approval_id }) => {
255
+ const signalParams = { ...(signal_columns !== undefined ? { signal_columns } : {}), ...(signal_backfill !== undefined ? { signal_backfill } : {}) };
256
+ const approvalParams = { table_id, mapping, metadata_columns, ...signalParams, ...(identity_merge ? { identity_merge } : {}) };
252
257
  const gate = await authorizeConnectorMutation('set_connector_mapping', confirmed, approval_id, approvalParams, {
253
258
  effect: 'Replace the connector mapping, clear removed custom properties, refresh the live view, and resync contacts.',
254
259
  table_id,
255
260
  mapping,
256
261
  metadata_columns: metadata_columns ?? [],
262
+ ...signalParams,
257
263
  ...(identity_merge ? { identity_merge } : {}),
258
264
  });
259
265
  if (gate)
260
266
  return gate;
261
267
  const result = await callConnectorApi('/api/dashboard/connector/mapping', {
262
268
  method: 'PATCH',
263
- body: { table_id, mapping, metadata_columns, ...(identity_merge ? { identity_merge } : {}) },
269
+ body: { table_id, mapping, metadata_columns, ...signalParams, ...(identity_merge ? { identity_merge } : {}) },
264
270
  });
265
271
  return j(result.ok ? result.data : { error: result.error });
266
272
  });
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import dns from 'node:dns/promises';
3
- import { cancelSendQueueRows, findReplayableEnrollmentDlqRows, listSendQueueRows, replayEnrollmentDlqRows, retrySendQueueRows, } from '@sendinel/domain';
3
+ import { cancelSendQueueRows, computeDomainReadiness, findReplayableEnrollmentDlqRows, listSendQueueRows, replayEnrollmentDlqRows, retrySendQueueRows, } from '@sendinel/domain';
4
4
  import { logAudit } from '../audit.js';
5
5
  import { adminDb, db } from '../db.js';
6
6
  import { assertChannelCanExecute, checkApproval, currentChannelContext, requestApproval, withApproval } from '../lib/action-approvals.js';
@@ -141,7 +141,7 @@ export function registerDeliveryOpsTools(server) {
141
141
  idempotentHint: true,
142
142
  openWorldHint: false,
143
143
  },
144
- description: 'Return stored DNS verification status for a sending domain. This does not perform a live DNS refresh.',
144
+ description: 'Returns stored SPF/DKIM/DMARC from the latest health check; does NOT query DNS live. Use recheck_domain_dns for a live re-check.',
145
145
  inputSchema: { domain_id: z.string().uuid() },
146
146
  }, async ({ domain_id }) => {
147
147
  const { data, error } = await db().from('domains')
@@ -170,6 +170,40 @@ export function registerDeliveryOpsTools(server) {
170
170
  : null;
171
171
  return j({ spf, dkim, dmarc, all_verified: allVerified });
172
172
  });
173
+ server.registerTool('recheck_domain_dns', {
174
+ title: 'Recheck Domain DNS Live',
175
+ annotations: {
176
+ readOnlyHint: false,
177
+ destructiveHint: false,
178
+ idempotentHint: true,
179
+ openWorldHint: true,
180
+ },
181
+ description: 'Perform a live provider/DNS verification via the domains:write API and persist domain status and Elastic Email tracking observations. Returns Sendinel readiness; raw EE TrackingStatus is advisory and may remain Broken even when ready. Standard approval applies: call without approval_id, then repeat with the same domain_id and the approved approval_id. Failed checks return an error, not a readiness verdict.',
182
+ inputSchema: {
183
+ domain_id: z.string().uuid(),
184
+ approval_id: z.string().uuid().optional().describe('Call without this to request approval, then repeat with the approved approval_id.'),
185
+ },
186
+ }, withApproval('recheck_domain_dns', async ({ domain_id }) => {
187
+ try {
188
+ const result = await callSendinelV1(`/api/v1/domains/${domain_id}/verify`, { method: 'POST' });
189
+ if (!result.ok)
190
+ return j({ error: v1ErrorMessage(result.error), status: result.status });
191
+ const { data, error } = await db().schema('email').from('domains')
192
+ .select('id, name, provider, status, dns_records, verified_at')
193
+ .eq('project_id', getProjectId())
194
+ .eq('id', domain_id)
195
+ .maybeSingle();
196
+ if (error)
197
+ return j({ error: error.message });
198
+ if (!data)
199
+ return j({ error: 'Domain not found after verification', code: 'NOT_FOUND' });
200
+ return j({ domain_id, checked_live: true, status: data.status, verified_at: data.verified_at,
201
+ readiness: computeDomainReadiness(data) });
202
+ }
203
+ catch (error) {
204
+ return j({ error: error instanceof Error ? error.message : 'Domain recheck failed' });
205
+ }
206
+ }));
173
207
  server.registerTool('dnsbl_check', {
174
208
  title: 'DNSBL Check',
175
209
  annotations: {
@@ -763,28 +797,36 @@ export function registerDeliveryOpsTools(server) {
763
797
  idempotentHint: true,
764
798
  openWorldHint: false,
765
799
  },
766
- description: 'List sending domains configured for the project and their current verification status.',
800
+ description: 'List sending domains with Sendinel readiness (ready true/false/null, reasons, provider_detail). Raw provider values, including EE tracking_status_raw, are labelled detail only and do not drive readiness.',
767
801
  inputSchema: { site_id: z.string().uuid().optional() },
768
802
  }, async ({ site_id }) => {
769
803
  const projectId = getProjectId();
770
- let domainQuery = db().from('domains')
804
+ let domainQuery = db().schema('email').from('domains')
771
805
  .select('id, name, provider, provider_id, region, status, dns_records, verified_at, created_at')
772
806
  .eq('project_id', projectId)
773
807
  .order('created_at', { ascending: false });
774
808
  if (site_id) {
775
- const { data: site } = await db().from('sites')
809
+ const { data: site, error: siteError } = await db().schema('email').from('sites')
776
810
  .select('domain_id')
777
811
  .eq('id', site_id)
778
812
  .eq('project_id', projectId)
779
813
  .maybeSingle();
780
- if (!site?.domain_id)
814
+ if (siteError)
815
+ return j({ error: siteError.message });
816
+ if (!site)
817
+ return j({ error: 'Site not found', code: 'NOT_FOUND' });
818
+ if (!site.domain_id)
781
819
  return j({ domains: [], count: 0 });
782
820
  domainQuery = domainQuery.eq('id', site.domain_id);
783
821
  }
784
822
  const { data, error } = await domainQuery;
785
823
  if (error)
786
824
  return j({ error: error.message });
787
- return j({ domains: data ?? [], count: data?.length ?? 0 });
825
+ if (!data)
826
+ return j({ error: 'Domain query returned no result' });
827
+ return j({ domains: data.map((domain) => ({
828
+ ...domain, readiness: computeDomainReadiness(domain),
829
+ })), count: data.length });
788
830
  });
789
831
  server.registerTool('register_domain', {
790
832
  title: 'Register Domain',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendinel/mcp-server",
3
- "version": "1.0.86",
3
+ "version": "1.0.88",
4
4
  "description": "AI-controlled email operations control plane for campaigns, contacts, segments, analytics, and multi-provider sending via MCP.",
5
5
  "mcpName": "ai.sendinel/mcp-server",
6
6
  "type": "module",