Connecting Google Search Console to Your AI Assistant: A WSL2 & Antigravity Guide
Key takeaways: connecting Search Console to an AI assistant
- The AminForou/mcp-gsc server connects an AI assistant to your Google Search Console data through the Search Console API.
- On Windows the server runs inside WSL2.
uvxdownloads and runs it, so you do not need to clone the repository or set up GitHub. - Since version 0.4.2 the server requests the read-only Search Console scope (
webmasters.readonly) by default. It asks for the fullwebmastersscope, and turns on the tools that add or delete properties and delete sitemaps, only if you setGSC_ALLOW_DESTRUCTIVE=true. - An External OAuth app left in Testing mode loses its sign-in after 7 days. Publish the app, or use an Internal app if you are on Google Workspace.
- Tested with mcp-gsc 0.3.2. Scope behaviour checked against the 0.4.2 source, which is the version
uvxinstalls as of December 2026.
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 several CSV reports and cross-referencing queries, pages, impressions and click-through rates in a spreadsheet. It works, but it is slow.
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, such as "Which of my product pages get the most impressions but almost no clicks?", and your assistant will query the live data and 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 how to configure the 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, 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.
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 uv Inside WSL2
The server is run by uv, a fast Python package manager. Its uvx command downloads the published mcp-gsc package and runs it, so there is nothing to clone. Open your WSL2 terminal and run:
# Install uv (the Astral Python package manager)
curl -LsSf https://astral.sh/uv/install.sh | sh
source ~/.bashrc
To verify the installation, run:
uv --version
which uvx
The first command prints a version number. The second prints the full path to uvx, usually /home/yourname/.local/bin/uvx. Note it down: you will need it in Step 7. If either command says "command not found", close your WSL2 terminal, reopen it, and try again.
Step 3: Install the Antigravity IDE
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/).
Should you let the AI run the remaining steps?
Once Antigravity is linked to your WSL2 environment, you do not need to run the remaining terminal commands yourself. The connected AI model (such as Gemini Flash or Claude) can run shell commands and edit configuration files on your behalf. We use the AI for two reasons:
- Path translation: Windows and Linux (WSL2) use different file path formats, and copying paths by hand often leads to errors. The AI knows that WSL2 mounts your Windows drive at
/mnt/c/and can resolve your Linux home directory for you. - Configuration files: MCP clients read a JSON configuration file. Instead of editing JSON by hand, the AI writes the structure, fills in your username and checks that the paths are absolute.
For the remaining steps, you can open the Antigravity chat window and ask the assistant to do them. We show the AI prompt (with what the AI does behind the scenes) and the manual commands for each step, so you can choose.
Step 4: Create a Google Cloud Project and Enable the API
Google Cloud Console is a separate service from Google Search Console. It is Google's platform for managing API access, and you need it to create the credentials that let your AI assistant 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.
- 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 Enable and wait until the page confirms it is enabled.
Step 5: Set Up the Google Auth Platform
Before Google lets you create credentials, you must register your application and declare what data it will access. Google now handles this in the Google Auth Platform, so it may look different from older tutorials.
- In the left-hand navigation, click APIs & Services >OAuth consent screen. This opens the Google Auth Platform. Click Get started.
- App information: enter an App name such as
My SEO Assistant(it is only shown to you during sign-in) and select your email address as the User support email. Click Next. - Audience: if your Search Console login is a Google Workspace account, choose Internal. Internal apps need no test users and their sign-in does not expire after 7 days. Otherwise choose External. Click Next.
- Contact information: enter your email address and click Next.
- Finish: agree to the Google API Services User Data Policy, click Continue, then Create.
- Go to the Data Access tab in the Google Auth Platform sidebar. Click Add or Remove Scopes. A panel slides in from the right.
- Scroll to the bottom of the panel. Below the list of common scopes, there is a section labelled "Manually add scopes" with a text field.
- Paste
https://www.googleapis.com/auth/webmasters.readonlyand click Add to Table. This read-only scope is what mcp-gsc requests by default from version 0.4.2. Releases up to 0.4.1 always requested the fullhttps://www.googleapis.com/auth/webmastersscope, and so does 0.4.2 if you setGSC_ALLOW_DESTRUCTIVE=trueto turn on the tools that add or delete properties and delete sitemaps. In either of those cases, add the full scope instead. - Make sure the scope is ticked in the table, click Update, then Save.
- If you chose External, go to the Audience tab. Under Test users, click + Add users, type the Google email address you use for Search Console and click Save.
- This step is required. While your app is in Testing mode (the default), only email addresses listed here can sign in. If you skip it, the sign-in will fail later with an "Access denied" error.
- In Testing mode, Google expires your sign-in after 7 days, and you would have to repeat Step 8 every week. Once sign-in works, come back to the Audience tab and click Publish app to move it to In production. Google will still show the "unverified app" warning when you sign in, which is fine for an app only you use.
Step 6: Create and Download OAuth Credentials
Now you create the credentials file that the MCP server uses to identify itself to Google when requesting your data:
- In the Google Auth Platform sidebar, click Clients, then + Create client.
- For Application type, select Desktop app.
- Give it a name, such as
Local SEO Client, and click Create. - A dialog shows your Client ID and Client Secret. Click Download JSON now. Google shows the client secret only once, so if you close the dialog without downloading, you will have to add a new secret. The file is saved to your Windows
Downloadsfolder with a name likeclient_secret_123456789.json.
Next, move this file from your Windows Downloads folder into your WSL2 filesystem. You can do it 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 creates the destination directory and copies the credentials file from your Windows filesystem (mounted at /mnt/c/ in WSL2) to your Linux home directory. It renames the file to client_secrets.json, which avoids errors with long 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 asks where to copy it. Change the destination to
/home/yourname/mcp/client_secrets.json(note the renamed filename) and press Enter. - 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 7: Register the MCP Server in Antigravity
You need to tell Antigravity how to run the MCP server. 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 directory ~/mcp-gsc and a .mcp.json file in it. Set up the mcp-search-console server to run with the full path to uvx (find it with which uvx) and the argument mcp-search-console. Set the environment variable GSC_OAUTH_CLIENT_SECRETS_FILE to the absolute path of ~/mcp/client_secrets.json and GSC_DATA_STATE to all."
What the AI does and why: The AI creates the .mcp.json file. Antigravity reads this configuration to start the GSC MCP server and expose its tools. The AI finds your username and the full path to uvx and writes absolute paths, which avoids the path errors that stop an MCP client from connecting.
Option B: Create the configuration file manually
In your WSL2 terminal, run the following commands to create the file (replace the placeholder values):
# Replace 'yourname' with your WSL2 username
mkdir -p ~/mcp-gsc
cat > ~/mcp-gsc/.mcp.json << 'EOF'
{
"mcpServers": {
"mcp-search-console": {
"command": "/home/yourname/.local/bin/uvx",
"args": ["mcp-search-console"],
"env": {
"GSC_OAUTH_CLIENT_SECRETS_FILE": "/home/yourname/mcp/client_secrets.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. - Use the full path that
which uvxprinted in Step 2. Desktop apps do not read your shell profile, so a bareuvxcommand often fails withspawn uvx ENOENT.
Older guides also set GSC_CREDENTIALS_PATH. Leave it out: in mcp-gsc 0.3.2 and later it is the path to a service-account key, and the server stops with an error if it points at a file that does not exist.
Step 8: Authenticate with Google
The first time Antigravity starts the MCP server, it needs your permission to access your Google Search Console account:
- 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 5).
- 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 token is saved to
~/.config/mcp-gsc/token.json, and the server reuses it and refreshes it in later sessions. If your app is External and still in Testing mode, Google expires the sign-in after 7 days; publish the app (Step 5) to avoid signing in every week.
What Can You 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."
If you would like help interpreting the data or building an action plan from the results, get in touch. This is 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 5. Go back to the Google Auth Platform > Audience tab and add it.
- Asked to sign in again after a week: Your External app is still in Testing mode. Click Publish app on the Audience tab, then sign in once more.
- "Command not found: uv" or
spawn uvx ENOENT: Close your WSL2 terminal and reopen it, then runwhich uvxand put that full path in.mcp.json. 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.jsonpaths are correct. Check that the client secrets file exists by runningls -la ~/mcp/client_secrets.jsonin WSL2, and remove anyGSC_CREDENTIALS_PATHline left over from an older guide. - The browser redirect fails: The redirect relies on WSL2 forwarding
localhostfrom Windows into Linux. This is on by default. If it has been turned off, or still fails, addnetworkingMode=mirroredunder[wsl2]in%UserProfile%\.wslconfig, runwsl --shutdownin PowerShell, and start WSL2 again.
References
- Model Context Protocol. (n.d.). MCP Server Configuration. modelcontextprotocol.io
- Foroutan, A. (n.d.). mcp-gsc: Google Search Console MCP server. github.com/AminForou/mcp-gsc
- Microsoft. (n.d.). Install WSL. learn.microsoft.com
- Google Developers. (n.d.). Using OAuth 2.0 for Desktop Applications. developers.google.com












