Connect Attentive to Claude: Sync Subscriptions and Marketing Events
from the team behind Truto
Attentive in Claude, in about a minute.
The best way to connect Attentive to Claude is Elaichi: connect Attentive 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 Attentive
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 Attentive into your own product? This guide is for you.
A comprehensive engineering guide to connecting Attentive's APIs to Claude via MCP. Covers dynamic server generation, tool configuration, schema mapping, and automated e-commerce workflows.
The developer guide
Learn how to build and configure a managed MCP server to connect Attentive to Claude, enabling AI agents to manage SMS subscriptions and marketing events natively.
If your team needs to connect Attentive to Claude to automate SMS subscriber lifecycles, manage e-commerce events, or orchestrate custom segmentation, you need a Model Context Protocol (MCP) server. This server acts as the translation layer between Claude's tool-calling capabilities and Attentive's REST APIs. You can either build and maintain this infrastructure yourself, dealing with constant upstream schema changes, 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 Attentive to ChatGPT or explore our broader architectural overview on connecting Attentive to AI Agents.
Giving a Large Language Model (LLM) read and write access to an SMS marketing engine like Attentive presents severe engineering challenges. You have to handle strict compliance logic for opt-ins, enforce precise data validation for phone numbers, and map deeply nested JSON payloads to MCP tool definitions. Every time Attentive updates an endpoint or adds a new e-commerce event schema, you must manually update your server code, redeploy, and test the integration to prevent AI hallucinations.
This guide breaks down exactly how to use Truto to generate a secure, managed MCP server for Attentive, connect it natively to Claude, and execute complex e-commerce and marketing workflows using natural language.
The Engineering Reality of the Attentive API
A custom MCP server is a self-hosted integration layer. While the open MCP standard provides a predictable JSON-RPC interface for models to discover tools, implementing it reliably against the Attentive API requires significant domain expertise. Attentive is built for high-volume, compliant SMS marketing, and its API enforces strict operational constraints that LLMs naturally struggle with.
If you decide to build a custom MCP server for Attentive, here are the specific integration challenges you will face:
Strict Identity and Payload Constraints Attentive enforces rigid rules around how user attributes are managed. For instance, when updating user properties, the API allows a maximum of 100 attributes per user. Furthermore, the API explicitly rejects arrays or nested objects for attribute values—everything must be flat. Phone numbers must always strictly adhere to the E.164 format. An LLM operating without strict schema constraints will frequently attempt to push nested JSON objects or poorly formatted phone numbers, resulting in 400 Bad Request errors. Your MCP server must construct perfect JSON Schemas from Attentive's documentation to constrain the LLM's output.
Asynchronous Batch Processing
Not all endpoints in Attentive execute synchronously. Operations like adding members to a segment (create_a_attentive_segments_member) or uploading large product catalogs are queued for asynchronous batch processing. The API returns a batchJobId rather than a success payload. If you expose this to Claude natively, the agent will assume the task is complete the moment it receives the 202 Accepted response. You must build a polling mechanism or specifically instruct the LLM on how to check bulk job statuses (get_single_attentive_bulk_job_by_id) before moving on to dependent tasks.
Flat Namespace Tool Resolution When an MCP client like Claude calls a tool, all arguments arrive as a single flat JSON object. However, Attentive's API requires strict separation between query parameters, URL path parameters, and request body payloads. Building this manually requires writing custom parsers for every single endpoint. A managed MCP approach uses dynamically derived schema mapping to automatically split the LLM's flat arguments into the correct API request structures on the fly.
How to Generate an Attentive MCP Server
Truto eliminates the need to build a custom server. Instead of writing code, Truto dynamically derives MCP tools directly from the integration's documented resources and schemas. Every MCP server is scoped to a single integrated account (a specific tenant's connected Attentive instance) and authenticated via a secure, hash-backed token URL.
You can generate the MCP server using either the Truto Dashboard or the Truto REST API.
Method 1: Creating the Server via the Truto UI
For ad-hoc agent setup or internal automation, generating the server via the UI takes seconds:
- Log in to your Truto dashboard and navigate to the Integrated Accounts section.
- Select the specific Attentive connection you want to expose to Claude.
- Click on the MCP Servers tab.
- Click Create MCP Server.
- Configure your optional filters (e.g., restrict to
readmethods only, or filter by specific tool tags). - Copy the generated MCP Server URL (e.g.,
https://api.truto.one/mcp/a1b2c3d4...).
Method 2: Creating the Server via the Truto API
For production multi-tenant applications where you are spinning up agents programmatically for your users, you should generate the MCP server via the Truto API.
Make a POST request to the /integrated-account/:id/mcp endpoint:
// Example using fetch to create an MCP server programmatically
const response = await fetch('https://api.truto.one/integrated-account/attentive-account-id/mcp', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_TRUTO_API_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: "Claude Attentive Marketing Agent",
config: {
methods: ["read", "write"], // Expose all CRUD operations
require_api_token_auth: false
},
expires_at: null // Permanent token
})
});
const mcpServer = await response.json();
console.log("Your MCP Server URL:", mcpServer.url);The API securely provisions a token, stores a hashed reference in a high-speed KV store, validates that the integration actually has active tools, and returns the endpoint URL ready for Claude to consume.
Connecting the MCP Server to Claude
Once you have your Truto MCP URL, connecting it to Claude requires zero additional coding. The integration operates over standard HTTP POST with JSON-RPC 2.0 messages.
Method 1: Via the Claude Desktop UI
If you are using Claude Desktop directly for internal operations:
- Open Claude Desktop and navigate to Settings.
- Click on Integrations (or Connectors depending on your version).
- Click Add MCP Server.
- Paste the URL provided by Truto.
- Click Add.
Claude will immediately perform a handshake (the initialize protocol method), request the available tools (tools/list), and dynamically populate the agent's context window with Attentive's capabilities.
Method 2: Via Manual Configuration File
If you prefer managing your desktop environment via config files, or you are running a custom remote transport setup, you can update your claude_desktop_config.json file to bridge Server-Sent Events (SSE) to standard I/O using the official MCP CLI proxy:
{
"mcpServers": {
"truto_attentive": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-sse",
"https://api.truto.one/mcp/YOUR_SECURE_TOKEN_HERE"
]
}
}
}Restart Claude Desktop. The server-sse package acts as a transport bridge, allowing Claude's standard stdio interface to securely communicate with Truto's remote HTTP endpoint.
Attentive Hero Tools for Claude
Truto automatically maps Attentive's sprawling API surface into deterministic, schema-validated MCP tools. Below are the highest-leverage tools exposed to Claude for marketing automation.
Create a Subscription Opt-In
Tool Name: create_a_attentive_subscription
This is the core tool for managing marketing consent. It explicitly opts a user into SMS or email subscriptions. It enforces strict E.164 phone formatting and requires mapping either a signUpSourceId or explicit locales to guarantee compliance.
"The user at +14155552671 just consented to marketing texts via the inbound chat portal. Opt them into the SMS subscription list using our standard signup source ID."
Log an E-commerce Purchase
Tool Name: create_a_attentive_ecommerce_purchase
Records a completed transaction inside Attentive to trigger post-purchase journeys, loyalty flows, and revenue attribution. The required JSON body maps directly to the upstream PurchaseRequest schema, handling currency, order IDs, and itemized product data.
"A customer with the email sarah@example.com just completed checkout for order #99812. The total was $150.00. Log this purchase event in Attentive so her post-purchase flow triggers."
Track a Custom Marketing Event
Tool Name: create_a_attentive_custom_event
Sends arbitrary, event-based user actions to Attentive. This is vital for triggering custom Journey Builders and populating Segment conditions. Note that event types are strictly case-sensitive in the upstream system.
"Trigger a custom event called 'Webinar_Registered' for the user at +14155559999. Include custom properties showing the webinar topic was 'Q3 E-commerce Trends'."
Update User Attributes
Tool Name: create_a_attentive_user_attribute
Creates or updates a single user's profile with custom attributes and identifiers. Truto's dynamically generated JSON schema forces Claude to pass a maximum of 100 attributes and prevents the model from attempting to pass invalid arrays or objects.
"Update the subscriber profile for john.doe@example.com. Set his custom attribute 'Loyalty_Tier' to 'Gold' and 'Lifetime_Value' to '850'."
Manage Segment Memberships
Tool Name: create_a_attentive_segments_member
Adds a user to a specific Attentive segment in bulk. Because this is an asynchronous operation upstream, this tool queues the request and returns a batchJobId to the agent.
"Add the user with phone number +12125550198 to the 'High Intent Buyers' segment. Note the batch job ID returned."
Trigger Cart Abandonment Events
Tool Name: create_a_attentive_ecommerce_add_to_cart
Reports an add-to-cart event to Attentive when a shopper adds a product to their shopping cart but hasn't yet purchased. This is the primary trigger for high-converting abandoned cart SMS flows.
"Customer jenny@example.com just added the 'Premium Cotton Throw' to her cart but closed the browser tab. Log an add-to-cart event with the product details to initiate her abandonment sequence."
For a complete list of all auto-generated tools and detailed JSON schema requirements, visit the Attentive Integration Page.
Workflows in Action
Connecting Claude to Attentive unlocks sophisticated, multi-step marketing orchestrations driven entirely by natural language. Here are two real-world examples of how Claude executes workflows using Truto's MCP server.
Workflow 1: The VIP Segment Upgrade
When a customer crosses a specific spend threshold, an agent can instantly log the purchase, update their loyalty tier, and drop them into a VIP messaging segment.
"A customer just made a $500 purchase (order #8821) linked to +13105550144. Log the purchase event, update their user attribute 'Loyalty_Tier' to 'Platinum', and add them to the VIP segment."
sequenceDiagram
participant Claude as Claude Desktop
participant Truto as Truto MCP Server
participant Upstream as Attentive API
Claude->>Truto: call create_a_attentive_ecommerce_purchase<br>{"user": "+13105550144", "orderId": "8821", "amount": 500}
Truto->>Upstream: POST /ecommerce/purchases
Upstream-->>Truto: 200 OK
Truto-->>Claude: Success
Claude->>Truto: call create_a_attentive_user_attribute<br>{"phone": "+13105550144", "Loyalty_Tier": "Platinum"}
Truto->>Upstream: POST /attributes
Upstream-->>Truto: 202 Accepted
Truto-->>Claude: Success
Claude->>Truto: call create_a_attentive_segments_member<br>{"members": [{"phone": "+13105550144"}]}
Truto->>Upstream: POST /segments/members
Upstream-->>Truto: 202 Accepted (batchJobId)
Truto-->>Claude: batchJobId: 9283-abcResult: The agent successfully chains three distinct API operations. It logs the financial event, updates the flat attribute namespace in compliance with Attentive's limits, and captures the async batch ID for the segment addition.
Workflow 2: Custom Event Registration
Marketing teams often need to trigger journeys based on offline actions or non-standard interactions (like attending an in-person event or submitting a lead form).
"We just scanned a badge at the NY trade show for jane@example.com. Ensure she is opted into our email subscription list, then trigger a custom event called 'TradeShow_Scanned' so she receives the post-show content flow."
Step-by-step Execution:
- Claude identifies the email and calls
create_a_attentive_subscriptionwith the email address and explicit subscription type. - Truto validates the payload and proxies the opt-in to Attentive.
- Claude then immediately calls
create_a_attentive_custom_event, passing the strict event string "TradeShow_Scanned" and linking it to the user's email. - Attentive registers the event, which natively triggers the predefined Journey Builder flow for trade show attendees.
Security and Access Control
Exposing an SMS marketing engine to an AI agent carries inherent risk. An LLM hallucinating a bulk delete operation on a master subscriber segment is a catastrophic failure. Truto's MCP architecture provides granular security controls at the server level, long before a request ever hits Attentive.
- Method Filtering: When creating the MCP server, you can pass
methods: ["read", "custom"]to explicitly strip outcreate,update, anddeletetools. This ensures the Claude agent acts strictly as a data-retrieval analyst, physically incapable of altering subscriber data. - Tag Filtering: Attentive tools are categorized by tags (e.g.,
events,ecommerce,subscriptions). By passingtags: ["ecommerce"], the generated MCP server will exclusively expose catalog and purchase tools, hiding all underlying core subscriber management endpoints. - Require API Token Auth: By default, possession of the cryptographic MCP URL grants tool execution rights. For zero-trust environments, setting
require_api_token_auth: trueforces Claude to also pass a valid Truto session or API Bearer token in the request headers. - Ephemeral Servers: Setting an
expires_atISO datetime when generating the server will automatically schedule a cleanup alarm. Once the TTL is reached, Truto purges the token from the edge KV store and database, immediately revoking Claude's access.
Handling Rate Limits
One critical operational detail when connecting LLMs to third-party APIs is rate limit management. Attentive enforces varying quotas depending on the specific endpoint (e.g., bulk async uploads vs. synchronous profile lookups).
It is important to note that Truto does not automatically retry, throttle, or apply backoff logic when hitting upstream limits. If your Claude agent rapid-fires requests and Attentive responds with an HTTP 429 Too Many Requests, Truto passes that 429 error directly back to the caller.
To aid in building robust agents, Truto normalizes upstream rate limit information into standardized IETF headers:
ratelimit-limit: The total allowed requests in the current window.ratelimit-remaining: The number of requests left.ratelimit-reset: The timestamp when the quota resets.
The calling LLM framework, or the custom prompt logic within Claude, must be designed to catch these 429 responses, read the reset headers, and pause execution accordingly.
Moving Forward with Agentic Marketing
Connecting Claude to Attentive via a managed MCP server removes the infrastructure burden of maintaining OAuth tokens, parsing complex REST schemas, and dealing with undocumented API behaviors. By relying on Truto's dynamic, documentation-driven tool generation, you ensure that your LLM always has the most accurate, schema-validated tools at its disposal.
Whether you are building internal marketing co-pilots or integrating autonomous agents into your SaaS product, a robust MCP architecture is the foundation for reliable AI execution. Stop writing fragile point-to-point connector code, and start orchestrating workflows at scale.
FAQ
- What is the easiest way to connect Attentive to Claude?
- The best way to connect Attentive to Claude is Elaichi: connect Attentive 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 handle API rate limiting and retries for Attentive?
- No. Truto passes HTTP 429 rate limit errors directly back to the caller and normalizes upstream rate limit info into standardized IETF headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset). The calling LLM or framework is responsible for implementing its own retry and backoff logic.
- Can I limit the Claude agent to only read data from Attentive?
- Yes. When generating the MCP server, you can use method filtering to restrict available tools. By passing `methods: ["read"]` in the configuration, the server will only expose GET or LIST operations, preventing the LLM from executing writes or deletes.
- How are custom attributes handled in the MCP tools for Attentive?
- Truto automatically derives the required JSON Schema for custom attributes from the integration's documentation records. The LLM receives a strict tool definition, ensuring it respects Attentive's constraints (e.g., maximum of 100 attributes, no arrays or nested objects).