How to Add Google Search to Codex

Codex CLI is fast and tight to your terminal workflow, but like any model-based agent it’s limited to what it learned during training. That’s fine for most tasks, but it falls short when you need current information — latest package versions, recent CVEs, updated API docs. AgentPatch adds Google Search without requiring you to manage a separate search API.

Why This Matters

Dependency management, security patches, and framework upgrades all require knowing what’s current. Codex can reason about code well, but if it’s working from stale knowledge it’ll suggest outdated approaches or miss breaking changes introduced after its training cutoff.

Giving Codex access to Google Search means it can verify the current state of things before making recommendations. It doesn’t need to hedge with “as of my last update” — it can just check.

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 migrating from an older version of a library:

“I need to upgrade from React Router v5 to the latest. What are the main migration steps?”

Codex searches Google instead of relying on training data:

Searching Google for "React Router v5 to v6 migration guide 2026"...

React Router is now on v7. The major changes from v5 are:
- Route components replaced with element prop
- useHistory replaced with useNavigate
- Switch replaced with Routes
- Nested routes use relative paths by default

The official migration guide is at reactrouter.com/upgrading/v5. Want me to start
updating the router config in src/App.tsx?

Codex found the current version, pulled the actual migration path, and offered to start the work. No copy-pasting from a browser.

Wrapping Up

Connecting AgentPatch to Codex gives it access to live search results during any session. Beyond Google Search, the same connection exposes every other tool on the marketplace — no additional setup needed per tool. See what’s available at agentpatch.ai.