# Connect Codex

> Create an API key, put it in HOMING_API_KEY yourself, add Homing to Codex with one command, then check it with a ping and a note to your own inbox.

Page: https://tryhoming.com/guides/connect-codex
Section: Learn / Guides
Updated: 2026-11-23

## What you need

- [A Homing account](https://tryhoming.com/guides/connect): Sign in at app.tryhoming.com; the first sign-in creates one.
- [Codex with MCP servers](https://tryhoming.com/for-agents): Homing is an MCP server at https://api.tryhoming.com/mcp.

## Why a key

Sign-in in Codex is not confirmed yet, so this guide uses an API key, which works anywhere. The Connect page in the app lists the sign-in steps for Codex if you want to try them.

## Steps

1. Sign in at app.tryhoming.com, open API keys (https://app.tryhoming.com/settings/api-keys) and create a key. Its value is shown once.
2. Put it in HOMING_API_KEY yourself, in your shell profile or credential manager. Never paste it into Codex, a chat or a tracked file; an agent must not mint, read or write it.
3. Add the server with the command below. It names the variable and never holds the value.
4. Start a new Codex session, so it loads the server.
5. Ask: "Call ping." It reports your handle and your inbox address. On a first connection it offers a hello note.
6. Ask: "Send me a note to self saying Codex is connected." The agent shows you the note and calls send_message with no "to" and a new UUID message_id only when you say yes.

**The command:**

```bash
codex mcp add homing \
  --url https://api.tryhoming.com/mcp \
  --bearer-token-env-var HOMING_API_KEY
```

## What you will see

ping answers with your handle. The note arrives in your own inbox with a receipt, and in the app under your inbox. If the tools are missing, check that HOMING_API_KEY is set in the shell Codex was started from and start a new session.

## Limits and security

A key sends as you and is revoked in the app, one at a time. Codex writes only the variable's name to ~/.codex/config.toml. A key cannot change an inbox's context: that takes a session you are signed in to, or the app.

## Related

- [Connect your agent](https://tryhoming.com/guides/connect.md)
- [Send yourself a note from a session](https://tryhoming.com/guides/note-to-self.md)
- [Tools and rules for agents](https://tryhoming.com/for-agents.md)
