Skip to content

feat: add MCP onboarding and prepare 0.3.3 - #24

Merged
spaxe-dev merged 9 commits into
mainfrom
feat/onboard
Nov 4, 2026
Merged

spaxe-dev merged 9 commits into
mainfrom
feat/onboard

Conversation

@spaxe-dev

Copy link
Copy Markdown
Owner

Summary

  • Add zen-mcp onboard, which finds common MCP clients, preselects them, and merges a zen-mcp stdio server into each selected config. Existing servers, JSONC comments, trailing commas, and TOML tables are preserved, and rerunning updates the entry instead of duplicating it.
  • Prepare the 0.3.3 release metadata: version bump, completed changelog, and docs.
  • Fix the four findings from the security re-audit that were in scope: F8, F4, F10, and F13.

Security fixes

  • F8, Glance privileged load. Glance now resolves the tab URL, requires http(s), checks the allowlist before the preview loads, and uses a content principal instead of the system principal. After the preview opens, the bridge reads the URL that actually committed; if it is outside the allowlist, the preview is closed and the call fails. A location change watch closes the preview if a later redirect leaves the list.
  • F4, malformed safety config. Non-boolean safety keys, non-array allowlists, and unrecognized environment boolean values now stop startup instead of falling back to permissive defaults. This includes autoLaunch and autoAttachWindows.
  • F10, read-only cards. zen_progress, zen_ask, and zen_notify are mutating tools, so read-only mode blocks them.
  • F13, unbounded arrays. zen_tabs_close, zen_folder_create, and zen_folder_add_tabs cap tabIds at 100, surfaced as maxItems in the tool schemas.

Known residual: an initial request to a redirect target can reach that host before Glance reads the committed URL and closes the preview, because the remote server decides the redirect. The allowlist prevents the preview from staying open or returning the off-list URL.

Test plan

  • npm run typecheck
  • npm run build
  • npm test: 279 tests, 274 pass, 5 skipped, 0 fail
  • ZEN_MCP_E2E=1 npm run test:zen: 40/40 live checks on Windows with Zen 1.24b
  • Packed tarball installs into a clean prefix: zen-mcp --version reports 0.3.3, doctor passes, onboard --help lists every client
  • Independent auditor re-test passed F8, F4, F10, and F13 at 1ee90f6
  • Windows, Ubuntu, and macOS Node 22/24 CI matrix (this PR)
  • Live launch on real macOS and Linux hardware (Verify and fix macOS and Linux support #15, still open)

The live Zen suite is not part of CI. Nothing is tagged or published by this PR.

Marionette's chrome sandbox exposes Services, Cc, and Ci, but cannot load
resource:// modules on Zen 1.24b, so the explicit Services import failed
before ownership could be proven. Read the environment through the sandbox
globals, fall back to nsIEnvironment when Services is hidden, and fail with
a clear message when neither is available.

Refs #15
Batch verification can paint and record two highlights on the same tab at
once. Interleaved steps left an overlay host that clear could not find in
the live suite. Evidence and clear now run through a per-tab lock so the
paint and record sequence for one quote finishes before the next starts.
Set ZEN_MCP_TEST_HEADFUL=1 to drop --headless. Isolation still comes from
the launcher's own -no-remote, so the visible run exercises the production
launch path instead of a test-only shortcut.
Add live checks for background tab activation, evidence re-highlighting
from Show source, Stop from the progress card, split view cleanup, and
essentials keeping their original space. Each check drives the real bridge
UI and asserts the user-visible result, not just the tool response.

Covers #16, #17, #18, #19, #23
`zen-mcp onboard` lists the supported MCP clients, preselects the ones
found on this machine, and merges only the `zen-mcp` stdio entry into each
selected client's configuration. Standard JSON clients get `mcpServers`,
VS Code gets `servers` with `type: stdio`, Zed gets `context_servers`, and
Codex gets `[mcp_servers.zen-mcp]`.

JSON files are merged key by key. JSONC files are spliced in place so
comments and trailing commas survive, and TOML tables are replaced without
touching other servers. Rerunning updates the existing entry instead of
adding a duplicate, and an invalid file is reported without being written.

`--clients` skips the picker for scripts and non-TTY shells, `--command`
sets the command clients should run, and `--clients other` prints a
paste-ready runbook with paths, entry shapes, merge rules, validation, and
a completion report.

Tests cover detection and paths, JSON and JSONC merges, TOML merges,
invalid files, picker movement and toggling, and the runbook. README and
configuration docs describe the command.
Bump the package, lockfile, README tarball example, and advertised server
version to 0.3.3. Complete the changelog with the onboarding picker and
every fix since 0.3.2: launch ownership and error reporting, POSIX process
names, tab focus, evidence repaint, essentials, split cleanup, evidence
matching, batch audit, Stop delivery, and per-tab evidence serialization.
Resolve the tab's current URL and require http(s) plus the domain
allowlist before calling Zen's Glance manager. Pass a content principal
for the URL instead of the system principal, and keep the host pre-check
for explicit URLs.

Adds fake-manager unit coverage and a live regression for allowed and
privileged tabs.
Reject malformed safety settings and unrecognized safety environment
values instead of falling back to a weaker policy. Block the three UI
card tools in read-only mode, and cap tab-id arrays at 100 per call.

Updates the docs and changelog for 0.3.3.
The host re-checked the URL it requested, so a redirect could leave the
allowlist after Glance opened. Read the committed glance URL, close the
preview when it is outside the list, and keep watching location changes
for a later redirect. Malformed autoLaunch and autoAttachWindows values
now stop startup instead of falling back to true.
@spaxe-dev

Copy link
Copy Markdown
Owner Author

The macOS Node 24 job was auto-cancelled twice after 15 minutes in the queue with no runner assigned (runner_name and runner_group are empty, zero steps). The other five checks pass on this commit, including macOS Node 22 and Node 24 on Windows and Ubuntu. This is a GitHub runner scheduling failure, not a test failure, so we are merging with macOS Node 22 as the macOS evidence.

@spaxe-dev
spaxe-dev merged commit 02b361c into main Nov 4, 2026
10 of 12 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