Skip to content

feat(console): add native VS Code install links - #2830

Merged
mickdarling merged 1 commit into
betafrom
codex/beta-native-install-links
Sep 25, 2026
Merged

mickdarling merged 1 commit into
betafrom
codex/beta-native-install-links

Conversation

@mickdarling

@mickdarling mickdarling commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Summary

The hosted Connect page gains an Open in VS Code button that sends the selected connection name and deployment-discovered HTTP MCP endpoint to VS Code's native installation review. Cursor keeps its existing browser install route, and all generated links, commands, and manual configurations use the editable connection name.

Configuration generation now lives in a small pure module, separate from the UI and permission evaluation. Invalid names remove stale setup actions; endpoint validation remains same-origin and excludes credentials, query parameters, and fragments. The UI explains that opening setup does not establish a connection or install local permission hooks, and includes retry, manual-merge, and removal guidance.

Refs #2809, #2828, #2808, #2827. This is a bounded first slice; those broader issues remain open. OpenAI/Anthropic route qualification is recorded in #2813–#2817. No dependency, OAuth policy, permission-engine, or deployment changes.

Validation

  • Focused Connect UI suite: 35 tests passed.
  • Full ESLint and production build passed.
  • Security rapid suite: 108 passed, 46 skipped; script typecheck passed.
  • Full unit run: 14,703 passed, 9 skipped, 1 failed (653 suites passed). The sole failure is the unchanged auth-asset test: Express rejects /fonts.css under this hidden .codex worktree path. The focused auth-asset suite passes 2/2 on unchanged beta in a non-hidden checkout; environment-specific follow-up [Testing][beta] Auth asset routes return 404 under hidden checkout ancestor #2831. No auth behavior was changed.
  • Independent Sol review found no blocking code issues. Actual Connect UI checked at desktop and 400px widths, including invalid-name recovery.
  • Browser/native handoff: clicked generated link in Chrome; VS Code displayed the expected connection name, http type and endpoint in its MCP Server review page. Closed before saving or granting access.

Deployment qualification

@mickdarling mickdarling added target: beta Targets the active DollhouseMCP 2.1 beta line area: platform-compat Multi-platform support labels Sep 25, 2026
@mickdarling

Copy link
Copy Markdown
Member Author

@codex review

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @mickdarling's task —— View job


Reviewed commit: b882e75272ee270cc33431f87ffde2a06dcf38fc

Tasks

  • Verify HEAD SHA
  • Read CLAUDE.md and repo guidelines
  • Read changed files
  • Provide review feedback

Review

Overall this is a clean, well-structured PR. The separation of configuration logic into connect-config.js is a good design decision, and the security validations are thorough. A few observations below.

src/web-console/ui/connect-config.js

Regex anchor edge case (line 6–10):

