Skip to content

Add one-command access token setup - #2

Merged
calvin-archastro merged 1 commit into
mainfrom
harden/release-install
Aug 18, 2026
Merged

Add one-command access token setup#2
calvin-archastro merged 1 commit into
mainfrom
harden/release-install

Conversation

@calvin-archastro

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

Copy link
Copy Markdown
Contributor

Review on ArchCode

Problem and author intent

The local Intern MCP owned a device OAuth session, refresh-token persistence, and login/logout tools even though TryIntern now creates user-owned profile access tokens. Installation also required users to understand Codex/Claude MCP environment configuration. This change makes the server token-only and adds one secure setup command that configures and verifies the selected host. The companion onboarding UI and live product proof are in firstlanding PR 10428.

What changed

  • Removed device authorization, refresh handling, browser launch, credential JSON, and MCP login/logout tools.
  • Added intern-mcp setup --host codex|claude: securely prompt, perform a real intern_auth_status handshake, atomically save a mode-0600 Intern profile, configure the host with nonsecret intern-mcp launch, and report organization/role.
  • Added transactional setup behavior: serialized token updates, Claude user-scope/shadow detection, conflict-aware single-entry rollback, Codex committed-state handling, and stale-lock fail-closed behavior.
  • Added launch for profile-backed host startup while preserving serve plus INTERN_ACCESS_TOKEN for manual and CI configurations.
  • Updated server instructions, local launcher, installation docs, package smoke, and real Codex/Claude harness coverage.
  • Kept public setup commands registry-neutral; the npmjs scope override is documented only for machines with an internal @archastro mapping.

Scope

Local developer tooling only. No Platform or live infrastructure changes.

Risk assessment

Medium. Setup writes a local credential profile and native host configuration. Tokens never enter child argv or host config, writes are mode-0600 and atomic, concurrent setup is serialized, and rollback modifies only the owned Claude entry. The server's existing site/Git behavior is unchanged.

User impact

Users copy one token and run one command. Setup confirms their organization and role, tells them to restart the host, and leaves a pinned MCP package registration. Manual hosts can continue supplying INTERN_ACCESS_TOKEN directly.

Testing

  • Canonical packaged setup proof: scripts/harness-install-smoke.mjs. It packs and installs the actual npm artifact in isolated homes, serves a real Intern-shaped HTTP session boundary, runs packaged setup for Codex and Claude, crosses both native configuration writers, starts the saved profile launcher, and asserts connected identity plus nonsecret persisted configuration.
  • Canonical MCP workflow proof: src/server.test.tsan authorized MCP client prepares and publishes an Intern checkout over stdio. The official MCP client spawns the built executable, crosses real stdio, HTTP, filesystem, Git, validation, preview, publish, and shutdown boundaries, and observes the deployed committed content.
  • src/setup.test.ts covers hidden prompting, mode-0600 storage, no token argv/output, real host argument contracts, Claude scope spoofing, rollback, Codex split-state prevention, live/stale setup locks, and rejected tokens.
  • npm run check — formatting, lint, TypeScript build, 29 tests, and clean-package smoke passed.
  • npm run test:harnesses — real isolated Codex and Claude setup passed after rebase.
  • Companion firstlanding browser lifecycle — all 11 steps passed.

Follow-ups and known issues

  • Publish @archastro/intern-mcp@0.1.0 before exposing the public command outside the preview environment.
  • After the first release, configure npm trusted publishing and remove the one-time bootstrap release token as already documented.

@calvin-archastro
calvin-archastro merged commit 74fd947 into main Aug 18, 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