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

# Connect OpenAI Codex to the Didit MCP Server

> Add the Didit MCP server to OpenAI Codex with one command, codex mcp add didit --url https://mcp.didit.me/mcp, then sign in with Didit. No API key needed.

OpenAI Codex connects to the hosted Didit MCP server (`https://mcp.didit.me/mcp`) with one command. Codex then opens **Log in with Didit** in your browser and stores the sign-in for you; there is no API key to copy. The same configuration serves the Codex CLI and the Codex IDE extension.

```bash theme={null}
codex mcp add didit --url https://mcp.didit.me/mcp
```

***

## Set up

**1. Add the server**

```bash theme={null}
codex mcp add didit --url https://mcp.didit.me/mcp
```

Codex writes the server to `~/.codex/config.toml`, sees that it needs OAuth, and starts the sign-in straight away. If you cancel it, run `codex mcp login didit` later.

**2. Log in with Didit**

Your browser opens **Codex wants to access your Didit account**. Choose the organizations to connect, review the permissions, and click **Approve**. The terminal prints `Successfully logged in to MCP server 'didit'.`

**3. Confirm**

```bash theme={null}
codex mcp list
```

The `didit` row shows status `enabled` and auth `OAuth`.

Prefer to edit the file yourself? This is the whole entry in `~/.codex/config.toml`:

```toml theme={null}
[mcp_servers.didit]
url = "https://mcp.didit.me/mcp"
```

Then run `codex mcp login didit` to sign in.

> [!NOTE]
>
> **No API key in the config.** The server uses OAuth 2.1 with PKCE and acts as **you**: only in the organizations you approve at sign-in, with your role's permissions. Codex identifies itself with a Client ID Metadata Document. See [Authentication](https://docs.didit.me/integration/mcp/authentication.md).

***

## Check that it works

Start Codex and ask, naming the server:

```text theme={null}
Use the didit MCP server: call didit_context_get and list my organizations and applications.
```

Codex loads MCP tools on demand, so name the Didit server or the tool in your first prompt. It calls `didit_context_get` and lists your organizations with their applications.

To keep a session focused, limit Codex to the tools you need with `enabled_tools`:

```toml theme={null}
[mcp_servers.didit]
url = "https://mcp.didit.me/mcp"
enabled_tools = ["didit_context_get", "didit_session_create", "didit_session_list", "didit_session_get_decision"]
```

`disabled_tools` does the reverse. Tool names are in the [tools reference](https://docs.didit.me/integration/mcp/tools.md).

***

## Troubleshooting

* **`Not logged in` in `codex mcp list`.** Run `codex mcp login didit` and finish the browser sign-in.
* **On a remote machine with no browser.** Run `codex mcp login didit`, open the printed URL on your own computer, and keep the terminal running until the sign-in completes; the callback goes to a local port on the machine running Codex, so forward that port if needed.
* **A tool answers with `missing_scope`.** Your role in that organization lacks the permission. See [roles and permissions](https://docs.didit.me/integration/mcp/authentication.md#roles-and-permissions).
* **To sign out:** `codex mcp logout didit`.

***

## Next steps

> [card] [Connect ChatGPT](https://docs.didit.me/integration/mcp/chatgpt.md)
>
> The Didit plugin in the ChatGPT directory, or the full server as a custom MCP server.

> [card] [Connect Claude](https://docs.didit.me/integration/mcp/claude.md)
>
> One-click connector link for Claude web, Desktop and Code.

> [card] [Tools reference](https://docs.didit.me/integration/mcp/tools.md)
>
> Everything the agent can call, tool by tool.

> [card] [Example prompts](https://docs.didit.me/integration/mcp/examples.md)
>
> Longer worked examples with real payloads.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.