Codex workspace setup
How to automate LinkedIn using Codex without handing it your account

Codex can shorten the work around LinkedIn outreach: researching a prospect, checking a list, drafting a sequence and preparing a campaign for review. It cannot turn an unauthorized LinkedIn bot into an approved one. The useful setup is to connect Codex to an outreach workspace, let it read the state and propose changes, then decide separately whether and how any LinkedIn action should happen.
That distinction matters. A prospect saved in a CRM is a record. A connection request sent to a person is an account action. Treating those as the same step is how an efficient-looking workflow becomes hard to audit, difficult to stop, and potentially risky for the account.
What Codex actually automates
Codex is an agent that can work with files and connected tools. Its MCP documentation describes how to attach external tool servers to the CLI and inspect available tools. An MCP connection is a route to a provider's capabilities, not a blanket permission to perform every LinkedIn action.
That tool check matters because some Codex-and-LinkedIn integrations focus on publishing posts or managing pages, while an outreach workspace needs prospect, list and flow controls. Inspect the actual provider's tools before following a guide written for a different job. A working post-publishing connection is not proof that prospect import or campaign review exists.
For outreach, split the job into three layers:
- Reasoning: Codex can examine a target account, turn your selection rules into a research checklist, compare records and draft messages. You should ask it to show sources and uncertainties, rather than manufacture personalization.
- Workspace state: A connected system such as OutreachGenie can hold prospects, lists, flows and campaigns. A prepared campaign is not necessarily an active campaign. OutreachGenie's prospecting page explicitly separates saving a prospect from starting outreach.
- LinkedIn account actions: Invitations, messages, profile browsing and scraping are a different category. LinkedIn's automated-activity help page says unauthorized third-party software or extensions that scrape, modify or automate its website can lead to account restrictions. Slow pacing, a logged-in session or a human-looking message does not establish platform approval.
That gives you a useful stopping point: finish the research and workspace preparation, then decide whether a site action is permitted and worth doing.
Connect Codex to the OutreachGenie workspace
The OutreachGenie Codex setup guide uses a workspace API key and a Streamable HTTP MCP server. Create the key in the workspace's API-key settings. Keep it out of prompts, screenshots, shell history, source control and article drafts. Your environment needs to expose the key to the Codex process as LINKEDIN_CRM_API_KEY; the exact secure way to do that depends on how you run Codex.
The documented server registration is:
codex mcp add linkedin-crm --url https://api.outreachgenie.ai/mcp --bearer-token-env-var LINKEDIN_CRM_API_KEY
Restart Codex if you set the environment variable after it was launched. Then run codex mcp list or inspect /mcp inside Codex. These commands verify the configuration. They do not, by themselves, prove that your key is valid, a particular tool is enabled or a campaign was created. The Codex MCP docs also describe tool restrictions and approval settings; use them to keep discovery and preparation separate from writes.
Start with a read-only request:
Inspect my OutreachGenie workspace. List the available MCP tools, the prospect lists and the draft flows. Do not create, edit, send or launch anything. Tell me which data you could not access.
If that fails, check the environment variable in the same process environment as Codex, the workspace key's status and access, and the server configuration. Do not paste the key into a chat to debug it. An unauthenticated browser visit to the /mcp URL is also not a useful connection test: the endpoint expects an MCP request, not a regular page view.
Build a list before asking for a message
The most valuable part of a Codex workflow is often a clean prospect list, not faster sending. Define the list in terms a reviewer can check: company type, role, geography, a reason to approach this person, and an exclusion rule. A vague instruction such as “find 100 founders” encourages weak matches and invented context.
For example:
Review the current prospect list for agency founders in the UK. Identify duplicates, records with no source, companies outside the stated market, and contacts whose role is uncertain. Suggest a keep/research/remove decision for each record, with the evidence you used. Do not contact anyone.
Codex can turn the result into a shortlist, but the source field should stay attached to each recommendation. If an account's relevant detail cannot be verified, the draft should say so or leave it out. A personal-looking line based on a guess is worse than a concise, honest opening.
Before allowing a workspace write, look at the proposed change: which records will be added, which list will receive them, whether an existing record already represents the person, and whether an exclusion should apply. Ask Codex to present a diff or a small sample, then approve that specific change. Keeping this review at the record level makes later mistakes traceable.
Turn the list into a flow, then a campaign draft
A flow is the behavior you intend for a prospect after they enter an outreach process. A campaign binds that behavior to an audience and operating state. Do not tell Codex to “run a LinkedIn campaign” and assume it has understood both.
Ask it to draft the flow first:
For the reviewed list, propose a short LinkedIn outreach flow. State the purpose of each step, what must be true before it runs, what happens when someone replies or declines, and what a reviewer should check before activation. Keep every message as a draft. Do not launch a campaign.
The review should test more than tone. Is the first message relevant to the listed people? Does the second step rely on an accepted connection that may not exist? Does the flow stop when a person replies? Could it contact someone excluded from outreach? If the tool does not expose a reply or failure state, do not assume Codex can monitor it.
Next, ask for a campaign preview: the chosen list, chosen flow, intended operating window, current status, and a sample of the audience-message pairing. Confirm that the list and flow are the ones you reviewed. Only then consider an explicit campaign-state change in the product's own controls. Preparation in OutreachGenie is one thing; actual LinkedIn execution is subject to the platform's rules and whatever permissions and safeguards the connected service genuinely provides.
Avoid the tempting shortcut: a logged-in LinkedIn bot
Some guides propose giving an automation tool LinkedIn session cookies or instructing an agent to send a daily batch of invitations. That can look like a one-command solution because the agent already has the session. It also puts account credentials in a third-party integration and crosses from research into website automation.
LinkedIn's prohibited-software guidance is the relevant standard here. An integration vendor's claim that actions occur at “human pace” is not evidence that LinkedIn permits them. If you are considering any site-action integration, review its permissions, data handling, and LinkedIn's current terms before using it. Codex can still help prepare your work even if you decide not to automate the website.
Measure conversations, not prepared records
A clean workflow needs different counts for different stages. Keep prospects reviewed, records saved, campaigns prepared, actions attempted, actions completed, replies and qualified conversations separate. A list of 200 prepared records is not 200 people contacted. A queued action is not a delivered message. A reply is not automatically a sales opportunity.
Review failures and replies before increasing the volume of work. If an action fails, identify whether it was a missing field, a permission problem, a changed interface or a platform restriction; do not silently retry a broad batch. If someone responds, pause or remove them from any follow-up that no longer fits. If a system cannot reliably express those stop conditions, keep the corresponding step manual.
The work product should be inspectable: a sourced shortlist, a proposed record change, a message draft, a flow preview and a decision log. That leaves the decision about who to contact and when with you.
Put Codex to work with OutreachGenie
If you already use Codex, OutreachGenie's Codex MCP guide is the place to connect it to your outreach workspace. Start with read-only inspection, prepare one small list and flow, and review the campaign preview before changing any live state. OutreachGenie can keep those prospects, lists, flows and campaigns together; it does not remove LinkedIn's account-policy risk, and you should not treat an MCP connection as permission to automate the site.
For the broader distinction between MCP tools and outreach workflows, see our MCP prospecting explainer.
Research used for this guide
Try the workflow