Skip to main content

FleetQ Bridge — Local Compute Gateway

FleetQ Bridge is a lightweight Go binary that runs on your local machine (macOS or Linux) and connects it to the FleetQ cloud platform over a secure WebSocket. Once connected, FleetQ can route experiments, projects, and agent requests to your machine — running local LLMs and AI agents at zero cloud cost.

Bridge is ideal for teams that want to use their own GPUs, run proprietary models via Ollama, or leverage local agents like Claude Code and Codex without paying per-token cloud LLM fees.

How it works

Bridge establishes a persistent WebSocket connection to FleetQ's relay infrastructure. When FleetQ needs to run a task on your machine, it sends a request through the WebSocket, Bridge routes it to the appropriate local backend, and streams the response back.

FleetQ Cloud                    Relay (WSS)                    Your Machine
    │                              │                               │
    │   Experiment runs            │                               │
    │   "Use claude-code agent"    │                               │
    │─────────────────────────────>│   WebSocket message           │
    │                              │   (agent.request)             │
    │                              │──────────────────────────────>│  Bridge daemon
    │                              │                               │     │
    │                              │                               │     ├─ Claude Code
    │                              │                               │     ├─ Codex
    │                              │                               │     ├─ Ollama (LLMs)
    │                              │                               │     ├─ LM Studio
    │                              │                               │     └─ MCP servers
    │                              │                               │
    │                              │   WebSocket chunks            │
    │                              │   (client-relay.chunk)        │
    │   Streaming response         │<──────────────────────────────│
    │<─────────────────────────────│                               │
    │                              │                               │

The relay uses the Pusher/Reverb protocol over TLS (WSS). Each team gets a private channel (private-daemon.{'{'}teamId{'}'}) that only authenticated bridges can subscribe to.

Installation

One-line install on macOS and Linux:

bash
curl -fsSL https://get.fleetq.net | sh

Or download directly from the platform:

bash
curl -fsSL https://fleetq.net/get/bridge | sh

The script auto-detects your OS and architecture (macOS arm64/x86_64, Linux x64/arm64) and installs the fleetq-bridge binary to /usr/local/bin or ~/.local/bin.

Authenticating

First, create an API token in Team Settings → API Tokens, then log in:

bash
fleetq-bridge login --api-url https://fleetq.net --api-key YOUR_API_TOKEN

This saves your credentials to ~/.fleetq/bridge.json. You only need to do this once per machine.

Starting the bridge

bash
fleetq-bridge start

On startup, Bridge:

  1. Discovers local LLM endpoints (Ollama, LM Studio) and CLI agents (Claude Code, Codex, Gemini)
  2. Registers with FleetQ via REST API — receives WebSocket credentials
  3. Connects to the relay via WSS and subscribes to the team's private channel
  4. Sends heartbeats every 30 seconds to keep the connection alive
  5. Refreshes endpoints every 60 seconds (detects new models, agents coming online/offline)

Optional flags

Flag Default Description
--ollama http://localhost:11434 Ollama server URL
--lmstudio http://localhost:1234 LM Studio server URL
--endpoint — Additional OpenAI-compatible endpoint (can repeat)
Example: connect to custom Ollama + LM Studio
fleetq-bridge start --ollama http://gpu-server:11434 --lmstudio http://localhost:1234

Agent discovery

Bridge probes for locally installed CLI agents by checking if their binaries are in $PATH:

Agent Binary Requires Cost
Claude Code claude ANTHROPIC_API_KEY $0 platform cost
Codex codex OPENAI_API_KEY $0 platform cost
Gemini CLI gemini GOOGLE_API_KEY $0 platform cost

Agents are marked found: true/false in the endpoints manifest. Only found agents are available for routing. While Bridge itself costs nothing, agents that call external APIs (Anthropic, OpenAI, Google) require their own API keys set on the machine where Bridge runs.

If you run Bridge as a system service (launchd/systemd), make sure the service environment includes the correct PATH so that agent binaries can be found. For macOS launchd, add /opt/homebrew/bin to the PATH environment variable in your plist.

LLM endpoints

Bridge discovers and proxies requests to local LLM servers:

