DEV Community

dodou
dodou

Posted on

Give Claude Live Google Search with an MCP Server

An agent's answers are only as fresh as the data it can reach. Wire a SERP API into Claude — or Cursor, Cline, Continue, Codex — through MCP and it can pull live Google results mid-conversation, with sources it can cite. The config is about ten lines of JSON; no glue code, no custom tool schemas to write.

I set this up last week for release-note checking and competitor-watching questions. It's the fastest "my agent knows what happened on the web today" upgrade I've done.

What you need

  • An MCP-capable client: Claude Desktop, Claude Code, Cursor, Cline/Roo, Continue, or Codex.
  • Python on your PATH (the server runs via python -m serpbase_mcp).
  • An API key from a SERP API provider. I use SerpBase — new accounts get 100 free searches without a card, search requests cost 1 credit, and standard credits don't expire. The server, its tool list, and the endpoint parameters are documented in SerpBase's MCP integration docs; the code itself lives in the serpbase-dev/serpbase-mcp repo on GitHub.

The config

Install the server per its repo README, then add it to your client's MCP config (for Claude Desktop that's claude_desktop_config.json):

{
  "mcpServers": {
    "serpbase": {
      "command": "python",
      "args": ["-m", "serpbase_mcp"],
      "env": {
        "SERPBASE_API_KEY": "your_api_key"
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Restart the client and you get six tools exposed to the agent: Google Search, Images, News, Videos, Maps Search, and Maps Detail — all returning structured results the model can read and cite directly. The key rides in the process environment, not in the chat, and not in your repo.

On Windows, if python isn't found, try "command": "python3" or the full path to your interpreter — that was the only hiccup in my setup.

Prompts that work well

The value shows up with questions that have a time dimension:

  • "Search Google for the latest release notes of and summarize what changed, with sources."
  • "Check Google News for from this week and tell me if anything looks important."
  • "Search for ' pricing' and compare what's on their page today with what I pasted below."

One habit worth keeping: ask the agent to do one search per question instead of letting it chain ten. Every successful tool call is a billed API request (search/news/videos are 1 credit, images/maps are 2), and failed requests come back with credits_charged: 0 — so retries don't cost you, but enthusiasm does.

MCP server or agent skill?

The same org also publishes a portable agent skill (serpbase-dev/serpbase-skill) — a skill folder plus a shell fallback for agents that prefer scripts over an MCP server (opencode-style agents, Claude Code memory, shell workflows). If your tool reads local instructions instead of speaking MCP, use the skill; otherwise the server above is the cleaner path.

FAQ

Does this replace calling the API from my code? No. The MCP server is for interactive agent use — research, monitoring questions, cited answers. Production pipelines should still call the endpoints directly with the same key.

Is my API key exposed to the model? The model sees tool results, not the key. The key lives in the server process's environment via the env block in your config.

What does it cost to try? A hundred free searches cover a real evaluation — wire it up, ask your team's actual questions for a day, and check the credit log afterward.

Add the config, restart your client, then ask it something you'd normally google. When the answer comes back with today's sources attached, you'll know it's working.

Top comments (0)