# Connect Codex

> Documentation index: [llms.txt](https://namera.ai/llms.txt).

Source: https://namera.ai/docs/cli/guides/automation/connect-codex

Give Codex access to Namera through local MCP.

Install the [Namera CLI](https://namera.ai/docs/cli/installation) and Codex
on the machine that will run the agent. Make sure `namera` is on that process's
PATH. Complete account setup and any required key import on the same machine.

## Register Namera [#register-namera]

```sh
codex mcp add namera -- namera mcp serve --profile codex
```

The client launches a local stdio process. You do not need to start a background
daemon or configure a hosted MCP URL.

## Authorize the Connection [#authorize-the-connection]

You can authorize before the first tool call:

```sh
namera mcp login --profile codex
namera mcp status --profile codex
```

<div className="docs-response">

```text
OK MCP connected to Namera
-> Profile: codex
-> Server: https://api.namera.ai

Permissions
-> View wallets, session keys, and transaction history
-> Send transactions and sign with authorized session keys
-> Stay connected
```

</div>

Approve only the active session keys and permissions this agent needs. Ordinary
`namera login` and `NAMERA_API_KEY` do not authorize the MCP connection.

If you skip manual login, the first authenticated tool call opens browser consent
and asks you to retry after approval. If the browser cannot open, follow the URL
printed by `namera mcp login`.

## Check Read Access First [#check-read-access-first]

Ask the agent to list your Namera accounts and inspect a session key before
requesting an execution. Read access and execute/sign access are separate.
To send transactions, the selected key must also permit the target network
and action.

For self-funded gas, configure an explicit ceiling on the `mcp serve` command.
Tools cannot raise that ceiling; see [Sponsor Gas](https://namera.ai/docs/cli/guides/transactions/sponsor-gas).

## Disconnect [#disconnect]

```sh
namera mcp logout --profile codex
```

This revokes the MCP connection without deleting imported keys. Remove the MCP
registration from the agent client separately if you no longer want it launched.

Example output uses fixture accounts and hashes, captured with the CLI's output
formatters. Plain-text output is shown without terminal colors; your values and
relative expiry dates will differ.
