Skip to main content

What is MCP, and how does it work with Twain?

A plain-English explainer of the Model Context Protocol (MCP), what it's used for, which Twain tools are available via MCP, and how to connect Claude and other clients.

Just want to connect? Here's the short version.

  1. In Claude (web, desktop or mobile), go to Settings → Connectors and add a custom connector.

  2. Paste the server URL: https://mcp.api.twain.ai/

  3. Sign in with your Twain account when prompted.

Using a different client? See How to connect below. Want to see it in action? Follow Run a Campaign from Claude with the Twain MCP.


MCP stands for Model Context Protocol. It's an open standard that lets AI assistants (like Claude or ChatGPT) plug directly into the tools and data they need to do useful work: your CRM, your spreadsheets, your inbox, or in our case, your Twain Agents.

In Twain, MCP means you can run your Twain Agent from inside another AI tool. Instead of switching tabs to Twain, you ask Claude (or any MCP-compatible client) to use your Twain Agent for you, and it does.


What is MCP, in plain English?

Think of MCP as the USB-C port for AI. Before USB-C, every device had its own cable. Before MCP, every AI integration was a one-off: custom code to connect a model to Slack, a different setup for Google Drive, another for Salesforce.

MCP fixes that. It defines one standard way for an AI model to:

  • Read data from a tool (e.g., pull a list of leads from your CRM).

  • Take actions in a tool (e.g., draft an email, create a task, run an automation).

  • Use templates and context the tool provides (e.g., the right prompt, the right examples).

Anthropic introduced MCP as an open standard in late 2024, and it's now supported by most major AI assistants and dev tools. Because it's open, any tool can build an "MCP server" and any AI model can be an "MCP client." That's why the ecosystem grew quickly.


What is MCP used for?

MCP is the layer that turns a chat model into something that can actually do things in your stack. Common uses:

  • Connecting AI to your work tools: Slack, Notion, Google Drive, GitHub, your CRM.

  • Letting AI run automations: kicking off an automation, running a search agent, qualifying leads.

  • Giving AI live, current context: instead of relying only on what the model was trained on, it pulls fresh data on demand.

If you've used Claude with connectors, ChatGPT with connectors, or Cursor with custom integrations, you've already used MCP, even if you didn't see it.


What does MCP have to do with Twain?

Twain Agents can be deployed via MCP. That means your Twain Agent, with all its setup (buyer personas, signals, writing style, qualification rules), is reachable as a tool from any MCP-compatible AI client.

In practice:

  • You're working in Claude reviewing an account list. You ask Claude to run your Twain outbound agent on the top 20 leads. It does.

  • You're in your own internal AI tool and want it to use Twain's qualification logic before passing leads to a rep. The tool calls your Twain Agent over MCP.

  • Your ops team is building an automation and wants Twain in the loop alongside Clay, your CRM, and your inbox, without writing custom integration code for each piece.

The agent stays the same. You don't rebuild it for MCP. The same agent you use in a Twain campaign is the one that gets exposed via MCP, with the same personas, signals, and style.


What you can do via MCP

The MCP exposes the core building blocks of a Twain workspace. Every tool maps to something you can already do in the UI.

  • Browse the workspace. list_workspaces, list_agents, list_campaigns, list_workflows. Read-only, no credits spent.

  • Inspect a setup. get_campaign and get_workflow return the configuration of a campaign or automation, so the assistant can decide which one fits a new contact.

  • Read results. list_contacts and get_contact return the contacts on a campaign with their research and generated messages.

  • Generate for a contact. generate_contact takes a LinkedIn URL, domain, or email, runs the research, drafts the sequence, and stores the contact on the campaign. You pick the mode (Base, High or Ultra) for every run. Longer runs continue in the background; the assistant checks on them with get_generation_status and list_generation_jobs.

  • Bulk add contacts. add_contacts_to_campaign is free. Drop in a list of LinkedIn URLs, then generate in the Twain UI or via MCP afterwards. Up to 20 custom variables per contact come along.

  • Push into an automation. add_contact_to_workflow queues a contact through a campaign's automation (research, copy, export, notify) without you opening the app.

  • Create from scratch. create_workspace, create_agent (builds an agent from a company URL plus an ICP description) and create_campaign (sets up a campaign from a brief, attached to that agent).

  • Check credits. get_credits returns the current credit balance so the assistant can warn you before generating.

  • Send feedback. give_feedback passes a note about the output straight to the Twain team.

Read-only tools never cost credits. The two tools that generate (generate_contact, add_contact_to_workflow) are charged by mode: 1 credit on Base, 2 on High, and 10 for the first message step plus 2 per additional step on Ultra (see How Modes Work: Base, High, and Ultra). The assistant will confirm before spending any.

For the full list of tools and parameters, see the MCP server documentation.


When should you use Twain via MCP vs. directly?

  • Use Twain directly when you're running standard outbound, inbound, or nurture campaigns. The Twain UI is built for this.

  • Use Twain via MCP when you want to call your agent from somewhere else: an AI assistant, a custom workflow, or a tool that orchestrates several systems together.

Most customers use both: Twain directly for campaign-level work, and MCP when they want their agent to plug into a broader AI workflow.


How to connect

You'll need an agent set up in Twain (see How Twain Agents Work) and an MCP-compatible client. The server URL for all clients is https://mcp.api.twain.ai/ (with the trailing slash).

Claude (web, desktop and mobile)

  1. Open Settings → Connectors in Claude.

  2. Add a custom connector and paste https://mcp.api.twain.ai/ as the URL.

  3. Sign in with your Twain account when prompted. The connection is live.

Claude Code

Run:

claude mcp add --transport http twain https://mcp.api.twain.ai/

The first time you use a Twain tool, Claude Code opens a browser to sign in. Prefer an API key? Add --header "X-Api-Key: <your-twain-api-key>" to the command. Verify with claude mcp list.

ChatGPT, Codex, Cursor and other clients

The MCP server documentation has copy-ready setup for ChatGPT, Codex, Cursor and any other MCP client. Clients without a sign-in flow use your API key in the X-Api-Key header.

Where do I find my API key?

In Twain, click your name at the bottom of the left sidebar and choose API key, then Copy Key. The key is created the first time you open the dialog and works for both the API and MCP. You'll need a verified email address.

You can also find all of these instructions in the app: open the same menu and choose Install MCP.


Example prompts

Once connected, you don't think about MCP. You just talk to the assistant. A few prompts that work well:

  • "List my Twain campaigns and tell me which one is for outbound to founders."

  • "Generate a sequence for linkedin.com/in/sample in the Founders campaign on High." The assistant confirms the credit cost before running.

  • "Add these 30 LinkedIn URLs to the automation of my Q2 SDR campaign."

  • "How many credits do I have left?"

  • "Spin up a new campaign called 'Cybersecurity CTOs' from the agent that targets infosec leadership."

If you'd like help wiring up Twain over MCP for your specific setup, reach out to us in the chat and we'll walk through it with you.


A note on terminology

In the API and MCP, contact replaces the older terms lead and recipient (for example generate_contact and add_contacts_to_campaign). The old tool names no longer work, so if you built integrations on them, update your tool calls.

Automations are still called workflows in the API and MCP (for example list_workflows and add_contact_to_workflow).

Did this answer your question?