groundmail-mcp 0.5.6 → 0.5.8

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.
Files changed (2) hide show
  1. package/dist/index.js +26 -8
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -324,21 +324,28 @@ async function callMcpTool(client, name, args) {
324
324
  function formatToolError(error) {
325
325
  if (!error || typeof error !== "object") return "Request failed";
326
326
  const err = error;
327
- const lines = [typeof err.message === "string" && err.message ? err.message : "Request failed"];
327
+ const text = (value) => typeof value === "string" && value.trim() ? value.trim() : null;
328
+ const lines = [text(err.message) ?? "Request failed"];
328
329
  const code = typeof err.code === "string" && /^[a-z_]+$/.test(err.code) ? err.code : null;
329
330
  if (code) {
330
331
  const status = typeof err.status === "number" ? ` (HTTP ${err.status})` : "";
331
332
  lines.push(`code: ${code}${status}`);
332
333
  }
334
+ const requiredScope = text(err.requiredScope);
335
+ if (requiredScope) lines.push(`required scope: ${requiredScope}`);
333
336
  if (err.details !== void 0 && err.details !== null) {
334
337
  lines.push(`details: ${JSON.stringify(err.details)}`);
335
338
  }
336
- if (typeof err.upgradeUrl === "string" && err.upgradeUrl) {
337
- lines.push(`upgrade: https://app.groundmail.dev${err.upgradeUrl.startsWith("/") ? "" : "/"}${err.upgradeUrl}`);
338
- }
339
- if (code) {
340
- lines.push(`how to fix: https://docs.groundmail.dev/errors#${code}`);
339
+ const upgradeUrl = text(err.upgradeUrl);
340
+ if (upgradeUrl) {
341
+ lines.push(
342
+ `upgrade: ${/^https?:\/\//.test(upgradeUrl) ? upgradeUrl : `https://app.groundmail.dev${upgradeUrl.startsWith("/") ? "" : "/"}${upgradeUrl}`}`
343
+ );
341
344
  }
345
+ const hint = text(err.hint);
346
+ if (hint) lines.push(`hint: ${hint}`);
347
+ const docsUrl = text(err.docsUrl) ?? (code ? `https://docs.groundmail.dev/errors#${code}` : null);
348
+ if (docsUrl) lines.push(`how to fix: ${docsUrl}`);
342
349
  return lines.join("\n");
343
350
  }
344
351
  var paginationProps = {
@@ -596,7 +603,7 @@ function resolveApiKey() {
596
603
  }
597
604
 
598
605
  // src/server.ts
599
- var MCP_SERVER_VERSION = "0.5.6";
606
+ var MCP_SERVER_VERSION = "0.5.8";
600
607
  var MCP_SERVER_INSTRUCTIONS = [
601
608
  "Groundmail sends transactional email from domains the user has verified.",
602
609
  '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.',
@@ -639,6 +646,17 @@ var PROTECTED_RESOURCE_METADATA_PATHS = /* @__PURE__ */ new Set([
639
646
  `${PROTECTED_RESOURCE_METADATA_PATH}${MCP_HTTP_PATH}`
640
647
  ]);
641
648
  var DOCS_URL = "https://docs.groundmail.dev/ai/mcp";
649
+ var MCP_SCOPES_SUPPORTED = [
650
+ "full",
651
+ "emails:send",
652
+ "emails:read",
653
+ "domains:read",
654
+ "domains:write",
655
+ "webhooks:write",
656
+ "templates:write",
657
+ "suppressions:write",
658
+ "account:read"
659
+ ];
642
660
  function trimOrigin(origin) {
643
661
  return origin.replace(/\/$/, "");
644
662
  }
@@ -650,7 +668,7 @@ function buildProtectedResourceMetadata(origin) {
650
668
  resource_name: "Groundmail",
651
669
  resource_documentation: DOCS_URL,
652
670
  authorization_servers: [appOrigin.replace(/\/$/, "")],
653
- scopes_supported: ["full"],
671
+ scopes_supported: [...MCP_SCOPES_SUPPORTED],
654
672
  bearer_methods_supported: ["header"]
655
673
  };
656
674
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "groundmail-mcp",
3
- "version": "0.5.6",
3
+ "version": "0.5.8",
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",
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@modelcontextprotocol/sdk": "^1.30.0",
43
- "groundmail": "0.14.1"
43
+ "groundmail": "0.14.3"
44
44
  },
45
45
  "devDependencies": {
46
46
  "tsup": "^8.5.0",