Integration · opencode
Connect opencode to Google Search Console
5 steps · about 5 minutes
By the GSC PAP team · Updated
opencode is a terminal coding agent that can call Model Context Protocol (MCP) tools. Point it at GSC PAP and it can read your Search Console clicks, impressions, CTR and average position, plus GA4 and PageSpeed, from the same terminal you deploy from.
opencode splits MCP servers into local ones, which it starts as a command, and remote ones, which it reaches over a URL. GSC PAP is hosted, so it is a remote server: nothing to install, nothing to keep running, and no Google Cloud project to create.
This guide assumes opencode is already installed and working. If not, install it first from opencode.ai.
How to connect Google Search Console to opencode
- 1
Sign in to GSC PAP and copy your token
Go to gscpap.com and click "Sign in with Google." Approve the read-only access it asks for, then pick which sites to grant. The connect page shows your bearer token once, so copy it now. If you lose it, create a new one at app.gscpap.com/account/tokens; existing tokens keep working.
- 2
Put the token in your shell environment
Keep the token out of the config file itself. opencode can read it from the environment at load time, which also means the same config works on another machine without editing.
shell# macOS, Linux echo 'export GSC_PAP_TOKEN="paste-your-token-here"' >> ~/.zshrc source ~/.zshrc # Windows (PowerShell, persistent) [Environment]::SetEnvironmentVariable("GSC_PAP_TOKEN", "paste-your-token-here", "User") - 3
Add the server to opencode.json
Open your opencode config, opencode.json or opencode.jsonc, and add the block below under the mcp key. Note that the key is mcp, not mcpServers: opencode uses its own shape rather than the one Claude Desktop and Cursor share. If the file already lists servers, add the gsc-pap entry inside the existing mcp object.
json{ "$schema": "https://opencode.ai/config.json", "mcp": { "gsc-pap": { "type": "remote", "url": "https://mcp.gscpap.com/mcp", "enabled": true, "oauth": false, "headers": { "Authorization": "Bearer {env:GSC_PAP_TOKEN}" } } } } - 4
Check that opencode sees it
List the servers opencode knows about. gsc-pap should appear as a remote server. If a connection looks wrong, the debug command prints what happened during the handshake, which is the fastest way to tell a bad token from a bad URL.
shellopencode mcp list opencode mcp debug gsc-pap - 5
Ask a Search Console question
Start opencode in a project and ask: "Using gsc-pap, what are my top queries by clicks over the last 28 days?" The agent calls list_sites first to find your property, then search_analytics_query. From there you can ask for quick wins, decaying pages or a period comparison without leaving the terminal.
opencode MCP setup: common issues
- ·The config key is mcp, and the server needs "type": "remote". Under mcpServers, or without the type, opencode will not load it.
- ·Set "oauth": false when you authenticate with a header. Otherwise opencode can try to negotiate OAuth with the server and the bearer token never gets used.
- ·If opencode.json lives in a repo, use the {env:GSC_PAP_TOKEN} form rather than pasting the token. A bearer token in a committed config is a token you have to rotate.
- ·"Missing or invalid bearer token" means the environment variable was empty when opencode started, not that the token is wrong. Check it with echo $GSC_PAP_TOKEN in the same shell you launch opencode from.
- ·Nothing here needs a Google Cloud project. If a guide tells you to download a credentials JSON, it is describing a self-hosted server, not this one.
Frequently asked questions
Does opencode support remote MCP servers?
Yes. opencode separates local servers, which it starts as a command, from remote ones, which it reaches over a URL. A remote server is configured with "type": "remote" and a url, and it can carry custom request headers, which is how GSC PAP authenticates.
How do I pass an API token to an MCP server in opencode?
Through the headers object on the server entry. opencode supports environment substitution in that value, so "Authorization": "Bearer {env:GSC_PAP_TOKEN}" keeps the token out of the file. Pair it with "oauth": false so opencode does not try an OAuth flow instead.
Can I use Google Search Console in opencode without a Google Cloud project?
Yes, that is the point of a hosted server. GSC PAP registered the OAuth client once for everybody, so you sign in with Google, copy a token and paste one config block. Self-hosting is the path that needs your own Cloud project, OAuth client and credentials file.
Other integrations
All integrationsClaude Desktop
Connect Claude Desktop to Google Search Console without creating a Google Cloud project. Sign in with Google, paste one config block, restart Claude.
Cursor
Connect Google Search Console to Cursor through a hosted MCP server. Sign in with Google, paste one token into mcp.json, and skip the Google Cloud project.
Claude Code
Add Google Search Console to Claude Code with one claude mcp add command. Hosted and read-only: no Google Cloud project, no OAuth credentials, no Python.
Codex CLI (OpenAI)
Add Google Search Console, GA4 and PageSpeed data to OpenAI's Codex CLI with one TOML block and a bearer token. You never create a Google Cloud project.
VS Code (GitHub Copilot)
Connect Google Search Console to GitHub Copilot in VS Code with one .vscode/mcp.json entry, then ask agent mode about GSC. You skip Google Cloud setup.
Gemini CLI (Google)
Query Google Search Console (GSC) from your terminal with Gemini CLI. Register GSC PAP as an MCP server in settings.json, with no Google Cloud project.
Windsurf (Devin Desktop)
Give Windsurf, now Devin Desktop, your Google Search Console data. Add GSC PAP as a remote MCP server with one bearer token and no Google Cloud project.
Zed Editor
Bring Google Search Console into Zed's AI assistant as an MCP context server. You add one settings.json block and a token, with no Google Cloud setup.
JetBrains IDEs
Connect Google Search Console to IntelliJ, PyCharm, WebStorm and other JetBrains IDEs via AI Assistant's MCP settings, without a Google Cloud project.
Continue (extension)
Continue MCP setup for Google Search Console: add one mcpServers entry with a bearer token in VS Code or JetBrains. You do not need a Google Cloud project.
Claude.ai (browser)
Add Google Search Console to Claude.ai as a custom connector. Paste one URL and approve access. No token to copy, no config file, no Google Cloud project.
Direct HTTP (curl, custom agents)
Call the GSC PAP MCP server from curl or your own agent. It is JSON-RPC over HTTP with a bearer token, so you need no MCP client or Google Cloud project.
Cline
Add Google Search Console to Cline in VS Code or the Cline CLI as a remote MCP server. One token, no Google Cloud project, read-only access.
Warp
Add Google Search Console to Warp's agent as a remote MCP server. Paste one JSON block with your token, press Start, and ask about your traffic in the terminal.
LM Studio
Give a local model your Search Console data. Add GSC PAP to LM Studio's mcp.json as a remote server, with one token and no Google Cloud project.
ChatGPT
Add Google Search Console to ChatGPT as a custom MCP server. What the setup looks like, and the plan requirement that decides whether you can do it at all.
Goose
Add Google Search Console to Goose as a streamable_http extension. One block in config.yaml with your token, no Google Cloud project, read-only access.
Google Antigravity
Add Search Console to Google Antigravity as a custom MCP server. It handles dynamic client registration, so the setup is a URL and a sign-in, with no token.
Roo Code
Add Google Search Console to Roo Code in VS Code as a streamable-http MCP server. One block with your token, no Google Cloud project, read-only.
Kilo Code
Add Google Search Console to Kilo Code as a remote MCP server. It can negotiate OAuth for you, or take a bearer token. No Google Cloud project either way.
Amp
Add Google Search Console to Amp as a remote MCP server, in settings or with one CLI command. No Google Cloud project, read-only scopes.
Kiro
Add Google Search Console to Kiro as a remote MCP server. One entry in mcp.json, the token read from an approved environment variable, read-only access.
Raycast
Add Google Search Console to Raycast AI as an HTTP MCP server. Dynamic OAuth means no token to paste, and HTTP servers work on Raycast for iOS too.
GitHub Copilot CLI
Add Google Search Console to GitHub Copilot CLI with one command or one JSON entry. Remote HTTP transport, your token in a header, read-only access.
n8n
Give an n8n AI Agent your Search Console data through the MCP Client Tool node, and schedule the SEO report you keep meaning to write.
LibreChat
Add GSC PAP to librechat.yaml as a streamable-http MCP server, and give every user on your install their own Search Console access rather than a shared one.