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, and how Twain Agents can be deployed via MCP.

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

  1. In Claude Desktop, go to Settings β†’ Connectors β†’ Customize

  2. Click +, choose Remote MCP server, and paste: https://mcp.api.twain.ai/

  3. Authenticate with your Twain account when prompted


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 a workflow).

  • 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 a workflow, 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 Desktop 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. All read-only, no credits spent.

  • Inspect a setup. get_campaign and get_workflow return the configuration of a specific campaign or workflow so the assistant can decide which one fits a new lead.

  • Generate for a single lead. generate_lead takes a LinkedIn URL, domain, or email, runs the research, drafts the sequence, and stores the lead on the campaign. 30 to 90 seconds, 1 to 2 credits.

  • Bulk add leads. add_leads_to_campaign is free. Drop in a list of LinkedIn URLs and review the generated copy in Twain's UI afterwards.

  • Push into a workflow. add_lead_to_workflow queues the lead through the workflow's automated steps (research, copy, notify) without you opening the app.

  • Create from scratch. create_agent builds a Twain agent from a company URL plus an ICP description. create_campaign stands up a new API-mode campaign attached to that agent.

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

Read-only tools never cost credits. The two tools that do (generate_lead, add_lead_to_workflow) cost 1 to 2 credits per call, and the assistant will confirm before spending any.


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 existing agent set up in Twain (see Getting Started with Twain Agents) and an MCP-compatible client. The MCP server URL for all clients is: https://mcp.api.twain.ai/

Claude Desktop

The easiest way is through the Claude Desktop UI:

  1. Open Settings in Claude Desktop.

  2. Go to Connectors β†’ Customize.

  3. Click + to add a custom connection.

  4. Under Remote MCP server URL, enter https://mcp.api.twain.ai/

On first use, a browser tab opens for OAuth. Sign in with your Twain account and the connection is live.

Alternatively, you can edit the config file directly. Add this under mcpServers in ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "twain": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.api.twain.ai/"]
    }
  }
}

Save and restart Claude Desktop. The first tool call triggers OAuth the same way.

Claude Code

Claude Code supports HTTP MCP servers natively. 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 for OAuth. After that, the token is cached. Verify with claude mcp list.

Cursor

Open ~/.cursor/mcp.json (create it if missing) and add:

{
  "mcpServers": {
    "twain": {
      "url": "https://mcp.api.twain.ai/"
    }
  }
}

Reload Cursor. Twain tools appear alongside your other MCP servers, and OAuth runs on first use.

Gemini CLI

Add this under mcpServers in ~/.gemini/settings.json:

{
  "mcpServers": {
    "twain": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.api.twain.ai/"]
    }
  }
}

Restart gemini and run /mcp list to confirm Twain is connected.


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." The assistant confirms the credit cost before running.

  • "Add these 30 LinkedIn URLs to my Q2 SDR Workflow."

  • "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

Twain is updating the terminology used across the API and MCP to align with the product. The terms lead and recipient are being replaced with contact.

In practice, this means tool names, parameter names, and field names that previously referenced lead or recipient will move to contact (for example, add_leads_to_campaign β†’ add_contacts_to_campaign).

If you have integrations or automations built on the Twain MCP, check your tool call names and update them as the new names roll out. The underlying behavior doesn't change, only the naming.

Did this answer your question?