Guides

Connect an assistant

Use your Hub's knowledge and tools from Claude Code, Claude or another MCP client, signed in as yourself and limited to the tools you may use.

You will connect Claude Code to a running Hub, allow the connection and ask a question it answers from the Hub's knowledge. Then you will see how to share the same Hub with your team, with Claude on the web and with other MCP clients.

The assistant brings its own model and subscription. The Hub supplies its instructions, knowledge and the tools the signed-in person may use, under the same access rules as chat.

Video lesson 8 · 2:55Your own Claude, connected through MCPConnect an assistant to your hub with your own identity.

What you need

Start the Hub

Terminal
hubzoid run my-hub

When the Hub is ready, hubzoid run prints the line that connects Claude Code:

Output
✓ Hubzoid is ready: http://127.0.0.1:3080  (local mode, sign-in off)
  Connect Claude Code: claude mcp add --transport http my-hub http://127.0.0.1:3080/mcp
Where the server name comes from

The server name, my-hub here, comes from the Hub folder's name, or from name: in the Hub's AGENTS.md when it sets one.

Add the Hub to Claude Code

Paste the line hubzoid run printed into a second terminal:

Terminal
claude mcp add --transport http my-hub http://127.0.0.1:3080/mcp

No key or header goes into Claude Code's configuration. You authorize the connection in the next step.

Allow the connection

Start Claude Code, run /mcp, choose my-hub and authenticate.

Your browser opens Hubzoid. With sign-in on, Hubzoid asks you to sign in first. On your laptop sign-in is off and you are the Hub's owner, so you go straight to the consent page.

The consent page says which assistant wants to use which agent and which account you are signed in as. It lists what the connection allows: reading the agent's knowledge and files, and using the tools your access allows, including ones that make changes. Choose Allow connection and return to Claude Code.

Ask something

Message
List the tools available from my-hub, then use them to tell me our refund window.

Claude Code lists the Hub's tools, such as read_knowledge and grep_data, reads knowledge/house-rules.md and answers from it. The reasoning runs on Claude Code's own model. The Hub only runs the tools.

Connect other assistants

Claude on the web and desktop

Claude reaches the server from the internet, so the Hub needs a public HTTPS address first. See share it with your team.

  1. In Claude, open Customize, then Connectors, select + and Add custom connector.
  2. Enter a name and the full public MCP address, such as https://hub.example.com/mcp.
  3. Leave the advanced client ID and client secret empty. Hubzoid registers the client itself.
  4. Add the connector, connect, sign in to Hubzoid and choose Allow connection.

An organization administrator may need to allow custom connectors first. Menu labels depend on your Claude plan and version.

Other MCP clients

Other clients, such as Codex or Cursor, can connect when they meet every requirement below. Their setup is in their own documentation.

Every requirement a client must meet
RequirementValue
TransportStreamable HTTP. Each JSON-RPC message is one POST. The server is stateless.
Addresshttps://<host>/mcp, or https://<host>/b/<hub>/mcp with several Hubs
Sign-inOAuth authorization code flow with PKCE (S256), found from the WWW-Authenticate header of a 401
Client registrationDynamic registration as a public client, with no client secret. Redirect addresses use HTTPS, or HTTP on a loopback address such as localhost.
ResourceThe resource parameter set to the exact MCP address
Scopehub:access

A client that can only send a fixed API key or header cannot connect. Hubzoid's own protocol tests run locally, so confirm one real sign-in with each client against your deployment before you roll it out.

Share it with your team

A Hub that teammates reach needs sign-in on and a public address. MCP then turns on by itself: hubzoid run serves it at <address>/mcp whenever the public address (HUBZOID_PUBLIC_URL) is HTTPS or on this computer. To set it yourself, put both values in the Hub's .env and restart:

my-hub/.env
MCP_SERVER=true
MCP_PUBLIC_URL=https://hub.example.com/mcp
How MCP_SERVER and MCP_PUBLIC_URL behave
  • MCP_SERVER and MCP_PUBLIC_URL in the Hub's .env always win. MCP_SERVER=false turns MCP off.
  • MCP_PUBLIC_URL is the exact public address of the endpoint, ending in /mcp with no trailing slash, on HTTPS, or HTTP only on this computer.
  • Connections are tied to that address. Changing it means everyone connects again.
  • With several Hubs behind a gateway, each Hub turns MCP on in its own .env and gets its own address, https://<host>/b/<hub>/mcp.

Each teammate then adds the shared address once and authenticates in /mcp as above:

Terminal
claude mcp add --transport http --scope user my-hub https://hub.example.com/mcp

Behind your own reverse proxy

