Skip to content

Blog

Build an Outbound Sales Agent in Cursor and Claude Code with MCP

Turn Cursor or Claude Code into an autonomous outbound SDR. Step-by-step setup, copyable agent prompt rules, budget safeguards, and CSV lead generation.

All posts8 min read

Most B2B SaaS founders and growth engineers spend hours juggling tabs: searching LinkedIn, exporting lists from Apollo, uploading CSVs to enrichment tools, and cleaning columns in Google Sheets.

With the Model Context Protocol (MCP), you can turn your existing coding environment—like Cursor or the Claude Code CLI—into an autonomous sales development representative (SDR). By giving your assistant direct access to live B2B contact data, you can ask for prospective buyers in plain English, have your agent filter matches for free, verify work emails, and write clean leads directly into your local project repository.

In this tutorial, you'll learn how to connect Leadscart's B2B Data MCP server to Cursor and Claude Code in under two minutes, apply strict budget guardrails, and run real outbound campaigns directly from your terminal.

Why run prospecting from Cursor and Claude Code?

  • Zero tab switching: If you build software or manage marketing tech stacks in your editor, sourcing leads directly where you work eliminates cognitive friction.
  • Structured, file-native outputs: Rather than downloading CSVs from a SaaS portal, your agent can write directly to data/prospects.csv, format JSON for an API, or trigger an email sequencer script automatically.
  • Iterative programmatic refinement: Tell your agent: “Only keep companies whose tech stack includes Next.js or Postgres and whose headcount grew past 50.” The agent inspects attributes programmatically without you clicking through dozens of checkboxes.

Prerequisites and API key setup

Before connecting, you will need a Leadscart API key:

  1. Sign up at leadscart.io to receive your 25 free test credits (no card required).
  2. Navigate to Settings → API & MCP and click Create API key.
  3. Copy your secret key (it starts with lc_live_...). Store it safely—keys are shown only once.

Connecting Leadscart MCP to Cursor and Claude Code

Method 1: Connect to Cursor

Cursor natively supports Streamable HTTP MCP servers. You can add Leadscart globally or per workspace:

  1. Open Cursor, press Cmd + Shift + J (or Ctrl + Shift + J on Windows), and open Cursor Settings.
  2. Select Features in the sidebar, then scroll down to MCP Servers.
  3. Click + Add New MCP Server and fill in the details:
    • Name: Leadscart
    • Type: command or sse / streamable-http
    • URL: https://leadscart.io/api/mcp
    • Headers: Authorization: Bearer lc_live_YOUR_KEY

Alternatively, you can configure it via your project's .cursor/mcp.json file:

{
  "mcpServers": {
    "leadscart": {
      "url": "https://leadscart.io/api/mcp",
      "headers": {
        "Authorization": "Bearer lc_live_YOUR_KEY"
      }
    }
  }
}

Method 2: Connect to Claude Code CLI

Claude Code is Anthropic's command-line agent. You can add Leadscart with a single terminal command:

claude mcp add --transport http leadscart https://leadscart.io/api/mcp --header "Authorization: Bearer lc_live_YOUR_KEY"

Verify the connection by running claude mcp list. You will see Leadscart's live tools:people_search, email_find, list_create, and list_export.

The 4-stage prospecting workflow

Once connected, your agent can execute a complete outbound campaign across four stages:

In Leadscart, searching companies and viewing matching candidate profiles costs 0 credits. Prompt your agent to explore candidate cohorts without worrying about burning your balance:

“Find 15 VP of Engineering and Heads of Infrastructure at Series B B2B SaaS companies in the US and UK with 50 to 250 employees. Show their names, current roles, and company websites.”

The agent automatically invokes the people_search tool. It evaluates filters, pages through results, and presents the best matches in a markdown table—all without consuming a single credit.

Stage 2: Qualification and candidate selection

Review the agent's output in your chat. You can instruct the agent to drop matches that don't fit your criteria:

“Discard anyone at agencies or consultancies. Keep the top 10 matches at high-growth software vendors.”

Stage 3: Email reveal with cost verification

When you are ready to reveal verified emails, instruct the agent to pull deliverable addresses for the qualified list. Each verified email costs 1 credit, and misses are always free:

“Find verified work emails for these 10 people. Confirm the maximum credit cost before running the call.”

The assistant calls email_find. If our data provider verifies the address, you get a clean deliverable email. If a person has no verified address, zero credits are deducted.

Stage 4: Write to a project CSV

Finally, ask Cursor or Claude Code to save the verified records directly into your workspace:

“Save these contacts into outbound/leads.csv with columns: Name, Title, Company, Domain, Verified Work Email, and LinkedIn URL.”

Battle-tested agent system prompt (.cursorrules)

To prevent your assistant from being careless with credits, paste this rule block into your project's .cursorrules file or into your Claude Code custom instructions:

# B2B Prospecting & MCP Guidelines

You have access to the Leadscart MCP server for B2B prospecting.
Follow these strict operational rules:

1. ZERO-COST EXPLORATION:
   - Always use `people_search` to explore candidate pools.
   - Searching, filtering, and pagination cost 0 credits.
   - Present search results to the user in a clean table BEFORE revealing emails.

2. CREDIT CONFIRMATION GATE:
   - Revealing verified work emails (`email_find`) costs 1 credit per verified person.
   - NEVER call `email_find` on more than 10 people without explicit user confirmation.
   - State the maximum possible credit cost before executing any reveals.

3. DELIVERABILITY & SAFEGUARDS:
   - Every response contains a `credits` envelope with `spent` and `remaining`.
   - Alert the user if the remaining credit balance drops below 50.
   - Do not hallucinate email patterns. Rely strictly on verified addresses returned by the tool.

4. OUTPUT FORMATTING:
   - When requested, write prospects to a local CSV file with proper headers.
   - Ensure domains and LinkedIn URLs are cleanly formatted.

Budget safeguards and runaway loop prevention

Autonomous agent loops can occasionally get stuck in retries or excessive pagination. Leadscart provides multiple layers of safety built directly into the protocol:

  • 0-credit search: Unlike platforms that charge per query page (see our B2B Data MCP server comparison), Leadscart never charges for search iterations.
  • Batch cap: email_find accepts a maximum of 25 people per request, preventing an agent from attempting to reveal hundreds of contacts in a single unmonitored call.
  • Daily fair-use caps: Every workspace has daily fair-use limits (e.g., 500 reveals/day on Starter, 2,000 on Growth). Even if an agent runs an infinite loop overnight, your monthly credits cannot be drained in an afternoon.

Next steps and resources

You now have a fully automated outbound prospecting agent running right inside your development environment. Explore further resources to optimize your stack: