Building a Local Business Finder with Codex

Codex CLI is fast and stays in the terminal — but it can’t look up local businesses on its own. When you’re building a location-aware app and need real data to work with, that gap slows you down. AgentPatch adds Google Maps to Codex so it can fetch business listings directly during any session.

Why This Matters

Building a local business finder requires realistic data at every stage: development, testing, and demo prep. Mocked data hides bugs that real-world queries surface, like results with missing ratings, businesses that have closed, or sparse results in low-density areas.

With Maps available in Codex, you can work with real data without breaking the terminal workflow to look things up manually.

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 building a pet store locator and want to generate seed data for your database. You ask Codex:

“Grab 4 real pet stores in Brooklyn from Maps and write them into the seed file.”

Codex searches Maps and handles the rest:

Searching Google Maps for "pet store Brooklyn NY"...

Found results. Here are 4 to use:

1. Petland Discounts — 7601 5th Ave, Brooklyn, NY 11209 | 4.1★
2. Brooklyn Pets — 254 Flatbush Ave, Brooklyn, NY 11217 | 4.4★
3. Urban Jungle — 378 Metropolitan Ave, Brooklyn, NY 11211 | 4.6★
4. Animal Farm Pet Center — 2807 Avenue U, Brooklyn, NY 11229 | 4.3★

Writing to db/seed.ts...

Real data, real addresses, directly into the seed file. Codex didn’t need to leave the terminal and neither did you.

You can also use this during development when you need to test edge cases:

“Find a neighborhood in Brooklyn with very few restaurants so I can test the empty state.”

Codex can search, evaluate the results, and use them to inform the code it writes — all in one pass.

Wrapping Up

Connecting AgentPatch to Codex gives it live access to Google Maps data during any coding session. Maps is one tool; the same connection also unlocks web search, news, email, and every other tool on the marketplace. See what’s available at agentpatch.ai.