Feat/claude desktop#80
Merged
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.
Summary
Extends Claude Desktop gating to cover the Settings → Extensions install path — the dominant way users add MCP servers today. Each Desktop Extension's bundle manifest is rewritten in place using the schema-blessed
_meta.agentlockslot (MCPB v0.3+), routing everytools/callthroughagentlock mcp-proxywith daemon policy enforcement.What changed
~/Library/Application Support/Claude/Claude Extensions/<id>/manifest.jsonso MCP traffic is gated alongside the existingmcpServerspath.mcp_config+ version fields under_meta.agentlock.original_*for byte-clean restore on uninstall.manifest_version0.1/0.2/missing → "0.3" (and the deprecateddxt_versionfield in lockstep) so the validator accepts the wrap.mcp_config.commandto the agentlock binary, defeating Claude Desktop's UtilityProcess shortcut and forcing the literal-spawn path.manifest.jsonand per-extensionClaude Extensions Settings/<id>.jsonand includes them in install / uninstall payloads.docs/status.mdupdated to reflect the new coverage and the auto-update caveat.Test plan
bun testpasses (cli)cargo testpasses (ledger)go test -race ./...passes (control-plane)agentlock install— plan should include a write op forClaude Extensions/<id>/manifest.json.jq '{manifest_version, dxt_version, has_meta: has("_meta")}' <bundle>/manifest.jsonshows"0.3","0.3",true.ps -ef | grep "agentlock mcp-proxy --name <ext-id>"shows one live process per wrapped extension.mcp__<ext-id>__<tool>withverdict: "allow".tool_prefix: "mcp__<ext-id>__") andPATCH /v1/modetofirewall. Repeat the prompt — chat shows the synthesized deny error and ledger recordsverdict: "deny".agentlock installwith claude-desktop deselected — bundle manifest restored to byte-equivalent original (no_meta, original version fields back).Notes for reviewers
_meta.agentlock): picked because v0.1/v0.2 areadditionalProperties: falseeverywhere with no tolerated marker slot — confirmed by hand-probing the live validator. v0.3 is a strict superset of v0.1/v0.2(additive only), so bumping is safe per the upstream
modelcontextprotocol/mcpbschemas.dxt_versiontoo: the v0.3 schema pins it asconst: "0.3"if present. Anthropic's own Control Chrome extension still ships with the deprecateddxt_version: "0.1"and nomanifest_version; without bumpingboth, the validator rejects the wrap.
TestBundleManifest_BumpsLegacyDxtVersionpins this case.mcp_config.commandmatters:type: "node"extensions normally short-circuit through Claude Desktop's UtilityProcess (Electron built-in Node), bypassingmcp_config.commandentirely. Rewriting the command toa non-
nodebinary fails the runtime's "is this a Node.js server" check and forces basic-execution spawn. Pinned byTestBundleManifest_*.docs/status.md; users re-runagentlock install. A filesystem watcher closes this; outof scope.
--name <ext-id>, so the daemon seesmcp__<ext-id>__<tool>instead ofmcp__<server-name>__<tool>. Existing user gates pointing at the oldmcpServersnames won't matchExtensions traffic — a
tool_prefixgate covers both. Worth a release note.extensions-installations.json): not edited by the install pipeline. The bundle manifest is the launch source; the registry is an audit record. The existingmergeExtensionRegistry/stripExtensionRegistryhelpers stay as defensive cleanup but are not wired in.
Checklist
CONTRIBUTING.md.envcontent committed