Show HN: Locum – Grok Bot delegates tasks to Claude/Codex CLI on your machine A developer released Locum, an open-source server that lets xAI's Grok Bot delegate coding tasks to the Claude Code and Codex CLIs running on the user's own machine via a custom MCP connector and a Cloudflare tunnel, preserving the user's own subscription credentials. The project explicitly prohibits hosting for third parties and enforces invariants such as never reading credential files or calling vendor APIs directly, to comply with Anthropic's terms that disallow routing requests through Free, Pro, or Max plan credentials on behalf of others. A locum is a qualified professional who temporarily does someone else's job. Lets Grok Bot delegate coding work to the Claude Code and Codex CLIs you are already logged into on your own machine, instead of burning Grok Bot usage on its own agent loop. Not affiliated with or endorsed by xAI, Anysphere, OpenAI, or Anthropic. Grok Bot runs on a persistent computer in xAI's cloud, so it cannot see localhost . It reaches this server over a tunnel, as a custom MCP connector -- a documented Grok feature, not a workaround. Grok Bot xAI cloud └─ MCP tool call ──► tunnel ──► this server your Mac ├─ spawns claude -p your Claude sub └─ spawns codex exec your ChatGPT sub Anthropic's Claude Code legal page https://code.claude.com/docs/en/legal-and-compliance draws the boundary explicitly: Advertised usage limits for Pro and Max plans assume ordinary, individual usage of Claude Code and the Agent SDK. Anthropic does not permit third-party developers to offer Claude.ai login or to route requests through Free, Pro, or Max plan credentials on behalf of their users. So: | ✅ | You, your machine, your subscription, your own work | | ❌ | Hosting this so other people's requests hit your subscription | Sharing the code so others run it on their own subscription -- fine only while the invariants below hold | Invariants. Do not remove them; they are the reason this is legal. - Never read credential files, keychains, or OAuth tokens. - Never call api.anthropic.com / api.openai.com directly. - Only ever spawn the official claude / codex binaries, authenticated by the operator through the vendors' own login flows. - Single-operator: one bearer token, one allowlist of workspace roots. If a change would break one of these, it is the wrong change. Requires claude and codex already signed in, plus uv https://docs.astral.sh/uv/ . cp .env.example .env then set a real token and your roots set -a && source .env && set +a uv run server.py Tunnel it Cloudflare quick tunnels do not carry SSE; this server uses Streamable HTTP, so they work fine : brew install cloudflared cloudflared tunnel --url http://127.0.0.1:8791 That quick tunnel is fine for a first run, but it hands out a new hostname on every restart and Grok stores the URL -- so you would re-register and re-consent every time. For anything ongoing, take a stable hostname instead needs a domain already on your Cloudflare account : cloudflared tunnel login browser, once ./setup-tunnel.sh locum.example.com cloudflared tunnel run locum setup-tunnel.sh is idempotent: it creates the named tunnel if missing, points DNS at it, and writes ~/.cloudflared/config.yml . To keep the tunnel up across reboots, use the script, not cloudflared service install : sudo ./install-service.sh cloudflared service install writes a launchd plist containing only the binary path, with no tunnel run subcommand, so the daemon crash-loops while your user-level tunnel quietly masks the failure. install-service.sh writes the plist itself and verifies /health before claiming success. That keeps the tunnel up. To keep the server up as well, so a reboot does not leave a healthy hostname pointing at nothing: ./install-agent.sh no sudo: it must run as you Two macOS requirements, both of which fail confusingly if missed: - If this checkout is under ~/Documents , ~/Desktop , or ~/Downloads , grant Full Disk Access to . launchd agents do not inherit your terminal's TCC grants, and TCC judges the executable launchd starts. uv - Run claude setup-token and put the result in .env as CLAUDE CODE OAUTH TOKEN . A launchd agent does not get your login session's credential access, so delegation fails with "OAuth session expired" even though the server itself starts fine. Register at grok.com/connectors - New Connector - Custom , with the tunnel URL plus /mcp . Grok's custom connectors speak OAuth 2.1 only -- the dialog has no static header field. The bridge therefore ships its own minimal authorization server, so there is no third-party OAuth app to create. Grok discovers the endpoints via /.well-known/oauth-authorization-server and self-registers over RFC 7591. If Grok still shows the manual "OAuth Credentials Required" form, fill it as: | Field | Value | |---|---| | Client ID | anything, e.g. locum | | Client Secret | leave empty | | Authorization Endpoint | https://