Repository navigation
Description
Relocated from dezren39/darwin-nix#338 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue references inside it are historical (dezren39/nix numbering).
Today anything that can reach the daemon's socket or loopback port is trusted; the Origin/Host check stops browsers, not callers.
Optional, off unless set: a setting (e.g. transport.bearerToken, from env so it need not live in a config file) that, when set, makes every /v1 and /mcp request carry Authorization: Bearer <token> or get 401. Unset keeps today's behaviour. Reject tokens shorter than 32 characters, as codex-connectors-mcp does.
The CLI, plugin and scripts read the same setting so they keep working. A first, cheap step toward #253 (authorization) and #300 (the permissive interface that authorizes everyone); principals per surface are #298.
Reference: https://github.com/wileai/codex-connectors-mcp (CODEX_CONNECTORS_HTTP_TOKEN).
Acceptance criteria
- With
transport.bearerTokenset (sourced from env), every/v1and/mcprequest without a matchingAuthorization: Bearer <token>gets 401; with the token it succeeds. - With the setting unset, behaviour is byte-for-byte today's (no auth check).
- Tokens shorter than 32 characters are rejected at startup/config load with a clear error.
- The CLI, plugin, and scripts read the same setting and keep working when it is set.
Activity
developing-today commentedon Oct 28, 2026
CODE-900
dezren39 commentedon Oct 28, 2026
History carried over from dezren39/darwin-nix#338 (verbatim, oldest first):
@dezren39 · 2026-10-27T11:47:10Z
Intake review
Fleet monitor intake enrichment, 2026-10-27.
Liveness: still live — no merged PR implements the optional bearer token. Related: #253 (OAuth authorization), #298 (principal per surface), #300 (permissive auth interface).
Notes: Deliberately a first, cheap step — a shared secret, not principals. Suggested approach: single middleware check on both surfaces, one shared token-reading helper so CLI/plugin/scripts cannot drift.
Risks: token comparison should be constant-time; do not log the token; docs must state this is not a substitute for #253/#298.
46 remaining items
mcpx: resolve the target daemon's bearer token for record-targeted cl…
mcpx: resolve the target daemon's token through its config chain, not…
Merge pull request #2711 from developing-today/queue/3271-1975-bearer…
dezren39 commentedon Oct 30, 2026
🤖 Agent note · done
dezren39 commentedon Nov 3, 2026
🤖 Agent note · triaged → already implemented and on
main; closing COMPLETED (the merge never auto-closed this issue)repo-worker-code, OpenChamber scheduled lane (queue task 7806, coverage-pass triage)85960a654807aecb42c431868f8baac0b4aa2e0b(branchqueue/3271-1975-bearer-token), confirmed an ancestor oforigin/maind3476bce7. Prior task 3271 logged the merge in its note; the issue itself stayed open because the PR carried no closing keyword.Acceptance criteria, verified at current
main/v1and/mcprequest when set —internal/daemon/bearer.go:59requireBearerwraps the whole HTTP surface, chained in both handler constructions (internal/daemon/server.go:457,:531); missing/mismatched credential → 401 with a message namingtransport.bearerToken, constant-time compare.bearer.goreadstransport.bearerToken, empty = no check).MinBearerTokenLengthcheck atbearer.go:50;internal/daemon/bearer_test.go:84asserts the error names the setting and the 32-character minimum.internal/cli/client.go:134-193(targetBearerToken, own-daemon and target-daemon resolution) plusdocs/environment.md:112forMCPX_TRANSPORT_BEARER_TOKENhanded to daemon-hosted scripts;internal/cli/bearer_test.gocovers the eight previously-unauthorized CLI request paths and the target-daemon resolution P2.docs/configuration.md:1070(transport.bearerToken/--transport-bearer-token/MCPX_TRANSPORT_BEARER_TOKEN).Verification run for this triage (2026-11-03)
cd pkgs/mcpx && go test ./internal/daemon/ ./internal/cli/ -run Bearer -count=1→ ok / ok; the tree tested has zero diff againstorigin/maind3476bce7ininternal/daemon/bearer.go,internal/daemon/server.goandinternal/cli.Scope note: this closes the optional bearer token step only. #253 (authorization), #298 (principals per surface) and #300 (permissive auth interface) remain the follow-on work and are untouched.
dezren39 commentedon Nov 3, 2026
agent-note:v1
state: triaged (coverage pass)
Coverage pass 2026-11-03: reviewed in the fleet-wide per-issue pass (drift / overlap / already-handled / stale / blockers / ordering). Verdict: still live; queued in repo-health-code-pilot as triage at priority 40 (priority/normal). If this is already handled at current main, the triage closes it with evidence; if it needs splitting, the triage files the split.
Found via: coverage pass 2026-11-03
fix(mcpx): stop judging catalogue-n/a authsplit sides (#2695) (#5138)