Integration · Codex CLI (OpenAI)
Connect OpenAI Codex CLI to Google Search Console
4 steps · about 4 minutes
By the GSC PAP team · Updated
Codex CLI is OpenAI's terminal coding agent. It connects to remote MCP servers over Streamable HTTP and can read a bearer token from an environment variable, so the token does not have to sit in its config file.
This guide goes from a fresh Codex install to your first Search Console question in about four minutes.
How to add the Search Console MCP server to Codex CLI
- 1
Install Codex CLI and sign in
Install Codex with npm or Homebrew, then run codex login (or start codex and choose Sign in with ChatGPT). If Codex is already installed and signed in, skip this step.
shellnpm install -g @openai/codex # or brew install --cask codex codex login - 2
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. The connect page then shows your bearer token once, so copy it now. If you lose it, create a new one at app.gscpap.com/account/tokens; your other tokens keep working.
- 3
Register gsc-pap with Codex
Run the command below. It adds a gsc-pap entry to ~/.codex/config.toml that points at the server and tells Codex to read the token from the GSC_PAP_TOKEN environment variable. You can also paste the same three lines into config.toml by hand.
shellcodex mcp add gsc-pap --url https://mcp.gscpap.com/mcp --bearer-token-env-var GSC_PAP_TOKEN # This writes the following block to ~/.codex/config.toml: # [mcp_servers.gsc-pap] # url = "https://mcp.gscpap.com/mcp" # bearer_token_env_var = "GSC_PAP_TOKEN" - 4
Set the token and start Codex
Add the token to your shell profile so every new terminal has it, then start Codex. This keeps the token out of config.toml, but your shell profile now holds it in plain text, so do not commit or share that file. Use ~/.bashrc instead of ~/.zshrc if you use bash. Inside Codex, run /mcp to confirm gsc-pap is connected, then ask: "What sites are in my Search Console?" Codex calls list_sites and replies with your verified properties.
shellecho 'export GSC_PAP_TOKEN="YOUR_TOKEN"' >> ~/.zshrc source ~/.zshrc codex
Codex CLI MCP troubleshooting
- ·Codex reads GSC_PAP_TOKEN when it starts. If you set the variable in one terminal and launch Codex from another, Codex has no token and gsc-pap offers no tools. Open a new terminal or run source ~/.zshrc before you start Codex.
- ·codex mcp list shows the server and the variable name, but it does not test the connection. Run /mcp inside a Codex session to see whether gsc-pap connected.
- ·The Codex IDE extension reads the same ~/.codex/config.toml, so you register the server once. The extension also needs GSC_PAP_TOKEN in the environment it starts from.
- ·A tool call that fails with "Missing or invalid bearer token" means the token is wrong or was revoked. Create a new one at app.gscpap.com/account/tokens and update GSC_PAP_TOKEN. Your other tokens keep working.
Frequently asked questions
Do I need a Google Cloud project or API key to use Search Console in Codex?
No. There is no Google Cloud project to create, no Search Console API to enable, and no OAuth client JSON to download. You sign in with Google at gscpap.com, and the bearer token you get there is the only credential Codex needs. Codex reads it from the GSC_PAP_TOKEN environment variable.
Does the Codex IDE extension use the same MCP config as the CLI?
Yes. OpenAI's docs say the Codex CLI, the IDE extension and the ChatGPT desktop app share ~/.codex/config.toml, so you add the [mcp_servers.gsc-pap] block once instead of configuring each surface separately.
Can Codex change anything in my Search Console?
No. GSC PAP holds read-only Google scopes: webmasters.readonly for Search Console and read-only access for GA4. Codex can read clicks, impressions, CTR, position, sitemap status and URL inspection results, but it cannot submit sitemaps, request indexing, or change settings.
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.
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.
opencode
Add Google Search Console to opencode as a remote MCP server. One config block with your token, no Google Cloud project, no local server to run.
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.