claude-mac-bridge
Provides secure SSH connectivity between the server and the remote Mac over the Tailscale network.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@claude-mac-bridgeBuild the auth module"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
claude-mac-bridge
MCP server that lets an AI agent delegate tasks to Claude Code running on a remote Mac over SSH or Tailscale. It returns structured output with a reusable session ID.
How it works
Agent → ask_claude → SSH → Claude Code on the Mac → response + session_idThe bridge runs Claude Code non-interactively with claude -p, parses its JSON
response, and records each delegation in a local audit log.
Related MCP server: mcp-home-server
When this is useful
Use the bridge when your main agent or UI runs on another machine, but the code, toolchain, and authenticated Claude Code installation live on your Mac. One MCP call moves the coding task into that environment without manual SSH commands, prompt escaping, JSON parsing, or session bookkeeping.
Pass the returned ID back as resume_session_id for related work. Claude
resumes the saved conversation, decisions, and task context while the worktree
stays on the Mac.
Requirements
Claude Code installed and signed in on the Mac
Passwordless SSH from the agent machine to the Mac
Python 3.10+ on the agent machine
Tailscale on both machines, if the Mac is reached through Tailscale
GNU
timeouton the Mac for remote process cleanup (brew install coreutils)
Setup
1. Prepare Claude Code on the Mac
curl -fsSL https://claude.ai/install.sh | bash
claude # follow the sign-in prompt
claude -p "what is 2+2" --output-format json2. Prepare SSH on the agent machine
ssh-keygen -t ed25519 -f ~/.ssh/mac_bridge
ssh-copy-id -i ~/.ssh/mac_bridge.pub user@<mac-tailscale-ip>
ssh -i ~/.ssh/mac_bridge user@<mac-tailscale-ip> "claude --version"3. Connect your agent
git clone https://github.com/freeze1999/claude-mac-bridge.git
cd claude-mac-bridge
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
BRIDGE_DIR="$PWD"
codex mcp add claude_bridge \
--env CLAUDE_BRIDGE_SSH_HOST="user@100.x.x.x" \
--env CLAUDE_BRIDGE_CLAUDE_BIN="/opt/homebrew/bin/claude" \
-- "$BRIDGE_DIR/.venv/bin/python" "$BRIDGE_DIR/server.py"Run codex mcp list, restart Codex, then use /mcp to confirm the server is
active. The agent discovers ask_claude from the server automatically. For
calls longer than Codex's default MCP tool timeout, add
tool_timeout_sec = 620 under [mcp_servers.claude_bridge] in
~/.codex/config.toml.
Claude Code can register the same STDIO server with its own MCP command:
BRIDGE_DIR="/absolute/path/to/claude-mac-bridge"
claude mcp add --transport stdio --scope user claude_bridge \
-e CLAUDE_BRIDGE_SSH_HOST="user@100.x.x.x" \
-e CLAUDE_BRIDGE_CLAUDE_BIN="/opt/homebrew/bin/claude" \
-- "$BRIDGE_DIR/.venv/bin/python" "$BRIDGE_DIR/server.py"Tool usage
# Run in a specific project on the Mac
r1 = ask_claude(
task="Fix the failing tests",
workdir="/Users/me/projects/app",
)
# Continue the same Claude conversation
r2 = ask_claude(
task="Now simplify the implementation",
workdir="/Users/me/projects/app",
resume_session_id="<session_id from r1>",
)ask_claude accepts:
Parameter | Required | Description |
| yes | Task or question for Claude |
| no | Extra code, errors, or background |
| no | Absolute working directory on the Mac |
| no | Session ID returned by an earlier call |
Configuration
Environment variable | Default | Description |
| required | SSH target, such as |
|
| Claude Code binary on the Mac |
|
| Delegation timeout in seconds |
|
| Audit log path |
|
| Log rotation threshold |
|
| Pass |
Monitoring
python3 monitor.py
python3 monitor.py /path/to/bridge.logTrust boundary
Claude Code's permission configuration controls what delegated tasks may do on
the Mac. Setting CLAUDE_BRIDGE_SKIP_PERMISSIONS=true removes that layer for
every caller of this bridge. The audit log contains complete task and response
text and is gitignored by default.
Status
The bridge supports remote working directories, structured Claude output, session recovery, concurrent calls, audit logging, and log rotation.
Argument building, JSON parsing, working-directory handling, and log rotation are unit-tested. New and resumed Claude sessions are also exercised with live CLI runs.
License
MIT.
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
9 remote MCP servers on Cloudflare Workers for AI agents. Free tier + Pro API keys.
Remote MCP server for supportsheep: run AI interviews and manage support content for your blog.
- QuallaaOAuthcom.quallaa
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceAn MCP server that orchestrates AI coding assistants (Claude Code CLI and Gemini CLI) to perform complex programming tasks autonomously, allowing remote control of your local development environment from anywhere.7 npm140MIT
- FlicenseNot gradedqualityDmaintenanceSelf-hostable MCP server that gives Claude tools to run shell scripts and read files on a home server, deployed via Multipass VM and Cloudflare Tunnel.-
- AlicenseNot gradedqualityBmaintenanceMCP server for AI agents to control a Mac via screen and mouse/keyboard, supporting Anthropic Claude and OpenAI for task automation.236 npmApache 2.0
- AlicenseNot gradedqualityDmaintenanceMCP server that gives Claude Code full mouse, keyboard, and app control on macOS. Tell Claude what to do and watch it operate your computer.78 npmMIT