@sendinel/mcp-server 1.0.59 → 1.0.60
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/build/tools/advisor.js +17 -14
- package/package.json +1 -1
package/build/tools/advisor.js
CHANGED
|
@@ -649,9 +649,12 @@ Return ONLY valid JSON (no markdown fences): { "topics": [{ "title": "...", "rat
|
|
|
649
649
|
.order('check_date', { ascending: false })
|
|
650
650
|
.limit(1);
|
|
651
651
|
const health = (healthRows ?? [])[0];
|
|
652
|
-
const spfValid = health?.spf_valid ??
|
|
653
|
-
const
|
|
654
|
-
const
|
|
652
|
+
const spfValid = health?.spf_valid ?? null; // null = not checked yet (#3904)
|
|
653
|
+
const spfFailed = spfValid === false;
|
|
654
|
+
const dkimValid = health?.dkim_valid ?? null; // null = not checked yet (#3904)
|
|
655
|
+
const dkimFailed = dkimValid === false;
|
|
656
|
+
const dmarcValid = health?.dmarc_valid ?? null; // null = not checked yet (#3904)
|
|
657
|
+
const dmarcFailed = dmarcValid === false;
|
|
655
658
|
const warmupDay = health?.warmup_day ?? null;
|
|
656
659
|
const warmupDailyLimit = health?.warmup_daily_limit ?? null;
|
|
657
660
|
// 3. Fetch recent 7-day email_log stats
|
|
@@ -686,9 +689,9 @@ Return ONLY valid JSON (no markdown fences): { "topics": [{ "title": "...", "rat
|
|
|
686
689
|
issues.push({ type: 'high_complaint', severity: 'critical', detail: `Complaint rate ${complaintRate}% exceeds 0.3% threshold` });
|
|
687
690
|
else if (complaintRate > 0.1)
|
|
688
691
|
issues.push({ type: 'elevated_complaint', severity: 'high', detail: `Complaint rate ${complaintRate}% approaching danger zone` });
|
|
689
|
-
if (
|
|
690
|
-
issues.push({ type: 'dns_invalid', severity: 'high', detail: `Missing DNS: ${
|
|
691
|
-
if (
|
|
692
|
+
if (spfFailed || dkimFailed)
|
|
693
|
+
issues.push({ type: 'dns_invalid', severity: 'high', detail: `Missing DNS: ${spfFailed ? 'SPF' : ''}${spfFailed && dkimFailed ? ' + ' : ''}${dkimFailed ? 'DKIM' : ''}` });
|
|
694
|
+
if (dmarcFailed)
|
|
692
695
|
issues.push({ type: 'no_dmarc', severity: 'medium', detail: 'DMARC record missing or invalid' });
|
|
693
696
|
if (warmupDay != null && warmupDay < 42 && bounceRate > 3) {
|
|
694
697
|
issues.push({ type: 'warmup_risk', severity: 'high', detail: `Domain on warmup day ${warmupDay} with ${bounceRate}% bounce rate — warmup at risk` });
|
|
@@ -711,9 +714,9 @@ Return ONLY valid JSON (no markdown fences): { "topics": [{ "title": "...", "rat
|
|
|
711
714
|
immediate.push('Review recent bounce reasons in suppression log');
|
|
712
715
|
}
|
|
713
716
|
// DNS fixes
|
|
714
|
-
if (
|
|
717
|
+
if (spfFailed)
|
|
715
718
|
immediate.push('Add SPF record for sending domain');
|
|
716
|
-
if (
|
|
719
|
+
if (dkimFailed) {
|
|
717
720
|
const { data: dkimSite } = await db()
|
|
718
721
|
.from('sites')
|
|
719
722
|
.select('provider')
|
|
@@ -722,7 +725,7 @@ Return ONLY valid JSON (no markdown fences): { "topics": [{ "title": "...", "rat
|
|
|
722
725
|
.maybeSingle();
|
|
723
726
|
immediate.push(dkimRemediationText(dkimSite?.provider));
|
|
724
727
|
}
|
|
725
|
-
if (
|
|
728
|
+
if (dmarcFailed)
|
|
726
729
|
shortTerm.push('Add DMARC record (start with p=none for monitoring)');
|
|
727
730
|
// List hygiene
|
|
728
731
|
if (bounceRate > 2 || complained > 0) {
|
|
@@ -738,7 +741,7 @@ Return ONLY valid JSON (no markdown fences): { "topics": [{ "title": "...", "rat
|
|
|
738
741
|
shortTerm.push('Reduce daily send volume by 50% for at least 48 hours');
|
|
739
742
|
}
|
|
740
743
|
// Re-verification
|
|
741
|
-
if (
|
|
744
|
+
if (spfFailed || dkimFailed) {
|
|
742
745
|
shortTerm.push('Re-verify domain after DNS changes (use dns-verify API)');
|
|
743
746
|
}
|
|
744
747
|
// Monitoring steps
|
|
@@ -753,11 +756,11 @@ Return ONLY valid JSON (no markdown fences): { "topics": [{ "title": "...", "rat
|
|
|
753
756
|
}
|
|
754
757
|
// 7. Compute health score (0-100)
|
|
755
758
|
let healthScore = 100;
|
|
756
|
-
if (
|
|
759
|
+
if (spfFailed)
|
|
757
760
|
healthScore -= 15;
|
|
758
|
-
if (
|
|
761
|
+
if (dkimFailed)
|
|
759
762
|
healthScore -= 15;
|
|
760
|
-
if (
|
|
763
|
+
if (dmarcFailed)
|
|
761
764
|
healthScore -= 5;
|
|
762
765
|
if (bounceRate > 8)
|
|
763
766
|
healthScore -= 30;
|
|
@@ -780,7 +783,7 @@ Return ONLY valid JSON (no markdown fences): { "topics": [{ "title": "...", "rat
|
|
|
780
783
|
estimatedRecovery = '7-14 days';
|
|
781
784
|
else if (bounceRate > 5 || complaintRate > 0.3)
|
|
782
785
|
estimatedRecovery = '5-7 days';
|
|
783
|
-
else if (
|
|
786
|
+
else if (spfFailed || dkimFailed)
|
|
784
787
|
estimatedRecovery = '2-3 days';
|
|
785
788
|
else if (bounceRate > 2)
|
|
786
789
|
estimatedRecovery = '3-5 days';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sendinel/mcp-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.60",
|
|
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",
|