Skip to content

feat: let a dev app and MCP server use their own state directory - #37

Merged
iamnbutler merged 2 commits into
mainfrom
feat/state-env
Oct 17, 2026
Merged

iamnbutler merged 2 commits into
mainfrom
feat/state-env

Conversation

@iamnbutler

Copy link
Copy Markdown
Contributor

Every Desktop Tools.app relinks ~/.local/state/desktop-tools/desktop-client to its own client at launch. A development build run next to the installed app therefore redirects the live MCP server to the dev client. On this Mac, two dev apps from parallel work were doing exactly that.

A dev app does not take over the live socket. The bridge takes an exclusive flock lease on desktop.sock.lock and refuses a second host with socketAlreadyOwned while the installed app serves. Only the client link is affected.

  • DESKTOP_TOOLS_STATE sets the app's state directory: its socket and client link. An empty value is ignored.
  • src/mcp.ts uses the same variable for its default --client and --socket.
  • docs/app.md documents it under Development.

Verified: a Developer ID dev build launched with open -n --env DESKTOP_TOOLS_STATE=/tmp/f7/state served /tmp/f7/state/desktop.sock, linked its client there, and left ~/.local/state/desktop-tools/desktop-client pointing at /Applications. An MCP server pointed at that directory inspected and drove TextEdit, so the dev build kept the installed app's grants. npm run check passes.

🤖 Generated with Claude Code

iamnbutler and others added 2 commits October 16, 2026 21:05
Every Desktop Tools.app relinks ~/.local/state/desktop-tools/desktop-client
to its own client at launch, so a development build run next to the installed
app redirects the live MCP server's client. A second app cannot take over
desktop.sock: the bridge's flock lease refuses it while the installed app
serves.

DESKTOP_TOOLS_STATE now sets the app's state directory (socket and client
link) and the MCP server's default client and socket paths.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
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