Beta

Codex CLI

Codex CLI streamable-HTTP MCP server; an http_headers_helper script fetches a fresh JWT.

FamilyOpenAI
Auth methodpat_swap
Originlocal
Token stepPAT swap through Codex's http_headers_helper, which runs the token script on connect and again after a 401.
StatusAvailable
Version—
Released—
Environmentproduction
MCP endpointhttps://edge.a24labs.net/mcp
Token endpoint (PAT exchange)https://frontdoor.a24labs.net/v1/oauth/token
AuthFront Door PAT exchange → Bearer JWT (15 min); or OAuth PKCE, client awp-edge-mcp-oauth

Steps

  1. Get a PAT. Ask your operator for an AWP PAT, then exchange it at the token endpoint for a Bearer JWT. Save it to ~/.config/awp/edge.pat with mode 600. Never paste it into chat or commit it.
  2. Install the token script. Save as ~/.config/awp/awp-edge-token.sh (chmod 700). It prints a Bearer JWT valid for 15 minutes.
  3. Configure OpenAI Codex CLI. Add the config below.
  4. Load the token. Codex runs the helper (through sh -c, with HOME and PATH) when it connects and again when Edge answers 401 or 403, so the 15-minute JWT is renewed without a restart. Use one method: an explicit bearer token takes precedence over the helper's Authorization header.
  5. Get your twin connected. Paste the prompts below into the agent, in order.

1. Token script

~/.config/awp/awp-edge-token.sh
#!/bin/bash
# awp-edge-token.sh — exchange an AWP PAT for a 15-minute Edge JWT. Prints the JWT only.
# The PAT is read from a mode-600 file and sent on stdin, so it never appears in argv or history.
set -euo pipefail
PAT_FILE="${AWP_PAT_FILE:-$HOME/.config/awp/edge.pat}"
printf '{"grant_type":"urn:awp:params:oauth:grant-type:pat","secret":"%s"}' "$(cat "$PAT_FILE")" |
  curl -sS --fail-with-body -X POST "https://frontdoor.a24labs.net/v1/oauth/token" \
    -H 'content-type: application/json' --data-binary @- |
  python3 -c 'import json,sys; print(json.load(sys.stdin)["access_token"])'
Token endpoint response
{
  "access_token": "<JWT>",
  "token_type": "Bearer",
  "expires_in": 900,
  "scope": "..."
}

2. Configure OpenAI Codex CLI

Headers helper

~/.config/awp/edge-headers.sh (chmod 700)
#!/bin/bash
# Prints the Authorization header as JSON for Codex's http_headers_helper.
printf '{"Authorization":"Bearer %s"}\n' "$("$HOME/.config/awp/awp-edge-token.sh")"

Codex config

~/.codex/config.toml
[mcp_servers.awp-edge]
url = "https://edge.a24labs.net/mcp"
http_headers_helper = "~/.config/awp/edge-headers.sh"

Alternative: token from the environment (expires in 15 min)

~/.codex/config.toml + shell
# config.toml: replace http_headers_helper with
# bearer_token_env_var = "AWP_EDGE_JWT"
export AWP_EDGE_JWT="$(~/.config/awp/awp-edge-token.sh)"
codex

3. Load the token

Codex runs the helper (through sh -c, with HOME and PATH) when it connects and again when Edge answers 401 or 403, so the 15-minute JWT is renewed without a restart. Use one method: an explicit bearer token takes precedence over the helper's Authorization header.

4. Get your twin connected

Your PAT is bound to a twin workspace; these prompts confirm the connection end to end.

  1. List the tools the awp-edge MCP server exposes.
    Expect: 5 tools on this Edge (fewer if your PAT lacks a capability).
  2. Call the awp-edge tool discovery with limit 5 and list the resource ids it returns.
    Expect: Up to five resources labelled STORE (evidence.source=awp-store).
  3. Call workspace_search with query "agents hub" and limit 5.
    Expect: Up to five STORE results.
  4. Call project_query with {"id": "<project-id>"}. Use id only; free-text query is unsupported.
    Expect: One project, or a clear bad-args error if you pass query.

OAuth sign-in (optional)

For clients that support OAuth sign-in instead of a static header. Authorization server https://id.a24labs.net/realms/a24labs, public client awp-edge-mcp-oauth, PKCE S256.

Machine-readable: /recipes/openai-codex-cli/recipe.json · /llms.txt · /recipes.json · /catalog.json · No-script start page: /start/