{
  "id": "claude-code",
  "family": "Anthropic",
  "title": "Claude Code",
  "auth_method": "pat_swap",
  "origin": "local",
  "token_step": "PAT swap through Claude Code's headersHelper, which runs the token script on every connect. OAuth later.",
  "availability": {
    "status": "available",
    "line": null
  },
  "environment": "production",
  "verified": false,
  "badge": "Beta",
  "version": null,
  "released_at": null,
  "summary": "Remote HTTP MCP server in.mcp.json; a headersHelper script fetches a fresh JWT on every connect.",
  "client": "Claude Code (CLI)",
  "html": "https://agents.a24labs.net/recipes/claude-code/",
  "json": "https://agents.a24labs.net/recipes/claude-code/recipe.json",
  "endpoints": {
    "hub": "https://agents.a24labs.net",
    "mcp": "https://edge.a24labs.net/mcp",
    "prm": "https://edge.a24labs.net/.well-known/oauth-protected-resource",
    "as_metadata": "https://id.a24labs.net/realms/a24labs/.well-known/openid-configuration",
    "auth_discovery": "https://edge.a24labs.net/discovery/v1/authentication",
    "bootstrap": "https://edge.a24labs.net/.well-known/awp-eeg",
    "token_endpoint": "https://frontdoor.a24labs.net/v1/oauth/token",
    "idp": "https://id.a24labs.net/realms/a24labs"
  },
  "steps": [
    {
      "title": "Get a PAT",
      "body": "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."
    },
    {
      "title": "Install the token script",
      "body": "Save as `~/.config/awp/awp-edge-token.sh` (chmod 700). It prints a Bearer JWT valid for 15 minutes."
    },
    {
      "title": "Configure Claude Code (CLI)",
      "body": "Add the config below."
    },
    {
      "title": "Load the token",
      "body": "The headers helper runs the token script each time Claude Code connects, so the 15-minute JWT never sits in a config file. Run `/mcp` in Claude Code to reconnect after it expires."
    },
    {
      "title": "Get your twin connected",
      "body": "Paste the prompts below into the agent, in order."
    }
  ],
  "config": [
    {
      "title": "Headers helper",
      "path": "~/.config/awp/edge-headers.sh (chmod 700)",
      "lang": "bash",
      "body": "#!/bin/bash\n# Prints the Authorization header as JSON for Claude Code's headersHelper.\nprintf '{\"Authorization\":\"Bearer %s\"}\\n' \"$(\"$HOME/.config/awp/awp-edge-token.sh\")\""
    },
    {
      "title": "Project MCP config",
      "path": ".mcp.json (project root)",
      "lang": "json",
      "body": "{\n \"mcpServers\": {\n \"awp-edge\": {\n \"type\": \"http\",\n \"url\": \"https://edge.a24labs.net/mcp\",\n \"headersHelper\": \"~/.config/awp/edge-headers.sh\"\n }\n }\n}"
    },
    {
      "title": "One-off alternative (token expires in 15 min)",
      "path": "shell",
      "lang": "bash",
      "body": "claude mcp add --transport http awp-edge https://edge.a24labs.net/mcp \\\n --header \"Authorization: Bearer $(~/.config/awp/awp-edge-token.sh)\""
    }
  ],
  "token_script": "#!/bin/bash\n# awp-edge-token.sh — exchange an AWP PAT for a 15-minute Edge JWT. Prints the JWT only.\n# The PAT is read from a mode-600 file and sent on stdin, so it never appears in argv or history.\nset -euo pipefail\nPAT_FILE=\"${AWP_PAT_FILE:-$HOME/.config/awp/edge.pat}\"\nprintf '{\"grant_type\":\"urn:awp:params:oauth:grant-type:pat\",\"secret\":\"%s\"}' \"$(cat \"$PAT_FILE\")\" |\n  curl -sS --fail-with-body -X POST \"https://frontdoor.a24labs.net/v1/oauth/token\" \\\n    -H 'content-type: application/json' --data-binary @- |\n  python3 -c 'import json,sys; print(json.load(sys.stdin)[\"access_token\"])'",
  "token_response_example": "{\n  \"access_token\": \"<JWT>\",\n  \"token_type\": \"Bearer\",\n  \"expires_in\": 900,\n  \"scope\": \"...\"\n}",
  "prompts": [
    {
      "prompt": "List the tools the awp-edge MCP server exposes.",
      "expect": "5 tools on this Edge (fewer if your PAT lacks a capability)."
    },
    {
      "tool": "discovery",
      "prompt": "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)."
    },
    {
      "tool": "workspace_search",
      "prompt": "Call workspace_search with query \"agents hub\" and limit 5.",
      "expect": "Up to five STORE results."
    },
    {
      "tool": "project_query",
      "prompt": "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": {
    "note": "For clients that support OAuth sign-in instead of a static header.",
    "authorization_server": "https://id.a24labs.net/realms/a24labs",
    "client_id": "awp-edge-mcp-oauth",
    "pkce": "S256"
  }
}