Backend Discovery Protocol
Ollama GET /api/tags → lists available models POST /api/chat (JSONL streaming)
LM Studio GET /v1/models → lists loaded models POST /v1/chat/completions (SSE streaming)
OpenAI-compatible GET /v1/models POST /v1/chat/completions (SSE streaming)

Bridge probes each configured endpoint on startup and every 60 seconds. Available models are reported to FleetQ and appear in the platform's model selector. Streaming responses are chunked back through the WebSocket in real-time.

MCP server proxying

Bridge can manage local MCP servers (Playwright, filesystem, custom tools) and proxy tool calls from the FleetQ platform to them. This means FleetQ experiments can use tools running on your machine.

Configuration

Create ~/.fleetq/mcp.json with your MCP server definitions:

~/.fleetq/mcp.json
{
  "servers": {
    "playwright": {
      "command": "npx",
      "args": ["@anthropic-ai/mcp-playwright"],
      "env": {}
    },
    "filesystem": {
      "command": "npx",
      "args": ["@anthropic-ai/mcp-filesystem", "/home/user/projects"],
      "env": {}
    }
  }
}

On startup, Bridge spawns each MCP server as a child process, performs the JSON-RPC 2.0 handshake (initialize + notifications/initialized), and keeps them running for the lifetime of the bridge session. Server names are reported to FleetQ and appear in the Bridge tab.

How proxy calls work

  1. FleetQ sends POST /api/v1/bridge/mcp-call with server name, method, and params
  2. The request is pushed to Redis and forwarded to Bridge via WebSocket
  3. Bridge dispatches the JSON-RPC call to the local MCP server's stdin
  4. The MCP server responds on stdout; Bridge sends the result back through the WebSocket
  5. FleetQ receives the result and continues the experiment/workflow
MCP calls support configurable timeouts (1–300 seconds, default 60s). FleetQ adds 10 seconds of buffer for network overhead.

Recommended MCP servers

These MCP servers work well with FleetQ Bridge for common automation tasks:

Playwright

@anthropic-ai/mcp-playwright

Browser automation — navigate pages, click elements, fill forms, take screenshots. Perfect for web scraping experiments and monitoring workflows.

npm install -g @anthropic-ai/mcp-playwright

Filesystem

@anthropic-ai/mcp-filesystem

Read, write, and search files on the bridge machine. Useful for agents that need to work with local project files or generate reports.

npm install -g @anthropic-ai/mcp-filesystem

Git

@anthropic-ai/mcp-git

Git operations — clone, pull, commit, diff, log. Enables agents to work with repositories directly from FleetQ workflows.

npm install -g @anthropic-ai/mcp-git

PostgreSQL

@anthropic-ai/mcp-postgres

Query PostgreSQL databases from FleetQ experiments. Useful for data analysis agents and reporting workflows.

npm install -g @anthropic-ai/mcp-postgres

Fetch

@anthropic-ai/mcp-fetch

HTTP requests — GET, POST, PUT, DELETE with custom headers and bodies. For API integration experiments.

npm install -g @anthropic-ai/mcp-fetch

After installing, add the server to your ~/.fleetq/mcp.json and restart Bridge. The server will appear in your Bridge connection's MCP server list.

Multi-bridge support

A team can have multiple active Bridge connections simultaneously — for example, a developer's laptop and a GPU server. FleetQ's BridgeRouter picks the best bridge for each request based on the routing mode:

Mode Behavior
auto Picks the highest-priority active bridge that has the requested agent/model (default)
per_agent Routes each agent to a specific bridge (configured per-agent)
prefer Always prefers a specific bridge, falls back to others if unavailable

Configure routing mode via MCP tools (bridge_set_routing) or the Bridge tab in Settings. You can also label bridges (bridge_rename) for easier identification.

Running as a service

For always-on connectivity, run Bridge as a system service that starts on boot and auto-restarts on failure.

macOS (launchd)

Create ~/Library/LaunchAgents/com.fleetq.bridge.plist:

