To use this MCP server, you must authenticate with the Google Search Console API. We recommend the Secure Desktop Flow, which uses your local machine’s keychain and hardware-bound encryption to store tokens safely.
1. OAuth 2.0 Desktop Flow (Recommended)
This method allows you to log in with your Google account via a browser, just like any other desktop application.
Security Features
- System Keychain: Tokens are stored in your OS’s native credential manager (macOS Keychain, Windows Credential Manager, Linux Secret Service).
- Hardware-Bound Encryption: Fallback storage uses AES-256-GCM with a key derived from your unique machine ID. Tokens cannot be decrypted on other devices.
- Multi-Account Support: Easily switch between multiple Google accounts.
How to Login
Run the following command in your terminal:
- A local secure server will start.
- Your browser will open to the Google Authorization page.
- Grant access to your Search Console data.
- The CLI will automatically fetch your email and securely store your credentials.
Logout & Management
You can manage your sessions directly from the CLI:
2. Service Account (Advanced / Headless)
For server-side environments or automated tasks where interactive login isn’t possible, you can use a Google Cloud Service Account.
Step 1: Create a Service Account
- Go to the Google Cloud Console.
- Create a new project (or select an existing one).
- Go to IAM & Admin > Service Accounts.
- Click Create Service Account.
- Give it a name (e.g.,
seo-agent) and click Create and Continue.
- Click Done.
Step 2: Generate a JSON Key
- In the Service Accounts list, click on your new account.
- Select the Keys tab.
- Click Add Key > Create new key.
- Select JSON and click Create.
- A JSON file will download to your computer. Keep this file secure.
Step 3: Grant Access in Search Console
You must give your Service Account permission to see your data:
- Open the Google Search Console.
- Go to Settings > Users and permissions.
- Click Add User.
- Enter the Service Account Email (e.g.,
seo-agent@your-project.iam.gserviceaccount.com).
- Select Permissions (Full or Restricted) and click Add.
Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to point to your key file:
To access Bing data, you simply need an API Key.
Step 1: Get Your API Key
- Go to Bing Webmaster Tools Settings.
- Log in with your Microsoft account.
- Click Generate API Key.
- Copy the key.
You can configure the Bing API Key in your MCP client configuration using the BING_API_KEY environment variable.
Example for Claude Desktop:
Setup Wizard support
Alternatively, run npx search-console-mcp setup and choose Option 3 to configure your Bing API Key interactively.
4. Google Analytics 4 (Service Account)
GA4 integration currently requires a Service Account for the most reliable connection.
Step 1: Automated Setup
Run the setup wizard with the GA4 flag:
Step 2: Granting Property Access
Just like Search Console, you must add your Service Account email to your GA4 property:
- Open Google Analytics.
- Go to Admin > Property Settings > Property Access Management.
- Click the blue + button > Add users.
- Enter the Service Account Email.
- Select the Viewer role (minimum) and click Add.
5. PageSpeed Insights (Optional API Key)
PageSpeed tools (pagespeed_analyze, pagespeed_core_web_vitals, analytics_pagespeed_correlation) work without any configuration using Google’s free tier.
For heavy usage (batch audits, automated monitoring), you can provide an API key to increase quotas.
Step 1: Create an API Key
- Go to the Google Cloud Console — Credentials.
- Click Create Credentials > API key.
- Copy the generated key.
Step 2: Enable the API
- In the same GCP project, go to APIs & Services > Library.
- Search for PageSpeed Insights API.
- Click Enable.
Set the PAGESPEED_API_KEY environment variable in your MCP client or .env file:
This key is optional. Without it, all PageSpeed tools still work — just at lower rate limits.
What’s Next?
Once you’re authenticated, you can manage your accounts and connect additional ones: