# Connect Codex

> Add PromptGale to OpenAI Codex with codex mcp add or config.toml, sign in with OAuth, and raise the tool timeout so long AI answers finish.

Add PromptGale to Codex as a remote MCP server at `https://promptgale.com/mcp`. It signs in with OAuth in the browser, so there is no key to paste.

## How to connect Codex to PromptGale

1. Add the server, then sign in with codex mcp login promptgale. Codex opens the browser for the approval.
2. Set tool_timeout_sec = 300: Codex stops tool calls after 60 s by default and some answers take longer.
3. The Codex app uses the same config (~/.codex/config.toml).

**Terminal**

```bash
codex mcp add promptgale --url https://promptgale.com/mcp
codex mcp login promptgale
```

**~/.codex/config.toml**

```toml
[mcp_servers.promptgale]
url = "https://promptgale.com/mcp"
tool_timeout_sec = 300
```

## Where the config lives

- `~/.codex/config.toml`, under `[mcp_servers.promptgale]`, with `url` required.
- OpenAI says the Codex CLI, the IDE extension and the ChatGPT desktop app share this file.

## How sign-in works

- `codex mcp login promptgale` opens the browser for the approval. Run it again to sign in again.

## Check that it works

Ask Codex: "Use PromptGale to check who I am connected as, then list the engines." It should call `whoami` and `get_capabilities`. Neither costs credits.

## Try it

Then ask: "Use PromptGale to ask ChatGPT in the US: what is the best CRM for a small agency? List the sources it cited and tell me whether Acme is mentioned." That runs one task and costs ChatGPT's price in credits.

## What Codex can do with PromptGale

Once connected, Codex can ask ChatGPT, Gemini, Perplexity, Bing Copilot Search, Meta AI, Google AI Overview, and Google AI Mode a prompt from the country you pick, and read the answer, its cited sources and where each brand ranks. For example:

- "Ask ChatGPT and Perplexity in the US for the best CRM for a small agency, and tell me which brands they name first."
- "Check whether Gemini mentions Acme when asked for project management tools in Germany."
- "Run these 20 prompts on every engine as a batch and list the sites they cite most."

Running a prompt costs that engine's price in credits; reading results, credits and countries is free. The tools are listed in [Connect an agent](https://promptgale.com/docs/mcp.md).

## Troubleshooting

- Tool calls stop after 60 seconds: that is the default `tool_timeout_sec`. Set it to 300 as in the config above.
- The server does not start in time: `startup_timeout_sec` defaults to 10 seconds; raise it on a slow network.
- `codex mcp list` lists your servers; `/mcp` inside Codex shows the ones that are active.

Checked against [OpenAI docs: Codex MCP](https://learn.chatgpt.com/docs/extend/mcp?surface=cli) on 2026-11-27. Menu names in Codex can change; the vendor page is the reference.

## Next

- Every tool and what it costs: [Connect an agent](https://promptgale.com/docs/mcp.md).
- What a result contains: [Results](https://promptgale.com/docs/results.md).
- The engines and their prices: [Engines](https://promptgale.com/docs/engines.md).

---

Docs index: https://promptgale.com/llms.txt · Full reference: https://promptgale.com/llms-full.txt · OpenAPI: https://promptgale.com/v1/openapi.json
