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.readonlyandanalytics.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.
1Calls the MCP endpoint without a token
2401, pointing at the resource metadata
3Registers itself as a public client
4Asks to authorize, with a PKCE S256 challenge
5Sends the user to Google consent
The pending request rides through as a signed JWT that expires in 10 minutes.
6Returns; the user picks a property
7Redirects with a single-use code
Codes expire in 5 minutes.
8Trades the code and verifier for tokens
9Calls a tool, such as find_traffic_drops
10Reads Search Console or Analytics
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
updateManythat 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-Authenticateheader 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.
| Tool | Source | What it answers |
|---|---|---|
get_search_performance | Search Console | Clicks, impressions and average position, with a trend and a daily series |
get_top_search_queries | Search Console | Top queries by clicks, with impressions, CTR and position |
get_top_pages | Search Console | Top pages by organic clicks |
get_country_breakdown | Search Console | Clicks, impressions and position for the top countries |
find_keyword_opportunities | Search Console | Queries ranking 5 to 15 with real impressions, the quickest wins for page one |
find_traffic_drops | Search Console | Pages that lost the most clicks against the previous equal period |
find_decaying_pages | Search Console | Pages whose last 28 days trail the same window about three months earlier |
find_cannibalization | Search Console | Queries where two or more of your pages split the clicks |
get_traffic_overview | Analytics | Active users, sessions, AI-referred users and the top channel |
get_traffic_by_channel | Analytics | Active users by channel, including LLM referrers |
get_ai_traffic | Analytics | Users and sessions from ChatGPT, Gemini, Claude, Perplexity, Copilot and others |
get_top_landing_pages | Analytics | Top landing pages, with each page's top source and whether it is AI |
get_technical_audit | Audit | A health score, page speed, llms.txt, robots and sitemap checks, and on-page issues |
get_connection_info | Account | Which Google account and properties the connection reads |
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.BabyLoveGrowth backend pull requests and module history. Private repository; tool authorship from the commit history, dates from merge times, read 16 Oct 2026.
- 2.Production OAuth authorization server metadata. S256 PKCE, authorization_code and refresh_token grants, scope seo:read, read 16 Oct 2026.
- 3.The connector's live tool list, read through a connected Claude client. 15 tools on 16 Oct 2026.