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

# Codex

> Connect OpenAI Codex to the OnePerfectSlice remote MCP server over streamable HTTP with OAuth login.

Codex connects to the hosted OnePerfectSlice server over streamable HTTP. You register the URL in your Codex config, then authenticate with `codex mcp login`.

## Connect

<Steps>
  <Step title="Register the server">
    Add the server to `~/.codex/config.toml`:

    ```toml theme={null}
    [mcp_servers.ops]
    url = "https://mcp.oneperfectslice.ai/mcp"
    ```

    <Note>
      OAuth login is supported only for streamable HTTP servers — the `url` field is what enables it. Don't set a `command` for `ops`.
    </Note>
  </Step>

  <Step title="Authenticate">
    Run the OAuth login flow:

    ```bash theme={null}
    codex mcp login ops
    ```

    Your browser opens to OnePerfectSlice — log in and **select the team** whose data this connection should access. Codex stores the token in its managed encrypted credential storage.
  </Step>

  <Step title="Verify">
    ```bash theme={null}
    codex mcp list
    ```

    You should see `ops` listed and authenticated.
  </Step>
</Steps>

## Test it

In Codex, try:

```
Use ops to list available slices
```

You should see a tool call to `list_slices` and get back a list of your team's slices.

## Troubleshooting

| Problem                       | Solution                                                                                    |
| ----------------------------- | ------------------------------------------------------------------------------------------- |
| `ops` not listed              | Check the `[mcp_servers.ops]` block in `~/.codex/config.toml` for typos, then restart Codex |
| Login didn't complete         | Re-run `codex mcp login ops` and finish both login and team selection in the browser        |
| Wrong team's data             | Run `codex mcp login ops` again and select a different team                                 |
| Tool calls fail after a while | Re-run `codex mcp login ops` to refresh credentials                                         |

## Switching teams

Each connection is scoped to one team. To switch, run `codex mcp login ops` again and select the new team during sign-in.
