> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tavily.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Codex

> Add Tavily web search, extraction, crawling, and research to Codex with the official Tavily plugin or MCP server.

Give [Codex](https://developers.openai.com/codex) live web search, extraction, crawling, and research. In **Codex in the ChatGPT desktop app**, install the official Tavily plugin, which bundles Tavily's MCP tools and skills. In the **Codex CLI and IDE extension**, connect Tavily's hosted [MCP server](https://docs.tavily.com/documentation/mcp.md). All three share one MCP config, so you only set it up once.

> [tab] Codex app
>
> **1. Install the plugin**
>
> [Add to Codex](https://chatgpt.com/plugins/plugin_asdk_app_69f271663a288191ac98f46bed7cb032?search=tavily)
>
> Or open **Plugins** in the ChatGPT desktop app, search for **Tavily**, and select **+**. The same plugin also works in ChatGPT chats.
>
> **2. Connect**
>
> When prompted, connect Tavily and sign in to your Tavily account.
>
> **3. Try it**
>
> Start a new Codex chat and ask, or type `@` to pick Tavily:
>
> > Use Tavily to find the latest docs for a dependency in this repo, check our usage against the installed version, and cite the source.

> [tab] Codex CLI & IDE
>
> **1. Add the server**
>
> ```bash theme={null}
> codex mcp add tavily --url https://mcp.tavily.com/mcp/
> ```
>
> Codex detects OAuth and opens your browser to sign in to Tavily. To sign in again later, run `codex mcp login tavily`.
>
> Or add it to `~/.codex/config.toml` yourself, then run `codex mcp login tavily`:
>
> ```toml ~/.codex/config.toml theme={null}
> [mcp_servers.tavily]
> url = "https://mcp.tavily.com/mcp/"
> ```
>
> To scope Tavily to one repository, use `.codex/config.toml` in a trusted project instead.
>
> **2. Verify**
>
> Run `codex mcp list`, or `/mcp` inside a Codex session, and confirm `tavily` is listed. The IDE extension and desktop app pick up the same server.
>
> **3. Try it**
>
> > Use Tavily to research how other projects handle rate limiting for this API client, then propose a change and cite the sources.

## What you get

| Tool | What it does |
| - | - |
| `tavily_search` | Search the web |
| `tavily_extract` | Extract clean content from URLs |
| `tavily_map` | Discover a site's URLs |
| `tavily_crawl` | Crawl multiple pages from a site |
| `tavily_research` | Run multi-source research with citations |

The plugin also adds Tavily skills, such as `tavily-research` and `tavily-best-practices`, that guide Codex through multi-step work.

## More options

> [accordion] Use an API key instead of OAuth
>
> Export your [Tavily API key](https://app.tavily.com) as `TAVILY_API_KEY` in the environment Codex runs in, then add the server with:
>
> ```bash theme={null}
> codex mcp add tavily --url https://mcp.tavily.com/mcp/ --bearer-token-env-var TAVILY_API_KEY
> ```
>
> Or in `config.toml`:
>
> ```toml theme={null}
> [mcp_servers.tavily]
> url = "https://mcp.tavily.com/mcp/"
> bearer_token_env_var = "TAVILY_API_KEY"
> ```

> [accordion] Use keyless access
>
> For limited Search and Extract without an account:
>
> ```toml theme={null}
> [mcp_servers.tavily]
> url = "https://mcp.tavily.com/mcp/"
> http_headers = { "X-Tavily-Access-Mode" = "keyless" }
> ```
>
> See [keyless access](https://docs.tavily.com/documentation/keyless.md).

> [accordion] Run the MCP server locally
>
> Requires [Node.js](https://nodejs.org/en/download) 20+ and a [Tavily API key](https://app.tavily.com):
>
> ```bash theme={null}
> codex mcp add tavily-local --env TAVILY_API_KEY=YOUR_TAVILY_API_KEY -- npx -y tavily-mcp@latest
> ```

> [accordion] Use the CLI and Agent Skills instead of MCP
>
> Install the [Tavily CLI](https://docs.tavily.com/documentation/tavily-cli.md), sign in, and add the [Agent Skills](https://docs.tavily.com/documentation/agent-skills.md) to your project:
>
> ```bash theme={null}
> curl -fsSL https://cli.tavily.com/install.sh | bash
> tvly login
> npx skills add tavily-ai/skills --skill '*' --agent codex
> ```
>
> Start a new session to load them. Add `--global` to install them for all projects.

## Troubleshooting

* **The plugin doesn't show up in the IDE extension.** The IDE extension doesn't support plugins. Use the MCP server, which the extension reads from `config.toml`.
* **Tavily tools don't appear after installing the plugin.** Start a new chat. Plugins load at the start of a chat or session.
* **`tavily` isn't authenticated.** Run `codex mcp login tavily`. With `bearer_token_env_var`, check that `TAVILY_API_KEY` is set where Codex runs.
* **The project `.codex/config.toml` is ignored.** Codex reads project config only in trusted projects.
* **OAuth uses the wrong key.** Tavily uses the key named `mcp_auth_default`, so rename a key in the [Tavily dashboard](https://app.tavily.com). See [API key selection](https://docs.tavily.com/documentation/mcp.md#oauth-authentication).

## Resources

* [Tavily plugin](https://chatgpt.com/plugins/plugin_asdk_app_69f271663a288191ac98f46bed7cb032) · [skills repository](https://github.com/tavily-ai/skills)
* [Codex plugin docs](https://developers.openai.com/codex/plugins) · [Codex MCP docs](https://developers.openai.com/codex/mcp)
* [Tavily MCP server](https://docs.tavily.com/documentation/mcp.md) · [Agent Skills](https://docs.tavily.com/documentation/agent-skills.md) · [Tavily CLI](https://docs.tavily.com/documentation/tavily-cli.md)
