# Deploy from Codex CLI: connect Livops over MCP

> Add a [mcp_servers.livops] table with url = "https://livops.uz/api/mcp" to ~/.codex/config.toml and run codex mcp login livops. Codex can then deploy, read build logs, explain a failure and roll back, and with default_tools_approval_mode = "writes" it asks before anything that changes.

Source: https://livops.dev/en/guides/deploy-from-codex

By Livops team, the people who build and run Livops. Updated 19 November 2026.

Codex CLI works in your terminal and your repository. Connected to Livops, it can also deploy what it wrote and read back why a build failed. This page has the `config.toml` entry for both ways of signing in, the approval setting that fits Livops's tools, and what Codex can and cannot do with each.

## What you need

- A Livops account, and a project or a GitHub repository to make one from.
- Codex CLI.
- For the token route only: an `lvp_` API token from the team's **Settings → API tokens**, created by the team owner.

Livops is a Streamable HTTP MCP server at `https://livops.uz/api/mcp`. Codex reads MCP servers from `~/.codex/config.toml`, one `[mcp_servers.<name>]` table each, where a Streamable HTTP server needs a `url`[1].

## Connect through the browser

```toml
[mcp_servers.livops]
url = "https://livops.uz/api/mcp"
default_tools_approval_mode = "writes"
```

Then:

```bash
codex mcp login livops
```

`codex mcp login <server-name>` signs in to a server that supports OAuth[1]. Livops opens in the browser: the app's name, a team to pick, what the app will be able to do, and **Allow**. With two-factor on, your code comes first. Codex gets a key that lasts an hour, works only at `/api/mcp` and renews itself.

`default_tools_approval_mode` takes `auto`, `prompt`, `writes` or `approve`, and `writes` prompts for tools that are not marked read-only[1]. Livops marks every tool one way or the other, so with `writes` the reads run straight away and every change waits for you.

## Connect with an API token

```toml
[mcp_servers.livops]
url = "https://livops.uz/api/mcp"
bearer_token_env_var = "LIVOPS_TOKEN"
default_tools_approval_mode = "writes"
```

`bearer_token_env_var` names an environment variable whose value Codex sends as the bearer token in `Authorization`[1]. Export the token before you start Codex:

```bash
export LIVOPS_TOKEN=lvp_xxx
```

The token never lands in `config.toml`, which matters if you use a project's `.codex/config.toml`: Codex reads that file only for trusted projects[1], and it lives next to code you commit.

## Browser sign-in or token: what can Codex do?

Codex works in one team, as you, with your role. A **viewer** only reads.

| | Browser sign-in | `lvp_` API token |
| --- | --- | --- |
| Read projects, deploys, build and runtime logs, metrics | Yes | Yes |
| Deploy, roll back, restart, set variables | Yes | Yes |
| Delete anything | Yes, if your role allows | No |
| Read a database password or bucket key | Yes, if your role allows | No |
| Open a Payme or Click top-up link, redeem a promo code | Yes | No |

Card numbers, your password, two-factor, sessions, creating API tokens, deleting the account, handing a project over, project members and raw backup downloads have no tool at all.

The token column is the server's rule, not the tool list's: an `lvp_` request that would delete, pay or read a password gets `403`, through MCP or not.

## A deploy loop in Codex

1. Codex edits the code and pushes to the branch the project follows. Every push to that branch starts a deploy.
2. "Follow the latest shop-api deploy until it ends": `list_deploys`, then `get_deploy_log`, which returns up to 5000 lines.
3. If it fails: "Why?" Codex can read the log itself, or call `explain_failure`, which asks Livops's own assistant for the cause and a fix. The previous version keeps running meanwhile.
4. If the new version misbehaves after going live: "Roll shop-api back to the previous deploy" (`rollback`).

To build again without a new push, `deploy` redeploys a project from its current source.

## Safety notes

- Tool annotations are hints. The specification says a client must treat them as untrusted unless the server is trusted, and that a human should be able to deny a tool call[2]. `writes` is that human step for Livops.
- Logs, commit messages and query results are passed to the model as data. A log line telling the model to do something is still only a log line, but Codex decides what it does next; keep the prompt for changes.
- A database connection URL and a bucket secret are real secrets. Over a browser connection Codex can fetch them, which is the reason to approve those calls by hand.
- Calls are rate limited per account.

## Deploying from Codex on Livops

1. Add `[mcp_servers.livops]` with the `url` and `default_tools_approval_mode = "writes"` to `~/.codex/config.toml`.
2. Run `codex mcp login livops`, pick the team, press **Allow**.
3. Ask Codex: "List my Livops projects."
4. Push, and ask it to follow the build.

Also see [MCP (AI clients)](https://livops.dev/en/docs/mcp) for every tool, and [API tokens](https://livops.dev/en/docs/api-tokens) for what a token can do.

## Questions

**Where does Codex keep MCP servers?**

In ~/.codex/config.toml by default, one [mcp_servers.<name>] table per server. A project can have its own .codex/config.toml, which Codex reads only for trusted projects.

**How do I sign Codex in without a token?**

Add the server with just its url, then run codex mcp login livops. Livops opens in the browser, you pick a team and press Allow. On a machine without a browser, codex mcp login has a --no-browser option.

**Which approval mode should I use?**

writes. It prompts for every tool that is not marked read-only, and Livops marks each tool: reads set readOnlyHint, everything that changes something sets destructiveHint. Reads then run without a prompt and every change waits for you.

**Can I keep the token out of config.toml?**

Yes. bearer_token_env_var names an environment variable, and Codex sends its value in the Authorization header. Put the lvp_ token in that variable, not in the file.

**What can a token not do?**

Delete anything, read a database password or a bucket key, pay, or change the variables a whole environment shares. The server refuses those for an lvp_ token whatever tool asks for them.

**How do I disconnect Codex?**

In the cabinet, Account, then Connected AI apps, then Disconnect. With a token, revoke it under Settings, API tokens.

## Sources

1. [OpenAI — Model Context Protocol (Codex CLI)](https://learn.chatgpt.com/docs/extend/mcp?surface=cli). Checked 19 November 2026.
2. [Model Context Protocol — Tools (specification 2025-11-25)](https://modelcontextprotocol.io/specification/2025-11-25/server/tools). Checked 19 November 2026.
