Skip to content

Improve Intern MCP setup diagnostics - #3

Merged
calvin-archastro merged 1 commit into
mainfrom
agent/add-intern-mcp-diagnostics
Aug 19, 2026
Merged

Improve Intern MCP setup diagnostics#3
calvin-archastro merged 1 commit into
mainfrom
agent/add-intern-mcp-diagnostics

Conversation

@calvin-archastro

@calvin-archastro calvin-archastro commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Review on ArchCode

Problem and author intent

Intern MCP setup collapsed upstream HTTP and transport failures into “Intern rejected this access token,” so the production IAP interception was invisible. The hidden token prompt also gave no feedback that a paste arrived. This change adds privacy-safe diagnostics and visible, length-preserving secret entry without putting the bearer in shell history, host configuration, logs, or terminal output.

What changed

  • Added --verbose setup parsing and propagated it through the real child MCP handshake.
  • Logged allowlisted HTTP lifecycle fields on stderr: method, query-free origin/path, status, duration, safe request ID/content type, IAP interception marker, and typed transport codes.
  • Excluded authorization headers, cookies, response bodies, query values, and raw transport messages from diagnostics.
  • Reworked the terminal token prompt to render one * per pasted character while preserving the original token internally.
  • Added clean Ctrl-C/Ctrl-D cancellation instead of leaving top-level await unsettled.
  • Extended the packaged Codex/Claude setup harness to exercise verbose logging and prove response/request secrets never appear.

Companion infrastructure change: Firstlanding PR 10488.

Scope indicator

CLI/package only. No server API or frontend changes.

Risk assessment

Medium. The prompt and diagnostic paths handle a bearer credential. Risk is bounded by allowlisted fields, stderr-only diagnostics, secret-scanning assertions across the packaged setup flow, and real-PTY verification.

User impact

Users can run setup --host codex --verbose or setup --host claude --verbose to see actionable redacted request diagnostics. Pasting a token now visibly renders the correct number of stars, and cancellation exits with a clear error.

Testing

  • Canonical E2E: scripts/harness-install-smoke.mjs, run through npm run test:harnesses (passed). It packs the artifact, installs it in an isolated home, crosses the real setup executable, MCP stdio child, loopback HTTP server, and real Codex/Claude configuration writers, then asserts successful identity/configuration and scans verbose stderr plus saved host configuration for request, response, and bearer secrets.
  • npm run check — passed: formatting, lint, TypeScript build, 32 tests, and clean-consumer package smoke.
  • Manual real-PTY proof — a 17-character paste rendered 17 stars with no plaintext; Ctrl-C returned Token entry cancelled without an unsettled-await warning.
  • Independent adversarial review reproduced the original cancellation issue, verified the fix, and found no remaining actionable issues.

Follow-ups and known issues

  • Production setup also depends on the linked Firstlanding PR removing IAP from the exact bearer-authenticated MCP routes.

@calvin-archastro
calvin-archastro merged commit 8f076aa into main Aug 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant