How to Add Location Intelligence to Codex
Codex CLI is strong for code tasks, but when your work touches location data — validating addresses, generating test fixtures, building a geo feature — it has no way to fetch real place information. AgentPatch adds Google Maps to Codex so it can look up locations on its own during any session.
Why This Matters
A lot of backend and API work involves location data in some form: validating that an address exists, finding realistic coordinates for test cases, checking whether a city name is in a particular country. These are small tasks but they break your flow if you have to leave the terminal to handle them.
With Maps available in Codex, those lookups happen inline. You ask, Codex searches, and it uses the results to keep working.
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 working on an API that accepts business addresses and need to validate your normalization logic against real data. You ask Codex:
“I need 3 real business addresses in different formats — one with a suite number, one with a PO box, one standard — to test our address normalizer.”
Codex searches Maps and structures the results:
Searching Google Maps for "businesses Chicago" and filtering for format variety...
Here are three addresses in different formats:
1. Standard: 233 S Wacker Dr, Chicago, IL 60606 (Willis Tower)
2. Suite: 71 S Wacker Dr, Suite 3500, Chicago, IL 60606 (law firm)
3. Floor/Unit: 1 N Dearborn St, Floor 7, Chicago, IL 60602 (co-working)
Using these in the address normalizer tests now.
Codex found real addresses with natural format variation — exactly what you need to stress-test normalization logic — without you leaving the terminal.
Wrapping Up
Connecting AgentPatch to Codex gives it live location intelligence through Google Maps. That’s one tool on the marketplace — the same connection also unlocks web search, news, email, image generation, and more. See everything at agentpatch.ai.