One browser, many agents
How several MCP clients share one browser through Deputy, and what happens when one of them exits.
You can add Deputy to several clients and run them at the same time: Claude Code in one terminal, Codex in another, Cursor in your editor. They all use the same browser.
How they share it
Every client that starts gets its own deputy-mcp process. The first one to start becomes the hub: it listens on 127.0.0.1:7331 and owns the extension's connection. Each one that starts later joins the hub as a peer: it mirrors the hub's view of your tabs and sends its browser calls through the hub.
From each client's side nothing differs: every one sees the same tools and the same tabs. The setup page's Deputy program row shows how many agents are sharing the connection.
When the hub's client exits
The connection survives it. A peer takes over the port, waiting a random moment of up to 0.4 seconds so peers don't all race for it at once, and the extension connects again by itself. A call made during the hand-over may fail with The Deputy hub went away. Try again in a moment.
Keeping agents apart
Tools act on the active tab unless they're given a tabId, and all your agents see the same active tab. When two agents work at once, have each open its own tab with browser_tabs (action: "open") and pass that tab's tabId to the tools it calls.
If a tab closes while Deputy is working in it, the call fails with Tab … closed while Deputy was working in it. rather than hanging.
The port
Deputy uses 127.0.0.1:7331. If something that isn't Deputy holds that port, deputy-mcp keeps serving its client, logs port 7331 is taken by something that is not Deputy, and tries again every 3 seconds.
The DEPUTY_PORT environment variable makes deputy-mcp use another port. The extension connects on 7331, though, so a hub on another port won't reach it: free port 7331 instead. See Settings.