Connect Lemlist to ChatGPT: Automate Outreach & Campaign Workflows
Learn how to connect Lemlist to ChatGPT using a managed MCP server. Automate outbound campaigns, lead enrichment, and sales operations with AI agents.
You want to connect Lemlist to ChatGPT so your AI agents can read campaign statistics, manage lead statuses, and orchestrate outbound outreach workflows autonomously. If your team uses Claude, check out our guide on connecting Lemlist to Claude or explore our broader architectural overview on connecting Lemlist to AI Agents.
Giving a Large Language Model (LLM) read and write access to your sales engagement platform is a significant engineering challenge. You either spend weeks building, hosting, and maintaining a custom Model Context Protocol (MCP) server, or you use a managed infrastructure layer that handles the boilerplate for you. This guide breaks down exactly how to use Truto to generate a secure, managed MCP server for Lemlist, connect it natively to ChatGPT, and execute complex sales development workflows using natural language.
The Engineering Reality of the Lemlist API
A custom MCP server is a self-hosted integration layer that translates an LLM's JSON-RPC tool calls into REST API requests. While the MCP standard provides a predictable way for models to discover tools, implementing it against Lemlist's API is difficult because of the platform's specific domain logic.
If you build a custom Lemlist MCP server, you own the entire integration lifecycle. Here are the specific engineering challenges you will encounter:
1. Lead State Isolation Across Campaigns
In Lemlist, a "Lead" is not just a global contact record. A single email address can exist across multiple campaigns, each with its own independent state (isPaused, emailStatus, interested). If your AI agent needs to mark a lead as "interested" or pause them, it must specify the exact campaignId. If your MCP server doesn't enforce schema boundaries to require campaign IDs for lead mutations, the LLM will hallucinate global updates that fail or, worse, update the wrong campaign.
2. Complex Sequence Branching
Extracting sequence steps for LLM analysis is not a matter of reading a flat array. Lemlist sequences support A/B testing variants, conditional branching (e.g., "if clicked, send X; if no reply, send Y"), and multi-channel steps (LinkedIn, cold calling, manual tasks). Your custom server must parse nested conditions arrays and conditionalStepIndex pointers and flatten them into a context window - friendly string, otherwise the LLM cannot comprehend the campaign's logic.
3. Asynchronous Enrichment Jobs
Lemlist provides powerful native enrichment (finding emails, phone numbers, and LinkedIn verification). However, these are asynchronous jobs. You cannot simply call an enrichment endpoint and expect immediate data. The API returns an enrichmentId. Your MCP server must expose tools for the LLM to trigger the job, and secondary tools to poll for the enrichmentStatus before proceeding.
4. Strict Rate Limiting and 429 Errors
Lemlist enforces aggressive API rate limits to protect their infrastructure. When connecting LLMs to APIs, rate limits are a critical failure point because AI agents can fire off dozens of parallel requests when summarizing bulk data.
Note on Truto's architecture: Truto does not automatically retry, throttle, or apply exponential backoff when an upstream API like Lemlist returns an HTTP 429 Too Many Requests error. Instead, Truto passes that 429 error directly back to the caller (your LLM client). Truto normalizes the upstream rate limit information into standard IETF headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset). The LLM framework or calling agent is responsible for reading these headers and executing its own backoff strategy.
Step 1: Create the Lemlist MCP Server
Instead of building out OAuth token management, pagination cursors, and schema generation from scratch, you can use Truto to dynamically generate a Lemlist MCP server. The server is scoped to a specific authenticated Lemlist account and returns a secure connection URL.
You can create this server in two ways: via the Truto UI or programmatically via the API.
Method A: Via the Truto UI
This is the fastest method for internal teams setting up automated workflows.
- Log into your Truto dashboard and connect a Lemlist account.
- Navigate to the Integrated Accounts page and select your Lemlist connection.
- Click the MCP Servers tab.
- Click Create MCP Server.
- Configure your server (you can filter allowed methods, such as
readonly, or set an expiration date). - Copy the generated MCP server URL (e.g.,
https://api.truto.one/mcp/abc123def456...).
Method B: Via the API
If you are building an application and want to provision Lemlist MCP servers dynamically for your users, you can use the Truto API.
Make a POST request to /integrated-account/:id/mcp. You can pass a config object to restrict the tools the LLM can access.
curl -X POST https://api.truto.one/integrated-account/<lemlist_integrated_account_id>/mcp \
-H "Authorization: Bearer <YOUR_TRUTO_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"name": "Lemlist Campaign Automation Agent",
"config": {
"methods": ["read", "write", "custom"]
}
}'The API will return a JSON object containing the ready-to-use URL:
{
"id": "mcp_8f7d6a5b",
"name": "Lemlist Campaign Automation Agent",
"url": "https://api.truto.one/mcp/a1b2c3d4e5f6g7h8...",
"expires_at": null
}Step 2: Connect the MCP Server to ChatGPT
Once you have your Truto MCP URL, you can connect it to ChatGPT. You do not need to write any local server code; Truto hosts the JSON-RPC interface and executes the API proxies on the edge.
Method A: Via the ChatGPT UI
If you are using ChatGPT Enterprise, Pro, or Team with Developer Mode enabled:
- In ChatGPT, navigate to Settings -> Apps -> Advanced settings.
- Toggle Developer mode on.
- Under MCP servers / Custom connectors, click Add new server.
- Enter a name (e.g., "Lemlist Agent").
- Paste your Truto MCP URL into the Server URL field.
- Click Save.
ChatGPT will perform the MCP initialization handshake, read the available Lemlist tools, and they will immediately be available in your prompt interface.
Method B: Via Manual Config File
If you are using Claude Desktop, Cursor, or a local agent framework that requires a configuration file, you can connect the Truto URL using the standard Server-Sent Events (SSE) transport adapter.
Add the following to your mcp_config.json:
{
"mcpServers": {
"lemlist_truto": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-sse",
"--url",
"https://api.truto.one/mcp/a1b2c3d4e5f6g7h8..."
]
}
}
}Lemlist Hero Tools for AI Agents
Truto automatically generates tools from Lemlist's API documentation, injecting descriptions and JSON schemas so the LLM knows exactly what parameters to pass. Here are the most high-leverage tools available for your agent.
1. List All Campaigns
Tool name: list_all_lemlist_campaigns
This tool retrieves all campaigns in the workspace. The LLM can filter by status (running, paused, draft, errors) to quickly audit outbound activity without scraping every record.
"Audit our Lemlist workspace and list all campaigns currently in the 'errors' or 'paused' state. Give me their IDs and names."
2. Add Lead to Campaign
Tool name: create_a_lemlist_campaign_lead
Use this tool to inject new prospects directly into active sequences. The LLM handles the mapping of variables like firstName, companyName, and icebreaker automatically.
"Take this list of three startup founders, generate a customized one-sentence icebreaker for each based on their LinkedIn profiles, and add them as leads to campaign ID 'camp_89xyz'."
3. Get Campaign Statistics
Tool name: lemlist_campaign_stats_list_v_2
This tool fetches detailed performance metrics for a specific campaign, including sent count, opened count, clicked count, and replied count. This is critical for automated campaign triage.
"Check the statistics for campaign ID 'camp_89xyz'. Calculate the open rate and reply rate. If the reply rate is under 2%, let me know so we can adjust the messaging."
4. Enrich a Lead
Tool name: create_a_lemlist_lead_enrich
This tool triggers Lemlist's native enrichment features. The agent can use this to find verified emails, verify existing emails, find phone numbers, or run LinkedIn enrichment for a specific lead ID.
"Look up lead ID 'lead_456' and run an email verification and LinkedIn enrichment job on their profile."
5. Mark Lead as Interested
Tool name: create_a_lemlist_lead_interested
When a prospect responds positively, this tool allows the agent to update the lead's status within a specific campaign, halting further automated follow-ups and marking them for sales handoff.
"Find the lead with email 'sarah@example.com' in campaign ID 'camp_89xyz' and mark them as interested."
6. Pause a Campaign
Tool name: lemlist_campaigns_pause
If an AI agent detects a high bounce rate or an error spike, it can immediately halt the sequence to protect domain reputation.
"Pause campaign ID 'camp_89xyz' immediately and confirm when the state change is successful."
To view the complete list of available operations, schemas, and return types, visit the Lemlist integration page.
Workflows in Action
When you connect Lemlist to ChatGPT via an MCP server, the model can chain these tools together to execute complex, multi-step operations without human intervention.
Scenario 1: Automated Campaign Triage & Safety Pauses
Outbound teams often run dozens of campaigns simultaneously. If a campaign hits a spam trap or suffers a high bounce rate, domain reputation can be ruined in hours. An AI agent can monitor this continuously.
"Check the stats for all our 'running' Lemlist campaigns. Calculate the bounce rate for each. If any campaign has a bounce rate over 8%, pause the campaign immediately and give me a summary report of what you did."
Tool execution sequence:
list_all_lemlist_campaigns(Filtered by status = running) -> Returns list of active campaigns.lemlist_campaign_stats_list_v_2-> Loops through each active campaign ID to retrieve delivery metrics.lemlist_campaigns_pause-> Executes only on the campaigns that breach the 8% bounce rate threshold.
Result: The LLM stops the bleeding on bad campaigns instantly and outputs a neat summary of which sequences were halted, protecting your deliverability infrastructure.
sequenceDiagram
participant User as ChatGPT (Agent)
participant Truto as Truto MCP Server
participant Lemlist as Lemlist API
User->>Truto: list_all_lemlist_campaigns(status="running")
Truto->>Lemlist: GET /campaigns?status=running
Lemlist-->>Truto: Active Campaigns Array
Truto-->>User: JSON Response
User->>Truto: lemlist_campaign_stats_list_v_2(campaign_id="camp_1")
Truto->>Lemlist: GET /campaigns/camp_1/stats
Lemlist-->>Truto: Sent: 1000, Bounced: 95
Truto-->>User: JSON Response
Note over User: Agent calculates 9.5% bounce rate.<br>Threshold exceeded.
User->>Truto: lemlist_campaigns_pause(campaign_id="camp_1")
Truto->>Lemlist: POST /campaigns/camp_1/pause
Lemlist-->>Truto: Success
Truto-->>User: Action confirmedScenario 2: Lead Injection and Contextual Enrichment
When a sales rep finds a prospect on a website, they can simply ask the LLM to research them, enrich their contact info, and drop them into a sequence with a personalized message.
"I found a great prospect named John Doe at Acme Corp. Please add him to our 'Q3 Enterprise Outreach' campaign. Run a LinkedIn enrichment on him, and use his company name to draft a custom icebreaker variable."
Tool execution sequence:
list_all_lemlist_campaigns-> Finds the ID for "Q3 Enterprise Outreach".create_a_lemlist_campaign_lead-> Adds the prospect to the campaign with placeholder data.create_a_lemlist_lead_enrich-> Triggers LinkedIn enrichment on the newly created lead ID.lemlist_lead_variables_bulk_update-> Applies the custom AI-generated icebreaker variable to the lead record.
Result: The prospect is successfully enriched, customized, and scheduled for outreach without the sales rep ever leaving the chat interface.
Security and Access Control
When granting an LLM access to your outbound engine, security is paramount. Truto provides several mechanisms to lock down your Lemlist MCP server:
- Method Filtering: Restrict the server to safe operations. You can configure
methods: ["read"]to allow the LLM to pull stats and lists, but block it from creating leads or sending emails (write). - Tag Filtering: If your integration uses resource tags, you can limit the MCP server to specific functional areas (e.g., only exposing "campaigns" and hiding "team_credits").
- Require API Token Auth: By setting
require_api_token_auth: true, the MCP URL alone is not enough to execute tools. The client must also pass a valid Truto API token in theAuthorizationheader, ensuring only authorized services can trigger actions. - Time-to-Live (TTL): You can set an
expires_atdatetime. Truto will automatically revoke the token and delete the server infrastructure when the time expires, which is perfect for temporary agent tasks or contractor access.
Final Thoughts
Connecting Lemlist to ChatGPT transforms your AI agent from a passive text generator into an active revenue operations assistant. Instead of manually auditing bounced emails, writing icebreakers, and managing lead statuses across dozens of tabs, your agents can execute those workflows programmatically.
By leveraging Truto's dynamic MCP server generation, you skip the heavy lifting of maintaining OAuth flows, parsing nested schemas, and dealing with pagination. Your engineering team can provision secure, fully authenticated LLM toolkits in minutes rather than weeks.
FAQ
- How do I handle Lemlist rate limits with ChatGPT?
- Lemlist enforces strict API rate limits. Truto does not absorb or retry these automatically. When the limit is hit, Truto passes the HTTP 429 error directly to ChatGPT, translating the upstream limits into standard IETF headers (`ratelimit-limit`, `ratelimit-remaining`, `ratelimit-reset`). Your LLM agent or client framework must read these headers and implement its own retry and backoff logic.
- Can I restrict the MCP server to read-only access?
- Yes. When generating the MCP server via the Truto API or UI, you can apply method filtering. Setting `config.methods = ["read"]` ensures the LLM can only execute safe GET requests (like fetching stats or listing campaigns) and cannot pause campaigns or add leads.
- How does ChatGPT know which Lemlist campaign a lead belongs to?
- Truto automatically parses Lemlist's API documentation and generates strict JSON schemas for every tool. When the LLM attempts to use a tool like `create_a_lemlist_lead_interested`, the schema explicitly requires a `campaign_id` parameter. The LLM understands this requirement and will ask you for it, or use another tool to look it up first.