Docs / Integrations
MCP

Use Prefsly with Codex

Give Codex access to one chosen preference profile.

Set it up

  1. Run the commands below to add Prefsly as a remote HTTP MCP server and start OAuth login with dynamic client registration.

    Codex CLI commands

    codex mcp add prefsly --url https://www.prefsly.io/mcp
    codex mcp login prefsly --oauth-client-registration dcr
    codex mcp list
  2. Sign in to Prefsly and approve one profile.
  3. Run codex mcp list to confirm the server. Add the startup instruction below to ~/.codex/AGENTS.md to apply it across projects.

    Startup instruction for ~/.codex/AGENTS.md

    At the start of every new session, call the `prefsly` MCP tool `get_profile` and use its returned preferences throughout the session. If the call fails, tell me that prefsly.io preferences could not be loaded.

Use a profile token instead

Use this option when you prefer not to complete browser OAuth. The token is scoped to one profile and Codex sends it as a bearer token on MCP requests.

  1. In Prefsly Connections, choose the profile to share, give the connection a recognizable name, and create a profile token. Copy it immediately; Prefsly shows it only once.
  2. Store the token in your preferred secret manager, then make it available as PREFSLY_PROFILE_TOKEN before launching Codex. Do not put the token itself in config.toml, source control, or shell history.
  3. Run the command below. If you want to keep an existing OAuth connection, use a distinct server name consistently in the command.

    Codex CLI profile-token configuration

    export PREFSLY_PROFILE_TOKEN='your-profile-token'
    codex mcp add prefsly --url https://www.prefsly.io/mcp --bearer-token-env-var PREFSLY_PROFILE_TOKEN
    codex mcp list
  4. Run codex mcp list, then ask Codex to call get_profile to confirm the profile is available.
Good to know

MCP server configuration differs among Codex clients. Check the current client documentation before adding credentials.

Update or disconnect

For copied prompts, copy a new prompt after edits. For MCP, your next tool call sees the saved revision. Revoke a connection from Prefsly Connections when you no longer want a client to retrieve the profile.

Official source

Codex MCP documentation ↗

Related Prefsly guides

Create and manage profilesMCP authentication optionsMCP troubleshootingPrivacy and sharing controls
Published by Prefsly · Last reviewed September 25, 2026 · All documentation