Skip to content

Codex CLI

Codex stores MCP server config in ~/.codex/config.toml (or a project-scoped .codex/config.toml for trusted projects).

Section titled “Connect to a server (OAuth) — recommended”

If someone — you, or someone in your household — is running the self-hosted server, this is the recommended way to connect: you log into YNAB with your own account instead of sharing a token. Point Codex at its URL instead of a command:

[mcp_servers.ynab]
url = "https://<your-hostname>/mcp"

Then start the login:

Terminal window
codex mcp login ynab

This opens the browser OAuth flow — you’ll log into YNAB and choose read-only or full access.

No server to run, but a single token stands in for your own login — the right trade when you’re the only person using this.

Terminal window
codex mcp add ynab \
--env YNAB_TOKEN=your-personal-access-token \
--env YNAB_BUDGET_ID=last-used \
-- npx -y @redlinelabs/ynab-mcp

Or add it to config.toml directly:

[mcp_servers.ynab]
command = "npx"
args = ["-y", "@redlinelabs/ynab-mcp"]
[mcp_servers.ynab.env]
YNAB_TOKEN = "your-personal-access-token"
YNAB_BUDGET_ID = "last-used"

See the Quick start for where to get a token.