The built-in public port routes everything MCP sign-in needs. A reverse proxy of your own must forward the MCP and sign-in paths to the Hub.

Every path to forward, with several Hubs too

A reverse proxy of your own must forward /mcp, /mcp/oauth/*, /.well-known/oauth-protected-resource/mcp and /.well-known/oauth-authorization-server/mcp/oauth to the Hub's bridge, along with /auth and /api/auth/* for sign-in. With several Hubs the same paths carry /b/<hub>: remove that prefix from the /mcp paths and keep the /.well-known/ paths whole.

Check discovery from outside before anyone connects. Both must return JSON that names your public address, not an HTML page:

Terminal
curl -fsS https://hub.example.com/.well-known/oauth-protected-resource/mcp
curl -fsS https://hub.example.com/.well-known/oauth-authorization-server/mcp/oauth
Limits, logging and the full OAuth route list

Apply your usual request size and rate limits, especially to /mcp/oauth/register and the authorization endpoint. Keep Authorization headers, cookies and token requests out of your logs. Every OAuth route is listed in the HTTP endpoints reference.

Decide who may connect

Signing in proves who someone is. The Use this agent grant (use_hub) decides whether they may use this Hub, over MCP exactly as in chat. Someone without it sees "Hub access needed" on the consent page and never sees a tool name.

Grant it to named people in Settings → Agents → the agent → Access. Use Add user for someone new, or Edit access on someone already listed.

Settings, the My Hub agent on its Access tab, People view: Lee Okafor, Priya Raman and Sam Rivera, each with Use this agent and an Edit access button, and Add user above the list.Settings, the My Hub agent on its Access tab, People view: Lee Okafor, Priya Raman and Sam Rivera, each with Use this agent and an Edit access button, and Add user above the list.
Everyone listed here with Use this agent can connect an assistant to this agent. Nobody else can.

Or grant it from the command line:

Terminal
hubzoid grant priya@example.com use_hub ./my-hub
Other ways access is granted, and what is no longer read

Granting any tool permission grants use_hub too. Chat app groups grant nothing, and MCP_ACCESS_GROUP is no longer read: hubzoid doctor warns while it is set. If the access store cannot be read, the call is refused rather than let through. The full Access editor is in restrict tools.

How it works

Chat: the Hub runs the model

The Hub agent reasons with the model set for the Hub and calls tools until it can answer.

  1. Person

    Web app, Slack or the API

  2. Bridge

    /v1

    Checks who is asking

  3. Runtime

    Runs the agent

  4. Model

    Reasons and asks for tools

  5. Tools

    Run in the bridge

MCP: the assistant brings its own model

The assistant does the reasoning. The Hub checks the access token, lists the tools this person may use and runs the ones called. A tool call runs no agent and keeps no conversation. Only a workflow offered as a tool can call the Hub model, inside its own run.

  1. Assistant

    With its own model

  2. Bridge

    /mcp

    Checks the token and access

  3. Runtime

    Not used

  4. Model

    Only inside a workflow run

  5. Tools

    Results go back to the assistant

Both paths use the same tools, knowledge and permission checks.

Every call is checked in code before a tool runs. The model is never the gate.

The five checks on every call, and why no conversation is kept
  1. Sign-in and consent. The client receives OAuth credentials issued by Hubzoid and never sees the person's password or session. An existing sign-in skips the form, never the consent.
  2. The token check. An unknown or expired token, a revoked connection, or an account that is deleted, replaced, blocked or awaiting approval gets 401, with OAuth discovery in the WWW-Authenticate header.
  3. The front door. The person must hold Use this agent in this Hub.
  4. The tool list and the guard. Tools the person may not use are left out of the list, and a gated tool checks the permission again when it is called.
  5. The audit record. Every restricted tool decision, allowed or denied, is stored with the person and the channel mcp.

The connection keeps no conversation. The assistant holds its own history, and each call to the Hub stands alone.

What the assistant receives

Instructions

When the client connects, it receives the body of AGENTS.md, the same text the Hub's own agent follows. Clients that support server instructions, such as Claude Code, add them to the assistant's context.

Give MCP clients shorter instructions

If AGENTS.md holds guidance meant only for the Hub's own agent, or is long, give MCP clients a shorter version. mcp_instructions: wins when present:

my-hub/AGENTS.md
---
name: My Hub
mcp_instructions: |
  House rules for Kestrel & Oak, a home-goods shop.
  Use read_knowledge for policies such as house-rules.
  Use grep_data for the exports in raw_data/.
---

You are the team assistant for Kestrel & Oak. ...

Tools

The assistant gets the same tools the chat agent uses, minus the ones that only make sense inside a chat.

  • Offered: the knowledge, file, search and utility tools such as read_knowledge, grep_data and http_get, and your tools_local/ tools.
  • Offered to people who may use them: your restricted/ tools, and the workflow, Run for me and access tools granted in Settings. Each call is checked again.
  • Over MCP only: agent_health, eval_status and recent_denials, read-only tools for people who manage access to the agent.
  • As skills: sub-agents arrive through load_skill. The Hub does not run a second model for an MCP caller.
  • Not offered: chat-only tools such as write_artifact and read_upload, remember, call_jev, and the tools of the Hub's own MCP servers and connectors.
Context cost, and the mcp restricted surface

The full list per channel is in built-in tools. Every tool schema costs context in every connected client, so keep the set focused. The mcp channel is in the default HUBZOID_RESTRICTED_SURFACES list, because each caller signs in as themselves. If you set that variable, keep mcp in it.

Manage connections

  • Revoke. Each person lists and revokes their assistant connections at /mcp/oauth/connections, or /b/<hub>/mcp/oauth/connections with several Hubs, after signing in. Revoke connection stops its tokens at once. It does not undo actions or remove data already shared with the assistant.
Token lifetimes, account changes and API keys
  • Lifetime. One scope, hub:access, covers reading context and running the tools the person's access allows. There is no read-only grant. Access tokens last up to 10 minutes. Refresh tokens and the consent last up to 30 days, and reusing an old refresh token revokes the connection. Client registrations expire after a year.
  • Account changes. Every call checks the account and its grants again. Deleting, replacing or blocking the account, or removing Use this agent, ends access on the next call. A grant changed in Settings applies on the next call, with no reconnect.
  • Keys. API keys, including keys from BRIDGE_API_KEYS, are never accepted at /mcp.

Test allowed and denied calls

Before handing the address to a team, check both sides of the door. A request without a token must be refused:

Terminal
curl -si https://hub.example.com/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}'

The answer is 401 with a WWW-Authenticate header that points to OAuth discovery. Then connect as a person with access and as one without.

Every check and its expected result
CheckExpected result
No token, a made-up one, or a key from BRIDGE_API_KEYS401
Sign-in as someone without Use this agent"Hub access needed" on the consent page, and no connection
Sign-in as someone with accessThe tools list shows the unrestricted tools
A restricted tool the person lacksMissing from the tools list, and a call returns isError with an access denied message
The connection revoked at /mcp/oauth/connections401 on the next call, until the person connects again
What a refused call returns, and where to review decisions

A refused restricted tool answers with "isError": true and a message like this, and the attempt is recorded:

Output
[access denied: 'ledger_read' requires the "Read ledger" (ledger) permission, which the current user does not have. This attempt was logged.]

Review the decisions in Settings → Activity → Audit log → Tool decisions, with the channel filter set to mcp, or on the server:

Terminal
hubzoid audit ./my-hub --denied

If something goes wrong

What you seeWhat to do
hubzoid run prints no "Connect Claude Code" lineMCP is off. Remove MCP_SERVER=false from the Hub's .env, or set MCP_SERVER=true with an MCP_PUBLIC_URL, then restart.
"Hub access needed" on the consent pageGrant the person Use this agent on the agent's Access tab, then reconnect from the assistant.
"Connection expired" in the browserStart connecting again from the assistant.
Claude Code sends an old Authorization header or API keyRemove the old entry, for example claude mcp remove my-hub --scope user, then add it again without a header.
Every call returns 401 after it workedThe connection was revoked, the account changed or MCP_PUBLIC_URL changed. Authenticate again in /mcp.
A tool is missing from the listIt is restricted and the person lacks its permission, or it is a chat-only tool.
More problems and fixes
What you seeWhat to do
A discovery curl returns HTMLYour proxy does not forward the /.well-known/ paths to the Hub.
Claude on the web cannot reach the HubIt needs a public HTTPS address that the internet can reach.

Operational notes

The endpoint is stateless, so it works behind a load balancer and across bridge restarts.

Where tools run, and who pays for model calls
  • MCP calls run the Hub's tools on the Hub's machine, with the Hub's own credentials. Keep the credentials a tool needs in restricted/.env. The file-reading tools refuse the restricted/ folder, so no caller can read it.
  • Tool and knowledge calls over MCP spend none of the Hub's model tokens. A workflow offered as a tool runs on the Hub, and any model call it makes is billed to the Hub like any other run.

Next steps

Choose which cookies Hubzoid can use. You can change this at any time from Cookie settings in the footer. Read the Cookie Policy for details.