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

# Codex

> Connect Codex to the Agent Golf MCP server, sign in, and sign out.

Codex connects to the Agent Golf MCP server over streamable HTTP and signs in with OAuth. Server URL:

```text theme={null}
https://mcp.agent.golf/mcp
```

## Add the server

Use one of these. Both name the server `agentgolf`. A server in `config.toml` with that name takes the place of the plugin server.

> [tab] Agent Golf plugin
>
> The Agent Golf plugin 1.7.0 adds the server and the attribution and health skills. It also adds skills for rework, session health, and pull-request cost. Its tools need Codex 0.167.0 or later. Clone [agentgolf/agent-plugins](https://github.com/agentgolf/agent-plugins) and run from the clone:
>
> ```bash theme={null}
> codex plugin marketplace add "$PWD/codex"
> codex plugin add agentgolf@agentgolf-plugin-marketplace
> ```
>
> Restart Codex. Open `/hooks` to review and trust the plugin hook.

> [tab] codex mcp add
>
> Run in a shell:
>
> ```bash theme={null}
> codex mcp add agentgolf --url https://mcp.agent.golf/mcp
> ```
>
> This writes the server to `~/.codex/config.toml`, or to `$CODEX_HOME/config.toml`:
>
> ```toml theme={null}
> [mcp_servers.agentgolf]
> url = "https://mcp.agent.golf/mcp"
> ```

## Sign in

1. Run in a shell:

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

   Without a local browser, add `--no-browser`, open the printed URL, and paste the redirect URL back. In the Codex app or the IDE extension, select **Authenticate** next to the server instead.

2. In the browser, sign in to Agent Golf, select the workspace and the permissions, and select **Approve**. See [Sign in](https://docs.agent.golf/mcp/access.md#sign-in).

3. Restart Codex. `codex mcp list` shows the sign-in in the **Auth** column, and `/mcp` in Codex lists the tools.

Codex keeps the token and renews it. When the sign-in ends, run `codex mcp login agentgolf` again.

## Sign out

```bash theme={null}
codex mcp logout agentgolf
```

This removes the token from Codex. To end the access on the Agent Golf side too, revoke the client on the **MCP Clients** card of the **Account** page. See [Revoke a client](https://docs.agent.golf/mcp/access.md#revoke-a-client).

## Local transcripts

The remote server cannot read your local Codex transcripts. To let Codex read them, also add the local server of the CLI under another name. It needs `agentgolf login`:

```bash theme={null}
codex mcp add agentgolf-local -- agentgolf mcp
```

The plugin's `agentgolf-session-health` skill then reads the transcript around a failing tool call. For the CLI versions that the local server needs, see [Local transcripts](https://docs.agent.golf/mcp/overview.md#local-transcripts).


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