Cloud Gateway & MCPTools MCP (runtime)

Tools MCP — where the agent acts

The Tools MCP is the Cloud Gateway’s runtime endpoint. An MCP-native agent connects here and calls tools; each call is authorized by the gate and executed with a vaulted credential the agent never sees.

  • URL: https://gw.regentprotocol.org/gw/mcp
  • Auth (every request): Authorization: Bearer <control key> + X-Agent-Id: <agent id>, or an OAuth access token from the connector sign-in (see below)
  • Protocol: JSON-RPC 2.0 (initialize, tools/list, tools/call)

Using Claude, Claude Code or another app with custom connectors? You need no headers at all: add the URL as a custom connector and sign in — Connect from your agent app. The configuration below is for agents you run yourself.

Client config

{
  "mcpServers": {
    "regent-gateway": {
      "url": "https://gw.regentprotocol.org/gw/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_CONTROL_KEY",
        "X-Agent-Id": "YOUR_AGENT_ID"
      }
    }
  }
}

The control key comes from create_control_key (Admin MCP); the agent id from create_agent.

Calling a tool

tools/list returns exactly the tools in your catalog (see the Tool Catalog), plus the built-in pay tool. Each tools/call runs the full enforcement flow: gate → inject the vaulted credential → call the provider.

{
  "method": "tools/call",
  "params": {
    "name": "stripe",
    "arguments": {
      "method": "POST",
      "path": "v1/payment_intents",
      "body": { "amount": 500, "currency": "usd" },
      "intent": "pay the supplier invoice"
    }
  }
}

Arguments: method (default GET), path, body?, intent? (recorded in the audit), user_token? (OIDC id_token when acting for a person), facts? (verified facts for policy).

Without MCP: plain HTTP with a key bound to one agent

The same tools answer plain HTTP at https://gw.regentprotocol.org/gw/{tool}/{path}, and the gate decides each call the same way. For an agent that cannot speak MCP or sign in through OAuth — a browsing agent, Browser Use, Hermes, your own code — give it a key that can act as one agent only:

  1. In the console open Connect → Connect an agent in one screen. Name the agent, set the allowance and the ceiling, approve. The screen shows a control key bound to that agent once; it begins with rgnt_agt_. Put it wherever the agent keeps its secrets.
  2. Call with the key alone. No X-Agent-Id header: the key names the agent, and it is refused for any other agent.
curl https://gw.regentprotocol.org/gw/stripe/v1/balance \
  -H "Authorization: Bearer rgnt_agt_..."
  1. A call that moves money is decided first. With the default allowance the first one comes back escalated; a person approves it under Approvals in the console, and the agent retries with the same idempotency_key.

From Python the same call is rc.gateway(tool, path, body=…) on the SDK client (regent-control ≥ 0.11), from TypeScript control.gateway(tool, path, { body }) (@regent-protocol/control-sdk ≥ 0.3): both sign with the agent’s own key when the client holds one and return the provider’s response or the gate’s verdict as a value.

A machine that can run a command line has a better option: the owner mints an invite on the agent’s page, and regent-control enroll <code> generates the agent’s own Ed25519 key, registers the public half with a proof of possession and writes a bound key to ~/.regent/credentials.json. Requests are then signed (RFC 9421), the organization can require that signature, and the receipts say the agent held its own key. See Enrol an agent.

An agent that holds its own key signs its gateway requests the same way — the MCP tools/call or the plain-HTTP call, with Signature-Input and Signature over the request and its Content-Digest. The gateway verifies the signature against the keys registered for that agent and names the key to the gate, so the receipt records the agent’s key even though the gateway, not the agent, called the gate. A signature that does not verify is refused (SIGNATURE_INVALID); an unsigned request from a bound key still works where the owner did not require the agent’s signature. When the gate refuses a call, the agent gets the gate’s own code and message (SIGNATURE_REQUIRED, AGENT_NOT_BOUND, …); “control plane unreachable” is only ever an outage.

What a bound key cannot do: act as another agent (403), manage the organization, create mandates, or approve its own escalations.

The built-in pay tool

Every agent gets a built-in pay tool — a payment from the agent’s Custodian custody wallet (a second rail alongside API tools). It’s gated the same way and KMS co-signed by Regent.

{ "name": "pay",
  "arguments": { "to_address": "0x…", "amount": 5, "mandate_id": "…",
                 "intent": "supplier payout" } }

Returns pending (submitted, settles via webhook), denied, or escalated. Requires an active wallet + a spend mandate. See Custody and the Wallets page in the dashboard.

