How to Pull BLS Labor Statistics from Codex

Codex CLI is built for terminal-first workflows, but it can’t access live government data on its own. When you’re working on something that needs real labor statistics — inflation numbers, employment figures, wage data — Codex is stuck with whatever it learned during training. AgentPatch’s BLS Data tool fixes that by giving Codex direct access to the Bureau of Labor Statistics API.

Why This Matters

A surprising amount of development work touches economic data. You might be building a dashboard that tracks inflation, a financial model that uses payroll numbers, or a data pipeline that ingests CPI figures. In all of these cases, you need actual values from the BLS — not approximations from a model’s training data.

The BLS API is free but awkward. Series IDs are opaque strings, the response format requires parsing, and figuring out the right combination of parameters takes trial and error. With the BLS Data tool, Codex handles all of that. You tell it what you need in plain English and it pulls structured time series data: year, period, value, and optional calculations like month-over-month or year-over-year changes.

Setup

Add AgentPatch to ~/.codex/config.toml:

[mcp_servers.agentpatch]
url = "https://agentpatch.ai/mcp"
bearer_token_env_var = "AGENTPATCH_API_KEY"

Then set your API key:

export AGENTPATCH_API_KEY=your_api_key

Replace your_api_key with your actual key from the AgentPatch dashboard. Codex discovers all AgentPatch tools automatically on next start.

Example

You’re in a Codex session building a data ingestion script and need to validate against real BLS data. You ask:

“Pull the unemployment rate and total nonfarm payrolls for the last year so I can see what the response shape looks like.”

Codex queries both series in a single call:

Fetching BLS series LNS14000000 and CES0000000001 for 2025-2026...

Unemployment Rate (LNS14000000):
  Jan 2026: 4.0%
  Dec 2025: 4.1%
  Nov 2025: 4.0%
  ...

Total Nonfarm Payrolls (CES0000000001):
  Jan 2026: 157,600 (thousands)
  Dec 2025: 157,200
  Nov 2025: 156,800
  ...

Both series return data as strings with year, period, period_name, and value
fields. Want me to write the TypeScript types and parser for this shape?

Codex pulled two series in one call, showed you the real data, and offered to scaffold the code. The BLS tool supports up to 5 series per request, so you can compare unemployment, payrolls, CPI, and wages all at once.

At 50 credits ($0.005) per call, you can iterate on your data model without worrying about cost.

Wrapping Up

AgentPatch connects Codex to the Bureau of Labor Statistics and thousands of other time series covering employment, prices, wages, and productivity. The same MCP connection also gives you access to FRED data, web search, email, and everything else on the marketplace. See what’s available at agentpatch.ai.