Drive Twain From Your AI Assistant

Mohamed ChahinMay 6, 20264 min read

Connect Twain to Claude, Cursor, or any MCP client and run campaigns, generate sequences, and add leads from a single chat window. No Twain UI required.

Why it matters

Most outbound work doesn't happen in one app. You're in Slack reading a thread, in HubSpot looking at a deal, in Linear writing a ticket about a launch, and somewhere in there you decide a lead is worth reaching out to. Switching to Twain to actually do the outreach is friction. Often enough, the lead never makes it.

The Twain MCP server removes the switch. Wire Twain into Claude Code, Claude Desktop, Cursor, or anything else that speaks the Model Context Protocol, and the assistant in front of you can talk to Twain directly. List your campaigns, generate a sequence for a lead, add someone to a workflow, all from the chat you're already in.

The result is straightforward. Outreach happens on the same surface where the decision happens, instead of two tools later when the moment is gone.

What you can do

The MCP exposes the 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 is instructed to confirm before spending any.

Connect Claude Code

Claude Code (the CLI / VS Code integration) supports HTTP MCP servers natively. One command:

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. Sign in with the same account you use for Twain. After that, the token is cached and the assistant can call Twain tools directly.

Verify the server is connected:

claude mcp list

You should see twain in the list. The tools (list_campaigns, generate_lead, etc.) become available immediately.

Connect Claude Desktop

Claude Desktop talks to MCP over stdio, so a remote HTTPS server like Twain needs a small bridge. Use the mcp-remote proxy from npm. It translates desktop's stdio calls into HTTPS calls against the Twain server and handles OAuth for you.

Edit your Claude Desktop config:

open "$HOME/Library/Application Support/Claude/claude_desktop_config.json"

Add this entry under mcpServers:

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

Save the file and restart Claude Desktop. On first use, a browser tab opens for OAuth. Sign in once, and the token is reused on every later call.

Connect Cursor

Cursor speaks HTTP MCP directly, like Claude Code. Open ~/.cursor/mcp.json (create it if missing) and add:

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

Reload Cursor. The Twain tools show up alongside the rest of your MCP servers, and the OAuth handshake runs the first time you trigger one.

Connect Gemini CLI

Gemini CLI reads its MCP config from ~/.gemini/settings.json. The transport is stdio-only today, so the same mcp-remote proxy used for Claude Desktop bridges the gap. Add this under mcpServers:

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

Restart gemini and run /mcp list inside the CLI to confirm Twain is connected. The first tool call opens a browser for OAuth, and the token is cached after that.

Example prompts

Once the server is connected, you don't think about MCP. You just talk to the assistant.

A few prompts that work well out of the box:

  • "List my Twain campaigns and tell me which one is for outbound to founders." The assistant calls list_campaigns, reads the descriptions, picks the closest match.
  • "Generate a sequence for https://www.linkedin.com/in/sample in the Founders campaign." The assistant confirms the credit cost, runs generate_lead, and returns the campaign URL when it's done.
  • "Add these 30 LinkedIn URLs to my Q2 SDR Workflow." The assistant queues them through add_lead_to_workflow one at a time.
  • "How many credits do I have left?" One get_credits call.
  • "Spin up a new campaign called 'Cybersecurity CTOs' from the agent that targets infosec leadership." The assistant chains list_agents, create_campaign, and reports back with the campaign URL.

That's the whole product surface from a chat window. Same campaigns, same agents, same credits as the web app, just available wherever you happen to be working.