OpenAI's Codex CLI is a terminal coding agent that supports MCP servers. Without a search tool, it happily invents function signatures and references libraries that do not exist. Adding Scavio's MCP server fixes this by giving Codex access to live docs, Stack Overflow, GitHub issues, and YouTube transcripts during generation.
Prerequisites
- Node.js 20+ installed
- Codex CLI installed via npm install -g @openai/codex
- A Scavio API key
- An OpenAI API key configured for Codex
Walkthrough
Step 1: Install Codex CLI
Install OpenAI's terminal coding agent.
npm install -g @openai/codexStep 2: Set environment variables
Add both your OpenAI and Scavio keys to your shell profile.
export OPENAI_API_KEY="sk-..."
export SCAVIO_API_KEY="sk_live_..."Step 3: Configure Codex MCP servers
Add Scavio to ~/.codex/config.toml under [mcp_servers].
[mcp_servers.scavio]
command = "npx"
args = ["-y", "@scavio/mcp"]
[mcp_servers.scavio.env]
SCAVIO_API_KEY = "${SCAVIO_API_KEY}"Step 4: Launch Codex
Start Codex and verify the Scavio tools load.
codexStep 5: Ask Codex for live doc lookup
Prompt Codex to write code that requires fresh documentation.
> write a tool call to the latest LangGraph checkpointer APIPython Example
# Codex MCP config lives in TOML. To validate Scavio works independently:
import os, requests
r = requests.post('https://api.scavio.dev/api/v1/search',
headers={'x-api-key': os.environ['SCAVIO_API_KEY']},
json={'query': 'langgraph checkpointer api 2026'})
print(r.json()['organic_results'][:3])JavaScript Example
const res = await fetch('https://api.scavio.dev/api/v1/search', {
method: 'POST',
headers: { 'x-api-key': process.env.SCAVIO_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({ query: 'langgraph checkpointer api 2026' })
});
console.log((await res.json()).organic_results.slice(0, 3));Expected Output
Codex calls scavio.search_google with the query, receives the top 10 organic results, and uses them to generate code against the current LangGraph API rather than an outdated version from training data.