Built-in tools an agent uses about itself

Besides the catalogued tools and pay, every agent gets six built-ins. None of them moves money or changes terms; they run with the agent’s own credential (the OAuth access token a connector got at consent, or an enrolled agent’s key).

ToolKindWhat it gives
my_budgetreadsandbox or live, the home currency, the budgets held per currency and what is left today / this month (a portion, never the ceiling, unless the owner opted in), sellers the owner capped by name, a pending ask, the amount above which a person is asked, whether a card is stored, whether the owner is verified, which door the agent came through (connected_via), and the next step (stage, next.say, next.tool)
request_budgetaskasks the owner for a budget (currency, limits, caps per seller, purpose); a person signs it under Approvals
budget_request_statusreadwhere that ask stands
approval_statusreadafter ESCALATION_REQUIRED: approved (repeat the call with the same idempotency_key), denied, or pending. With wait (seconds, up to 50) the call holds until the owner decides, so the agent learns of the approval without being told
receiptreadthe signed receipt of one of the agent’s completed payments, with the public verify page
card_linkreadthe owner’s own page on Regent to store a card (Agentcard); never card details in the chat
verify_identityreadthe owner’s own page on Regent to verify their identity and take the organization live (a fixed address that asks for the passkey first), and whether they are verified already. The agent never relays a provider’s verification link: such a link opens without sign-in and cannot be told from a forgery

The assistant guides the owner

At connect time the server’s initialize answer carries instructions: call my_budget at the start of a conversation and whenever the owner asks what to do next, and relay its next.say in the owner’s language. The platform computes the owner’s stage from facts it already holds, so every door (connector, onboarding link, invite, SDK) gets the same guidance:

stagewhennext.toolwhat the assistant says, in short
no_budgetno active budget, nothing pendingrequest_budget”I have no budget yet; shall I ask you for one?” (sandbox: “nothing real is charged”)
budget_pendingan ask awaits the ownerbudget_request_status”Please confirm it under Approvals; I will continue once approved”
sandbox_readya budget in the sandboxpay (alternative: verify_identity)“Purchases are test-only; say what to buy, or say ‘go live‘“
verify_identitylive, owner not verifiedverify_identity”Verify once at the fixed Regent page; it asks for your passkey first”
link_cardlive, verified, no card storedcard_link”Store your card once at the fixed Regent page; I never see the number”
readybudget, verified, cardpay”Tell me what to buy; anything above your allowance asks for your approval”

So an owner needs one sentence from whoever invites them: add the connector (or tell the assistant to register with Regent) and ask it “what next?”. The assistant takes it from there.

The built-in request_budget tool

A connector agent (Claude, ChatGPT) learns from a refusal that it has no budget in the purchase currency — MANDATE_NOT_FOUND with currency: "USD". It may then ask the owner for one from inside the chat:

{ "name": "request_budget",
  "arguments": { "currency": "USD", "per_tx_limit": "25", "monthly_limit": "100",
                 "purpose": "a US SaaS subscription",
                 "entity_limits": [{ "match": "amazon", "per_tx_limit": "20" }] } }

Nothing is granted here. The ask lands under Approvals and in the owner’s inbox; a person signs it (passkey in a production organization). budget_request_status with the request_id says where it stands (pending_approval, approved with the mandate id, denied, expired); retrying the purchase after approval works too. One ask may wait at a time, an agent that already holds a budget in that currency is told so (MANDATE_EXISTS), an agent may hold at most three currencies, and the organization can switch agent requests off. The tool runs with the agent’s own credential — the OAuth access token the connector got at consent — so the request is filed under that agent.

What every call is checked against

The same gate decision runs on API tools and custody payments:

CheckBlocks when
Identitythe X-Agent-Id isn’t a registered, active agent
Mandatea money tool exceeds its per-tx / daily / monthly limit
Cedar policyyour rule forbids it — by tool, action, resource (recipient), amount, role
Guardianbehavioral risk is too high (can escalate)

Everything fails closed: no gate, no vaulted key, or a policy deny → the provider is never called. A deny is a normal, readable outcome (the agent sees the code + reason).

Per-agent tool control & modes

  • Disable a tool for one agent — in the dashboard, the agent’s page has a per-tool on/off switch. A disabled tool disappears from that agent’s tools/list and any call returns TOOL_DISABLED_FOR_AGENT.
  • Enforcement mode — enforce (a deny blocks) vs observe (shadow: records what it would block but lets the call run). Check the mode before a live demo.