Connecting Google Search Console to Your AI Assistant: A WSL2 & Antigravity Guide
One of the most common questions we get from clients is: "How do I actually know which of my pages are performing well in Google, and which ones are losing visibility?"
The standard answer involves logging into Google Search Console, exporting multiple CSV reports, and then trying to cross-reference queries, pages, impressions, and click-through rates in a spreadsheet. It works, but it is tedious, and most people give up before they find the actionable insights they need.
There is a better way. Using the Model Context Protocol (MCP), you can connect your AI assistant directly to your Search Console account. Once connected, you can ask questions in plain English — "Which of my product pages get the most impressions but almost no clicks?" — and your assistant will query the live data and give you a specific answer about your website.
This is the setup we use internally at IMD Agency when running search audits and performance reviews for our clients. Below, we walk through exactly how to configure the specific AminForou/mcp-gsc server on a Windows machine using WSL2.
Why WSL2?
The MCP server that connects to Google's APIs runs in a Linux terminal. If you are on macOS or Linux, it works natively. On Windows, you need Windows Subsystem for Linux (WSL2) — a free, built-in feature that gives you a Linux terminal without replacing your operating system. The Antigravity IDE connects to this Linux layer seamlessly, so once configured, everything runs in the background while you work on your normal Windows desktop.
Step 1: Install WSL2 and Set Up Your Linux Environment
If you already have WSL2 with Ubuntu installed, skip to Step 2. Otherwise, follow the instructions below.
⚠️ Important Hardware Prerequisite: To run WSL2, your PC's motherboard BIOS/UEFI settings must have CPU Virtualisation enabled (often named Intel VT-x, Intel Virtualization Technology, AMD-V, or SVM Mode). If this is disabled, the WSL installer will fail with an error.
- Open PowerShell as Administrator. To do this, right-click the Windows Start button and select Terminal (Admin) or Windows PowerShell (Admin).
- Run the following command:
This installs WSL2 and Ubuntu in one step. It may take a few minutes and will ask you to restart your computer.wsl --install - After restarting, a terminal window will open automatically and ask you to create a Unix username and password. Choose something simple — you will need this username later. This is your WSL2 account, separate from your Windows login.
- Once you see a command prompt like
yourname@DESKTOP:~$, you are inside your Linux environment. This is your WSL2 terminal.
How to open WSL2 in the future: Press the Windows key, type Ubuntu, and press Enter. Alternatively, open any terminal and type wsl.
Step 2: Install the Required Tools Inside WSL2
You need two tools installed inside your WSL2 environment: git (to download the MCP server code) and uv (a fast Python package manager that runs the server). Open your WSL2 terminal and run the following commands one at a time:
# Update your package list (you may be asked for your WSL2 password)
sudo apt update sudo apt install -y git curl -LsSf https://astral.sh/uv/install.sh | sh source ~/.bashrcTo verify everything installed correctly, run:
git --version
uv --versionBoth commands should print a version number. If either says "command not found", close your WSL2 terminal, reopen it, and try again.
Step 3: Set Up GitHub
The MCP server code is hosted on GitHub, a platform for sharing and downloading code. You need a GitHub account and a way for your WSL2 environment to authenticate with it.
Create a GitHub account (if you do not have one)
- Go to github.com/join and create a free account.
- Remember your username and the email address you used — you will need both in a moment.
Configure your Git identity inside WSL2
Git needs to know who you are. Open your WSL2 terminal and run the following two commands, replacing the placeholder values with your own details:
# Replace with your actual name and email
git config --global user.name "Your Name"
git config --global user.email "[email protected]"Generate an SSH key and add it to GitHub
SSH keys let your WSL2 environment communicate securely with GitHub without typing your password every time. Run the following in your WSL2 terminal:
# Generate a new SSH key (press Enter three times to accept the defaults)
ssh-keygen -t ed25519 -C "[email protected]"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
cat ~/.ssh/id_ed25519.pub
The last command prints a long string starting with ssh-ed25519. Select and copy the entire line.
- In your web browser, go to github.com/settings/keys and sign in.
- Click New SSH key.
- Give it a title like
WSL2 on my Windows PC. - Paste the key you copied into the Key field.
- Click Add SSH key.
To verify the connection works, run:
ssh -T [email protected]If it asks "Are you sure you want to continue connecting?", type yes and press Enter. You should see a message like "Hi yourname! You've successfully authenticated".
Step 4: Install the Antigravity IDE and Connect to GitHub
Download and install the Antigravity IDE on your Windows machine from the official website. When you first open it, Antigravity will detect your WSL2 installation and offer to connect to it. Accept this — it allows the IDE to run commands and run MCP servers directly inside your Linux environment.
Once connected, you should see your WSL2 filesystem in the Antigravity file explorer (paths starting with /home/yourname/).
Sign into GitHub from Antigravity
- Click the Accounts icon in the bottom left corner of the Antigravity sidebar (it looks like a person silhouette).
- Select Sign in with GitHub.
- Your browser will open and ask you to authorise Antigravity. Click Authorize.
- Once complete, you will see your GitHub username displayed in the Antigravity sidebar.
Letting the AI Do the Heavy Lifting (and Why We Do It)
This is where the magic happens. Once Antigravity is linked to your WSL2 environment and your GitHub account, you do not actually need to run the remaining terminal commands yourself. The connected AI model (such as Gemini Flash or Claude) has the ability to run shell commands and modify configuration files on your behalf.
We configure this setup using the AI for three key reasons:
- Resolving Path Translation Issues: Windows and Linux (WSL2) use entirely different file path formats. Copying paths manually often leads to formatting errors. The AI automatically understands how WSL2 mounts your Windows drive (via
/mnt/c/) and resolves your local Linux home directory paths dynamically. - Managing Virtual Environments: Running python servers requires installing dependencies. The AI can manage virtual environments via
uv, synchronise packages, and verify that the requirements are met without you needing to debug python environment path variables. - Generating Configuration Schemas: The Model Context Protocol uses a specific JSON schema structure in
.mcp.json. Instead of you copying and editing JSON strings manually, the AI dynamically builds the correct configuration structure, resolves your system username, and registers the paths correctly.
For the remaining steps, you can open the Antigravity chat window and ask the assistant to perform them for you. We will show the AI prompt (along with the logical explanation of what the AI does behind the scenes) and the manual commands for each step so you can choose how to proceed.
Step 5: Create a Google Cloud Project and Enable the APIs
Google Cloud Console is a separate service from Google Search Console. It is Google's platform for managing API access. You need it to generate credentials that allow your AI assistant to read your data. You will not be charged anything for this setup.
- Open your web browser and go to the Google Cloud Console.
- Sign in with the same Google account you use for Search Console. This is important — if you use a different account, the MCP server will not be able to access your data.
- At the very top of the page, click the project selector dropdown. Click New Project in the top right corner.
- Give your project a name you will recognise, such as
my-seo-assistant, and click Create. - Once the project is created, make sure it is selected in the top dropdown (it should have a blue tick next to it).
- In the left-hand navigation menu, click APIs & Services, then click Library.
- In the search bar, type Google Search Console API. Click on the result (it may also be called "Search Console API" or "Webmasters API"). On the next page, click the blue Enable button. Wait until the page confirms it is enabled.
Step 6: Set Up the OAuth Consent Screen
Before Google lets you create credentials, you must register your application and declare what data it will access. Google has recently reorganised this interface under the Google Auth Platform sidebar, so it may look different from older tutorials.
- In the left-hand navigation, click APIs & Services >OAuth consent screen.
- If you are asked to choose a User Type, select External and click Create.
- You will land on the Branding tab. Fill in the following:
- App name: Enter something like
My SEO Assistant. This is only shown to you during the sign-in step; it does not appear publicly anywhere. - User support email: Select your email address from the dropdown.
- Scroll down to Developer contact information and enter your email address again.
- App name: Enter something like
- Now go to the Data Access tab in the left sidebar (under the Google Auth Platform section). Click the Add or Remove Scopes button. A drawer panel slides in from the right.
- Scroll all the way to the bottom of this drawer. Below the list of common scopes, there is a section labelled "Manually add scopes" with a text input field.
- In the text field, paste:
https://www.googleapis.com/auth/webmasters.readonlyand click the Add to Table button. This grants read-only access to your Search Console data. - Make sure the scope is ticked in the table, then click Update at the bottom of the drawer to save.
- Go to the Audience tab in the left sidebar. Under the Test Users section, click + Add Users.
- Type in your Google email address — the same one you use for Search Console — and click Save.
- This step is required. While your app is in "Testing" mode (which is the default), only email addresses listed here can complete the authentication. If you skip this, the sign-in will fail with an "Access denied" error later.
Step 7: Create and Download OAuth Credentials
Now you generate the credentials file that the MCP server uses to identify itself to Google when requesting your data:
- In the left sidebar, click Credentials (under APIs & Services — not under the Auth Platform section).
- At the top of the page, click + Create Credentials and select OAuth client ID from the dropdown.
- For Application type, select Desktop app from the dropdown.
- Give it a name, such as
Local SEO Client, and click Create. - A modal pops up showing your Client ID and Client Secret. Click the Download JSON button. This saves a file to your Windows
Downloadsfolder with a name likeclient_secret_123456789.json. - You can close this modal now.
Next, you need to move this file from your Windows Downloads folder into your WSL2 filesystem. You can choose to run this manually or let the AI do it:
Option A: Let the AI assistant do it (Recommended)
Open the Antigravity chat window and type:
"Create a directory at ~/mcp and copy the downloaded Google client secrets JSON from my Windows Downloads folder to ~/mcp/client_secrets.json. My Windows username is YOUR_WINDOWS_USERNAME."
What the AI does and why: The AI automatically creates the destination directory and copies the credentials JSON file from your Windows filesystem (mounted at /mnt/c/ in WSL2) to your Linux home directory. It renames the file to a standardised client_secrets.json filename, avoiding errors that happen when referencing files with complex default browser download names.
Option B: Move it manually using Midnight Commander
Midnight Commander is a visual file manager that runs inside the terminal:
- Open the Antigravity terminal (which is connected to your WSL2 instance).
- First, create a folder to store your credentials:
mkdir -p ~/mcp - Install and launch Midnight Commander:
sudo apt install -y mc mc - Midnight Commander opens with two side-by-side file panels. In the left panel, navigate to your home directory (
/home/yourname/mcp). - In the right panel, navigate to your Windows Downloads folder by browsing to:
To do this, press/mnt/c/Users/YOUR_WINDOWS_USERNAME/Downloads/Tabto switch to the right panel, then typecd /mnt/c/Users/at the bottom command line and press Enter. Navigate into your Windows username folder, then intoDownloads. - In the right panel, find the file that starts with
client_secret_and ends with.json. Highlight it using the arrow keys. - Press F5 (Copy). A dialog box appears asking where to copy it. Change the destination to
/home/yourname/mcp/client_secrets.json— note the renamed filename. Press Enter to confirm. - Press F10 to exit Midnight Commander.
- Verify the file is in place:
This should print the file details.ls -la ~/mcp/client_secrets.json
Step 8: Fork and Download the GSC MCP Server
To keep the server code under your own control, you should create a personal copy (fork) of the repository on GitHub, then clone your fork inside WSL2. Again, you can let the AI handle the terminal steps:
Option A: Let the AI assistant clone and build it (Recommended)
First, fork the repository by going to github.com/AminForou/mcp-gsc in your browser and clicking Fork in the top right. Once that is done, open the Antigravity chat and type:
"Clone my personal GitHub fork of the mcp-gsc repository into my home directory (~/mcp-gsc), enter the folder, and run uv sync to set up dependencies."
What the AI does and why: The AI handles the SSH checkout process using your configured GitHub SSH keys, runs the clone command, and invokes uv sync. Using uv is the standard for fast Python environments. It ensures all required client libraries are synchronised and locked to the correct versions so the server starts reliably.
Option B: Perform the commands manually
- In your web browser, go to the original repository at github.com/AminForou/mcp-gsc.
- In the top right corner, click the Fork button.
- Ensure your own account is selected as the Owner, leave the repository name as
mcp-gsc, and click Create fork. - Once the fork is created, click the green Code button on your fork's page, select the SSH tab, and copy the repository URL (it will look like
[email protected]:YOUR_GITHUB_USERNAME/mcp-gsc.git). - Open your WSL2 terminal and run the following commands:
# Navigate to your home directory cd ~git clone [email protected]:YOUR_GITHUB_USERNAME/mcp-gsc.git
cd mcp-gsc
uv sync
If this completes without errors, the server is ready. You should see output confirming that dependencies were installed and synchronized successfully.
Step 9: Register the MCP Server in Antigravity
You need to tell Antigravity where the MCP server is and how to run it. You do this by creating a configuration file called .mcp.json in your project directory inside WSL2.
Option A: Let the AI assistant write the config file (Recommended)
Open the Antigravity chat and type:
"Create a .mcp.json file in my ~/mcp-gsc/ directory. Set up the mcp-search-console server command to use uvx mcp-search-console. Set the environment variables GSC_OAUTH_CLIENT_SECRETS_FILE pointing to ~/mcp/client_secrets.json, and GSC_CREDENTIALS_PATH pointing to ~/.gemini/antigravity-ide/gsc_credentials.json. Make sure to resolve the absolute paths with my active username."
What the AI does and why: The AI creates the .mcp.json file inside your workspace. Antigravity reads this configuration to boot the GSC MCP server and expose its tools. The AI reads your Linux environment, detects your username, and formats the environment paths using absolute paths, preventing typical path resolution syntax errors that cause the MCP client to fail to connect.
Option B: Create the configuration file manually
In your WSL2 terminal, run the following command to create the file (replace the placeholder values):
# Replace 'yourname' with your WSL2 username
cat > ~/mcp-gsc/.mcp.json << 'EOF'
{
"mcpServers": {
"mcp-search-console": {
"command": "uvx",
"args": ["mcp-search-console"],
"env": {
"GSC_OAUTH_CLIENT_SECRETS_FILE": "/home/yourname/mcp/client_secrets.json",
"GSC_CREDENTIALS_PATH": "/home/yourname/.gemini/antigravity-ide/gsc_credentials.json",
"GSC_DATA_STATE": "all"
}
}
}
}
EOF
Important: After creating this file, open it in Antigravity or a text editor and update the paths:
- Replace both instances of
yournamewith your actual WSL2 username. If you are not sure what it is, runwhoamiin your WSL2 terminal.
Step 10: Authenticate with Google (One-Time)
The first time Antigravity starts the MCP server, it needs your permission to access your Google Search Console account. This only happens once:
- Open a project in Antigravity that is connected to your WSL2 environment. The MCP server should attempt to start automatically.
- An authorisation link will appear in the Antigravity console output. It looks like this:
Please visit this URL to authorize this application: https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=... - Copy the entire URL (it is very long) and paste it into a web browser on your Windows desktop.
- Sign in with your Google account (the same one you added as a Test User in Step 6).
- You will see a warning page that says "Google hasn't verified this app". Click Advanced at the bottom left, then click Go to My SEO Assistant (unsafe).
- Critical step: The next screen shows check boxes for the permissions you configured earlier. You must tick the check box for Google Search Console access. Click Continue.
- Your browser will redirect to a
localhostURL and show a success message. Behind the scenes, WSL2 forwarded this request to the MCP server running inside Linux, which captured your authorisation tokens. - The tokens are automatically saved to the
gsc_credentials.jsonpath you specified in Step 9. You will not need to repeat this process — the server will use the saved tokens from now on and refresh them automatically when they expire.
What You Can Ask
With the connection live, you can query your search analytics directly from the Antigravity chat using tools like get_search_analytics, get_performance_overview, and compare_search_periods:
- "What are my top 20 search terms by clicks over the last 28 days?"
- "Which product pages have high impressions but low clicks? Those probably need better meta titles."
- "Compare my Search Console performance from the last 14 days against the 14 days before that."
- "Are there any indexation issues on the website? Let's check with the inspection tools."
This replaces hours of manual report extraction and spreadsheet filtering. With a live GSC MCP connection, you get the insights immediately, so you can focus on deciding what to do next.
If you would like help interpreting the data or building an action plan from the results, get in touch — this is exactly the kind of work we do for our clients.
Troubleshooting
- "Access denied" during Google sign-in: You did not add your email address as a Test User in Step 6. Go back to the Google Auth Platform > Audience tab and add it.
- "Command not found: uv": Close your WSL2 terminal and reopen it, then try again. If it still does not work, re-run the uv installation command from Step 2.
- The authorisation URL does not appear: Make sure the
.mcp.jsonfile paths are correct. Check that theclient_secrets.jsonfile exists at the path you specified by runningls -la ~/mcp/client_secrets.jsonin WSL2. - The browser redirect fails: Some Windows firewall or antivirus configurations block
localhostport forwarding from WSL2. Try temporarily disabling your firewall or adding a WSL2 exception.
References
- Model Context Protocol. (n.d.). MCP Server Configuration. modelcontextprotocol.io
- Microsoft. (n.d.). Install WSL. learn.microsoft.com
- Google Developers. (n.d.). Using OAuth 2.0 for Desktop Applications. developers.google.com










