Castrel Proxy is a lightweight local Bridge client. It connects to a remote Castrel Bridge Server over WebSocket, receives instructions from the server, executes them on your machine, and sends results back.
It provides three core capabilities:
Repository: castrel-ai/castrel-proxy
Castrel Proxy pairs with the server, keeps a persistent connection, executes tasks locally, and returns results. If you configure MCP, it can also call local MCP tools when needed.
pip install castrel-proxy
Requirement: Python >= 3.10
Get a verification code and server URL from your Castrel / Bridge Server admin UI, then run:
castrel-proxy pair <verification_code> <server_url>
After pairing, Castrel Proxy will:
~/.castrel/config.yaml~/.castrel/whitelist.conf~/.castrel/mcp.json and sync MCP tool info once (skipped if not configured)# Background daemon mode (default, Unix/macOS only)
castrel-proxy start
# Foreground mode (all platforms)
castrel-proxy start --foreground
castrel-proxy status
castrel-proxy logs
castrel-proxy logs -f
castrel-proxy stop
castrel-proxy unpair
By default, Castrel Proxy uses ~/.castrel/:
~/.castrel/config.yamlserver_url: server URLverification_code: pairing codeclient_id: stable ID derived from hostname + MAC (16 hex chars)workspace_id: extracted from the verification codepaired_at: pairing timestamp~/.castrel/whitelist.confgit, kubectl)~/.castrel/mcp.json~/.castrel/castrel-proxy.pid~/.castrel/castrel-proxy.log~/.castrel/<session_id>/terminal.logWhen the server sends a command, Castrel Proxy executes it locally and returns stdout, stderr, exit_code, and timing.
Security behavior:
~/.castrel/whitelist.conf can runls && cat file | grep foo is split and every subcommand must be allowedCastrel Proxy supports:
replace / append / prependConstraints:
If you want to expose local MCP tools to the server, configure ~/.castrel/mcp.json and use:
castrel-proxy mcp-list
castrel-proxy mcp-sync
Supported transports (as implemented):
stdio (requires command + args, optional env)http (requires url)sse (requires url)No. It makes an outbound WebSocket connection to the server and does not require inbound ports.
Add the base command name to ~/.castrel/whitelist.conf (one per line). For example, to allow kubectl get pods, add kubectl.
Common reasons:
pip uninstall castrel-proxy
Optional: remove local configs and logs:
rm -rf ~/.castrel