groundmail-mcp 0.17.1 → 0.19.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/dist/index.js +65 -18
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -130,6 +130,23 @@ function heldBackItem() {
|
|
|
130
130
|
["email", "reason"]
|
|
131
131
|
);
|
|
132
132
|
}
|
|
133
|
+
var nullableBoolean = (description) => ({ type: ["boolean", "null"], description });
|
|
134
|
+
var emailDelivery = {
|
|
135
|
+
...object(
|
|
136
|
+
{
|
|
137
|
+
receiving_server: nullableString("Hostname of the recipient's mail server, e.g. gmail-smtp-in.l.google.com"),
|
|
138
|
+
response: nullableString(
|
|
139
|
+
"Its exact SMTP reply to the latest attempt that finished: 250 \u2026 when it accepted the email, 5xx \u2026 when it refused it"
|
|
140
|
+
),
|
|
141
|
+
tls: nullableBoolean("Whether the connection used TLS; null when the attempt did not say"),
|
|
142
|
+
deferred_response: nullableString("Its reply to the latest deferral (a 4xx such as greylisting; delivery is retried); null when none"),
|
|
143
|
+
deferred_at: nullableString("When the latest deferral happened (ISO 8601)")
|
|
144
|
+
},
|
|
145
|
+
["receiving_server", "response", "tls", "deferred_response", "deferred_at"]
|
|
146
|
+
),
|
|
147
|
+
type: ["object", "null"],
|
|
148
|
+
description: "What the recipient's mail server said about the latest delivery attempt. Null until an attempt reports one, and for test emails. delivered_at minus created_at is how long it took to land"
|
|
149
|
+
};
|
|
133
150
|
var emailItem = object(
|
|
134
151
|
{
|
|
135
152
|
id: string("Email id (msg_\u2026)"),
|
|
@@ -147,6 +164,7 @@ var emailItem = object(
|
|
|
147
164
|
enum: ["hard", "block", null],
|
|
148
165
|
description: "Why it bounced: hard (address cannot receive; suppressed) or block (the receiving server refused the sender for reputation or policy; address not suppressed, safe to retry later). Null if it did not bounce"
|
|
149
166
|
},
|
|
167
|
+
delivery: emailDelivery,
|
|
150
168
|
held_back: arrayOf(
|
|
151
169
|
heldBackItem(),
|
|
152
170
|
"Recipients Groundmail validation held back before sending, with why; empty when none were"
|
|
@@ -459,7 +477,7 @@ var migrationOutput = object(
|
|
|
459
477
|
object(
|
|
460
478
|
{
|
|
461
479
|
id: string("Import id"),
|
|
462
|
-
provider: string("sendgrid, postmark or
|
|
480
|
+
provider: string("sendgrid, postmark, mailgun, resend or ses"),
|
|
463
481
|
dry_run: boolean("True for a preview: nothing was written"),
|
|
464
482
|
status: string("completed, partial (some items failed, each listed), failed, or in_progress"),
|
|
465
483
|
started_at: string("When the import started (ISO 8601)"),
|
|
@@ -1053,23 +1071,48 @@ async function callMcpTool(client, name, args) {
|
|
|
1053
1071
|
}
|
|
1054
1072
|
case "import_from_provider": {
|
|
1055
1073
|
const provider = optString(args, "provider");
|
|
1056
|
-
if (provider !== "sendgrid" && provider !== "postmark" && provider !== "mailgun") {
|
|
1057
|
-
return textResult("Missing or unknown provider: use sendgrid, postmark or
|
|
1074
|
+
if (provider !== "sendgrid" && provider !== "postmark" && provider !== "mailgun" && provider !== "resend" && provider !== "ses") {
|
|
1075
|
+
return textResult("Missing or unknown provider: use sendgrid, postmark, mailgun, resend or ses", true);
|
|
1058
1076
|
}
|
|
1059
|
-
const apiKey = optString(args, "api_key");
|
|
1060
|
-
if (!apiKey) return textResult("Missing required argument: api_key (the key of the account to import from)", true);
|
|
1061
|
-
const region = optString(args, "region");
|
|
1062
1077
|
const resources = optStringArray(args, "resources");
|
|
1063
1078
|
const cursor = optString(args, "cursor");
|
|
1064
|
-
const
|
|
1065
|
-
provider,
|
|
1066
|
-
api_key: apiKey,
|
|
1067
|
-
...optString(args, "account_api_key") ? { account_api_key: optString(args, "account_api_key") } : {},
|
|
1068
|
-
...region === "us" || region === "eu" ? { region } : {},
|
|
1079
|
+
const common = {
|
|
1069
1080
|
...resources?.length ? { resources } : {},
|
|
1070
1081
|
...optBoolean(args, "dry_run") ? { dry_run: true } : {},
|
|
1071
1082
|
...cursor ? { cursor } : {}
|
|
1072
1083
|
};
|
|
1084
|
+
let params;
|
|
1085
|
+
if (provider === "ses") {
|
|
1086
|
+
const accessKeyId = optString(args, "aws_access_key_id");
|
|
1087
|
+
const secret = optString(args, "aws_secret_access_key");
|
|
1088
|
+
const awsRegion = optString(args, "aws_region");
|
|
1089
|
+
if (!accessKeyId || !secret || !awsRegion) {
|
|
1090
|
+
return textResult(
|
|
1091
|
+
"Amazon SES needs aws_access_key_id, aws_secret_access_key and aws_region (one region per import), from an IAM user or role with the read-only import policy: https://docs.groundmail.dev/migrations#amazon-ses-iam-policy",
|
|
1092
|
+
true
|
|
1093
|
+
);
|
|
1094
|
+
}
|
|
1095
|
+
const sessionToken = optString(args, "aws_session_token");
|
|
1096
|
+
params = {
|
|
1097
|
+
provider,
|
|
1098
|
+
aws_access_key_id: accessKeyId,
|
|
1099
|
+
aws_secret_access_key: secret,
|
|
1100
|
+
...sessionToken ? { aws_session_token: sessionToken } : {},
|
|
1101
|
+
aws_region: awsRegion,
|
|
1102
|
+
...common
|
|
1103
|
+
};
|
|
1104
|
+
} else {
|
|
1105
|
+
const apiKey = optString(args, "api_key");
|
|
1106
|
+
if (!apiKey) return textResult("Missing required argument: api_key (the key of the account to import from)", true);
|
|
1107
|
+
const region = optString(args, "region");
|
|
1108
|
+
params = {
|
|
1109
|
+
provider,
|
|
1110
|
+
api_key: apiKey,
|
|
1111
|
+
...optString(args, "account_api_key") ? { account_api_key: optString(args, "account_api_key") } : {},
|
|
1112
|
+
...region === "us" || region === "eu" ? { region } : {},
|
|
1113
|
+
...common
|
|
1114
|
+
};
|
|
1115
|
+
}
|
|
1073
1116
|
return textResult({ migration: await client.migrations.run(params) });
|
|
1074
1117
|
}
|
|
1075
1118
|
case "get_import_report": {
|
|
@@ -1239,7 +1282,7 @@ var MCP_TOOLS = [
|
|
|
1239
1282
|
},
|
|
1240
1283
|
{
|
|
1241
1284
|
name: "get_email",
|
|
1242
|
-
description: "Get a single email by public id (msg_\u2026).",
|
|
1285
|
+
description: "Get a single email by public id (msg_\u2026): its status, and in delivery the recipient's mail server, its exact reply (250 \u2026 when accepted, 5xx \u2026 when refused), TLS and the latest deferral. delivered_at minus created_at is how long it took to land.",
|
|
1243
1286
|
inputSchema: {
|
|
1244
1287
|
type: "object",
|
|
1245
1288
|
properties: {
|
|
@@ -1781,17 +1824,21 @@ var MCP_TOOLS = [
|
|
|
1781
1824
|
},
|
|
1782
1825
|
{
|
|
1783
1826
|
name: "import_from_provider",
|
|
1784
|
-
description: "Beta. Import templates, suppressions (bounces, complaints, unsubscribes), sending domains and webhooks from SendGrid, Postmark or
|
|
1827
|
+
description: "Beta. Import templates, suppressions (bounces, complaints, unsubscribes), sending domains and webhooks from SendGrid, Postmark, Mailgun, Resend or Amazon SES into Groundmail. Ask the user for their provider API key (Resend: a Full access key; Amazon SES: an access key with the read-only import policy, and the region); it is used for this import only and never stored, so do not write it to a file. Run with dry_run first to show the user what will be imported. Imported webhooks start disabled; Amazon SES has no webhooks, so its configuration sets are reported in the notes instead. Templates that use logic Groundmail does not convert are imported as drafts. The result includes what needs attention, the code change, and a prompt for making it.",
|
|
1785
1828
|
inputSchema: {
|
|
1786
1829
|
type: "object",
|
|
1787
1830
|
properties: {
|
|
1788
|
-
provider: { type: "string", enum: ["sendgrid", "postmark", "mailgun"], description: "Provider to import from" },
|
|
1831
|
+
provider: { type: "string", enum: ["sendgrid", "postmark", "mailgun", "resend", "ses"], description: "Provider to import from (ses = Amazon SES)" },
|
|
1789
1832
|
api_key: {
|
|
1790
1833
|
type: "string",
|
|
1791
|
-
description: "SendGrid API key, Postmark server API token,
|
|
1834
|
+
description: "Not for ses. SendGrid API key, Postmark server API token, Mailgun private API key (read access is enough), or a Resend API key with Full access"
|
|
1792
1835
|
},
|
|
1793
1836
|
account_api_key: { type: "string", description: "Postmark only: account API token, needed to import sending domains" },
|
|
1794
1837
|
region: { type: "string", enum: ["us", "eu"], description: "SendGrid and Mailgun: eu for EU-region accounts (default us)" },
|
|
1838
|
+
aws_access_key_id: { type: "string", description: "Amazon SES only: access key ID of an IAM user or role with the read-only import policy" },
|
|
1839
|
+
aws_secret_access_key: { type: "string", description: "Amazon SES only: the secret access key" },
|
|
1840
|
+
aws_session_token: { type: "string", description: "Amazon SES only, temporary credentials: the session token" },
|
|
1841
|
+
aws_region: { type: "string", description: "Amazon SES only: the region to import, such as us-east-1. One region per import" },
|
|
1795
1842
|
resources: {
|
|
1796
1843
|
type: "array",
|
|
1797
1844
|
items: { type: "string", enum: ["domains", "webhooks", "templates", "suppressions"] },
|
|
@@ -1800,7 +1847,7 @@ var MCP_TOOLS = [
|
|
|
1800
1847
|
dry_run: { type: "boolean", description: "Preview without writing anything" },
|
|
1801
1848
|
cursor: { type: "string", description: "next_cursor from an import that stopped early, to continue it" }
|
|
1802
1849
|
},
|
|
1803
|
-
required: ["provider"
|
|
1850
|
+
required: ["provider"]
|
|
1804
1851
|
},
|
|
1805
1852
|
outputSchema: migrationOutput,
|
|
1806
1853
|
// Re-running skips what already exists, so it is safe to repeat.
|
|
@@ -1814,7 +1861,7 @@ var MCP_TOOLS = [
|
|
|
1814
1861
|
},
|
|
1815
1862
|
{
|
|
1816
1863
|
name: "get_import_report",
|
|
1817
|
-
description: "Beta. The stored report of an import from SendGrid, Postmark or
|
|
1864
|
+
description: "Beta. The stored report of an import from SendGrid, Postmark, Mailgun, Resend or Amazon SES: what was imported, skipped and failed, the DNS changes per domain, what still needs doing, the code change and a prompt for it. Pass the import id, or omit it for the latest import. Previews are not stored.",
|
|
1818
1865
|
inputSchema: {
|
|
1819
1866
|
type: "object",
|
|
1820
1867
|
properties: {
|
|
@@ -1884,7 +1931,7 @@ function resolveApiKey() {
|
|
|
1884
1931
|
}
|
|
1885
1932
|
|
|
1886
1933
|
// src/server.ts
|
|
1887
|
-
var MCP_SERVER_VERSION = "0.
|
|
1934
|
+
var MCP_SERVER_VERSION = "0.19.0";
|
|
1888
1935
|
var MCP_SERVER_INSTRUCTIONS = [
|
|
1889
1936
|
"Groundmail sends transactional email from domains the user has verified.",
|
|
1890
1937
|
'To test before a domain is verified, call send_email with from "noreply@mail.groundmail.dev" and to set to the Groundmail account email; sandbox sends to any other address are rejected.',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "groundmail-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"mcpName": "io.github.Groundmail/groundmail",
|
|
5
5
|
"description": "Groundmail MCP server: send transactional email, manage domains, templates, webhooks and suppressions from Claude, Cursor, ChatGPT and other MCP clients",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@modelcontextprotocol/sdk": "^1.32.1",
|
|
44
|
-
"groundmail": "0.
|
|
44
|
+
"groundmail": "0.31.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"tsup": "^8.5.0",
|