Google Search Console
STDIOGoogle搜索控制台API集成MCP服务器
Google搜索控制台API集成MCP服务器
This project provides a Model Context Protocol (MCP) server that allows Claude AI (via the Claude Desktop app) or others to interact with the Google Search Console API. You can use it to query performance data, inspect URLs, check indexing status, and more, directly from your Claude chat (or others).
You can follow me on X @metehan777 and visit my blog https://metehan.ai
Based on the available Google Search Console API endpoints allowed in this project:
(Note: Index coverage details and crawl errors beyond what's available in the URL Inspection API are generally not exposed via the Google Search Console API.)
See the Search Console API capabilities & announcements here: https://developers.google.com/webmaster-tools/v1/api_reference_index
venv (recommended, built into Python 3).Clone or Download: Get the project files onto your local machine. If using git:
git clone https://github.com/metehan777/google-search-console-mcp.git cd search-console-mcp
Create and Activate Virtual Environment: It's highly recommended to use a virtual environment to manage dependencies.
# Create the virtual environment (using the name 'fresh_env' as in previous steps) python3 -m venv fresh_env # Activate the environment # On macOS/Linux: source fresh_env/bin/activate # On Windows: # .\fresh_env\Scripts\activate
(You should see (fresh_env) at the beginning of your terminal prompt)
Install Dependencies: Install the required Python packages, including the project itself in editable mode.
pip install -e .
Google Cloud Setup & Credentials:
credentials.json: After creation, click "DOWNLOAD JSON". Save this file directly into the root of your project directory (search-console-mcp/) and ensure it is named exactly credentials.json.credentials.json is listed in your .gitignore file to avoid accidentally committing it.Initial Authentication:
token.json file will be created in your project directory. This stores your access token. Do not commit token.json if you are going to fork this repo and push/pull it again.While the primary use is via Claude Desktop integration, you can test the server directly using stdio transport:
The server will start and wait for JSON-RPC messages on standard input/output. You can press Ctrl+C to stop it. Logs will be printed to standard error.
To make the tools available in the Claude Desktop app:
Locate Configuration File: Find the Claude Desktop configuration file. On macOS, it's typically at:
~/Library/Application Support/Claude/claude_desktop_config.json
Edit Configuration: Open the file in a text editor. Add or modify the mcpServers section to include an entry for this tool. Use the absolute path to the python3 executable within your virtual environment.
{ "mcpServers": { "filesystem": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-filesystem", "/Users/username/Desktop", "/Users/username/Downloads" ] }, "google-search-console": { "command": "/Users/username/Documents/search-console-mcp/fresh_env/bin/python3", "args": [ "-m", "main" ], "cwd": "/Users/username/Cursor/search-console-mcp" } } }
/Users/username/Documents/search-console-mcp with the actual absolute path to your project directory on your system in both the command and cwd fields.mcpServers, just add the "google-search-console": { ... } block alongside them.Restart Claude Desktop: Close and reopen the Claude Desktop application for the changes to take effect.
Once set up and integrated, you can ask Claude to use the tools. Examples:
Claude should identify the appropriate tool and execute it via the MCP server. Remember to grant permissions during the initial authentication flow if prompted.
You can contribute or suggest improvements anytime!