Blog/Guide

How to use Claude Code for lead generation

How Claude Code can find and qualify B2B leads: what it needs, how MCP connects it to real data, where to keep a person in the loop, and the risks to plan for.

Postbly team · Updated November 5, 2026 · 4 min read

In short

Claude Code can run lead generation when you give it three things: a clear description of who you want, a way to reach real data, and written rules for how the work is done. Out of the box it has none of the data. It gets that through MCP, an open standard that connects it to outside tools. Used well, it does the repetitive research and drafting while you keep the decisions and approve anything that goes out under your name.

Why use a coding agent for sales work?

Claude Code is built to work through long, multi-step jobs: read something, decide, act, check the result, and carry on. Lead generation has the same shape. You define a target, search, filter, research each match, write, and record what happened. Doing that by hand is slow, and the steps are the same for each lead.

The difference from a chat window is that an agent can act on real systems. Anthropic's documentation puts it plainly: once a system is connected, "Claude can read and act on that system directly instead of working from what you paste."

What does Claude Code need?

Each of the three parts covers a different weakness of a general agent.

What it needs Why Without it
A target Your ICP and the signals that matter It finds plausible people who never buy
Real data Live sources for people, companies and events It guesses, or relies on old training data
Rules How you qualify, write and follow up Every run works differently

A target

Write down your ideal customer profile before anything else. Include who to exclude and the buying signals you care about. An agent will follow a vague brief confidently, so a vague brief gives you a long, tidy list of the wrong people.

Real data through MCP

MCP is the Model Context Protocol. The Claude Code documentation describes it as "an open source standard for AI-tool integrations" and says MCP servers "give Claude Code access to your tools, databases, and APIs." For lead generation, that means connecting tools that can:

  • Search for people and companies by role, industry, size and location.
  • Find events such as job posts, funding rounds and public posts.
  • Look up work emails and check them.
  • Store leads somewhere that outlasts one conversation.
  • Send messages from your own accounts, with limits.

For remote services, the documentation says HTTP servers "are the recommended option." Most hosted services also give you a key, so the tools act on your own account.

Rules the agent reads

Good results depend on written guidance more than on clever prompts. Put your method in a document the agent reads before it starts: how to judge fit, what a good message looks like, what never to say, and when to stop and ask. That turns a one-off good run into a repeatable process.

A workflow that holds up

This order keeps the expensive and risky steps until last.

  1. Read the current state. Have the agent start from your ICP and the leads you already have, so it does not repeat work.
  2. Search one signal at a time. Run one search per signal and check the results before moving on.
  3. Score before enriching. Judge each person against your ICP first, then look up contact details only for good fits. Data lookups usually cost money.
  4. Research the best leads. Have it read the person's recent activity and company page, and collect real details to use in the message.
  5. Draft, then review. Have it write messages using only facts it found, and read them yourself.
  6. Send only what you approved. Keep sending as a separate, deliberate step.
  7. Record the outcome. Log who was contacted and what happened, so the next run starts from the truth.

Where should a person stay involved?

Three decisions are worth keeping. An agent is good at preparing them and poor at owning the consequences.

  • Who you target. Check the ICP and a sample of each new list.
  • What goes out. Your name and your domain are on every message. One careless batch can damage both.
  • Anything hard to undo. Sending, disconnecting an account and deleting data should always need your approval.

Risks to plan for

  • Prompt injection. Profiles, posts and web pages are written by strangers, and some may contain instructions aimed at AI. The Claude Code docs warn: "Verify you trust each server before connecting it. Servers that fetch external content can expose you to prompt injection risk." Tell the agent to treat all outside text as data, never as instructions.
  • Invented facts. An agent can state a number or a detail it never checked. Ask it to quote where each fact came from, and have counts come from a query, not from its own arithmetic.
  • Platform rules. LinkedIn and email providers limit sending. Keep volumes low and spread them out, whatever a tool allows.
  • Cost. Paid data sources can add up over a long run, so check what each tool charges before you start one.
  • Privacy and consent. Cold outreach is regulated differently by country. Check the rules for where your prospects are, and honor every opt-out.

Common questions

Can Claude Code find leads by itself?

It can search the open web, but that gives you scattered results. For reliable lead generation it needs connections to real data sources, which is what MCP provides.

What is an MCP server for sales?

It is a service that gives an AI agent sales tools, such as searching for people, reading your lead list or sending a message. The agent calls those tools directly, in place of you copying data back and forth.

Do I need to be a developer to use Claude Code for sales?

You need to be comfortable in a terminal for setup. After that, you work by describing what you want in plain language.

Does this work with Codex too?

Yes. MCP is an open standard, so a server that works with Claude Code can also connect to other MCP clients, including Codex.

Is it safe to let an AI send sales emails?

Only with limits. Keep a review step, send from accounts with sensible volume caps, and start with a small batch you read yourself.

Sources

Retrieved November 5, 2026.