Blog
guide

How to Connect Google Search Console to OpenAI Codex Using Sequel

Musthaq Ahamad
Musthaq Ahamad
How to Connect Google Search Console to OpenAI Codex Using Sequel

Google Search Console shows you how your site performs in search: what queries bring people in, which pages rank, how often you appear in results. The OpenAI Codex CLI brings AI assistance to your terminal. Connecting them through Sequel's MCP server means you can interrogate your search performance data from the same terminal where you build and ship code. No CSV exports, no switching to a browser.

What You'll Accomplish

Once set up, you can launch Codex and ask:

  • "What are the top 20 queries driving traffic to my site this month?"
  • "Which pages have the highest impressions but low click-through rate?"
  • "How has our average position for branded queries changed over the past 90 days?"

Prerequisites

Step 1: Connect Google Search Console to Sequel

Sign in to sequel.sh and click Data Sources in the left sidebar.

Sequel Data Sources page

Click New Connection. On the "Choose a connector" page, select Google Search Console.

Choose a connector

Enter a Connection Name, a label for this property, e.g. sequel.sh GSC.

Then click Connect with Google.

Google Search Console connection form

A Google OAuth window will open. Sign in with the Google account that has access to your Search Console property and grant Sequel the requested permissions. You'll be redirected back to Sequel with the connection saved.

Step 2: Get Your Sequel API Key

Click Settings in the left sidebar, then select API Keys from the settings navigation.

Sequel API Keys page

Click New key, name it codex-gsc, and copy the key (starts with sql_).

Step 3: Configure Codex CLI to Use Sequel MCP

Set your API key as an environment variable. Add this to ~/.zshrc or ~/.bashrc:

export SEQUEL_API_KEY="sql_your_api_key"

Reload your shell:

source ~/.zshrc

Add Sequel to ~/.codex/config.toml. Create the file if it doesn't exist:

[mcp_servers.sequel]
url = "https://api.sequel.sh/mcp"
bearer_token_env_var = "SEQUEL_API_KEY"

Save the file. The next Codex session will load the Sequel MCP server automatically.

Step 4: Query Your Search Console Data

codex

Then ask:

What tables are available from my Search Console data?
What are my top 10 queries by clicks this month?
Which pages have more than 1000 impressions but less than 2% CTR?

What You Can Do Now

  • Keyword research: ask "What are the top 50 queries I rank for with an average position below 10?" to find quick-win opportunities
  • Content audits: ask "Which pages have been losing impressions over the past 3 months?"
  • CTR optimization: ask "Which queries have high impressions but low CTR?" to prioritize title and meta description improvements
  • Ranking monitoring: ask "Am I ranking for [keyword]? What's the current average position?"
  • Data-grounded development: ask Codex to generate a ranking report script grounded in your actual Search Console data schema

Try Sequel

Meet your always-on data analyst.

An AI data analyst that connects to all your data and answers questions with reports and visualizations. Free for up to 3 seats - no credit card required.

Get started free

Frequently asked questions

What Search Console data can I query through Sequel?

Queries (keywords), clicks, impressions, CTR, average position, top pages, devices, countries, and search appearance data. Basically anything available in the Google Search Console Performance report.

What Google permissions does Sequel request?

Sequel requests read-only access to your Google Search Console data. You can revoke this access at any time from your Google account settings under Security, then Third-party apps.

Do I need to be a Search Console property owner to connect?

No. You need at least Full User access to the property. Restricted Users can view some data but may not have access to all Search Console reports.

How far back does Google Search Console data go?

Google Search Console retains data for up to 16 months. When you ask date-ranged questions, Sequel queries within this window.

Can I connect multiple Search Console properties?

Yes. Add multiple Google Search Console data sources in Sequel, each with a distinct Connection Name, and target them by name in your queries.

Why use bearer_token_env_var for the API key?

Storing the API key in an environment variable keeps it out of config files that might be committed to source control or shared with others.

Written by

Musthaq Ahamad
Musthaq Ahamad

Co-founder and CEO of Sequel. Previously built developer tools and data infrastructure. Passionate about making data accessible for everyone.