How to Add Google Search to Claude Code

Claude Code is a capable coding agent, but it works from training data that has a cutoff date. When you need it to check current docs, look up a package version, or find a recent Stack Overflow answer, it’s guessing. Adding Google Search through AgentPatch fixes that.

Why This Matters

A lot of coding work involves looking things up: API docs, error messages, library changelogs, deprecation notices. Claude Code handles most of it from memory, but for anything recent it either hallucinates or tells you to check yourself.

With Google Search available as a tool, Claude Code can look things up directly during a task. Ask it to figure out why a build is failing and it can search for the error message. Ask it to update a dependency and it can check what the latest version actually is.

Setup

Install the AgentPatch CLI (zero dependencies, Python 3.10+):

pip install agentpatch

Set your API key:

export AGENTPATCH_API_KEY=your_api_key

Then use it:

ap search "web search"
ap run agentpatch google-search --input '{"query": "test"}'

Get your API key from the AgentPatch dashboard.

Run this command to add AgentPatch as an MCP server:

claude mcp add -s user --transport http agentpatch https://agentpatch.ai/mcp \
  --header "Authorization: Bearer YOUR_API_KEY"

Replace YOUR_API_KEY with your actual key from the AgentPatch dashboard. Claude Code discovers all AgentPatch tools automatically.

Example

You’re in a Claude Code session and run into an error:

“This ESLint rule is throwing on valid code. Can you look up whether this is a known bug?”

Claude Code searches Google directly:

Searching Google for "eslint no-unused-vars false positive destructuring 2025"...

Found a relevant GitHub issue (#16304). This is a known bug in [email protected] with
destructured imports — fixed in [email protected]. Your config pins "eslint": "^8.50.0".
I can bump that to ^9.0.0 if you want.

Claude Code found the issue, traced it back to a version constraint in your config, and offered to fix it — all without you opening a browser tab.

This also works for checking library compatibility, verifying deprecation timelines, or finding the right import path for a package that reorganized its exports.

Wrapping Up

Adding AgentPatch to Claude Code gives it a real-time connection to the web during any coding session. Google Search is one tool; the same config also gives access to image search, email, maps, and everything else on the marketplace. Visit agentpatch.ai to explore what’s available.