@mailrith/mcp-server
Advanced tools
| export type MailrithMcpCliOptions = { | ||
| transport: "stdio" | "http"; | ||
| baseUrl?: string; | ||
| apiKey?: string; | ||
| host: string; | ||
| port: number; | ||
| }; | ||
| type MailrithMcpCliEnvironment = { | ||
| MAILRITH_API_KEY?: string; | ||
| }; | ||
| export declare const parseMailrithMcpCliOptions: (argv: string[], env?: MailrithMcpCliEnvironment) => MailrithMcpCliOptions; | ||
| export declare const requireMailrithMcpStdioCredential: (options: Pick<MailrithMcpCliOptions, "apiKey">) => void; | ||
| export {}; | ||
| //# sourceMappingURL=cli-options.d.ts.map |
| {"version":3,"file":"cli-options.d.ts","sourceRoot":"","sources":["../src/cli-options.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,EAAE,OAAO,GAAG,MAAM,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC/B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AASF,eAAO,MAAM,0BAA0B,GACrC,MAAM,MAAM,EAAE,EACd,MAAK,yBAAuC,KAC3C,qBAoDF,CAAC;AAEF,eAAO,MAAM,iCAAiC,GAC5C,SAAS,IAAI,CAAC,qBAAqB,EAAE,QAAQ,CAAC,SAO/C,CAAC"} |
| const resolveEnvironmentApiKey = (env) => { | ||
| const apiKey = env.MAILRITH_API_KEY?.trim(); | ||
| return apiKey ? apiKey : undefined; | ||
| }; | ||
| export const parseMailrithMcpCliOptions = (argv, env = process.env) => { | ||
| const environmentApiKey = resolveEnvironmentApiKey(env); | ||
| const options = { | ||
| transport: "stdio", | ||
| ...(environmentApiKey ? { apiKey: environmentApiKey } : {}), | ||
| host: "127.0.0.1", | ||
| port: 8788, | ||
| }; | ||
| for (let index = 0; index < argv.length; index += 1) { | ||
| const value = argv[index]; | ||
| const nextValue = argv[index + 1]; | ||
| if (!value?.startsWith("--")) { | ||
| continue; | ||
| } | ||
| if (value === "--transport" && nextValue) { | ||
| options.transport = nextValue === "http" ? "http" : "stdio"; | ||
| index += 1; | ||
| continue; | ||
| } | ||
| if (value === "--base-url" && nextValue) { | ||
| options.baseUrl = nextValue; | ||
| index += 1; | ||
| continue; | ||
| } | ||
| if (value === "--api-key" && nextValue) { | ||
| const apiKey = nextValue.trim(); | ||
| options.apiKey = apiKey ? apiKey : options.apiKey; | ||
| index += 1; | ||
| continue; | ||
| } | ||
| if (value === "--host" && nextValue) { | ||
| options.host = nextValue; | ||
| index += 1; | ||
| continue; | ||
| } | ||
| if (value === "--port" && nextValue) { | ||
| const parsed = Number(nextValue); | ||
| if (!Number.isNaN(parsed) && Number.isFinite(parsed)) { | ||
| options.port = parsed; | ||
| } | ||
| index += 1; | ||
| } | ||
| } | ||
| return options; | ||
| }; | ||
| export const requireMailrithMcpStdioCredential = (options) => { | ||
| if (!options.apiKey) { | ||
| throw new Error("Local stdio requires a Mailrith credential. Set MAILRITH_API_KEY in the client secret environment or pass --api-key."); | ||
| } | ||
| }; | ||
| //# sourceMappingURL=cli-options.js.map |
| {"version":3,"file":"cli-options.js","sourceRoot":"","sources":["../src/cli-options.ts"],"names":[],"mappings":"AAYA,MAAM,wBAAwB,GAAG,CAC/B,GAA8B,EAC9B,EAAE;IACF,MAAM,MAAM,GAAG,GAAG,CAAC,gBAAgB,EAAE,IAAI,EAAE,CAAC;IAC5C,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACrC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CACxC,IAAc,EACd,MAAiC,OAAO,CAAC,GAAG,EACrB,EAAE;IACzB,MAAM,iBAAiB,GAAG,wBAAwB,CAAC,GAAG,CAAC,CAAC;IACxD,MAAM,OAAO,GAA0B;QACrC,SAA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,CAAC,CAAC;YACX,SAAS;QACX,CAAC;QAED,IAAI,KAAK,KAAK,QAAQ,IAAI,SAAS,EAAE,CAAC;YACpC,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;YACjC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;gBACrD,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC;YACxB,CAAC;YACD,KAAK,IAAI,CAAC,CAAC;QACb,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAC/C,OAA8C,EAC9C,EAAE;IACF,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CACb,sHAAsH,CACvH,CAAC;IACJ,CAAC;AACH,CAAC,CAAC"} |
+13
-0
@@ -5,2 +5,8 @@ # Changelog | ||
| - Restore Full Email Marketing Access as the submitted OAuth bootstrap default | ||
| while keeping exact operation scopes on normal tools and exact call-time | ||
| authorization. | ||
| - Read `MAILRITH_API_KEY` in the local CLI and let the public API enforce | ||
| permissions for direct credential-backed runtimes that do not preload a | ||
| capability response. | ||
| - Route every permanent delete through `mailrith_delete`, including deletes that also require Perform Live Actions. | ||
@@ -10,2 +16,9 @@ - Use effective workspace capabilities for connection, operation-search, and exact-schema availability instead of checking permissions alone. | ||
| ## 1.0.0 - 2026-07-26 | ||
| - Make the fixed submitted profile the default hosted and package surface, with focused tools, exact input and output schemas, human-readable titles, explicit annotations, and per-tool OAuth scopes. | ||
| - Allow anonymous static discovery for platform linking while rejecting every anonymous tool call before product access. | ||
| - Return tool-level OAuth challenges for missing connections and narrow grants, and keep scoped API-key support for direct and code-first clients. | ||
| - Preserve the compact seven-tool and configurable focused profiles as explicit compatibility options. | ||
| ## 0.2.0 - 2026-07-24 | ||
@@ -12,0 +25,0 @@ |
+1
-1
| #!/usr/bin/env node | ||
| export {}; | ||
| export declare const runMailrithMcpCli: (argv?: string[]) => Promise<void>; | ||
| //# sourceMappingURL=cli.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""} | ||
| {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAmHA,eAAO,MAAM,iBAAiB,GAC5B,OAAM,MAAM,EAA0B,kBAcvC,CAAC"} |
+5
-45
| #!/usr/bin/env node | ||
| import http from "node:http"; | ||
| import { Readable } from "node:stream"; | ||
| import { parseMailrithMcpCliOptions, requireMailrithMcpStdioCredential, } from "./cli-options.js"; | ||
| import { handleMailrithMcpHttpRequest, runMailrithMcpStdioServer, } from "./index.js"; | ||
| const parseCliOptions = (argv) => { | ||
| const options = { | ||
| transport: "stdio", | ||
| host: "127.0.0.1", | ||
| port: 8788, | ||
| }; | ||
| for (let index = 0; index < argv.length; index += 1) { | ||
| const value = argv[index]; | ||
| const nextValue = argv[index + 1]; | ||
| if (!value?.startsWith("--")) { | ||
| continue; | ||
| } | ||
| if (value === "--transport" && nextValue) { | ||
| options.transport = nextValue === "http" ? "http" : "stdio"; | ||
| index += 1; | ||
| continue; | ||
| } | ||
| if (value === "--base-url" && nextValue) { | ||
| options.baseUrl = nextValue; | ||
| index += 1; | ||
| continue; | ||
| } | ||
| if (value === "--api-key" && nextValue) { | ||
| options.apiKey = nextValue; | ||
| index += 1; | ||
| continue; | ||
| } | ||
| if (value === "--host" && nextValue) { | ||
| options.host = nextValue; | ||
| index += 1; | ||
| continue; | ||
| } | ||
| if (value === "--port" && nextValue) { | ||
| const parsed = Number(nextValue); | ||
| if (!Number.isNaN(parsed) && Number.isFinite(parsed)) { | ||
| options.port = parsed; | ||
| } | ||
| index += 1; | ||
| } | ||
| } | ||
| return options; | ||
| }; | ||
| const hasRequestBody = (method) => method !== undefined && method !== "GET" && method !== "HEAD"; | ||
@@ -124,4 +83,4 @@ const toHeaders = (headers) => { | ||
| }; | ||
| const main = async () => { | ||
| const options = parseCliOptions(process.argv.slice(2)); | ||
| export const runMailrithMcpCli = async (argv = process.argv.slice(2)) => { | ||
| const options = parseMailrithMcpCliOptions(argv); | ||
| if (options.transport === "http") { | ||
@@ -131,2 +90,3 @@ await startHttpServer(options); | ||
| } | ||
| requireMailrithMcpStdioCredential(options); | ||
| await runMailrithMcpStdioServer({ | ||
@@ -137,3 +97,3 @@ baseUrl: options.baseUrl, | ||
| }; | ||
| await main(); | ||
| await runMailrithMcpCli(); | ||
| //# sourceMappingURL=cli.js.map |
+1
-1
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,GAC1B,MAAM,YAAY,CAAC;AAUpB,MAAM,eAAe,GAAG,CAAC,IAAc,EAAc,EAAE;IACrD,MAAM,OAAO,GAAe;QAC1B,SAAS,EAAE,OAAO;QAClB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,IAAI;KACX,CAAC;IAEF,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACpD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;QAC1B,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QAElC,IAAI,CAAC,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7B,SAAS;QACX,CAAC;QAED,IAAI,KAAK,KAAK,aAAa,IAAI,SAAS,EAAE,CAAC;YACzC,OAAO,CAAC,SAAS,GAAG,SAAS,KAAK,MAAM,C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ACd,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;QAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,EAAE,CAAC;IACJ,KAAK,EAAE,SAAS;QACd,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;QAClC,IAAI,EAAE,MAAM,CAAC;QACb,kBAAkB,EAAE,OAAO,CAAC;QAC5B,eAAe,EAAE,MAAM,CAAC;QACxB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,QAAQ,EAAE,SAAS,8BAA8B,EAAE,CAAC;QACpD,WAAW,EAAE;YACX,YAAY,EAAE,OAAO,CAAC;YACtB,eAAe,EAAE,OAAO,CAAC;YACzB,cAAc,EAAE,OAAO,CAAC;YACxB,aAAa,EAAE,OAAO,CAAC;SACxB,CAAC;QACF,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACrC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACtC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,EAAE,CAAC;IACJ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,gCAA6i47B,CAAC"} |
+35
-2
@@ -6,3 +6,9 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; | ||
| import * as z from "zod/v4"; | ||
| import { generatedMailrithMcpToolManifest } from "./generated-tool-manifest.js"; | ||
| export { generatedMailrithMcpToolManifest }; | ||
| export declare const mailrithMcpMaxAnonymousBatchItems = 1; | ||
| export declare const mailrithMcpMaxAuthenticatedBatchItems = 25; | ||
| type MailrithFetch = typeof fetch; | ||
| export declare const mailrithMcpProfileKeys: readonly ["submitted", "compact", "custom"]; | ||
| export type MailrithMcpProfile = (typeof mailrithMcpProfileKeys)[number]; | ||
| export type MailrithMcpServerOptions = { | ||
@@ -18,2 +24,8 @@ baseUrl?: string; | ||
| capabilityContext?: MailrithMcpCapabilityContext; | ||
| /** | ||
| * `submitted` is the fixed public catalog used by listed platforms. | ||
| * `compact` preserves the legacy seven routing tools. | ||
| * `custom` exposes generated focused tools with caller-configured filters. | ||
| */ | ||
| profile?: MailrithMcpProfile; | ||
| }; | ||
@@ -38,2 +50,3 @@ export type MailrithMcpCapabilityLimitation = { | ||
| name: string; | ||
| title: string; | ||
| operation: MailrithSdkOperationDescriptor; | ||
@@ -51,2 +64,8 @@ description: string; | ||
| }; | ||
| securitySchemes: readonly [ | ||
| { | ||
| type: "oauth2"; | ||
| scopes: readonly string[]; | ||
| } | ||
| ]; | ||
| meta: Record<string, unknown>; | ||
@@ -60,2 +79,3 @@ invoke: (args?: Record<string, unknown>) => Promise<{ | ||
| isError?: boolean; | ||
| _meta?: Record<string, unknown>; | ||
| }>; | ||
@@ -83,4 +103,18 @@ }; | ||
| }; | ||
| export declare const mailrithSubmittedMcpToolNames: ("discovery_get_metadata" | "discovery_get_capabilities" | "discovery_get_open_api_document" | "workspace_get" | "sender_identities_list" | "sender_identities_get" | "email_delivery_connections_list" | "email_delivery_connections_start_setup" | "email_delivery_connections_get_setup" | "email_delivery_connections_renew_setup" | "email_delivery_connections_get" | "email_delivery_connections_update" | "email_delivery_connections_update_status" | "email_delivery_connections_verify" | "email_delivery_connections_send_test" | "email_delivery_connections_delete" | "analytics_create_report" | "analytics_get_report" | "diagnostics_list_automation_runs" | "diagnostics_get_automation_run" | "diagnostics_get_sequence" | "diagnostics_get_broadcast" | "diagnostics_get_subscriber" | "subscribers_list" | "subscribers_get" | "subscribers_upsert" | "subscribers_update" | "subscribers_delete" | "subscribers_update_status" | "subscribers_add_tag" | "subscribers_remove_tag" | "subscribers_add_to_sequence" | "subscribers_remove_from_sequence" | "tags_list" | "tags_create" | "tags_get" | "tags_update" | "tags_delete" | "custom_fields_list" | "custom_fields_create" | "custom_fields_get" | "custom_fields_update" | "custom_fields_delete" | "email_templates_list" | "email_templates_create" | "email_templates_get" | "email_templates_preview" | "email_templates_update" | "email_templates_delete" | "starting_points_list_email_templates" | "starting_points_get_email_template" | "starting_points_list_forms" | "starting_points_get_form" | "starting_points_list_landing_pages" | "starting_points_get_landing_page" | "forms_list" | "forms_create" | "forms_get" | "forms_list_submissions" | "forms_get_submission" | "forms_preview_double_opt_in" | "forms_update" | "forms_delete" | "landing_pages_list" | "landing_pages_create" | "landing_pages_get" | "landing_pages_list_submissions" | "landing_pages_get_submission" | "landing_pages_preview_double_opt_in" | "landing_pages_update" | "landing_pages_delete" | "sequences_list" | "sequences_create" | "sequences_get" | "sequences_preflight" | "sequences_preview_journey" | "sequences_send_test" | "sequences_update" | "sequences_update_status" | "sequences_delete" | "automations_list" | "automations_create" | "automations_get" | "automations_preflight" | "automations_preview_journey" | "automations_send_test" | "automations_update" | "automations_update_status" | "automations_delete" | "magic_links_list" | "magic_links_create" | "magic_links_get" | "magic_links_update" | "magic_links_delete" | "broadcasts_list" | "broadcasts_create" | "broadcasts_get_send_progress" | "broadcasts_list_delivery_errors" | "broadcasts_get" | "broadcasts_update" | "broadcasts_delete" | "broadcasts_preflight" | "broadcasts_schedule" | "broadcasts_unschedule" | "broadcasts_send" | "broadcasts_cancel" | "broadcasts_send_test" | "segments_list" | "segments_create" | "segments_get" | "segments_update" | "segments_delete" | "segments_preview" | "webhook_subscriptions_list" | "webhook_subscriptions_create" | "webhook_subscriptions_get" | "webhook_subscriptions_update" | "webhook_subscriptions_delete" | "webhook_subscriptions_rotate_secret" | "jobs_start_import_upload" | "jobs_get_import_upload" | "jobs_list_imports" | "jobs_create_import" | "jobs_get_import" | "jobs_list_exports" | "jobs_create_export" | "jobs_get_export")[]; | ||
| export declare const mailrithSubmittedMcpOperationOAuthScopes: ("analytics:read" | "live_actions:write" | "subscribers:read" | "subscribers:write" | "subscribers:import" | "subscribers:export" | "segments:read" | "segments:write" | "tags:read" | "tags:write" | "forms:read" | "forms:write" | "form_submissions:read" | "landing_pages:read" | "landing_pages:write" | "landing_page_submissions:read" | "broadcasts:read" | "broadcasts:write" | "sequences:read" | "sequences:write" | "magic_links:read" | "magic_links:write" | "automations:read" | "automations:write" | "workspace:read" | "email_delivery_connections:read" | "email_delivery_connections:write" | "email_templates:read" | "email_templates:write" | "custom_fields:read" | "custom_fields:write" | "webhooks:read" | "webhooks:write")[]; | ||
| /** | ||
| * The capability tool is the submitted profile's OAuth bootstrap. Requesting | ||
| * the complete public scope catalog lets Mailrith present every Work Profile | ||
| * and default a general-purpose connection to Full Email Marketing Access. | ||
| * Consent still grants only the profile or custom permissions the user | ||
| * approves, and every other submitted tool advertises its exact operation | ||
| * scopes for focused linking and step-up authorization. | ||
| */ | ||
| export declare const mailrithSubmittedMcpOAuthScopes: ("analytics:read" | "live_actions:write" | "subscribers:read" | "subscribers:write" | "subscribers:import" | "subscribers:export" | "segments:read" | "segments:write" | "tags:read" | "tags:write" | "forms:read" | "forms:write" | "form_submissions:read" | "landing_pages:read" | "landing_pages:write" | "landing_page_submissions:read" | "broadcasts:read" | "broadcasts:write" | "sequences:read" | "sequences:write" | "magic_links:read" | "magic_links:write" | "automations:read" | "automations:write" | "workspace:read" | "email_delivery_connections:read" | "email_delivery_connections:write" | "email_templates:read" | "email_templates:write" | "custom_fields:read" | "custom_fields:write" | "webhooks:read" | "webhooks:write")[]; | ||
| export declare const parseMailrithMcpCapabilityContext: (value: unknown) => MailrithMcpCapabilityContext | null; | ||
| export declare const createMailrithMcpToolDefinitions: (client: MailrithClient, options?: Pick<MailrithMcpServerOptions, "grantedScopes" | "enabledToolsets" | "readOnly">) => MailrithMcpToolDefinition[]; | ||
| export declare const createMailrithMcpToolDefinitions: (client: MailrithClient, options?: Pick<MailrithMcpServerOptions, "grantedScopes" | "enabledToolsets" | "readOnly" | "capabilityContext" | "baseUrl" | "apiKey"> & { | ||
| profile?: "submitted" | "custom"; | ||
| enforceRuntimeAuthorization?: boolean; | ||
| }) => MailrithMcpToolDefinition[]; | ||
| type MailrithCompactToolDefinition = { | ||
@@ -110,3 +144,2 @@ name: string; | ||
| export declare const handleMailrithMcpHttpRequest: (request: Request, options?: MailrithMcpServerOptions) => Promise<Response>; | ||
| export {}; | ||
| //# sourceMappingURL=index.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,OAAO,EAKL,KAAK,IAAI,EACV,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAiBL,KAAK,sBAAsB,EAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAML,KAAK,cAAc,EAGnB,KAAK,8BAA8B,EACpC,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAW5B,KAAK,aAAa,GAAG,OAAO,KAAK,CAAC;AAElC,MAAM,MAAM,wBAAwB,GAAG;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,eAAe,CAAC,EAAE,SAAS,sBAAsB,EAAE,CAAC;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,iBAAiB,CAAC,EAAE,4BAA4B,CAAC;CAClD,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1C,CAAC;AAEF,MAAM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E,iBAAiB,GAAG,UAAU,CAAC;;;CAQvE,CAAC;AAEH,eAAO,MAAM,uBAAuB,GAClC,UAAS,wBAA6B,cAqLvC,CAAC;AAEF,eAAO,MAAM,yBAAyB,GACpC,UAAS,wBAA6B,uBAMvC,CAAC;AAEF,eAAO,MAAM,4BAA4B,GACvC,SAAS,OAAO,EAChB,UAAS,wBAA6B,sBAiMvC,CAAC"} |
+3
-3
| { | ||
| "name": "@mailrith/mcp-server", | ||
| "version": "0.2.0", | ||
| "version": "1.0.0", | ||
| "description": "Official local and self-hosted MCP server for Mailrith.", | ||
@@ -42,4 +42,4 @@ "license": "MIT", | ||
| "zod": "^4.1.12", | ||
| "@mailrith/public-api": "^0.2.0", | ||
| "@mailrith/sdk": "^0.2.0" | ||
| "@mailrith/sdk": "^1.0.0", | ||
| "@mailrith/public-api": "^1.0.0" | ||
| }, | ||
@@ -46,0 +46,0 @@ "devDependencies": { |
+55
-30
@@ -17,4 +17,8 @@ # Mailrith MCP Server | ||
| selected workspace, but not billing, team, account-security, | ||
| credential-reading, or internal administration. A client can deliberately | ||
| select a focused Work Profile or read-only mode for a narrower connection. | ||
| credential-reading, or internal administration. The | ||
| `discovery_get_capabilities` connection check requests the complete public | ||
| permission catalog so Mailrith can show every Work Profile and default to Full | ||
| Email Marketing Access. The user can choose Reporting, another focused Work | ||
| Profile, or custom permissions instead. OAuth stores only the permissions the | ||
| user approves, and every tool checks those permissions again when it runs. | ||
@@ -25,34 +29,55 @@ ```bash | ||
| The server exposes seven stable tools: | ||
| Local stdio and self-hosted HTTP use `MAILRITH_API_KEY` automatically. An | ||
| explicit `--api-key` value takes precedence. Keep either value in the client | ||
| secret store or process environment; never put it in a committed configuration | ||
| file. Local stdio stops with a clear setup error when neither value is present | ||
| because it has no browser-based OAuth flow. | ||
| - `mailrith_check_connection` | ||
| - `mailrith_search_operations` | ||
| - `mailrith_get_operation` | ||
| - `mailrith_read` | ||
| - `mailrith_write` | ||
| - `mailrith_delete` | ||
| - `mailrith_live` | ||
| The default `submitted` profile exposes a fixed reviewed catalog of focused | ||
| tools such as: | ||
| Search first, load one exact operation schema, then use the matching execution | ||
| tool. This keeps the initial agent context small while every operation remains | ||
| validated against the generated public contract. Search understands common | ||
| product wording, singular and plural resource names, and normal action words. | ||
| When several operations are equally plausible, the result is marked as | ||
| ambiguous so the agent can narrow the request before it executes anything. | ||
| - `subscribers_list` | ||
| - `broadcasts_create` | ||
| - `broadcasts_preflight` | ||
| - `broadcasts_schedule` | ||
| - `broadcasts_send` | ||
| - `sequences_update_status` | ||
| - `automations_update_status` | ||
| Availability is based on the authenticated workspace's effective capability | ||
| response, not permissions alone. Search, exact schema lookup, and connection | ||
| diagnosis report when the current plan, workspace limit, email delivery | ||
| connection, active toolset, read-only setting, or rollout state prevents an | ||
| otherwise permitted operation. Operations outside the active Work Profile or a | ||
| read-only connection remain searchable so an agent can explain the missing | ||
| access, but execution stays blocked. Actionable setup links are returned when | ||
| the capability response provides one. | ||
| Every submitted tool has a human-readable title, a narrow description, exact | ||
| input and output schemas, explicit safety annotations, and machine-readable | ||
| operation permissions. Tools other than the connection check advertise their | ||
| exact OAuth permissions. The connection check advertises the complete | ||
| permission catalog so OAuth can offer every Work Profile; its result still | ||
| reports the exact permissions granted to the connection. The catalog stays the | ||
| same for every user so clients can review and select tools reliably. Workspace | ||
| role, plan, product readiness, and granted permissions are enforced when a tool | ||
| runs. | ||
| `mailrith_get_operation` returns the exact input schema by default. Set | ||
| `include_output_schema` to `true` for the one operation whose result contract | ||
| the agent needs; this avoids loading every output schema into context. | ||
| Anonymous clients may initialize and list this static catalog so ChatGPT and | ||
| other hosts can start OAuth linking. Anonymous tool calls never reach the | ||
| Mailrith product API and return HTTP `401` with a standards-based | ||
| `WWW-Authenticate` challenge instead. Authenticated calls that need more | ||
| permissions return HTTP `403` with the complete replacement permission set. | ||
| Single-tool responses also include MCP's tool-level OAuth challenge metadata | ||
| for clients that use it when linking or reconnecting an account. | ||
| Each anonymous HTTP request accepts one JSON-RPC message. Authenticated | ||
| requests may batch up to 25 messages. These limits keep discovery and tool | ||
| responses predictable for every connected workspace. | ||
| Permanent deletion always uses `mailrith_delete`. A delete may still require | ||
| Perform Live Actions access when it removes a public or externally connected | ||
| resource; the operation schema lists every required permission. | ||
| Automation reads never return saved webhook bearer tokens or custom header | ||
| values. They return only whether each value is configured. If a client reads | ||
| an Automation and sends the redacted definition back during an update, | ||
| Mailrith preserves the existing values unless the client explicitly replaces | ||
| or removes them. Changing the webhook destination requires new credential | ||
| values so an old secret cannot be carried to another service. | ||
| The package also preserves two explicit compatibility profiles: | ||
| - `compact` exposes the earlier seven discovery and routing tools. | ||
| - `custom` exposes generated focused tools with caller-selected Work Profile, | ||
| permission, and read-only filters. | ||
| Use these profiles only for local or purpose-built clients. Public ChatGPT, | ||
| Codex, Claude, and Cursor packages use the fixed `submitted` profile at the | ||
| single `/mcp` endpoint. |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
2399011
1.8%24
20%6153
7.8%0
-100%82
43.86%9
-10%2
100%+ Added
+ Added
- Removed
- Removed
Updated
Updated