const match = typeof value === 'string' && /^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/.exec(value);
if (!match || match[0] !== value) {

The comment on line 7 explains this correctly — JavaScript's $ can match just before a trailing \n, so checking match[0] !== value correctly guards against "valid-name\n". This is good. However, the pattern allows names of length 1 (just [A-Za-z0-9] with {0,63} matching zero characters), which seems intentional given the docs say "1–64". Worth confirming that single-character names are desired.

base64Utf8 comment accuracy (line 57):

// Endpoint validation and URL canonicalization constrain this JSON to ASCII.
return btoa(value);

The JSON encoded here includes the connectionName which is [A-Za-z0-9_-] (all ASCII), and the safeEndpoint which is validated to not include non-ASCII code points (the codePoint <= 32 check only catches control characters, not high Unicode). However, since validateConnectionName and validateHostedMcpEndpoint both operate on values that are URL-encoded by new URL() canonicalization, and unsafeEndpointText checks individual code points for control chars but not high Unicode, the comment may be overstated. A URL like https://mcp.example.test/mcp is ASCII-safe, but ideally this could assert or document why high-Unicode paths are impossible given the same-origin requirement and typical deployment configs.

vscodeLink format (line 75):

vscodeLink: `vscode:mcp/install?${encodeURIComponent(JSON.stringify({ name: profile.connectionName, type: 'http', url: safeEndpoint }))}`,

The VS Code vscode:mcp/install deep link format encodes the entire JSON payload as the query string with encodeURIComponent. This matches the VS Code MCP documentation format. The test at line 118 validates this correctly. Good.

cursorLink vs vscodeLink inconsistency:
Cursor uses name=...&config=... as separate query parameters; VS Code uses a single JSON blob as the query string. This is correct per each platform's respective protocol, not a bug, but it's worth documenting inline since the asymmetry could confuse future maintainers.

src/web-console/ui/connect.js

Re-export at line 9:

export { connectionArtifacts, validateHostedMcpEndpoint } from './connect-config.js';

This re-export maintains backward compatibility for any consumers importing from connect.js, which is good. The test file imports from both connect and connectConfig directly, which validates both paths.

nativeInstallLink uses <a> not <button> (line 168):

const link = document.createElement('a');
link.className = 'btn btn-primary';
link.href = href;

Using an <a> element for the native deep link is semantically correct (it navigates to a custom protocol URL). The CSS in connect.css at lines 30–33 correctly styles visited/hover/focus states for this <a> element. No rel="noopener" is needed here since custom protocol URLs don't open a new browsing context. Good.

No target attribute on the VS Code link:
The link doesn't set target="_blank" which is correct — custom protocol links shouldn't open a new tab. However, the link also has no rel attribute. While not strictly needed for vscode: protocol links, some browsers or security scanners may flag this. Minor.

Error swallowing in loadEndpoint (line 102):

} catch {
  host.dataset.endpoint = '';
  ...

The catch block silently swallows all errors. Given this is already a user-facing "fail closed" scenario with a visible error message, this is acceptable. For debugging, a console.error or development-mode logging might be useful, but that's a style preference.

selectClient reads nameInput.value on every name change (line 117–131):
This eagerly regenerates all artifacts on each keystroke during input. Given the artifacts are pure computations on already-validated strings, performance is fine. No concern.

tests/unit/web-console/ui/ConnectUi.test.ts

Coverage is strong. Tests cover:

  • Endpoint validation (same-origin, loopback, unsafe variants including injection chars)
  • Shell quote variants including full-width apostrophe (line 68) — excellent defensive testing
  • Connection name validation (line 97 with 12 invalid cases)
  • Round-trip for custom names and paths through all native formats
  • UI state: empty/connected sessions, error states, clipboard fallback, Sessions link availability, stale action clearing, pending-discovery behavior, keyboard accessibility, and toast feedback

One gap: There is no test verifying that the oauthNote() text is present on the VS Code panel specifically. Given the note is included in renderClientPanel for vscode, this is low-risk but easy to add.

afterAll cleanup (line 40):

for (const key of ['document', 'navigator', 'location', 'fetch']) Reflect.deleteProperty(globalThis, key);

This correctly cleans up globals after the test suite. The dom.window.close() before it is also appropriate.

connect.css

a.btn-primary color rule (lines 30–33):

.connect-client-panel a.btn-primary,
.connect-client-panel a.btn-primary:visited,
.connect-client-panel a.btn-primary:hover,
.connect-client-panel a.btn-primary:focus { color: var(--paper-strong); }

This correctly overrides the default anchor :visited color change, which would otherwise cause the button to appear visually different after clicking. Good UX fix, but a.btn-primary:focus-visible (not just :focus) would be more aligned with the focus style pattern used elsewhere in this file (e.g., .connect-name input:focus-visible on line 14). The :focus pseudo-class activates on mouse click as well, which could interfere with click styling on some browsers.

docs/guides/hosted-client-connection.md

The documentation is accurate and complete. It clearly explains the manual fallback paths, the name collision risk, and the limitation that copying/opening a link does not confirm a connection. The note about local permission hooks not being installed is appropriately prominent.


Summary

No blocking issues found. The security validation model is sound: same-origin enforcement, shell injection prevention via quote/control-char checks, and fail-closed behavior on bad metadata. The pure configuration module separation is clean. The test suite is comprehensive and well-targeted.

Minor suggestions (non-blocking):

  1. connect.css:33 — Consider :focus-visible instead of :focus for the a.btn-primary rule for consistency with the rest of the stylesheet
  2. connect-config.js:57 — Consider a brief inline note explaining why the VS Code link format uses a different query structure than Cursor, for future maintainability
  3. ConnectUi.test.ts — Optional: add a test asserting the oauthNote is rendered in the VS Code panel

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-25T18:04:48.339024Z b882e75 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Security Audit Passed

🔒 Security Audit Results

Security Audit Report

Generated: 2026-09-25T14:26:35.194Z
Duration: 7501ms

Summary

  • Total Findings: 0
  • Files Scanned: 176

Findings by Severity

  • 🔴 Critical: 0
  • 🟠 High: 0
  • 🟡 Medium: 0
  • 🟢 Low: 0
  • ℹ️ Info: 0

Recommendations

  1. Address all critical and high severity issues immediately
  2. Review medium severity issues and plan remediation
  3. Consider adding suppressions for false positives
  4. Run security audit regularly (e.g., in CI/CD pipeline)

@sonarqubecloud

Copy link
Copy Markdown

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: b882e75272

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@mickdarling

Copy link
Copy Markdown
Member Author

Review disposition for b882e75272ee270cc33431f87ffde2a06dcf38fc: both Codex and Claude completed with no blocking findings; independent Sol review and browser/native handoff checks are also complete.

Clarifications on the optional Claude observations:

  • Single-character names are intentional, matching the documented 1–64-character contract.
  • Endpoint output comes from new URL(value).href; hostnames and non-ASCII path characters are canonicalized before the Cursor JSON reaches btoa. The Cursor payload contains only the endpoint; the ASCII connection name is a separate query parameter.
  • Cursor and VS Code have deliberately different native URI contracts; both formats round-trip in tests and are linked in the user guide.
  • The optional focus-color style and literal OAuth-note text assertion do not represent missing enforcement or connection checks. Broader client/accessibility/live-connection qualification remains tracked in [Native install] VS Code / GitHub Copilot — direct setup and qualification #2828/[Beta install route] Native install links and direct setup from Connect #2809; no unrelated code churn is needed for this slice.

No review finding was suppressed. The draft remains gated by inherited dependency audit #2829 and the uncompleted live hosted OAuth/MCP check. #2831 separately tracks the hidden-checkout auth-asset test behavior.

@mickdarling
mickdarling marked this pull request as ready for review September 25, 2026 18:03
@mickdarling
mickdarling merged commit 174b0fe into beta Sep 25, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: platform-compat Multi-platform support target: beta Targets the active DollhouseMCP 2.1 beta line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant