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.
Step 4: Configure the Server
Set theGOOGLE_APPLICATION_CREDENTIALS environment variable to point to your key file:
3. Bing Webmaster Tools (API Key)
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.
Step 2: Configure the Client
You can configure the Bing API Key in your MCP client configuration using theBING_API_KEY environment variable.
Example for Claude Desktop:
Setup Wizard support
Alternatively, runnpx 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.
What’s Next?
Once you’re authenticated, you can manage your accounts and connect additional ones:- Managing Accounts — List, remove, and restrict accounts from the CLI.
- Multi-Account Support — Connect multiple Google and Bing accounts and let the server pick the right one automatically.
