In this tutorial, weโll walk you through the process of setting up your own MCP (Model Context Protocol) server, adding it to Claude Desktop, and integrating it with Google Search Console (GSC) data. This will allow you to compare time periods to identify SEO improvements, generate visual reports like bar charts and line graphs, and uncover optimization opportunities by analyzing click-through rates, impressions, and ranking shifts.
Letโs get started! ๐
By the end of this guide, Claude will automatically connect to the MCP server and you'll be able to run queries, visualize data, and optimize your websiteโs search performance with ease. Let's get started! ๐
This tutorial is designed to be beginner-friendly, and you donโt need any advanced technical skills. However, you should be comfortable running commands in the command line (also known as the terminal or command prompt).
Throughout this guide, you'll enter commands like:
python --version
git clone <repository-url>
If youโve never used the command line before, donโt worry! Just follow the instructions step by step, and you'll be good to go.
Thatโs all you needโ letโs get started! ๐
Follow these steps to create and download a service account JSON key from Google Cloud Console. If you already have a JSON credentials file, you can skip this part.
๐ Visit Google Cloud Console
my-app-service-account
).Before you begin working with the project, ensure that you have the necessary tools installed. Follow these steps to check if everything is ready.
python --version
python3 --version
If Python is installed, you will see the version number. If not, download and install it from ๐ Download Python
pip --version
pip3 --version
If pip is not installed, follow the official installation guide ๐ Download pip
uv --version
If uv is not installed, follow the official installation guide ๐ Download uv
If Claude Desktop is not installed, follow the official installation guide ๐ Download Claude Desktop.
git --version
If Git is installed, you will see the version number. If not, you can still download the program files, or you can download and install Git from ๐ Download Git
Open a new terminal in the folder where the files will be downloaded to. Run the following commands:
git clone https://github.com/seotesting-com/gsc-mcp-server.git
cd gsc-mcp-server
# Windows
uv venv
.venv\Scripts\activate
# macOS/Linux
uv venv
source .venv/bin/activate
# Windows/macOS/Linux
uv sync
Add the path to your JSON credentials file and run the following command:
mcp install server.py -v GOOGLE_APPLICATION_CREDENTIALS=<path to credentials file>
Make sure you replace <path to credentials file>
with the path to your JSON credentials file eg. C:\Users\Me\Downloads\credentials.json
.
You may need to end Claude tasks in the task manager.
Open Claude Desktop. If the MCP server has been configured correctly, you should be able to see 5 additional tools available in the chat box:
You can use the tools by asking Claude to perform various search console analytics tasks. Before invoking a tool, Claude will ask permission. You should click one of the 'allow' options to use the MCP server:
Lists all verified sites in your Google Search Console account.
Parameters:
- site_url: Full URL of your website (e.g., https://www.example.com/)
- start_date: Start date in YYYY-MM-DD format
- end_date: End date in YYYY-MM-DD format
- dimensions: List of dimensions (query, page, device, country, date)
- search_type: Type of search results (web, image, video, news, discover, googleNews)
- row_limit: Number of rows to return (max 25000)
Parameters:
- site_url: Full URL of your website
- current_start_date: Start date for current period in YYYY-MM-DD format
- current_end_date: End date for current period in YYYY-MM-DD format
- previous_start_date: Start date for previous period in YYYY-MM-DD format
- previous_end_date: End date for previous period in YYYY-MM-DD format
- dimensions: List of dimensions (query, page, device, country, date)
- search_type: Type of search results
- row_limit: Number of rows to return
Parameters:
- site_url: Full URL of your website
- start_date: Start date in YYYY-MM-DD format
- end_date: End date in YYYY-MM-DD format
- metric: Metric to sort by (clicks, impressions, ctr, position)
- limit: Number of results to return
Parameters:
- site_url: Full URL of your website
- start_date: Start date in YYYY-MM-DD format
- end_date: End date in YYYY-MM-DD format
- interval: Time interval for grouping (day, week, month)
If you encounter any issues while setting up or using the MCP server, try the following solutions:
Sometimes, tools donโt appear immediately. Restart Claude Desktop and try again. You may need to end the Claude process in Task Manager (Windows) or Activity Monitor (Mac) before restarting.
After setting up the MCP server, the new tools might take a few minutes to load. If they donโt appear right away, wait a few minutes and try again.
Ensure the service account JSON file is in an accessible folder. Avoid placing it in a restricted or admin-only folder (e.g., C:\Program Files\ on Windows or ~/Library/ on macOS). If necessary, move it to a more accessible location like your Documents or Desktop folder.
Go to File => Settings and click on the Developer tab. When you click on Search Console Analytics, it should display a status of 'running'. If not, there may be an error message providing details of what is causing the connection issue. If you cannot see the Settings as pictured below, make sure you have an up-to-date version of Claude Desktop: ๐ Download Claude Desktop.
Click on Edit Config and open 'claude_desktop_config.json' in a text editor. It should contain:
{
"mcpServers": {
"Search Console Analytics": {
"command": "uv",
"args": [\
"run",\
"--with",\
"google-api-python-client",\
"--with",\
"google-auth",\
"--with",\
"mcp[cli]",\
"--with",\
"pandas",\
"mcp",\
"run",\
"C:\\Documents\\gsc-mcp-server\\server.py"\
],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "C:\\Users\\Path\\To\\Credentials\\gscaccess-credentials.json"
}
}
}
}
If it contains something else, paste this data into file and make sure you update the file paths for the server.py file and the credentials file. Make sure to escape backslash characters (as shown). Restart Claude.
If you see the error "spawn uv ENOENT" when opening Claude Desktop, it means that uv is either not installed or not found in the system path. If uv is installed, you can try adding the full path to the claude config.
Open Claude Desktop and go to File > Settings > Developer. Click "Search Console Analytics", then select Edit Config. Locate the "command": "uv"
entry in claude_desktop_config.json. Replace "uv" with the full path to uv, which is usually: /Users/YOURUSERPROFILENAME/.local/bin/uv
Run this command to get the installation path of uv:
which -a uv
This command will display all the paths to the installations of uv you have. If the only path you can see is /Library/Frameworks/Python.framework/Versions/3.**/bin/uv
, you need to ๐ Download uv and go back to Part 3.
Save the file and restart Claude Desktop.
If the above method does not work, uv may not be installed correctly. Try installing it using Homebrew:
brew install uv
If you're still having issues, retrace your steps and ensure everything is set up correctly. ๐
No description, website, or topics provided.
No releases published
No packages published