MCP Server
The Mailrith Connector is available in Claude, and the same remote MCP server supports OAuth or protected server-side credentials for OpenAI, n8n, Pipedream, and other clients.
Official MCP Server
Mailrith provides an official remote MCP endpoint for agent runtimes that work better with tools than with raw HTTP calls. The MCP server exposes the public API as named tools that agents can inspect and call.
The remote endpoint is /mcp on the API origin. It accepts workspace API keys and OAuth access tokens, so workspace scope and permissions behave the same way as the REST API.
Use the MCP server when the agent platform supports MCP directly. Use the REST API or SDKs when you need a standard backend integration, custom retry behavior, or full control over how requests are built.
Every client uses the same server URL and sees the same reviewed focused-tool catalog. During OAuth, choose what the connection should do. Mailrith grants the matching permissions and checks them again when each tool runs.
- Choose OAuth for user-connected runtimes such as Claude Desktop. Create a workspace API key only for server-side runtimes that can safely store bearer credentials.
- Decide which Mailrith tools the agent is allowed to use. Keep the allowed tool list as small as possible.
- Configure the agent runtime to use
https://api.mailrith.com/mcp. If the runtime supports custom authorization headers, setAuthorization: Bearer <workspace_api_key_or_oauth_token>. - For OAuth, choose the Work Profile that matches the job on Mailrith's approval screen. Start with Reporting when the workflow only needs reads. If a later task needs another resource, reconnect from the agent app and choose the matching Work Profile.
- Test the workflow with a small prompt. Then check Mailrith and confirm the agent made only the expected actions.
- Add write tools only after the read flow works reliably.
- Grant only the resource permissions the connected agent needs. Mailrith checks the resource permission and workspace on every request, without adding a second action-approval step.
- Preferred transport: Streamable HTTP.
- Authentication: OAuth for Claude Desktop and other user-connected clients;
Authorization: Bearer <workspace_api_key_or_oauth_token>for code-first clients. - The hosted server exposes a fixed reviewed catalog of focused tools such as
subscribers_list,broadcasts_create,broadcasts_preflight, andbroadcasts_send. - Limit the tools exposed to an agent whenever the platform supports tool limits. A narrow toolset is easier to understand and safer to approve.
- Every submitted tool includes its exact input and output schema, OAuth permissions, and safety annotations.
OpenAI Responses API
OpenAI's MCP tool integration can connect directly to Mailrith's remote MCP server and use focused tools with exact schemas.
Use allowed_tools to keep only the focused tools needed for the job. A reporting workflow can keep capability, workspace, and Subscriber reads. A Broadcast preparation workflow can add sender, targeting, Template, draft, and preflight tools without enabling schedule or send.
Store the Mailrith API key in a server-side secret, and pass the key as an authorization header in the tool configuration.
import OpenAI from "openai";
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
});
const response = await openai.responses.create({
model: "gpt-5.1",
input: "List the newest subscribers and draft a re-engagement broadcast.",
tools: [
{
type: "mcp",
server_label: "mailrith",
server_url: "https://api.mailrith.com/mcp",
headers: {
Authorization: `Bearer ${process.env.MAILRITH_API_KEY}`,
},
allowed_tools: [
"discovery_get_capabilities",
"subscribers_list",
"sender_identities_list",
"segments_list",
"email_templates_list",
"broadcasts_create",
"broadcasts_preflight",
],
require_approval: {
always: {
read_only: false,
},
},
},
],
}); Claude Connector And Messages API
The Mailrith Connector is available in Claude's Connectors Directory. It uses OAuth, so users do not paste workspace API keys into Claude.
Code-first integrations that use the Claude Messages API can connect to the same remote MCP server with a task-specific Mailrith API key stored in a server-side secret manager.
On the Mailrith approval screen, check the requested permissions before approving. Mailrith grants the permissions requested by the connected app, so configure the connector or client to request only the scopes needed for its workflow.
Configure the connector with only the tools needed by the Claude workflow. Do not allow write or send tools for read-only workflows.
When troubleshooting permission errors, disconnect Mailrith and connect it again. Then confirm the connection requested the permissions required for the workflow. For example, drafting or activating a Sequence requires sequences:write, and inspecting templates requires email_templates:read.
- Open Claude or Claude Desktop, then open
Customize>Connectors. - Select the
+button, chooseBrowse connectors, and search forMailrith. - Choose
Mailrith, review its capabilities, and selectConnect. - Sign in to Mailrith, choose one workspace, review the requested permissions, and select
Allow Access. - Begin with a read-only request. Add write tools only when the task needs them, then confirm every change from the saved Mailrith resource or its progress endpoint.
const anthropicApiKey = process.env.ANTHROPIC_API_KEY;
const mailrithApiKey = process.env.MAILRITH_API_KEY;
if (!anthropicApiKey || !mailrithApiKey) {
throw new Error(
"Set ANTHROPIC_API_KEY and MAILRITH_API_KEY in the server's secret manager.",
);
}
const response = await fetch("https://api.anthropic.com/v1/messages", {
method: "POST",
headers: {
"content-type": "application/json",
"x-api-key": anthropicApiKey,
"anthropic-version": "2023-06-01",
"anthropic-beta": "mcp-client-2025-11-20",
},
body: JSON.stringify({
model: "claude-sonnet-4-6",
max_tokens: 1200,
messages: [
{
role: "user",
content: "List the newest subscribers and propose a broadcast.",
},
],
mcp_servers: [
{
type: "url",
url: "https://api.mailrith.com/mcp",
name: "mailrith",
authorization_token: mailrithApiKey,
},
],
tools: [
{
type: "mcp_toolset",
mcp_server_name: "mailrith",
default_config: { enabled: false },
configs: {
discovery_get_capabilities: { enabled: true },
subscribers_list: { enabled: true },
sender_identities_list: { enabled: true },
segments_list: { enabled: true },
email_templates_list: { enabled: true },
broadcasts_create: { enabled: true },
broadcasts_preflight: { enabled: true },
},
},
],
}),
});
if (!response.ok) {
throw new Error("Claude request failed with status " + response.status);
}
const result = await response.json();
// Pass result only to the authorized request handler.
// Never write Subscriber or Broadcast content to application logs. n8n And Pipedream
Workflow platforms usually provide MCP connection fields in a UI instead of a code-first SDK. Mailrith's remote server works with these clients by using a streamable HTTP URL and a Bearer token.
Store the Mailrith key in environment variables or in the platform's secret manager. Do not paste the raw key into step names, logs, shared screenshots, or exported workflow files.
Start with one low-risk tool, such as listing subscribers or reading workspace capabilities. Add write tools only after you confirm the workflow performs the expected actions.
Transport: Streamable HTTP
Server URL: https://api.mailrith.com/mcp
Authentication: Header
Header name: Authorization
Header value: Bearer {{$env.MAILRITH_API_KEY}} Server URL: https://api.mailrith.com/mcp
Authorization header: Bearer {{process.env.MAILRITH_API_KEY}}
Suggested tools: discovery_get_capabilities, workspace_get, subscribers_list, subscribers_get Need Help Shipping an Integration?
Reach the Mailrith team if you need help planning a sync, validating a webhook flow, or troubleshooting a request.