search-console-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@search-console-mcpshow me my site's performance for last month"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
search-console-mcp
Superfast, stdio-first MCP server for Google Search Console with:
Fast startup
Typed tool inputs
In-memory TTL caching + request coalescing
OAuth 2.0 refresh-token authentication
Features
Available MCP tools:
list_sitesquery_performanceinspect_urllist_sitemapsget_sitemap
Related MCP server: google-search-console-mcp-python
Requirements
Node.js 20+
pnpm 9+
Google Search Console property access
OAuth client credentials + refresh token
Quick Start (Plug & Play)
Get your refresh token (one-time setup):
pnpm install
pnpm authThis will:
Prompt for your Client ID and Secret
Open your browser for authorization
Save credentials to
.envautomatically
Build and run:
pnpm build
pnpm startThat's it! The server reads credentials from .env automatically.
Getting Credentials
Step 1: Create OAuth Client ID on Google Cloud Console
Go to Google Cloud Console
Create a new project (or use an existing one)
Enable the Google Search Console API:
Navigate to "APIs & Services" → "Library"
Search for "Google Search Console API"
Click "Enable"
Create OAuth 2.0 credentials:
Go to "APIs & Services" → "Credentials"
Click "Create Credentials" → "OAuth client ID"
Choose "Desktop application" or "Web application"
Add redirect URI:
http://localhost:9876(unique port to avoid conflicts)Copy the Client ID and Client Secret
Step 2: Get Refresh Token
Easiest way — use the built-in script:
pnpm install
pnpm authThis will:
Prompt for Client ID and Secret
Open your browser for authorization
Automatically save to
.env
Manual alternative if needed — use Google's OAuth 2.0 Playground:
Configure the OAuth Client ID (gear icon)
Use scope:
https://www.googleapis.com/auth/webmastersAuthorize and copy the refresh token
Step 3: Find Your Search Console Site URL
Go to Google Search Console
Select your property
In the URL bar, you'll see a property like:
sc-domain:example.com(domain property)https://example.com(URL prefix property)
Copy this value as your
GSC_SITE_URL
Setup
After pnpm auth creates your .env, you're ready to go:
pnpm build
pnpm startThe server automatically reads GSC_CLIENT_ID, GSC_CLIENT_SECRET, GSC_REFRESH_TOKEN, and GSC_SITE_URL from .env.
Manual .env Setup (optional)
If you prefer to create .env manually:
cat > .env << 'EOF'
GSC_CLIENT_ID="your-client-id"
GSC_CLIENT_SECRET="your-client-secret"
GSC_REFRESH_TOKEN="your-refresh-token"
GSC_SITE_URL="sc-domain:example.com"
GSC_CACHE_TTL_MS="30000"
GSC_HTTP_TIMEOUT_MS="12000"
GSC_HTTP_RETRIES="2"
EOFThen run:
pnpm build
pnpm startDocker
Build image:
docker build -t search-console-mcp .Run with .env file (easiest):
docker run --rm -i --env-file .env search-console-mcpOr pass env vars directly:
docker run --rm -i \
-e GSC_CLIENT_ID="your-client-id" \
-e GSC_CLIENT_SECRET="your-client-secret" \
-e GSC_REFRESH_TOKEN="your-refresh-token" \
-e GSC_SITE_URL="sc-domain:example.com" \
search-console-mcpAI Agent Integration
Claude Desktop
Option 1: Docker via local MCP config (Recommended)
This is the most reliable Claude Desktop setup: no custom connector UI, no remote URL, no TLS hassle.
Build image:
docker build -t search-console-mcp .Add this to Claude Desktop config (
~/Library/Application Support/Claude/claude_desktop_config.jsonon macOS):
{
"mcpServers": {
"search-console": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"--env-file",
"/absolute/path/search-console-mcp/.env",
"search-console-mcp"
]
}
}
}Example absolute path:
/Users/devbyray/Projects/devbyrayray/search-console-mcp/.envRestart Claude Desktop.
Option 2: Local Node.js process (stdio)
{
"mcpServers": {
"search-console": {
"command": "bash",
"args": ["-c", "cd /absolute/path/search-console-mcp && source .env && pnpm start"]
}
}
}Option 3: Custom Connector UI (remote MCP URL)
Use this only when you have a real remote endpoint.
URL must be
https://.../mcpCertificate must be trusted by Claude (public CA certificate)
localhost+ self-signed certificates may fail in Custom Connector mode
For local development, prefer Option 1 or 2.
Claude Code (VS Code Extension)
Create .env.local in your project, then add to VS Code settings:
{
"claude.mcpServers": {
"search-console": {
"command": "bash",
"args": ["-c", "cd /absolute/path/search-console-mcp && source .env && node dist/index.js"]
}
}
}GitHub Copilot
Best approach: Use .env with the server:
source .env && pnpm startThen configure Copilot CLI to connect to the running server.
Docker Integration for AI Agents
For containerized deployments, use .env:
docker build -t search-console-mcp .
docker run --rm -i --env-file .env search-console-mcpOther MCP Clients
All MCP clients can read .env files. Example configuration structure:
{
"command": "bash",
"args": ["-c", "cd /path/to/search-console-mcp && source .env && node dist/index.js"]
}Or pass env vars directly from your .env file to the client configuration.
MCP Client Configuration Example
Generic reference (use .env for actual values):
{
"mcpServers": {
"search-console": {
"command": "node",
"args": ["/absolute/path/search-console-mcp/dist/index.js"],
"env": {
"GSC_CLIENT_ID": "your-client-id",
"GSC_CLIENT_SECRET": "your-client-secret",
"GSC_REFRESH_TOKEN": "your-refresh-token",
"GSC_SITE_URL": "sc-domain:example.com"
}
}
}
}OAuth Refresh Token Notes
Use any OAuth 2.0 flow that produces a Google refresh token for the same client ID/secret pair. The server only needs the refresh token and will rotate access tokens automatically.
Development
pnpm devTests:
pnpm testLint:
pnpm lintTroubleshooting
Missing required environment variable: check all requiredGSC_*vars.token_refresh_failed: verify OAuth client ID/secret and refresh token pair.google_api_errorwith403: verify account access to the requested property.429/5xx: retries are automatic; reduce request volume or increase interval between calls.
This server cannot be deployed
Maintenance
Related MCP Connectors
Read-only Google Search Console MCP server for AI assistants.
1Hosted MCP server for GA4, Google Ads and Search Console. Google OAuth, nothing to install.
Hosted, read-only Google Search Console MCP: performance, comparisons, URL inspection, sitemaps.
SEO MCP server for keyword research, SERP analysis, audits, and Search Console workflows.
Related MCP Servers
- AlicenseAqualityCmaintenanceMCP server for querying Google Search Console data — search analytics, URL inspection, sitemap monitoring, and more — read-only tools for any MCP-compatible AI client.7Apache 2.0
- AlicenseNot gradedqualityCmaintenanceMCP server for Google Search Console API that enables querying search analytics, managing sites, inspecting URLs, and supporting domain delegation via service accounts.MIT
- AlicenseNot gradedqualityAmaintenanceMCP server for Google Search Console, enabling querying search analytics, URL inspection, sitemap management, and more via natural language.895 npm2MIT
- AlicenseAqualityDmaintenanceMCP server for Google Search Console, enabling querying search performance, listing properties, and inspecting URL indexing status from MCP-compatible clients.434 npm1MIT