Claude Code Web Search via MCP: Your Options Explained

Claude Code has no built-in web search. It can fetch a URL you give it, but it can’t search Google, Bing, or anything else on its own. MCP is the way to add that capability, and you have a few options for how to do it.

What MCP Is (in 30 Seconds)

The Model Context Protocol is a standard for connecting AI tools to external capabilities. Claude Code has native MCP support: you add a server to your config, and Claude Code discovers the tools that server exposes. No plugins, no extensions, no custom code. It reads the config, connects to the server, and the tools appear in its available tool list.

When you ask Claude Code something that would benefit from a web search, it calls the search tool, gets results, and incorporates them into its response. You don’t need to prompt it with “use the search tool.” It decides on its own.

Option 1: Self-Hosted MCP Server with a Search API

You can run your own MCP server that wraps a search API. The typical setup looks like this:

  1. Sign up for a search API (Brave, SerpAPI, Google Custom Search)
  2. Clone or install an open-source MCP server that wraps that API
  3. Run the server locally or on your network
  4. Point Claude Code at it in your MCP config

This gives you full control. You pick the search provider, you manage the API key, you set the rate limits. The downside is maintenance. You’re responsible for keeping the server running, updating it when the API changes, and managing the keys. If you use Brave’s free tier, you’re capped at 2,000 queries per month. Google Custom Search gives you 100 queries per day for free, then $5 per 1,000 after that.

For a solo developer who searches a few times a day, this works. For a team or heavy usage, the key management and rate limits become friction.

Option 2: Community MCP Servers

The MCP ecosystem has grown fast. There are open-source servers for Brave Search, Tavily, SearXNG, and others. These are maintained by the community, which means quality varies. Some are well-maintained with regular updates. Others haven’t been touched in months.

The setup is similar to option 1: clone the repo, install dependencies, configure your API key, and add it to your Claude Code config. You still need an API key for whatever search backend the server uses.

Community servers are a good option if you want a specific search provider and don’t mind occasional maintenance. Check the repo’s commit history and issue tracker before committing to one.

Option 3: MCP Tool Marketplaces

A tool marketplace runs the MCP server for you. You get one API key, one config block, and access to multiple tools (web search, news, images, and more). The marketplace handles the search provider integration, API keys, rate limits, and infrastructure.

The trade-off: you’re depending on a third-party service, and there’s a cost. But you skip all the setup and maintenance of options 1 and 2.

Setting Up AgentPatch (Marketplace Option)

AgentPatch is an MCP tool marketplace that provides Google Search, Bing Search, Google News, and other tools through a single connection. Here’s the setup for Claude Code.

The AgentPatch CLI is designed for AI agents to use via shell access. Install it, and your agent can discover and invoke any tool on the marketplace.

Install (zero dependencies, Python 3.10+):

pip install agentpatch

Set your API key:

export AGENTPATCH_API_KEY=your_api_key

Example commands your agent will use:

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

Get your API key from the AgentPatch dashboard.

Install the AgentPatch skill — it teaches Claude Code when to use AgentPatch and how to use the CLI:

/plugin marketplace add fullthom/agentpatch-claude-skill
/plugin install agentpatch@agentpatch

MCP Server (Alternative)

If you prefer raw MCP tool access instead of the skill:

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.

That’s the entire setup. No search API keys to manage, no server to run, no dependencies to install. Claude Code connects to AgentPatch’s MCP server and gets access to all available tools.

Which Option Should You Pick?

Self-hosted if you want full control, have a specific search provider requirement, and don’t mind the upkeep.

Community server if you found one that wraps your preferred search API and it’s well-maintained.

Marketplace if you want zero-config setup, access to multiple tools beyond search, and don’t want to manage API keys for individual providers.

Most developers start with a marketplace because it’s fast, then move to self-hosted if they have specific requirements. There’s no lock-in with MCP: you can swap your search MCP server at any time by changing one config block.

Wrapping Up

MCP is how you add web search to Claude Code. You can self-host, use a community server, or connect to a marketplace. AgentPatch takes the marketplace approach: one config block, one key, and you get Google Search plus dozens of other tools. See what’s available at agentpatch.ai.