Add one-command access token setup - #2
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
intern-mcp setup --host codex|claude: securely prompt, perform a realintern_auth_statushandshake, atomically save a mode-0600 Intern profile, configure the host with nonsecretintern-mcp launch, and report organization/role.launchfor profile-backed host startup while preservingserveplusINTERN_ACCESS_TOKENfor manual and CI configurations.@archastromapping.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_TOKENdirectly.Testing
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 packagedsetupfor Codex and Claude, crosses both native configuration writers, starts the saved profile launcher, and asserts connected identity plus nonsecret persisted configuration.src/server.test.ts—an 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.tscovers 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.Follow-ups and known issues
@archastro/intern-mcp@0.1.0before exposing the public command outside the preview environment.