zen-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
zen-mcp
zen-mcp is a local stdio MCP server for Zen Browser. It reads and mutates
tabs, Spaces, and ordinary tab groups in normal Zen windows, including tabs in
inactive and unsynchronized windows. It discovers Zen folders separately and
never treats them as ordinary tab groups.
The supported installation path is the included Nix flake. The project also builds with Node 22 and npm.
Requirements
Zen Browser
>=1.24b <1.25Nix with flakes enabled
A closed Zen profile during bridge installation and removal
The bridge uses Zen's privileged experiment APIs. It is intended for a profile that you control and should not be copied into an untrusted profile.
Related MCP server: Firefox Tab Management Agent MCP
Install
From this checkout:
nix profile install .#
zen-mcp-setup --profile default--profile is required. It accepts a Zen profile name, default, or an
absolute profile directory. Close every Zen process that uses the selected
profile first. Setup refuses to modify a locked profile.
The setup command:
backs up the existing
user.jsand any previouszen-mcp-bridge@local.xpiadds only the three preferences required by the experiment bridge
installs the profile-local bridge XPI
records enough state to restore the prior configuration on uninstall
Restart Zen completely after setup. Then register the stdio server with Codex:
codex mcp add zen-mcp -- zen-mcpThe equivalent Codex ~/.codex/config.toml entry is:
[mcp_servers.zen-mcp]
command = "zen-mcp"
args = []See the Codex MCP documentation for client configuration details.
Run the diagnostics after Zen has started:
zen-mcp-doctor --profile defaultThe doctor checks the Zen version, selected profile, managed preferences,
extension files, common MCP configuration files, live bridge authentication,
Spaces availability, and unsupported versions. Use --json for machine
readable output or --no-live to skip authentication.
Run without a profile install
nix run .#setup -- --profile default
nix run .#doctor -- --profile default
nix run .#nix run .# starts the stdio MCP server. It is normally launched by the MCP
client rather than interacted with directly. If the local bridge listener
cannot start, MCP initialization still completes and zen_status reports a
structured startupError; bridge-dependent tools return
BRIDGE_UNAVAILABLE.
Home Manager
The flake exports a Home Manager module for package installation:
{
inputs.zen-mcp.url = "path:/path/to/zen-mcp";
imports = [ inputs.zen-mcp.homeManagerModules.default ];
programs.zen-mcp.enable = true;
}The module installs zen-mcp, zen-mcp-setup, and zen-mcp-doctor through
the Home Manager profile. It does not register an MCP client automatically and
does not modify a Zen profile. Client registration remains separate so the
same server can be used by any compatible stdio MCP client.
If Zen's user.js is also managed by Home Manager, declare the bridge
preferences in that profile so setup can leave the generated file untouched:
programs.zen-browser.profiles.default.settings = {
"extensions.experiments.enabled" = true;
"xpinstall.signatures.required" = false;
"extensions.autoDisableScopes" = 0;
};Complete the one-time bridge setup while Zen is closed:
zen-mcp-setup --profile defaultUninstall
Close Zen, then run:
zen-mcp-setup --profile default --uninstallFor a source checkout, use:
nix run .#setup -- --profile default --uninstallUninstall removes the managed preference block and restores the original
user.js, including a symlinked user.js when its contents are unchanged. A
previous bridge XPI is restored when one existed; otherwise only the managed
XPI is removed. Unrelated profile configuration is preserved.
Remove the Codex registration separately if it is no longer wanted:
codex mcp remove zen-mcpCollections and IDs
Zen windows that mirror the same synced workspace form one logical collection. Mirrored DOM tabs are deduplicated into one result with all mirror window IDs. Each unsynchronized normal window is a separate collection. Private windows are excluded and reported as unsupported.
collection_id, space_id, tab_id, and group_id are guarded,
session-scoped identifiers. They include the bridge session nonce and become
invalid after Zen restarts or the bridge reconnects. Run discovery tools again
after a reconnect instead of retaining IDs.
Tools
Tool | Purpose |
| Report bridge and version state, profile, collections, Spaces availability, and unsupported windows. |
| List Spaces with IDs, names, icons, ordering, and active state. |
| Create a Space without switching to it, optionally after an existing Space. |
| List deduplicated logical tabs with collection, Space, URL, title, pin, group, discard, essential, and placeholder filters. Returns a flat |
| List ordinary tab groups and Zen folders as distinct kinds with title, color, collapsed state, members, and separate counts. |
| Create a plain, expanded |
| Rename, recolor, collapse, or add unpinned tabs to and remove members from an ordinary tab group. Zen folders and pinned additions are rejected. |
| Remove explicitly selected tabs from ordinary tab groups without closing them. Tabs in Zen folders are rejected. |
| Remove explicitly selected pinned tabs from pinned sections without changing their Space or ordinary-group membership. Essential tabs, Zen-folder members, and split views are rejected. |
| Preview and confirm moving tabs to another Space in the same collection. |
| Preview and confirm closing explicitly selected tabs. |
Read-only tools, additive mutations, reorganizing mutations, and destructive mutations advertise MCP annotation hints so clients can apply their own approval policy.
Tab groups and Zen folders
Zen folders and ordinary tab groups are different node types even though Zen's
tab-group APIs recognize both. list_tab_groups reports kind: "group" for an
ordinary <tab-group> and kind: "folder" for a ZenFolder, plus separate
groupCount and folderCount values. Collection status uses the same separate
counts.
create_tab_group calls Zen's ordinary addTabGroup operation, returns
kind: "group", and forces collapsed: false. It does not create a ZenFolder,
does not move selected tabs into one, and fails with GROUP_MEMBERSHIP before
mutation when a selection already contains a Zen-folder member or a pinned tab.
update_tab_group and ungroup_tabs are deliberately restricted to ordinary
tab groups. A Zen-folder target fails with GROUP_MEMBERSHIP and a message
stating that Zen folders are not ordinary tab groups. Adding a pinned tab to an
ordinary group is also rejected before mutation.
Zen treats an ordinary group containing any pinned tab as pinned and hides the
whole group while the Space's pinned section is collapsed. The bridge therefore
rejects pinned members during group creation or addition. unpin_tabs removes
an existing pinned tab from pinned sections while preserving its current
ordinary-group membership, which makes an otherwise hidden group visible. It
does not expand the pinned section automatically. An already-affected group
can also be renamed, have its pinned member removed, or be ungrouped through the
normal recovery operations.
list_tabs preserves the flat tabs array for clients that consume the
existing response, and adds an outline that groups the same filtered tabs by
collection, Space, Zen folder, ordinary tab group, and ungrouped status. Folder
containment is inferred from the snapshot's member tabs, so an ordinary group
nested inside a folder is shown beneath that folder without duplicating its
tabs. The MCP text content renders this outline as a readable tree; the full
response remains available in structuredContent.
Preview and confirmation
The first move_tabs or close_tabs call does not mutate the browser. It
returns:
the exact affected tabs, including split-view members and pinned tabs
warnings and an expiry timestamp
a one-use
confirmationToken
Repeat the same call with that token to execute it. Tokens expire after 120 seconds, are bound to the original arguments, and become stale if relevant collection state changes. Replaying a token fails.
Essential tabs are never moved, grouped, or closed. Pinned tabs can be moved or closed only when explicitly selected, and every affected pin appears in the preview. A selected split-view tab expands to its complete split-view unit. Tab groups and Zen folders cannot span Spaces or collections; move tabs first when consolidating across Spaces.
If a runtime mutation fails partway through, the bridge stops initiating
changes, reads browser state again, and returns verified succeeded, failed,
and unattempted targets. This is not an atomic rollback. Structured failures
include codes such as BRIDGE_UNAVAILABLE, UNSUPPORTED_ZEN_VERSION,
UNKNOWN_ID, STALE_PREVIEW, PROTECTED_TAB, GROUP_MEMBERSHIP, and
PARTIAL_APPLY.
Security model
The MCP endpoint listens only on
127.0.0.1and uses an ephemeral port.A random token is written to
${XDG_STATE_HOME:-~/.local/state}/zen-mcp/connection.jsonwith mode0600.The bridge reconnects and authenticates with the token in its first frame.
A per-user lock prevents multiple
zen-mcpserver processes from racing over the bridge connection.The token changes each time the server starts.
Only normal Zen windows are exposed. Private windows are excluded.
v1 limitations
Space deletion, Space metadata updates, remote MCP transport, private-window
access, and direct zen-sessions.jsonlz4 editing are not included. Opening or
navigating tabs, history, bookmarks, Space activation, and Space editing are
also outside v1. Zen-folder renaming, mutation, and ungrouping are not exposed.
Development
nix develop
npm install
npm run check
nix flake check
nix buildnpm run check runs type checking, ESLint, Vitest, and the production build.
The build creates dist/ and a deterministic
bridge/zen-mcp-bridge.xpi. The Nix package keeps dist/ and the XPI together
so the installed setup command finds its packaged bridge.
For a live end-to-end test, use a dedicated Zen profile and state directory:
npm run build
npm run smoke:live -- \
--profile /absolute/path/to/isolated-profile \
--state-root /absolute/path/to/isolated-stateThe profile must be running with the bridge installed and have at least two non-essential loose tabs in one Space and window. The smoke test creates an ordinary tab group, verifies it is expanded and distinct from Zen folders, renames, recolors, collapses, expands, and ungroups it. It requires explicit paths and refuses the default state root so it cannot silently target the default Zen profile.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Start and manage Reason cloud coding agents, projects and sessions from any MCP client.
Unofficial Browserless MCP — wraps the Browserless headless-Chromium REST API (browserless.io)
Browse and manage files in your Moxt AI workspace from any MCP client.
Manage SRG+ hubs, channels, content, assets, users, and workspaces from any MCP-aware AI agent.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables MCP clients to operate Chrome tabs with semantic snapshots, policy approvals, and deterministic workflow replay.-
- AlicenseAqualityCmaintenanceEnables AI agents to manage live Firefox tabs and native tab groups via MCP tools over stdio, with exact-match verification and safety constraints. It does not read page content or send browser data remotely.25Mozilla Public 2.0
- FlicenseNot gradedqualityDmaintenanceEnables MCP clients to control real Chrome tabs in existing profiles, supporting navigation, interaction, screenshots, and console/network inspection across multiple Chrome instances.-
- AlicenseNot gradedqualityBmaintenanceEnables local control of existing Chrome/Chromium browser tabs through MCP, including tab management, navigation, content reading, screenshots, and page interaction.Apache 2.0