---
name: hub-connect
description: Connect a compatible agent client to Hub MCP, reuse an existing connection, and choose the least required Hub permission. Use for Hub connection and onboarding requests.
---

# Hub connection

Hub is the service-discovery and nonfinancial-routing product. Agent Wallet is a separate, optional financial tool. Reuse an existing connection to the requested product; a Wallet connection is not automatically a Hub connection.

## Connection

- Hub MCP resource and audience: `https://agentichub.ir/mcp`
- Resource metadata: `https://agentichub.ir/.well-known/oauth-protected-resource/mcp`
- Authentication: OAuth authorization code with PKCE S256 and owner consent. The client must be registered with its exact redirect URI. Anonymous client registration is not assumed.
- Base scope: `hub.read` for discovery. Use `hub.read hub.publish` for owner-authorized profile/catalog publication, or `hub.read hub.route` for explicitly requested routing and traces.

When the user asks to use Hub, first use the existing Hub connector if one is exposed. With reading permission, `search_offers(query="پیراهن", location="تهران", limit=5)` is a read-only discovery example. Do not treat provider declarations as guaranteed stock, price or quality. Ask for the missing connection step only if a usable connection is unavailable.

## Codex CLI

For a user-requested new Codex connection with a pre-registered client, replace the public placeholder with that client's ID:

```sh
codex mcp add hub --url https://agentichub.ir/mcp --oauth-client-id YOUR_REGISTERED_CLIENT_ID --oauth-resource https://agentichub.ir/mcp
codex mcp login hub --scopes hub.read
```

The first command adds the remote server configuration; login obtains consent. Do not register another connection when the requested existing one already works. Keep tokens and any client secret out of URLs, prompts and public files.

## Boundaries

Publication and routing are separate operations requiring the user's intended scope. Ready receiving destinations and supported contracts are required. The currently accepted routing examples are synthetic nonfinancial operations, not commercial purchases or payments. Wallet financial authority stays in Wallet; never infer permission to pay from a request to connect.

The landing's editable inquiry and JSON are educational local examples, not live API results. Report what actually completed, and preserve unknown outcomes for recovery rather than declaring success.

Read the human connection guide at https://agentichub.ir/connect.md for endpoints, API examples and prerequisites.
