Connect Flexmail to Claude: Send Emails and Track Performance
from the team behind Truto
Flexmail in Claude, in about a minute.
The best way to connect Flexmail to Claude is Elaichi: connect Flexmail to Elaichi once, then add Elaichi to Claude as a connector. Two steps, about a minute, with a 14‑day free trial and no credit card required.
- No credit card required
- 500+ connectors
- Credentials vaulted, never read back
-
Start your free trial
14 days free, no credit card required.
-
Connect Flexmail
Once, in Elaichi. Claude never gets more access than you have.
-
Add Elaichi to Claude
In Claude, open Customize, then Connectors, press Add and paste the URL. Sign in and approve.
https://api.elaichi.ai/mcp
Building Flexmail into your own product? This guide is for you.
Connect Flexmail to Claude via Truto's managed MCP server. This guide details dynamic tool generation, how to map email schemas, handle Flexmail's specific domain verification logic, and execute complex workflows directly from Claude Desktop.
The developer guide
Learn how to connect Flexmail to Claude using Truto's managed MCP server. Execute email campaigns, track delivery stats, and manage sender domains via AI.
If your team needs to connect Flexmail to Claude to automate email marketing operations, manage sender identities, or analyze delivery statistics, you need a Model Context Protocol (MCP) server. This server acts as the translation layer between Claude's natural language tool calls and Flexmail's strict REST APIs. You can either build and maintain this infrastructure yourself, or use a managed integration platform like Truto to dynamically generate a secure, authenticated MCP server URL. If your team uses ChatGPT, check out our guide on connecting Flexmail to ChatGPT or explore our broader architectural overview on connecting Flexmail to AI Agents.
Giving a Large Language Model (LLM) read and write access to a production email sending platform like Flexmail is a serious engineering challenge. You have to handle strict API token lifecycles, map nested JSON schemas to MCP tool definitions, and deal with Flexmail's specific domain verification state machines. Every time Flexmail updates an endpoint or changes a delivery status flag, you have to update your server code, redeploy, and test the integration.
This guide breaks down exactly how to use Truto to generate a secure, managed MCP server for Flexmail, connect it natively to Claude Desktop, and execute complex email delivery workflows using natural language.
The Engineering Reality of the Flexmail API
A custom MCP server is a self-hosted integration layer. While the open MCP standard provides a predictable way for models to discover tools, the reality of implementing it against a highly stateful API like Flexmail is painful. Flexmail is built for enterprise volume, enforcing strict rules around sender identities, bounce handling, and asynchronous event reporting.
If you decide to build a custom MCP server for Flexmail, you own the entire API lifecycle. Here are the specific challenges you will face:
Sender Identity and Verification States
You cannot simply hit a POST /messages endpoint and expect an email to send. Flexmail requires all senders to operate from a verified domain with proper SPF, DKIM, and DMARC alignment. An LLM has no concept of this lifecycle. If you expose raw endpoints, Claude might attempt to send an email from an unverified address, leading to persistent 403 or 400 errors. Your MCP layer must provide structured tools like create_a_flexmail_sender and handle the subsequent verification state polling so the model understands why a message cannot be sent immediately.
Asynchronous Event Tracking vs LLM Context
Flexmail's /stats endpoint provides aggregated data that updates at intervals - it is not real-time. If you want granular, real-time data on soft bounces, hard bounces, or link clicks, you must rely on Flexmail's webhooks. Webhooks require a publicly accessible receiver, meaning your MCP server must spin up listener endpoints, ingest payload data, and somehow store it in a way the LLM can query later. Worse, Flexmail automatically disables any webhook after 10 failed delivery attempts, meaning your MCP architecture requires health-checking mechanisms.
Factual Note on Rate Limits
When dealing with bulk email APIs, rate limiting is a constant hurdle. Truto does not retry, throttle, or apply backoff on rate limit errors. When Flexmail returns an HTTP 429, Truto passes that error directly to the caller. Truto normalizes upstream rate limit info into standardized headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset) per the IETF spec. The caller (Claude Desktop or your custom agent framework) is entirely responsible for interpreting these headers and executing the appropriate retry and backoff logic.
Generating the Truto MCP Server for Flexmail
Truto eliminates the need to manually code tool schemas for Flexmail. Instead of hand-coding OpenAPI-to-MCP mappings, Truto's integration engine derives tools dynamically from the integration's resource configurations and documentation records.
Each generated MCP server is scoped to a single integrated account. The URL contains a cryptographic token that routes requests securely without requiring the client to handle OAuth exchanges.
There are two ways to create this MCP server: via the Truto dashboard or programmatically via the API.
Method 1: Creating via the Truto UI
For teams who want immediate access to Flexmail inside Claude Desktop, the dashboard is the fastest route:
- Log into your Truto dashboard and navigate to the Integrated Accounts section.
- Select your connected Flexmail account.
- Click on the MCP Servers tab.
- Click Create MCP Server.
- You will be prompted to configure the server. You can limit the server to specific operations (e.g., selecting only
readmethods) or specify tool tags to restrict access. - Click Generate and copy the resulting MCP Server URL (e.g.,
https://api.truto.one/mcp/a1b2c3d4e5f6...).
Method 2: Creating via the Truto API
For platform engineers embedding AI capabilities into their own infrastructure, you can generate MCP servers programmatically. This is useful for spinning up ephemeral MCP URLs scoped to individual user sessions.
Send a POST request to /integrated-account/:id/mcp with your configuration payload.
// Example: Creating a read-only MCP server for Flexmail
const response = await fetch('https://api.truto.one/integrated-account/<FLEXMAIL_ACCOUNT_ID>/mcp', {
method: 'POST',
headers: {
'Authorization': 'Bearer <YOUR_TRUTO_API_KEY>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: "Flexmail Analytics Agent",
config: {
methods: ["read"], // Restricts Claude to GET/LIST endpoints
tags: ["reporting"]
},
expires_at: "2026-12-31T23:59:59Z"
})
});
const data = await response.json();
console.log(data.url); // https://api.truto.one/mcp/...The Truto API validates that Flexmail has tools available, generates a random hex string, hashes it with HMAC, stores the metadata in a distributed KV store for low-latency routing, and returns the ready-to-use URL.
Connecting the MCP Server to Claude
Once you have your Truto MCP URL, you must register it with your AI client. The MCP protocol relies on JSON-RPC 2.0 messages over HTTP POST. You can configure Claude Desktop using either the graphical interface or the underlying JSON config file.
Method A: Via the Claude UI
If you are using an MCP-compatible UI (like the desktop app or specific web interfaces):
- Open Settings -> Integrations (or Connectors depending on your client version).
- Click Add MCP Server or Add custom connector.
- Provide a name (e.g., "Flexmail Prod").
- Paste the Truto MCP URL.
- Click Add. Claude will perform a handshake (
initializerequest) to retrieve the tool capabilities.
Method B: Via the Claude Desktop Config File
For developers managing environments programmatically, you can edit the claude_desktop_config.json file. Because Truto provides a hosted, remote HTTP endpoint rather than a local binary, you utilize an SSE (Server-Sent Events) bridge or a curl-based MCP wrapper. For standard remote setups, the configuration looks like this:
{
"mcpServers": {
"flexmail_integration": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-sse",
"--url",
"https://api.truto.one/mcp/a1b2c3d4e5f6..."
]
}
}
}Note: Restart Claude Desktop after updating this file. Claude will automatically call the tools/list endpoint via the Truto router, dynamically unpacking the Flexmail schemas into its context window.
High-Leverage Flexmail Hero Tools
Truto parses Flexmail's documentation records to inject required properties, parse nested body schemas, and append pagination cursors automatically. Here are the highest-leverage tools available to Claude when connected to Flexmail.
list_all_flexmail_messages
This tool retrieves messages sent via Flexmail. It allows Claude to filter by date range, recipient, sender, subject, tag, metadata, and event status. It returns critical delivery timestamps, including delivered_at, soft_bounced_at, and hard_bounced_at.
Usage note: Because this endpoint handles pagination (up to 500 records per page), Truto automatically injects limit and next_cursor fields into the tool schema, explicitly instructing Claude to pass cursor values back unchanged on subsequent calls.
"Claude, pull the last 200 messages sent to our enterprise tag over the weekend and identify which ones recorded a hard bounce."
create_a_flexmail_message
Sends a transactional or campaign email to a single recipient. The tool requires a recipient, sender (from), subject, and HTML content. It supports base64 attachment arrays up to 20MB, as well as placeholder substitutions.
Usage note: The LLM must construct a valid HTML payload. Truto's proxy API handles the 201 Created response, mapping the location headers back to the agent so it knows the specific message_id of the dispatched email.
"Draft a welcome email for new user example@domain.com, use the Flexmail sender identity sales@ourcompany.com, and dispatch it via the create message tool with link tracking enabled."
get_single_flexmail_message_by_id
Fetches the full lifecycle details of a specific message, including every event registered against it (opens, clicks, bounces).
Usage note: Useful for diagnostic workflows when a user complains about not receiving an email. Claude can pull the exact event timeline to determine if the message was rejected by the upstream ISP.
"Look up message ID 987654321 and tell me the exact timestamp it was opened, and what links the user clicked."
list_all_flexmail_senders
Retrieves the sender identities registered in the Flexmail account, including their verified status.
Usage note: Claude should always call this tool before attempting to dispatch an email to ensure the chosen from address is authorized. Only verified senders can successfully pass through the create_a_flexmail_message endpoint.
"List all our registered Flexmail senders. Are there any pending verifications we need to warn the marketing team about?"
create_a_flexmail_sending_domain
Registers a new sending domain in Flexmail, returning the DNS records required for SPF alignment and DMARC passes.
Usage note: This is a powerful infrastructure automation tool. Claude can provision a domain and output the exact TXT and CNAME records the IT team needs to apply to their DNS provider.
"Register the domain 'updates.ourcompany.com' as a new sending domain in Flexmail and output the required SPF and DKIM records in a formatted table for our network admins."
list_all_flexmail_stats
Fetches global message statistics for the entire account, filterable by date. Returns aggregates for sent, delivered, rejected, bounced, opens, and clicks.
Usage note: Claude can use this to generate weekly performance reports. Remember that these stats are updated at intervals by Flexmail, so they are suitable for trend analysis rather than real-time alerting.
"Retrieve our global Flexmail sending stats for the last 30 days. Calculate our overall open rate and compare our soft bounce ratio to last month."
For the complete tool inventory and granular JSON schema details, visit the Flexmail integration page.
Workflows in Action
With MCP providing a flat input namespace for query and body parameters, Claude can orchestrate complex, multi-step routines that previously required custom Python scripts.
Workflow 1: Domain Provisioning and Diagnostic Setup
When onboarding a new brand or subsidiary, marketing needs a dedicated sending domain, and engineering needs webhooks for monitoring. Claude can handle the entire setup.
"We need to spin up a new email channel for 'marketing.newbrand.com'. Register the domain in Flexmail, create a sender identity for 'hello@marketing.newbrand.com', and register a webhook pointing to 'https://api.ourbackend.com/webhooks/flexmail' for bounce events."
create_a_flexmail_sending_domain: Claude registers the domain and stores the returned DNS configuration requirements.create_a_flexmail_sender: Claude provisions the specific sender identity tied to that domain.create_a_flexmail_webhook: Claude registers the webhook specifically subscribing tohard_bounceandsoft_bounceevents.
Result: Claude provides the user with a confirmation of the created assets and prints out the exact DNS records the user needs to paste into Route53 or Cloudflare to complete domain verification.
sequenceDiagram participant Claude as Claude Desktop participant Truto as Truto MCP Server participant Flexmail as "Flexmail API" Claude->>Truto: call create_a_flexmail_sending_domain Truto->>Flexmail: POST /sending-domains Flexmail-->>Truto: Return DNS requirements Truto-->>Claude: JSON result Claude->>Truto: call create_a_flexmail_webhook Truto->>Flexmail: POST /webhooks Flexmail-->>Truto: Return Webhook ID Truto-->>Claude: JSON result
Workflow 2: Delivery Investigation
Customer Support escalates a ticket stating a VIP client is not receiving their invoices. Claude can autonomously investigate the delivery pipeline.
"Support says client example@enterprise.com isn't getting our automated reports. Check their message history in Flexmail for the past week and diagnose the issue."
list_all_flexmail_messages: Claude filters messages where the recipient matches the provided email address.get_single_flexmail_message_by_id: For any messages that show arejected_atorhard_bounced_attimestamp, Claude pulls the granular event timeline.- LLM Analysis: Claude reads the event metadata to determine if the issue is a blocked IP, a strict DMARC failure on the client's end, or an internal suppression list problem.
Result: Claude drafts a technical summary for the support agent, explaining exactly why the email bounced and providing the SMTP error codes returned by the upstream mail server.
Security and Access Control
Exposing an email platform to an AI agent carries risks. A hallucinating model could accidentally send bulk test emails to real customers or delete active webhooks. Truto's MCP architecture mitigates this at the server generation level:
- Method Filtering: You can restrict a token to
methods: ["read"]. This drops tools likecreate_a_flexmail_messagefrom the generated list entirely. The LLM simply cannot see or execute write commands. - Tag Filtering: Limit the agent's scope to specific functional areas by passing tags like
["reporting"]or["administration"]during token creation. require_api_token_auth: By default, possessing the MCP URL grants access. Setting this flag totrueforces a second authentication layer - the client must pass a valid Truto API token in the headers, ensuring only authenticated team members can leverage the MCP server.expires_at: For temporary audits or contractor access, you can apply a strict ISO datetime expiration. Truto's backend schedules a Durable Object alarm to aggressively destroy the token and its associated KV cache the moment it expires.
Moving Fast with Managed Integrations
Building an MCP server from scratch means dealing with protocol handshakes, pagination translation, rate limit normalization, and stateful tracking. When an upstream provider deprecates an endpoint, your custom integration breaks, taking your AI agent's capabilities down with it.
By leveraging Truto's documentation-driven tool generation, you outsource the API lifecycle. When Flexmail updates a schema, Truto's underlying integration definition updates, and the changes flow immediately into Claude's context window. Your engineering team focuses on building better prompts and orchestrating workflows, while Truto handles the plumbing.
Ready to stop maintaining integration code? Get your AI agents connected to production data safely and securely.
FAQ
- What is the easiest way to connect Flexmail to Claude?
- The best way to connect Flexmail to Claude is Elaichi: connect Flexmail to Elaichi once, then add Elaichi to Claude as a connector. Two steps, about a minute, with a 14-day free trial and no credit card required.
- Does Truto automatically handle Flexmail rate limits?
- No. Truto passes HTTP 429 rate limit errors directly back to the caller. It normalizes upstream rate limit info into standardized headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset) per the IETF spec, but Claude or your MCP client is responsible for implementing retry and backoff logic.
- Can I restrict Claude to only read data from Flexmail?
- Yes. When generating the MCP server token via Truto, you can pass a method filter (e.g., methods: ["read"]). This ensures the generated MCP server only exposes safe operations like list_all_flexmail_messages.
- What happens if a Flexmail webhook repeatedly fails?
- Flexmail automatically disables a webhook after 10 consecutive failed retries. You can use the list_all_flexmail_webhooks tool in Claude to audit disabled webhooks and re-enable them.
- Do I need to maintain custom tool schemas for Flexmail updates?
- No. Truto dynamically derives MCP tool schemas from Flexmail's API documentation records. When Flexmail updates an endpoint, Truto's proxy architecture updates the tools available to Claude automatically.