com.fleetq.bridge.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
  "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.fleetq.bridge</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/local/bin/fleetq-bridge</string>
        <string>start</string>
    </array>
    <key>EnvironmentVariables</key>
    <dict>
        <key>PATH</key>
        <string>/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
    </dict>
    <key>KeepAlive</key>
    <true/>
    <key>RunAtLoad</key>
    <true/>
    <key>StandardOutPath</key>
    <string>/tmp/fleetq-bridge.log</string>
    <key>StandardErrorPath</key>
    <string>/tmp/fleetq-bridge.log</string>
</dict>
</plist>
Load the service
launchctl load ~/Library/LaunchAgents/com.fleetq.bridge.plist

Linux (systemd)

Create ~/.config/systemd/user/fleetq-bridge.service:

fleetq-bridge.service
[Unit]
Description=FleetQ Bridge Daemon
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
ExecStart=/usr/local/bin/fleetq-bridge start
Restart=always
RestartSec=5
Environment=PATH=/usr/local/bin:/usr/bin:/bin

[Install]
WantedBy=default.target
Enable and start
systemctl --user enable --now fleetq-bridge

Bridge MCP tools

FleetQ's MCP server includes tools for managing bridge connections programmatically:

Tool Description
bridge_status Connection status, LLM/agent/MCP counts, routing mode
bridge_list List all agents across active bridges
bridge_endpoint_list Show LLM endpoints and agents for each bridge
bridge_endpoint_toggle Enable/disable individual endpoints
bridge_disconnect Disconnect a bridge by ID
bridge_rename Set a custom label for a bridge
bridge_set_routing Configure routing mode and per-agent preferences

REST API endpoints

Bridge-related REST API endpoints (all require Sanctum bearer token):

Method Path Purpose
GET /api/v1/bridge/status All connections (active + recent) with endpoints
POST /api/v1/bridge/register Register a new bridge connection
POST /api/v1/bridge/endpoints Update endpoints manifest (agents, LLMs, MCP servers)
POST /api/v1/bridge/heartbeat Keep connection alive (every 30s)
POST /api/v1/bridge/mcp-call Proxy MCP tool call to a bridge-hosted server
DELETE /api/v1/bridge Disconnect bridge(s)

Troubleshooting

Bridge shows 0 agents found

Agent binaries (claude, codex, gemini) must be in $PATH. If running as a service, ensure the service environment includes the correct PATH. On macOS with Homebrew, add /opt/homebrew/bin to the launchd plist's EnvironmentVariables.

Connection drops every ~2 minutes

If Bridge connects through a Cloudflare-proxied domain, Cloudflare's WebSocket idle timeout (~100s) may disconnect the session. Solution: use a dedicated subdomain (e.g. relay.yourdomain.com) with Cloudflare proxy disabled (DNS-only / grey cloud) and a Let's Encrypt certificate.

TLS certificate errors

If using Cloudflare Origin Certificates on the relay domain, they are only valid behind the Cloudflare proxy. For direct WebSocket connections (DNS-only mode), use a publicly-trusted certificate like Let's Encrypt.

MCP servers show as empty []

Ensure ~/.fleetq/mcp.json exists and is valid JSON. Bridge reads it on startup — restart Bridge after adding new MCP server configs.

Bridge connects but no requests arrive

Check that Reverb (WebSocket server) is running on the FleetQ side. Verify the relay URL in your bridge config (~/.fleetq/bridge.json) points to the correct host and port. Check /tmp/fleetq-bridge.log for connection and subscription errors.

Security

  • TLS everywhere: Bridge connects over WSS (TLS-encrypted WebSocket). API calls use HTTPS.
  • Token auth: Bridge authenticates with your Sanctum API token. Tokens are team-scoped.
  • Channel isolation: Each team gets a private Reverb channel. Subscription requires HMAC-SHA256 authentication.
  • No inbound ports: Bridge only makes outbound connections. Nothing is exposed on your local network.
  • MCP sandboxing: Only configured MCP servers can be called. No arbitrary command execution.
  • Graceful shutdown: Bridge notifies FleetQ on disconnect (Ctrl+C, SIGTERM) so the connection is cleaned up immediately.

Configuration reference

File Purpose
~/.fleetq/bridge.json API token, server URL, LLM endpoint URLs (created by fleetq-bridge login)
~/.fleetq/mcp.json MCP server definitions (command, args, env per server)
/tmp/fleetq-bridge.log Bridge daemon log (when running as a service)