# LinkedIn sales with Codex
> Connect Codex to Kinlead in config.toml, fetch scored leads and drafts from the same terminal where you write code, and do the actual sending from Kinlead.
- HTML: https://getkinlead.com/use-cases/codex-outbound
- Markdown: https://getkinlead.com/use-cases/codex-outbound.md

**Verdict:** Codex earns a place here when it already works on your codebase every day. Its setup is separate from the ChatGPT connector. Keep LinkedIn in Kinlead and keep the API key in an environment variable, not in the config file.

Codex reads config.toml and your repo. Kinlead sends.

## Highlights

- Set up in config.toml
- Key kept in your environment
- You approve before anything sends

## First weeks

1. **Finish Kinlead in the browser.** Connect LinkedIn and write the buyer profile in Workspace. Codex cannot turn a tagline into a buyer.
2. **Add the server to config.toml.** In ~/.codex/config.toml, add a table named [mcp_servers.kinlead] with url set to https://getkinlead.com/api/agent/v1/mcp and bearer_token_env_var set to "KINLEAD_API_KEY". That last value is the name of the variable. The key itself goes in your environment.
3. **Confirm the server, then fetch a scored list.** Start Codex and check that the Kinlead tools are listed. Have it read the Kinlead agent guide, call kinlead_get_context and list your agents. Then fetch no more than 30 people with drafts. Nothing gets sent.
4. **Send from Kinlead.** Cut weak leads and start a modest campaign. When the session closes, the work stops with it.

## Small config details that matter

The table is mcp_servers, written with a low line between the two words and no hyphen. If the tools never show up, check that name and check that the environment variable is set in the shell where Codex starts.

Never paste the key itself into config.toml, because config files get committed by accident. If a key does leak, revoke it in Kinlead and create a new one.

## What to ask in the first session

Give Codex the buyer: who buys, which companies fit, what signals matter, and who to skip. Then add these rules.

- Read https://getkinlead.com/agents.md before calling any tool.
- Call kinlead_get_context, then kinlead_list_agents.
- If no lead finder fits, propose a setup with kinlead_draft_agent_setup and wait for my yes.
- Fetch no more than 30 leads, each with a fit score from 1 to 5, the proof, and a two-sentence opener.
- Send, enroll, create, delete and reply only when I ask for that action by name in this session.

## Codex or ChatGPT

ChatGPT connects to Kinlead through its connector settings, with OAuth and no key. Codex uses the config file and a key. If you wanted a chat window and not a coding agent, the ChatGPT route is simpler.

Both reach the same tools. Pick the one you already have open.

## Related

- [Codex integration](https://getkinlead.com/integrations/codex.md): config.toml and API key setup.
- [LinkedIn sales with Claude Code](https://getkinlead.com/use-cases/claude-code-outbound.md): The same job from Anthropic's terminal agent.
- [LinkedIn sales with Cursor](https://getkinlead.com/use-cases/cursor-outbound.md): The same job from inside the editor.
- [Outbound for founders](https://getkinlead.com/use-cases/outbound-for-founders.md): The routine with no outside agent.

## Frequently asked questions

**Is it fine to store the API key inside config.toml?**

It would work, but do not. Keep the key in an environment variable and name that variable in bearer_token_env_var, so the key never sits in a file someone might commit.

**Will Codex keep running once the session ends?**

No. It only works while the session is open.

**Should I use Cursor or Claude Code instead?**

Use the agent you already work with. All three reach the same Kinlead tools.

## Add Codex when it already works on your repo

If you wanted a chat window instead, use the ChatGPT connector. Either way, the buyer profile in Kinlead comes first.

[Create a Kinlead account](https://getkinlead.com/signup) or [book a call](https://getkinlead.com/demo) to talk through pricing and setup.
