---
title: Connect Codex CLI
description: Add Hostino MCP to OpenAI Codex (CLI, IDE extension and app)
sidebar:
  order: 9
  badge:
    text: Alpha
    variant: success
---

**Codex** (the CLI, the IDE extension and the Codex app) supports remote MCP with OAuth, and all of them share one config file.

## 1. Add

```bash
codex mcp add hostino --url https://mcp.hostino.ai/mcp
```

Or directly in `~/.codex/config.toml` (Windows: `%USERPROFILE%\.codex\config.toml`):

```toml
[mcp_servers.hostino]
url = "https://mcp.hostino.ai/mcp"
```

## 2. Sign in

```bash
codex mcp login hostino
```

A browser opens; sign in and approve the permissions. Check the status with `codex mcp list`. To sign in again, run the same `login` command.

:::caution[If the tools return permission errors]
If Codex finds no token, it connects **without warning** and without authentication, and every tool returns `401`. Run `codex mcp login hostino` in that case.
:::

## Server without a browser (SSH)

The OAuth callback goes to `localhost` on a random port. To pin the port, add `mcp_oauth_callback_port = 5555` to `config.toml`, tunnel it over SSH (`ssh -L 5555:localhost:5555 …`), and open the sign-in link in your own machine's browser.

## Alternative

If your Codex version is old:

```toml
[mcp_servers.hostino]
command = "npx"
args = ["-y", "mcp-remote", "https://mcp.hostino.ai/mcp"]
```

## Next steps

- [Tools and outputs](/en/ai-mcp/remote-mcp/)
- [AI Deploy](/en/ai-mcp/ai-deploy/)
