Repository navigation
Labels
Description
Parent: #518
Outcome
A local mecatl process completes MCP OAuth itself—browser, callback, and token persistence—with no ACP URL elicitation. Operators may authenticate once before starting Buzz; later launches reuse the same credential profile silently.
Design requirements
- Implement the official SDK
AuthorizationCodeFetcheras a mecatl-owned local authorization session. - Bind loopback before constructing the redirect URI; use an unguessable callback path, GET-only route, bounded headers/query/time, safe constant/escaped HTML, security headers, and deterministic cancellation/shutdown.
- Consume one callback atomically. Bind state to the login attempt, principal/profile, MCP resource, issuer, and redirect URI; return only code/state/
issto the SDK. - Launch the browser through an argv-only OS API, never a shell. Explicit no-browser/print mode may write the URL only to the directly attached user terminal, never diagnostics or ACP/Buzz logs.
- Add a dedicated
mecatedMCP login operation that uses the same server/auth configuration as serving and exits only after durable save plus authenticated initialize/tool listing. - Optionally allow on-demand browser login only in an explicit local-interactive mode. Do not inspect Buzz, send ACP auth/elicitation requests, or depend on stdin.
- Serialize presentation so concurrent startup connects do not open multiple browsers.
- If browser/callback placement is unavailable, return typed login-required with the pre-login/pre-provision remedy rather than waiting on ACP.
Acceptance criteria
- A simulated browser completes the SDK flow through loopback.
- Wrong method/path/state/issuer, replay, duplicate, oversized, and late callbacks fail safely.
- Cancellation closes the listener and joins all goroutines.
- No token, code, state, verifier, cookie, or complete authorization URL reaches logs.
- A Buzz-style ACP launch in explicit local-interactive mode completes auth while its ACP transcript contains no auth/elicitation method or OAuth artifact.
- Pre-login followed by a new process invokes no browser.
Verification
Offline loopback integration tests, browser fake, replay/mismatch/fuzz tests, cancellation/goleak proof, terminal-vs-diagnostics redaction test, and ACP method recorder.
Dependencies and sizing
Depends on SDK qualification and the merged controller/fetcher contract.
Size: L. Complexity: high/security-sensitive. Execution: chunk callback host, then command/platform wiring.
Activity
JAORMX commentedon Aug 14, 2026
Implementation is complete on
feat/issue-522-mcp-oauth-login, stacked on #521. It adds a stdlib-only importablemcp/oauthloginruntime with random-path IPv4 loopback callback, strict state/issuer/query validation, bounded HTTP lifecycle, safe static HTML/headers, fixed-argv browser launch, explicit terminal-only no-browser mode, serialization/cancellation/cleanup, plus anapp.LoginMCPone-shot bridge through the real controller/Connect path. Security/QA repair waves added probe-flood resilience, proof that OAuth actually occurred, encrypted-store restart, post-callback cancellation, and temporary-session cleanup. No CLI/profile/config/ACP wiring is claimed; that remains #523. Lint, race/full tests, docs/site checks, and offline demo pass. Branch pushed; PR waits on stacked prerequisites for a clean diff.feat(mcp): add host-owned OAuth login runtime
fix(mcp/oauthlogin): pin only the callback path, not the port
fix(mcp/oauthlogin): pin only the callback path, not the port
fix(mcp/oauthlogin): pin only the callback path, not the port