TL;DR
- Codex CLI reaches LeadOcean through one
codex mcp addcommand and a browser sign-in. It counts every filter set you describe, so TAM, SAM and SOM become four exact counts instead of one analyst guess. - It takes about 15 minutes. The sizing run spends 0 records, because counts and lookups are free.
- Only people returned to you count as records. An optional 10-row spot-check spends 10 of the 1,000 free records.
Prerequisites
- A LeadOcean account from app.leadocean.io. The free plan has no card and gives 1,000 records, one-off.
- Codex CLI installed and signed in. The Codex MCP docs, September 2026, say the CLI, the IDE extension and the desktop app share one MCP configuration.
- Optional, for the REST check in Step 5:
curl,jqand a key in your shell as$LEADOCEAN_API_KEY. The MCP steps need no key.
export LEADOCEAN_API_KEY="paste-your-key-here"Step 1: Add the LeadOcean MCP server
Register the server with the CLI, then sign in. The server uses OAuth, so you paste no key.
codex mcp add leadocean --url https://api.leadocean.io/mcp
codex mcp login leadoceanThe login opens your browser on LeadOcean. Approve, return to the terminal, and the tools are available. Codex supports OAuth with Dynamic Client Registration and the LeadOcean server supports it too, so you do not create a client ID by hand.
If you prefer a file, the same entry goes in ~/.codex/config.toml.
[mcp_servers.leadocean]
url = "https://api.leadocean.io/mcp"Run codex mcp list to confirm the entry, then start codex. Type /mcp inside the terminal UI to see the server and its 13 tools. Server details are on the LeadOcean MCP page.
Step 2: Write the buyer in one sentence
A market size is only as good as the buyer definition behind it. Write one sentence that names the role, industry and company size. Keep it to filters LeadOcean holds.
Buyer: engineering leaders (VP or C-level, Engineering) at software companies
with 51 to 500 employees. Product: a developer tool. Question: how big is the
market, how much can I sell into from the US, and how many VPs is that?Everything after this step turns that sentence into counts. Paste the sentence into Codex as the first message of the session.
Step 3: Resolve the exact filter values
Filter values are exact strings. "Software" matches nothing, and "Software Development" does. Make Codex look each value up before it counts anything.
Use leadocean_list_enum_values to find the exact strings for: industry (software),
employee_range, job_level and job_function (engineering). Show me the values you
will use. Do not call any tool that spends records.Codex calls the free lookup and reports back. For this buyer it should settle on these values.
{
"industry": ["Software Development"],
"employeeRange": ["51-200", "201-500"],
"jobLevel": ["VP", "C-Team"],
"jobFunction": ["Engineering"]
}Read each tool call before you approve it. The Codex docs describe per-server approval settings in config.toml, and asking every time is a sensible default while you watch what the model calls. The tool names tell you what is free: leadocean_count_leads, leadocean_count_companies, leadocean_list_filters and leadocean_list_enum_values never spend records.
Step 4: Count TAM, SAM and SOM
Ask for one count per tier. Each tier keeps the filters above it and adds one. The prompt tells Codex to use only the free count tool and to label what each number is.
Use leadocean_count_leads with facets false for four counts. Never call a tool
that spends records.
1. TAM: jobLevel VP and C-Team, jobFunction Engineering, industry Software
Development. No size or country filter.
2. Add employeeRange 51-200 and 201-500.
3. SAM: add country US.
4. SOM pool: same as 3, but jobLevel VP only.
Put the results in a table with the exact filters beside each count. Say which
email statuses were counted.A count is a people count. To turn it into dollars you need accounts, and leadocean_count_companies counts those for free. It takes the company-search filters and breaks the total down by industry, headcount band, HQ country, HQ state and NAICS.
Use leadocean_count_companies with industry ["Software Development"],
employeeRange ["51-200","201-500"], hqCountry ["US"]. Report the total and
the split by headcount band. Multiply the total by my contract value of $X.Give Codex your own price, since LeadOcean holds no figure for your product. The REST version is /v1/companies/count, also free.
Step 5: Check one count over REST
You can reproduce any chat count from a terminal. The sizing call is a people search with count=true as a query parameter and limit at 1. The body is flat JSON with arrays.
curl -s "https://api.leadocean.io/v1/people/search?count=true" \
-H "x-api-key: $LEADOCEAN_API_KEY" -H "content-type: application/json" \
-d '{
"jobLevel": ["VP", "C-Team"],
"jobFunction": ["Engineering"],
"industry": ["Software Development"],
"employeeRange": ["51-200", "201-500"],
"country": ["US"],
"emailStatus": ["verified", "catch_all_valid", "catch_all"],
"limit": 1
}' | jq '.meta'This returns meta.total and no rows, so it spends no records. The REST total is capped at 100,000. For a bigger market, use the MCP count tool, which returns the total with totalIsExact beside it.
What you get
We ran the four counts from Step 4 on 2026-10-01 with leadocean_count_leads, facets off. Each one spent 0 records.
| Tier | Filters added | Mailable people |
|---|---|---|
| TAM | VP and C-Team, Engineering, Software Development | 21,679 |
| Narrowed | + employeeRange 51-200 and 201-500 | 5,777 |
| SAM | + country US | 2,683 |
| SOM pool | VP only | 937 |
Every figure is a mailable count: people with a verified, catch_all_valid or catch_all email, which is the tool's default. It is not everyone we hold for those filters, so label it that way in your deck.
The SAM call returned this payload. The credits field is the record cost.
{
"total": 2683,
"totalIsExact": true,
"credits": 0,
"defaults": "Counted only addresses worth sending to (emailStatus: verified or catch_all_valid or catch_all), which is this tool's default.",
"sample": 1,
"hasMore": true,
"unsupportedFilters": []
}Read the table as a funnel. Of 5,777 people at companies with 51 to 500 employees, 2,683 sit in the US, and 937 of those are VPs. The dataset refreshes monthly, so date every count you publish.
The account count ran on 2026-10-21 with leadocean_count_companies and spent 0 records. It found 11,577 US-headquartered Software Development companies with 51 to 500 staff, exact: 9,261 at 51-200 and 2,316 at 201-500. At a $10,000 contract value that is a $115.8M account TAM. Swap in your own price.
The people counts leave out funding, revenue and headquarters city or state filters, which the people count tool does not support. Use leadocean_count_companies for those cuts, or apply them at search time. Total spend for the run: 0 records.
If you spot-check 10 people, each person returned costs one record. This is the response shape from the API reference, with placeholder values.
{
"data": [
{
"profile_data": { "...": "name, title and company fields, placeholder" },
"contact_data": {
"has_email": true,
"has_phone": "<true or false>",
"email_status": "verified",
"email_type": "work"
}
}
],
"meta": { "source": "leadocean", "count": 1, "nextCursor": "<cursor>" }
}Search returns thin records: it tells you whether an address exists and its status, and the address itself comes from an enrich call with reveal_email.
Troubleshooting
| Error | Cause | Fix |
|---|---|---|
No LeadOcean tools in /mcp | The sign-in was not approved, or the entry is missing | Run codex mcp login leadocean again, then codex mcp list to confirm the entry. |
| 401 | Missing, wrong or revoked key on a REST call | Re-copy the key from app.leadocean.io and export $LEADOCEAN_API_KEY again. |
| 429 | Above your plan's rate per account (5 requests a second on Free, 200 on Agency) | Wait the Retry-After seconds, then slow the loop. Five counts need nothing near that rate. |
| 402 | Free plan: the 1,000 records are spent | Counts stay free. Check leadocean_get_account, or move to Solo at $97 a month. Free records do not reset. |
| Empty results or a count of 0 | A filter value outside the catalogue, such as industry: "Software" | Ask Codex to call leadocean_list_enum_values and pass the exact string it returns. |
| Total stops at 100,000 | The REST count is capped at 100,000 | Use leadocean_count_leads, or add a filter and count the pieces. |
FAQ
How many records does sizing a TAM in Codex CLI cost?
Zero. Counts, filter lookups and enum lookups are free, however many you run. Records are spent only on people returned by a search, a lookup or an export.
Is a people count the same as a market size?
No. It is the number of reachable buyers in a segment. Count accounts with leadocean_count_companies, multiply by your contract value to get dollars, and use your own price for that step.
Why does the count say "mailable"?
The count tool defaults to verified, catch_all_valid and catch_all emails. Pass emailStatus, hasEmail or reachable to change that. Say which one you used next to every number.
Can I pull the whole SAM into a list?
Not in one search. One search pages to 10,000 rows, and the capped page carries meta.depthCapped. Split the SAM by country or headcount band, or use an export from Solo up, which takes up to 50,000 rows a request.
Does Codex see my API key?
Not for the MCP steps. The server uses OAuth sign-in through codex mcp login, and you paste nothing into the chat. Only the optional REST check reads $LEADOCEAN_API_KEY from your shell.
Can I do this in another coding tool?
Yes. The same MCP URL works elsewhere. See Gemini CLI, Windsurf and VS Code. More recipes are in the blog hub.
Size your market in Codex CLI, free
Free to start. No credit card. 1,000 records to spend whenever you like.
Get your free API key →