Connecting HQ to claude.ai

Connect HQ to claude.ai so Claude can read and write your Vault.

Checked on 2026-11-19 against build v0.9.1-main.648. See this page on GitHub.

HQ can be added to claude.ai (web, Desktop and mobile) and to Claude Code as a custom connector. A Claude conversation then reaches the same two gateway tools every other MCP client gets, hq_discover and hq_call, with an access level you choose when you approve it. It is off by default. Design, threat model and test notes: docs/plans/claude-connector.md.

What you need

  • A Claude plan with custom connectors (Pro, Max, Team or Enterprise).
  • HQ reachable from Anthropic’s servers over public HTTPS. Connector traffic comes from Anthropic’s network, not your browser, so a tailnet-only HQ cannot be added on its own. Either something in front of HQ ends TLS for it (Caddy, a tunnel, Tailscale Funnel), or HQ ends TLS itself behind a forwarder that passes the encrypted bytes through (see “HQ ends TLS itself”).
  • web_auth_token set, and a browser where you are signed in to HQ’s web app: you approve each connection there.

Set it up

  1. Choose the origins.

    • public_url: the https origin Claude’s servers reach, for example https://hq.example.com. Claude gets https://hq.example.com/mcp as the connector URL.
    • authorize_url (recommended): a private https origin for the consent page, such as your tailnet name (https://hq.example.ts.net). Your browser can load it; the internet cannot. HQ answers its sign-in page only on this origin, so nobody outside can see when a connection window is open or fill it with requests. A browser on the same device as HQ can use plain http://127.0.0.1:<port>, http://[::1]:<port> or http://localhost:<port> instead: the only plain-http origins accepted, since the connection never leaves the device (the request cookie then drops its Secure attribute, which WebKit refuses over http). Prefer 127.0.0.1: localhost can resolve to ::1, where another user of the machine may be listening. HQ answers /oauth/authorize on such an origin only for a request that carries no reverse-proxy header (Forwarded, X-Forwarded-For, X-Forwarded-Host, X-Real-IP), so a proxy on the same machine that rewrites Host to this address does not open it. Whether claude.ai sends your browser to such an address is an open test; the runbook is docs/plans/native-bridge/w6-claude-run.md.
  2. Configure HQ (~/.hq/config.yaml or /opt/hq/config.yaml) and restart it:

    mcp_connector:
      enabled: true
      public_url: https://hq.example.com
      authorize_url: https://hq.example.ts.net
      default_scope: read_only        # preselected on the consent page: read_only | tasks | full
    

    If the connector cannot start (no web token, a URL that is not a bare origin, or profile: lite), HQ logs why and leaves it off. hq connector status shows the reason.

  3. Publish only the machine endpoints: /mcp, /oauth/token, /oauth/revoke and the three /.well-known/oauth-* documents. deploy/Caddyfile.connector does this with Caddy and also limits those paths to Anthropic’s address range (defence in depth; the range can change). The web app, /api and /ws stay private. A Cloudflare Tunnel with the same path rules works on a machine with no public address; behind Cloudflare, filter on Cf-Connecting-Ip in a WAF rule rather than Caddy’s remote_ip.

  4. Coding agents Claude starts run in the HQ folder of the machine they run on (~/Documents/HQ, the same place HQ starts a session given no folder), on every host, with no setup. To let Claude use other project folders too, list them:

    agent_host:
      handoff_cwd_allow: [/srv/projects]
    

    A folder outside the HQ folder and that list is not refused outright: HQ asks you to approve it (chat, web inbox, push) and Claude starts the session once you do. An approved folder stays allowed on that host until you revoke it (see “Folders the owner approves” in docs/AGENT_SESSIONS.md).

HQ ends TLS itself

The other way to be reachable: HQ keeps the certificate and ends TLS on the connector’s own name, and a public forwarder (hq edge) in front only passes encrypted bytes to the device. No certificate or key is ever on the forwarder, and nothing else is published: the web app, /api and /ws are not served on this origin at all.

mcp_connector:
  enabled: true
  public_url: https://phone.edge.example.com
  authorize_url: https://hq.example.ts.net   # required with this option
  tls:
    enabled: true
    agree_to_ca_terms: true            # accepts the CA's subscriber agreement for you
    acme_directory: letsencrypt        # or letsencrypt-staging while testing
    door_listen: null                  # optional: where the bridge hands the edge's streams to HQ
  • public_url must be a domain name the forwarder routes to this device; HQ gets a certificate for it from the ACME CA (Let’s Encrypt by default) over the same connection, and renews it two thirds of the way through its life.
  • authorize_url is required here: the consent page is never served on this origin, so it must be on a private one.
  • Off by default; not available under profile: lite. With tls.enabled, hq start and hq web open the door’s listener (door_listen) and keep the certificate fresh. By default it is a unix socket, <vault>/_data/connector_door/door.sock, in a directory only your user can enter (an absolute path in door_listen names another; a loopback ip:port is allowed as an opt-in, but another user or app on the machine could bind the port first and take the forwarded connections, including the CA’s validation of the certificate, so use it only on a machine with one user). It is on whenever TLS is, not only while a connection window is armed: Claude’s calls and token refreshes for an existing grant must work at any time, and the window guards /oauth/authorize alone. A bind that fails (a wrong directory mode, something else at the path) is reported and tried again every few seconds. The bridge (hq bridge serve or run) pipes the registered edge’s streams to that socket; register the device with the edge first (hq bridge register <link>, docs/PAIRING.md). The consent origin (authorize_url) for a device with no private https name can be its own loopback address (see step 1 above); docs/plans/native-bridge/w6-claude-run.md is the run that tests it against a real claude.ai account. Until that passes, a private https name (a tailnet name, Caddy or a tunnel) is the tested choice.
  • The CA limits how many certificates one domain may get a week; a rate-limited first order waits and says when it will try again. Keep the saved certificate: it is in _data/connector_tls/.
  • Details, the checks on every request, and what the forwarder must hand over: docs/security/CONNECTOR_TLS.md.

Connect

  1. In HQ, open Settings, then Claude connector, and choose Allow a new connection (or run hq connector arm). The window stays open for ten minutes and admits one connection.
  2. In Claude, open Settings, then Connectors, add a custom connector with the URL Settings shows, and press Connect. Claude detects the sign-in method on its own; leave its defaults.
  3. Your browser opens HQ’s consent page. Check that the request arrived when you pressed Connect, pick what Claude may do, name the connection, and press Allow (Decline refuses it).

For Claude Code, add the same URL as an HTTP server (claude mcp add --transport http hq https://hq.example.com/mcp) and authenticate when it asks; its sign-in uses a local callback.

What Claude can do

The access level you approve maps onto the gateway’s existing scopes:

Choice Reaches
Read only Search and read notes, tasks and session logs. No changes.
Tasks Read and update tasks only.
Full Every HQ tool, with the checks below.

On top of the scope:

  • Your approval for high-risk calls. Mail and other Google Workspace calls, remote MCP accounts, messages into your chat or an agent’s mailbox, config changes, pairing a machine, reading or typing into a terminal pane, locking down a host, self-update, skill, slash-command and agent-definition edits, deleting a task, file reads and writes outside the vault (file edits, folder listings, git diffs, status and logs, exports to a path, convert and OCR), commits, PRs and clones, and hq_ask in full mode each wait for you. HQ sends the exact call to your chat (and the web inbox) with Approve and Dismiss. One approval runs that call once, with exactly those arguments. Claude is told to call again after you approve. A request, and a dismissal, lasts a day.
  • Notes and tasks need no approval. Claude can create, edit, move and trash notes, and create and update tasks (tags, assignees and all), without asking you. A deleted note goes to _trash/ and stays there for 30 days. The exception is the vault’s system folders: skills/, _commands/ and agents/ (they become instructions), and _system/, _threads/, _data/, _trash/ and _mailboxes/ (HQ’s own identity, history and mail). HQ’s note tools do not write, move or trash anything in most of them for anyone, however the path is spelled (./skills/x, Skills/x): a skill or slash command changes only through skill_manage or slash_command_manage, which wait for you. Any other write, move or delete that touches one of those folders waits for you like the calls above. The note readers do not open _data/ at all (it holds keys and the database), on any grant. A task Claude files or updates keeps its tags and assignees but sends nobody a message: no agent mailbox and not your chat. An agent sees the task when it looks at its queue, never as something pushed at it.
  • Coding sessions are not gated, so Claude can drive agents for you, but only in the host’s HQ folder, handoff_cwd_allow folders and folders you approved when it asked, only the sessions it started (yours stay yours: it cannot drive them, list them, read their status or have a session it starts observe them), and every one it starts sends you a notice with what it was told and which sessions it observes.
  • Provenance. Tasks Claude writes are attributed to mcp:connector/<connection name>.
  • Limits and records. 120 calls a minute per connection. Every call is logged (tool, outcome and a hash of its arguments, never the arguments) for 30 days: Settings shows the newest, and hq connector log lists them.

Two things to keep in mind. A Claude conversation reads web pages, mail and files, and text in them can steer what Claude asks HQ to do; the checks above limit that, they do not make it impossible. And whatever HQ’s tools return becomes part of your Claude conversation, which Anthropic stores under its own terms. If your vault holds things that must not leave it, choose Tasks or Read only, or do not connect.

Manage connections

  • Settings, Claude connector: the connector URL, the window, connected clients (disconnect one), Disconnect all, and recent calls.
  • hq connector status | arm [--minutes N] | disarm | grants [--all] | revoke <id> | off | log.
  • off and Disconnect all revoke every connection, cancel approvals in flight and close the window. mcp_connector.enabled: false removes the endpoints entirely.

Tokens last an hour and refresh for up to 30 days, and a connection ends 90 days after you approved it. A refresh token used twice ends its connection and tells you, since that means a copy exists somewhere else.

Troubleshooting

  • “HQ is not accepting new connections right now”: the window is closed. Allow a new connection in Settings and press Connect again.
  • “This request has expired, was already answered, or was started in another browser”: approve in the browser that Claude opened, within ten minutes.
  • Claude says it couldn’t reach the server with HQ ending TLS itself: the certificate may not be issued yet (the connector’s TLS status says so, with the reason and the time of the next try), or the forwarder is not passing acme-tls/1 connections through, which the CA needs to issue it.
  • Claude says it couldn’t reach the server: check that https://<public_url>/mcp answers 401 with a WWW-Authenticate header, and that /.well-known/oauth-protected-resource and /.well-known/oauth-authorization-server return JSON from outside your network.
  • “too many connection requests are waiting” with a single public origin: someone is filling the window. Set authorize_url to a private origin.