Skip to content
Takshak Mudgal
Product engineering

Claude, connected to your Search Console

A remote MCP server at BabyLoveGrowth.ai with its own OAuth layer and 14 tools, so anyone can ask Claude about their own Search Console and Google Analytics data.

Status
Live
When
Jun 2026
Role
Built the OAuth server, the MCP transport and 14 of its 15 tools
Team
Me, with review from the team
Stack
TypeScript, Express, Prisma, PostgreSQL, OAuth 2.1, JSON-RPC
143
of the connector's 15 tools are mine
31
MCP protocol versions supported, from 2024-11-05 to 2025-06-18
1 h2
access tokens, with 30-day refresh tokens that rotate on every use
7 days1
from the first commit to the audit tool

Summary

BabyLoveGrowth.ai already pulled its customers' Search Console and Google Analytics data into its own dashboard. The goal was to let people ask an AI assistant about that data directly, without exporting reports, so in June 2026 I built a remote MCP server: anyone with a Google account can connect their own sites to Claude, or any other remote MCP client, and query them live.

I wrote the OAuth authorization server, the JSON-RPC transport and 14 of its 15 tools. It has been live since 16 June 2026, and the production OAuth metadata matched the code when I checked it on 16 October2.

Constraints

  • Claude's connector flow is strict. A remote MCP server has to publish OAuth discovery metadata, accept dynamic client registration and require PKCE, or Claude cannot connect to it.
  • Read-only, always. The Google scopes are webmasters.readonly and analytics.readonly. Nothing the assistant asks for can change a property.
  • Tokens live in someone else's client. Access and refresh tokens are held by a third-party app, so a leaked refresh token must stop working quickly and must not be reusable.

How a connection works

The server is two things in one Express module: an OAuth authorization server for MCP clients, sitting in front of Google's own OAuth, and a JSON-RPC endpoint that answers tool calls. I wrote the transport by hand, with no MCP SDK, which kept it to plain POST requests.

ClaudeMCP serverGoogle
  1. 1Calls the MCP endpoint without a token

  2. 2401, pointing at the resource metadata

  3. 3Registers itself as a public client

  4. 4Asks to authorize, with a PKCE S256 challenge

  5. 5Sends the user to Google consent

    The pending request rides through as a signed JWT that expires in 10 minutes.

  6. 6Returns; the user picks a property

  7. 7Redirects with a single-use code

    Codes expire in 5 minutes.

  8. 8Trades the code and verifier for tokens

  9. 9Calls a tool, such as find_traffic_drops

  10. 10Reads Search Console or Analytics

Fig. 1. Connecting Claude to a Search Console property. Google only ever sees read-only scopes; the client only ever sees tokens minted by the server.

The details that make it safe

  • The PKCE verifier is checked against its S256 challenge with a constant-time comparison.
  • Authorization codes are claimed atomically: one updateMany that only matches a code nobody has consumed, so two racing requests cannot both spend it.
  • Access tokens last an hour and are bound to the MCP resource URL, so a token minted for this server is useless anywhere else.
  • Refresh tokens are 32 random bytes stored only as SHA-256 hashes. They last 30 days and rotate on every use. If an old one is presented again, every token for that client and connection is revoked, because reuse means one of them leaked.
  • Unauthenticated calls get a WWW-Authenticate header pointing at the resource metadata, and both the OAuth routes and each connection are rate limited.

The tools

Most tools are thin and predictable on purpose: one Google API call, a clear time window and a compact result the model can reason about. The three analysis tools do the comparing on the server, so the assistant gets the answer to “what dropped” instead of two raw reports to diff.

MCP tools by data source
ToolSourceWhat it answers
get_search_performanceSearch ConsoleClicks, impressions and average position, with a trend and a daily series
get_top_search_queriesSearch ConsoleTop queries by clicks, with impressions, CTR and position
get_top_pagesSearch ConsoleTop pages by organic clicks
get_country_breakdownSearch ConsoleClicks, impressions and position for the top countries
find_keyword_opportunitiesSearch ConsoleQueries ranking 5 to 15 with real impressions, the quickest wins for page one
find_traffic_dropsSearch ConsolePages that lost the most clicks against the previous equal period
find_decaying_pagesSearch ConsolePages whose last 28 days trail the same window about three months earlier
find_cannibalizationSearch ConsoleQueries where two or more of your pages split the clicks
get_traffic_overviewAnalyticsActive users, sessions, AI-referred users and the top channel
get_traffic_by_channelAnalyticsActive users by channel, including LLM referrers
get_ai_trafficAnalyticsUsers and sessions from ChatGPT, Gemini, Claude, Perplexity, Copilot and others
get_top_landing_pagesAnalyticsTop landing pages, with each page's top source and whether it is AI
get_technical_auditAuditA health score, page speed, llms.txt, robots and sitemap checks, and on-page issues
get_connection_infoAccountWhich Google account and properties the connection reads
Fig. 2. The 14 tools I wrote, by data source, described from the live connector's own tool list3. The fifteenth, an LLM visibility test, is a teammate's.

Outcome

The connector went public on 16 June 2026 with Google sign-in for anyone, gained the three analysis tools two days later and the audit tool on 22 June1. It now has its own landing page and a set of Claude workflow guides on the BabyLoveGrowth site. I later added MCP users to the weekly performance email.

I have not published usage numbers here; they live in production data I do not quote.

What I would change

Writing the transport by hand kept it small, but it also means following each new MCP protocol revision myself. The server negotiates three versions today. If the spec keeps moving at this pace, a maintained SDK would cost less over a year than tracking the changes by hand.

Sources

  1. 1.BabyLoveGrowth backend pull requests and module history. Private repository; tool authorship from the commit history, dates from merge times, read 16 Oct 2026.
  2. 2.Production OAuth authorization server metadata. S256 PKCE, authorization_code and refresh_token grants, scope seo:read, read 16 Oct 2026.
  3. 3.The connector's live tool list, read through a connected Claude client. 15 tools on 16 Oct 2026.