# Connect Mochi to Codex

The Codex CLI, the Codex IDE extension and the ChatGPT desktop app all share the same Codex settings, so you add Mochi once. New to Mochi MCP? Start with the [overview](https://themochi.app/docs/integrations-and-tracking/mcp).

**Server URL:** `https://mcp.themochi.app/mcp`

## Codex CLI

1. Add Mochi:

   ```bash
   codex mcp add mochi --url https://mcp.themochi.app/mcp
   ```

   Or add it to `~/.codex/config.toml` yourself:

   ```toml
   [mcp_servers.mochi]
   url = "https://mcp.themochi.app/mcp"
   ```

2. Sign in:

   ```bash
   codex mcp login mochi
   ```

   A browser opens. Sign in to Mochi, **pick your workspace** and approve.

On a machine without a browser, run `codex mcp login mochi --no-browser`. Open the link it prints on another device, sign in, then paste the full redirect URL back into the terminal.

If `codex mcp add` doesn't accept `--url`, your Codex is out of date: update it, or use the config file instead.

## Codex IDE extension

1. Open the gear menu → **MCP servers** → **Add server**.
2. Name it `mochi`, choose **Streamable HTTP** and enter `https://mcp.themochi.app/mcp`.
3. Save, then choose **Restart extension**.
4. Click **Authenticate** and sign in to Mochi in the browser.

## Use it

Ask Codex something like "Pull this week's bookings from Mochi and summarise them by setter". In ChatGPT work chats, your workspace admin decides which tools are available.

## Troubleshooting

| Problem | Fix |
| --- | --- |
| Mochi tools fail with "unauthorized" | Run `codex mcp login mochi` again. |
| You followed an old guide that sets an experimental flag | Remove it. Current Codex doesn't need one for remote servers. |

Checked against OpenAI's Codex documentation on 26 November 2026: [MCP in the Codex CLI](https://learn.chatgpt.com/docs/extend/mcp?surface=cli) and [MCP in the IDE extension](https://learn.chatgpt.com/docs/extend/mcp?surface=ide).
