<!-- Generated by scripts/generate-llms.mjs from docs/clients/codex.md. Do not edit. -->

Source: https://qbash.com/docs/clients/codex

# How to add an MCP server to Codex

To add an MCP server to Codex in the terminal or your editor, run `codex mcp add <name> --url <server URL>` and then `codex mcp login <name>`. Codex in the ChatGPT app adds it as a ChatGPT plugin, the same way ChatGPT does.

The Codex CLI and the IDE extension keep their MCP servers in `~/.codex/config.toml`, so adding a server once makes it available in both on that computer. There is no separate Codex desktop app any more. Codex runs inside the ChatGPT app, which takes MCP servers as plugins from the Plugins page. Codex on the web doesn't read the local file.

:::note[Here from Google? Hi, we make the server in the screenshots]

- qbash runs Tasks, which are Python programs with AI steps, on its own servers, alongside your connected accounts and shared memory folders. Codex can call all of it as tools.
- You don't need qbash to follow this guide. Any remote MCP server goes in the same `config.toml`.

[What the qbash server does](https://qbash.com/docs-markdown/mcp-servers/official-mcp-server.md)

:::

## In the ChatGPT app

Codex in the ChatGPT app uses the same plugins as ChatGPT. Open the Plugins page, choose **Add**, then **Add custom MCP server**, paste `https://mcp.qbash.com/mcp`, choose **OAuth** and create it as a plugin. Then install the plugin and sign in to qbash. [How to add a custom MCP server to ChatGPT](https://qbash.com/docs-markdown/clients/chatgpt.md) has each step with screenshots.

The ChatGPT plan and role limits apply here too. On a Business or Enterprise workspace, if your role can't add it, talk to your workspace owner, who can add qbash and publish it to the workspace. A personal account that isn't part of a workspace can add it itself. The [ChatGPT guide](https://qbash.com/docs-markdown/clients/chatgpt.md#who-can-add-a-custom-mcp-server) has the table.

## From the terminal

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

The second command opens the qbash sign-in in your browser. Pick the qbash organization Codex should use.

## With an access token

To skip the browser sign-in, for example on a build machine, create a qbash [access token](https://qbash.com/docs-markdown/mcp-servers/official-mcp-server.md#connect) and add the server to `~/.codex/config.toml` yourself:

```toml
[mcp_servers.qbash]
url = "https://mcp.qbash.com/mcp"
bearer_token_env_var = "QBASH_TOKEN"
```

Codex reads the token from the `QBASH_TOKEN` environment variable and sends it in the `Authorization` header, so the token stays out of the file. To keep the server to one project, put the same block in `.codex/config.toml` inside a project Codex trusts.

## If you use Codex in a ChatGPT workspace

On Plus and Pro, nothing stops you adding a server to `config.toml`. In a Business or Enterprise workspace, two admin settings matter:

- **Allow members to use Codex locally** (shown in some workspaces as **Allow members to use Codex and Work Locally**). Without it, Codex returns a 403 error.
- Managed requirements under **Agent security** in the Admin console. If they include an `mcp_servers` list, only the servers on it load, and an empty list turns MCP off. With no list, any server is allowed.

The workspace permission **Create plugins with MCPs** decides whether you can add qbash as a plugin for Codex in the ChatGPT app. It doesn't affect a server in your own `config.toml`.

Sources: OpenAI's [Codex MCP docs](https://learn.chatgpt.com/docs/extend/mcp), [Codex admin setup](https://learn.chatgpt.com/docs/enterprise/admin-setup) and [managed configuration](https://learn.chatgpt.com/docs/enterprise/managed-configuration), checked 2026-11-04.

## Check it works

Run `codex mcp list` to see qbash among your servers, or type `/mcp` in a Codex session. Then ask Codex to list the qbash tools. OpenAI's [Codex MCP documentation](https://learn.chatgpt.com/docs/extend/mcp) covers the other settings.
