Give your agent more context: Google Search Console + website analytics via MCP
Your AI agent gets better the more context it has. Adding Google Search Console via MCP gives it your search rankings, impressions, and click-through rates alongside everything else it already knows, your code, your database, your website analytics. The setup takes about 10 minutes, and the result is an agent that can reason about your entire acquisition funnel without you checking anything manually.
The value here is less about having a nicer way to query GSC and more about your agent having the full picture when it's already helping you with something. When it's debugging a traffic drop, it can look at both search rankings and on-site behaviour in the same turn. When it's reviewing a new blog post, it can check whether similar content is already ranking. It just has the data when it's relevant.
What does GSC data give your agent?
Google Search Console is the only source of truth for how your site appears in Google search. Adding it via MCP gives your agent access to impressions, clicks, CTR, and average position, grouped by query, page, device, country, or date. It can also inspect URLs for indexing issues and check sitemap status, 19 tools in total.
You probably won't sit down and ask your agent "what's my average position for this keyword." But if you're writing a new blog post, it already knows what you rank for. If you're debugging a conversion drop, it can check whether search visibility changed without you thinking to ask. The data is just there, part of the context your agent works with.
Why does adding website analytics alongside GSC matter?
GSC covers everything before someone reaches your site: which queries, what position, how many impressions. Website analytics covers everything after: which pages they visit, how long they stay, whether they convert. Your agent needs both to reason about the full picture, and the value isn't in querying them separately but in having them both available in the same context.
A concrete example: your agent is investigating why signups dropped this week. With Lodd, it sees traffic from Google fell 30%. With GSC in the same session, it finds your top-ranking blog post dropped from position 4 to position 12. One conversation, both sides of the story.
According to Ahrefs (2025), 68% of online experiences begin with a search engine. If search is how people find you, your agent having both the ranking data and the on-site data means it can trace the full path from query to conversion in a single turn.
How do you set up mcp-gsc?
The mcp-gsc server is a Python package that connects to the Google Search Console API via OAuth. Setup has three parts: Google Cloud credentials, the MCP server, and connecting it to your agent.
Step 1: Create Google Cloud OAuth credentials
- Go to console.cloud.google.com and create a project (or use an existing one)
- Go to APIs & Services > Library, search for "Google Search Console API", and enable it
- Go to APIs & Services > Credentials > Create Credentials > OAuth client ID
- If prompted, configure the consent screen: choose External, add your email, and save
- For the OAuth client, choose Desktop app as the application type
- Download the JSON credentials file
Save it somewhere permanent:
mkdir -p ~/.config/mcp-gsc
mv ~/Downloads/client_secret_*.json ~/.config/mcp-gsc/credentials.jsonStep 2: Add mcp-gsc to your MCP config
For Claude Code, add to your .mcp.json (project-level or ~/.claude/.mcp.json for global):
{
"mcpServers": {
"gsc": {
"command": "uvx",
"args": ["mcp-gsc"],
"env": {
"GSC_OAUTH_CLIENT_SECRETS_FILE": "/path/to/.config/mcp-gsc/credentials.json"
}
}
}
}For Cursor, add the same config in your MCP settings.
uvx runs the Python package without a manual install (it's npx for Python). You'll need uv installed: curl -LsSf https://astral.sh/uv/install.sh | sh.
Step 3: Authenticate
Restart your agent. The first time you use a GSC tool, it opens a browser window for Google OAuth. Sign in, authorise access, and the token is cached for future sessions. You won't need to do this again.
How do you set up Lodd for website analytics?
If you don't already have Lodd set up, tell your agent:
"Add lodd.dev analytics to this project."
Your agent reads the setup instructions from lodd.dev/llms.txt, handles authentication via email verification, and adds the 2KB tracking script to your site. It takes about two minutes, and you get 42 MCP tools covering traffic, events, funnels, conversion attribution, and engagement metrics. Free up to 2,500 events per month.
Or add it manually to .mcp.json:
{
"mcpServers": {
"lodd": {
"command": "npx",
"args": ["-y", "@lodd/mcp-server"],
"env": {
"LODD_API_KEY": "your_api_key"
}
}
}
}What becomes possible with both connected?
Once both servers are running, your agent has search performance and website analytics in the same context. These are the kinds of things it can figure out on its own:
| Scenario | What the agent connects |
|---|---|
| Investigating a traffic drop | GSC rankings fell + Lodd confirms organic traffic down |
| Reviewing a new blog post | GSC shows what queries already rank + Lodd shows which existing pages convert |
| Planning content | GSC shows high-impression/low-click queries + Lodd shows which landing pages retain visitors |
| Debugging a conversion issue | Lodd shows bounce rate spiked + GSC shows traffic source shifted to different query intent |
| Checking a deploy's impact | Lodd shows real-time traffic + GSC shows whether indexing was affected |
Your agent doesn't run through these one at a time. It has both data sources in context and can make these connections while it's already helping you with something else.
What are the limitations?
GSC data is 2-4 days old. Google processes search data in batches, so you're always looking at what happened a few days ago. For real-time traffic, you need website analytics (Lodd or similar). For search performance trends, GSC is the right place to go.
The mcp-gsc OAuth flow requires a browser for the initial sign-in. This works fine on a local machine but might need a service account if you're running in a headless environment. The mcp-gsc documentation covers both auth methods.
GSC also has a 16-month data retention limit. Anything older than that is permanently deleted from Google's side. If you want long-term search performance history, you'll need to export it periodically.
Is this worth the 10-minute setup?
Every data source you connect to your agent makes it slightly better at helping you. GSC and website analytics together are a particularly strong combination because they cover the full journey: how people find you, and what they do when they arrive. Most agents today work with code and maybe a database. Adding search and traffic data means they can factor in how the product is actually being used and discovered, not just how it's built.
The setup is 10 minutes for GSC and about 2 minutes for Lodd. After that, your agent just has more context for everything it does.