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

# Connect Codex to Gcore MCP Server

> Connect Codex to Gcore MCP Server and check that the server is enabled.

Connect Codex to Gcore MCP Server so Codex can call Gcore operations.

* [Gcore API token](https://docs.gcore.com/account-settings/api-tokens.md) with permissions for the operations to perform
* [uv package manager](https://docs.astral.sh/uv/getting-started/installation/) installed

## Step 1. Install Codex

> [tab] Windows
>
> ```powershell theme={null}
> powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"
> ```

> [tab] macOS/Linux
>
> ```bash theme={null}
> curl -fsSL https://chatgpt.com/codex/install.sh | sh
> ```

Confirm the command is available:

```bash theme={null}
codex --version
```

## Step 2. Sign in

Sign in through the browser.

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

Verify that Codex is signed in:

```bash theme={null}
codex login status
```

## Step 3. Add Gcore MCP Server

The Codex configuration stores the variable name, not the token. Set `GCORE_API_KEY` in the shell that starts Codex. Enter the token at the prompt so the shell history does not store it. macOS uses Zsh, and Linux uses Bash. On both, the prompt hides the token. When a secret manager already exports `GCORE_API_KEY`, skip the prompt.

> [tab] Windows
>
> ```powershell theme={null}
> $env:GCORE_API_KEY = Read-Host "GCORE API token"
> ```

> [tab] macOS
>
> ```bash theme={null}
> read -rs "GCORE_API_KEY?GCORE API token: "
> echo
> export GCORE_API_KEY
> ```

> [tab] Linux
>
> ```bash theme={null}
> read -rsp "GCORE API token: " GCORE_API_KEY
> echo
> export GCORE_API_KEY
> ```

Open the Codex configuration and add this table. When the file already lists other servers, add the table without removing those entries.

> [tab] Windows
>
> ```powershell theme={null}
> notepad $env:USERPROFILE\.codex\config.toml
> ```

> [tab] macOS/Linux
>
> ```bash theme={null}
> nano ~/.codex/config.toml
> ```

```toml theme={null}
[mcp_servers.gcore]
command = "uvx"
args = ["--from", "gcore-mcp-server@git+https://github.com/G-Core/gcore-mcp-server.git", "gcore-mcp-server"]
env_vars = ["GCORE_API_KEY"]
```

Leave `GCORE_TOOLS` unset so the server stays in dynamic mode. Codex then receives six tools that reach every operation. Setting `GCORE_TOOLS` without `GCORE_MCP_MODE` selects direct mode. A value that matches nothing exits with status 2. Pattern rules are in [Tool filtering](https://docs.gcore.com/developer-tools/mcp-server/filter-tools-with-gcore-tools.md).

## Step 4. Verify the configuration

List the servers saved in the Codex configuration. This command does not start Gcore MCP Server or run an operation.

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

`gcore` appears as enabled. The `Auth` column says `Unsupported` because this server does not have its own sign-in. It reads `GCORE_API_KEY` from the environment. The command masks the key.

```text theme={null}
Name   Command  Args                                                                                         Env                  Cwd  Status   Auth
gcore  uvx      --from gcore-mcp-server@git+https://github.com/G-Core/gcore-mcp-server.git gcore-mcp-server  GCORE_API_KEY=*****  -    enabled  Unsupported
```

> [!NOTE]
>
> When `gcore` is missing, confirm that `uv --version` runs and that `GCORE_API_KEY` is set in the same shell. A Codex process started earlier does not see a variable exported later.

## Step 5. Test with a query

Start Codex from that shell and ask:

```text theme={null}
List my DNS zones
```

Codex should use Gcore MCP Server to retrieve the DNS zones. When the connection works and the token has the required permissions, Codex returns the available zones or reports that none were found.

> [!NOTE]
>
> Requests that return "401 Unauthorized" indicate an invalid or expired token. Required roles are in [API token permissions](https://docs.gcore.com/developer-tools/mcp-server/gcore-mcp-server-overview.md#api-token-permissions).
