Skip to content

MCP connectors API

The MCP connectors API manages connectors that bridge the gateway to external Model Context Protocol servers. All endpoints require an authenticated admin session and a tenant context.

Connectors are tenant-scoped. A connector may optionally be bound to a single gateway via the gateway_id field.

Request body shape. Endpoints that take a body (create, update, call-proxy, credential store) expect a JSON object. An absent body (empty or whitespace) is treated as an empty object; a body that is null, a bare scalar (42, true, "x") or a JSON array is rejected on the connector routes with 400 malformed_body ("request body must be a JSON object"). A malformed / unparseable body is a different case: it is rejected at the trust boundary with 400 malformed_body ("request body is not valid JSON"), never collapsed to an empty object. Create, the call-proxy, and credential-store then reject the empty body with 400 (a missing required field such as name/server_url); a partial update treats it as a no-op and returns 200 with the unchanged connector. In no case does a non-object body cause a 500.

Numbers in a request body are exact or refused. On /admin/v1/mcp and /admin/v1/mcp/* a number in the request body is preserved exactly or the request is refused by name; it is never silently rounded. A number a 64-bit double cannot hold exactly (an integer a double does not hold exactly such as 1234567890123456789, one beyond ±2^63, or a decimal such as 0.100000000000000001) answers 400 number_not_exact; send it as a string. A number-shaped token that is not valid JSON (0x10, a leading zero, +1, a trailing dot) answers 400 number_invalid. Non-finite literals (NaN, Infinity, 1e400) answer 400 malformed_body (see error codes). The check also covers a bare scalar body (9007199254740993 is refused, not treated as an empty object) and runs before the array rejection. A number that is accepted reaches the MCP server value-exact: it is re-encoded as the shortest text that reads back as the same double (1.50 is forwarded as 1.5, 1e2 as 100; the integer -0 arrives as 0, the same numeric value). This includes the arguments of a /call proxy request, the bounds in argument rules, and the expires_at of a credential.

A repeated key in a request body is refused. On the same routes an object that repeats a key at any depth ({"a":1,"a":2}, also inside an array or a nested object, and also when one spelling uses escapes such as "\u0061") answers 400 duplicate_key; nothing is written. The message names the repeated key when it is 1 to 64 printable ASCII characters. A JSON parser would otherwise keep only the last of the two, so a repeated key in an argument-rules body could silently drop rules. Send each key once.


Listing connectors

GET /admin/v1/mcp

Optional query parameter: gateway_id to filter by a specific gateway.

The response omits the auth_value field for every entry and instead carries auth_value_set (boolean: a credential is stored on the connector). Rows are owner-filtered to the caller (the tenant's shared/admin-provisioned connectors plus the caller's own private ones), never another member's private connector. Returns 403 ({ "error": "no tenant", "code": "no_tenant" }) when there is no tenant context (the chat app treats that typed answer as an empty catalog, not as a failure, and does not report it) and 401 when the caller has no user identity (fail closed — a missing user id never falls through to an unfiltered tenant-wide list).

Each row carries a server-computed connected boolean — usable by this caller. A scope = "tenant" row is always connected: true (the connector carries its own credential) and has no credential_status. A scope = "user" row is decorated by the same rule as GET /admin/v1/mcp/mine (connected + credential_status, table below): a no-auth connector (auth_type = "none") without a stored credential is connected: true / credential_status: "ready", a required-auth connector without a credential is connected: false / "none". The Chat sends every connected connector's tools to the model, so a no-auth personal connector reaches the model as created. A storage fault while reading the caller's credential returns 503 rather than silently reporting the connector as disconnected.

The reconnect_notice field (Atlassian v1 retirement)

Rows of GET /admin/v1/mcp and GET /admin/v1/mcp/mine can carry an additive reconnect_notice object. It is present only when both conditions hold, and absent otherwise:

  • the row's catalog_slug names a directory card with a retirement date (Atlassian and Confluence) and its server_url is byte-equal to that card's previous server, https://mcp.atlassian.com/v1/mcp. Only the exact v1 URL gets the notice (the same rule as the tool classes); a trailing slash or any other form of the URL gets none.
  • the caller owns the row: on /mcp/mine the row's creator; on GET /mcp the creator, or an admin for a tenant-wide or admin-provisioned row. Another member never sees the field on a row they do not own.
{
  "reconnect_notice": {
    "kind": "reconnect",
    "retires_on": "2027-03-01",
    "catalog_slug": "atlassian",
    "docs_url": "https://support.atlassian.com/atlassian-ai-gateway/docs/how-to-upgrade-from-atlassian-mcp-v1-to-atlassian-mcp-v2/",
    "current_server_url": "https://mcp.atlassian.com/v2/mcp?tools=all"
  }
}

retires_on is a YYYY-MM-DD date, docs_url the vendor's upgrade page, and current_server_url the directory card's current endpoint (a client compares it with its own connectors to tell whether the new connection already exists). The field is a prompt only: the gateway never reconnects or migrates a connection by itself. The rest of the row shape is unchanged.

is_atlassian. Every row of GET /mcp carries a server-derived boolean is_atlassian: true when the connector fronts the Atlassian Remote MCP (a directory card atlassian or confluence whose server_url is the card's exact URL). The web app uses it to list the connectors eligible as a Confluence or Jira knowledge source; the sync routes re-check it (400 not_atlassian_connector).


Group-scoped connectors (visibility, group_ids)

A connector has two independent settings. scope says whose credential it uses (tenant or user). visibility says who may see and use it:

visibility Who sees and can use the connector
tenant (default) Every member of the tenant (existing behaviour).
group Only members of the groups listed in group_ids.

Existing connectors are tenant. A group connector is admin-provisioned (it has no personal owner).

Who may set them. visibility and group_ids are accepted on POST /admin/v1/mcp and PATCH /admin/v1/mcp/{id} from admin, tenant_admin and ki_manager callers. A ki_manager can only create or keep group connectors: sending visibility: "tenant" (or omitting it on create, which would mean the personal path) is refused with 403, and so is changing a group connector back to tenant. A plain member sending visibility: "group" gets 403.

Request fields.

  • visibility: "tenant" or "group". Absent or null means the default on create and unchanged on PATCH.
  • group_ids: array of 1 to 50 group ids (duplicates are removed). Required with group; absent or null on PATCH leaves the shares unchanged. The connector and its shares are written in one transaction.

Rejections.

Status Code Cause
400 invalid_visibility visibility is present but not one of the two strings (visibility must be 'tenant' or 'group')
400 invalid_group_ids group_ids is not an array of 1 to 50 group-id strings (a non-array, an empty array, a non-string entry, or an entry that is not a UUID)
400 too_many_group_ids group_ids has more than 50 entries (counted before the id check and before duplicates are dropped)
400 group_ids_required visibility: "group" without any group, or a PATCH that would leave a group connector with none
400 group_ids_require_group_visibility group_ids sent with visibility: "tenant"
400 unknown_group a group id does not exist in the caller's tenant (nothing is created)
400 group_visibility_unsupported the connector type cannot be group-scoped
400 group_visibility_requires_shared_connector PATCH tries to make a member's personal connector group-visible
400 manage must be 1 (code invalid_manage) ?manage= has any value other than 1
403 forbidden the caller may not set visibility/group_ids (member; ki_manager choosing tenant)

The field codes follow the published rule (see Error codes): absent → <field>_required, null (where null does not mean "leave unchanged" or "absent") / wrong type → invalid_<field>, over a bound → <field>_too_long / too_many_<field>. On PATCH an absent field is left unchanged, and a null name or server_url is also left unchanged (200); a null oauth_auto_register counts as absent on create (201). The codes renamed in this release are invalid_connector_field → name_required / invalid_name / name_too_long / server_url_required / invalid_server_url / server_url_too_long / invalid_visibility (by field and cause), trusted_subprocessor_invalid → trusted_subprocessor_required / invalid_trusted_subprocessor, four_eyes_required_invalid → four_eyes_required_required / invalid_four_eyes_required, group_ids_invalid → invalid_group_ids / too_many_group_ids, manage_invalid → invalid_manage, credential_scope_invalid → credential_requires_user_scope, oauth_auto_register_invalid → invalid_oauth_auto_register, include_blocked_invalid → invalid_include_blocked, grandfathered_invalid → invalid_grandfathered. The discovery preview's single invalid_server_url is now split (see Previewing discovery). Status and the English error sentence are unchanged. During a rolling deploy a client may briefly see either spelling; match on the status and the error sentence, or accept both.

Listing. GET /admin/v1/mcp (which is also the Chat connector catalog) and GET /admin/v1/mcp/mine only return a group connector to members of one of its groups. Admins who are not in the group do not see it there either. For the management page, admin, tenant_admin and ki_manager callers can send GET /admin/v1/mcp?manage=1: it additionally returns the group connectors the caller is not a member of, each row carrying group_member (boolean). Rows with group_member: false are never offered to the model. Every row carries visibility; GET /admin/v1/mcp/{id} returns groups: [{group_id, group_name}] for a group connector to a managing caller. For any other caller ?manage=1 is ignored and the list stays fenced; a value other than 1 is a 400 for everyone.

Using a group connector. Calls (POST /admin/v1/mcp/{id}/call, the bridge, OAuth connect and Chat) re-check group membership on every request, for admins too. A non-member gets 404 (the connector's existence is not revealed). Removing a user from the group, deleting the group, or removing the last group from a connector takes effect for calls immediately. The tool list a client or chat session already holds can lag: it follows the tool-list cache and refreshes within the cache TTL.

Creating, changing and deleting a group connector, and every change of its groups (before and after), is written to the audit log (mcp_connector.group_created, mcp_connector.group_updated, mcp_connector.group_deleted). The change and its audit entry are committed together: when the entry cannot be written nothing is changed and the call answers 503 { "error": "temporarily unavailable; retry later" } (retryable, nothing was written) or a sanitised 500. A connector deleted while a PATCH is in flight answers 404; a DELETE of a connector that is already gone stays idempotent and answers 204; neither records an entry. A refused request (unknown group, missing group_ids) records none either. Audit events record connector URLs (server_url, oauth_authorize_url, oauth_token_url) with any user:password@ userinfo stripped, so a legacy row that still carries credentials never leaks them into the audit log or the tenant audit API.


Listing my personal connectors

GET /admin/v1/mcp/mine

Member-accessible (requires only a tenant context and an authenticated user; not tenant_admin-gated). A caller without a tenant gets 403 with code: "no_tenant"; the connectors page then shows a notice ("Your account isn't attached to a tenant yet") in place of its actions and does not report the refusal as a client error. Returns only the caller's tenant connectors with scope = "user", each decorated with a connected boolean reflecting whether this caller can use the connector (a stored per-user credential, or a no-auth connector that needs none). The auth_value field is never returned (auth_value_set is). The response is an array, empty when no user-scoped connectors exist. Returns 401 when unauthenticated.

Each row also carries a credential_status reflecting the caller's stored credential, so the UI can offer the right action:

credential_status Meaning UI action
connected a per-user credential is stored (and valid) Disconnect offered
expired the stored credential is past its expires_at and has no refresh token, or the provider has since rejected it (see below) Reconnect + Disconnect offered
ready auth_type = "none" and no credential is stored — usable as created none
none a required-auth connector with no credential yet Connect offered

💡 Note (a rejected token reads expired): the status is no longer derived from expires_at alone. When a stored per-user credential is rejected by the provider at call time (a 401/403 on the tools/list/tools/call handshake), the gateway records the rejection and this row flips to expired — even if its expires_at is still in the future and it has a refresh token — so "Reconnect needed" is shown instead of a permanent, false "Connected". The mark is cleared automatically on the next successful call (self-heal, so a transient provider 401 does not pin the row) and on every reconnect/refresh. The rejection check takes precedence over the refresh-token short-circuit.

Because a stored per-user credential is transmitted to the MCP server on presence alone (see Storing my credential), a connector that has a stored credential is reported connected — offering Disconnect — even when its auth_type is none. ready is reserved for a none-typed connector with genuinely nothing to revoke; it never masks a credential that is still egressing.

💡 Note: The connector CRUD routes manage tenant-scoped connectors. Creating (POST /mcp) requires the MCP_AUTHOR permission — for the built-in roles that is member, ki_manager, tenant_admin, or admin (a viewer, demouser, or finance user gets 403), and a tenant custom role granting MCP_AUTHOR is admitted regardless of its base role. Reading, editing, and deleting a connector (GET /mcp/<ID>, PATCH, DELETE) require being the connector's owner or a tenant_admin/admin — not a blanket tenant_admin; an admin-provisioned tenant-wide connector (no owner) is admin-only. The self-service routes — GET /mcp/mine and the /mcp/<ID>/credential lifecycle below — are member-accessible and act only on the calling user's own credential rows.


Listing the connector directory

GET /admin/v1/mcp/catalog

Returns the connector directory the create form pre-fills from: { "entries": [ … ], "oauth_redirect_uri": "…" }. Each entry describes a known connector type (its display name, endpoint template, and auth shape); the list carries no secrets and does not include the per-tool class maps (those are read through Tool classes). An entry may also carry app_tools (the tools its in-chat viewer may call, see MCP Apps) and arg_bounds (tool → argument → { min, max, integer }, see tool-argument bounds); both are informational. oauth_redirect_uri is the deployment's public OAuth callback URL to register in an identity-provider app (null when not configured on this deployment). Accessible to any caller holding MCP_AUTHOR (the connector-authoring permission); a viewer, demouser, or finance user receives 403, and a caller with no tenant receives 403.

Open directory. Every entry is returned, alphabetically by slug, to every caller who may read the directory; there is no active-set filtering and no active field (the former active_mcp_connectors setting was removed by migration 0675). This is a discoverability list, not an egress or security boundary: POST /mcp without a catalog_slug is unaffected and a member may still register a custom connector by URL.

Internal kinds are excluded from the directory. A connector directory entry has a kind: mcp (the default — a JSON-RPC tool server), data_source (a content source the connector-sync engine pulls from — see connector sync), or governed_query (a first-party governed database-query connector answered through the runner; see the governed_query fence below). The governed_query kind is omitted from this listing — it is created programmatically by the governed-query enrollment flow, never picked from the directory — so it never appears in the directory.

Creating a connector

POST /admin/v1/mcp

Field Type Required
name string yes — non-empty, at most 120 bytes (else 400 name must be a non-empty string (max 120 bytes)); a name with nothing visible answers 400 name_required on create and invalid_name on update; a name that is not a string or not valid UTF-8 answers 400 invalid_name on create and on update; over 120 bytes answers 400 name_too_long
server_url string yes
auth_type none | bearer | header no (defaults to none)
auth_value string required when auth_type is bearer or header; at most 4096 bytes; must contain no control characters (CR, LF, NUL, tab, ...) because it is sent verbatim in an upstream header; a non-string value or a control character returns 400; a whitespace-only value counts as empty; for header it must have the form Header-Name: value with a non-empty value (else 400); for bearer it must be the bare token (printable ASCII without spaces, e.g. abc, 12|abc, a JWT) — a Bearer prefix, any whitespace or non-ASCII character returns 400. The same rule applies on PATCH and PUT /admin/v1/mcp/{id}/credential
scope tenant | user no (defaults to tenant)
gateway_id string no — binds the connector to one gateway of the connector's own workspace. Absent / null = unbound; not a string, "", longer than 36 bytes, invalid UTF-8 or containing a control, line-break or invisible formatting character (see refused characters) → 400 gateway_id_invalid; an unknown id or another workspace's gateway → the same 400 { "error": "unknown gateway_id", "code": "gateway_id_unknown" }; a database fault → 503. The gateway's own id is stored.
catalog_slug string no (must name a real directory entry; an unknown slug returns 400. A caller that is not a platform admin may only use a slug that is visible to it in the directory, else 403, see below)
entra_tenant_id string (GUID) required only for a tenant-scoped catalog entry (see below)
environment prod | sandbox no (Salesforce templated entry only; defaults to prod)
server_api_name string no (Salesforce templated entry only; defaults to sobject-reads)
oauth_auto_register boolean no — true discovers the server's OAuth endpoints and sets the gateway up as an OAuth client while creating (a Client ID Metadata Document where the server supports it, otherwise Dynamic Client Registration) (see Automatic OAuth setup)

On create, an explicit null auth_type or scope is rejected with 400 (omit the field to get the default); only update treats null as "keep".

A user-scope connector must not carry an auth_value — its credential is held per user — so supplying one returns 400. For a tenant-scope connector, auth_type none must not carry an auth_value (returns 400), and bearer or header requires a non-empty auth_value.

Stored form of auth_value (tenant scope). A new or changed auth_value is stored encrypted under the deployment master key (a v2: / v3: envelope) on POST and on PATCH; the value is never returned. An auth_value that is blank, or an auth_type of none, stores nothing. If the gateway cannot encrypt it (no master key configured) the request answers a sanitised 500 and nothing is written. The submitted value is always taken as the literal credential: one that merely looks like a v2: / v3: envelope is encrypted again, never stored as sent. A PATCH that omits auth_value leaves the stored credential unchanged. Existing connectors that still hold a plain token keep working until the credential is next changed. The gateway reads a stored auth_value in either form: the plain token, or a master-key-encrypted ciphertext (a v2: / v3: envelope under the deployment master key). Both authenticate identically. A stored value that is shaped like a ciphertext but cannot be decrypted (corrupted, or sealed under a key this deployment does not hold) fails closed: the upstream is never called, nothing is sent in place of the credential, and tool listing and calls answer 424 with code: "connector_credential_required" and reason: "credential_unreadable" (the gateway could not decrypt the stored credential; re-enter it — no request was sent); the cause is logged server-side at ERR without the value. Repair it with PATCH /admin/v1/mcp/{id} carrying a new auth_value (PUT /admin/v1/mcp/{id}/credential is for per-user connectors and answers 400 credential_requires_user_scope for a tenant connector).

Catalog slug. A catalog_slug that is a directory entry is accepted for every caller who may create connectors. An unknown slug, a non-string slug, or an internal kind that is not in the directory (governed_query for anyone but a platform admin) is refused with 400 and unknown catalog_slug; nothing is created.

URL rules (each rejected with 400 and the message shown here; the connector is not created):

Input Rejected Message
server_url not an http:// / https:// URL (for example ftp://…), empty, over 500 bytes, or containing whitespace or control characters server_url must be an http(s):// URL (max 500 bytes)
server_url (any role) carries credentials in the authority (https://user:password@host/…, also an empty https://@host/…) — put the secret in auth_value. Only the authority is checked: ?tools=all and an @ in the path, query or fragment are accepted, and %40 is not a delimiter. Answers 400 with code server_url_userinfo server_url must not contain credentials (user:password@); put them in auth_value
server_url (members) a private, internal, loopback or link-local address, or a name that resolves to one — a member's connector may only reach the public internet, except a target whose exact host:port is on the connector's own tenant's connector egress hosts (platform-admin managed) server_url must be a public address (private/internal addresses aren't allowed)
server_url (shared / admin-provisioned) the same address check as a member's, with one extension for a tenant-visible shared connector: a private (RFC1918) target is accepted when it lies inside the tenant's private destination allowlist. Loopback, link-local, cloud-metadata and docker addresses are never accepted. A group-visible shared connector is public-only. A target whose exact host:port is in the connector's own tenant's connector egress hosts is also accepted (public, private or loopback address, http:// or https://); the deployment-wide AIG_SSRF_ALLOW is not consulted for connectors. Answers 400 with code server_url_not_public. A name that does not resolve at save time is accepted (it is checked again before every call); if the allowlist or the operator denylist cannot be read the save answers 503 and can be retried server_url must be a public address or a private address approved for this organization
oauth_authorize_url / oauth_token_url not an https:// URL that names a host (an http:// URL, https:// alone, https:///x, https://?q, https://#f, and an empty host such as https://@as.example/x or https://:443/x are refused), empty, over 2048 bytes, not valid UTF-8, containing whitespace or control characters, a non-string, or missing while any other oauth_* field is present (any oauth_* key means "OAuth intended", so both URLs are then required) oauth_authorize_url must be an https:// URL (max 2048 bytes) / oauth_token_url must be an https:// URL (max 2048 bytes)
oauth_authorize_url / oauth_token_url (member-owned connector) a private/internal address oauth_authorize_url must be a public address (private/internal addresses aren't allowed) / oauth_token_url must be a public address (private/internal addresses aren't allowed)

Manual OAuth fields (oauth_*) — accepted shape. The five fields are validated together on POST and PATCH. A field that is present but invalid is refused with 400 and code: "invalid_oauth_config"; it is never silently dropped, and nothing is created, changed or revoked. Every field must be a JSON string (a number, boolean, array or object is refused). A request without any oauth_* key is not an OAuth request and is not checked.

Field Accepted Absent / null / "" Message when refused
oauth_authorize_url, oauth_token_url https:// URL that names a host, 1–2048 bytes, valid UTF-8, no whitespace or control characters (CR, LF, TAB, NUL, DEL) required once any oauth_* key is present oauth_authorize_url must be an https:// URL (max 2048 bytes) / oauth_token_url must be an https:// URL (max 2048 bytes)
oauth_client_id non-blank string, valid UTF-8, at most 4096 bytes, no control characters; stored exactly as sent (not trimmed) required (oauth_client_id is required for an OAuth connector) oauth_client_id must be a string, oauth_client_id must not be blank, oauth_client_id must be valid UTF-8, at most 4096 bytes, without control characters
oauth_scopes "" (no scopes), or single-space-separated RFC 6749 scope-tokens, at most 4096 bytes (no leading, trailing or double space) absent or null: none supplied (on PATCH the stored value is kept; "" clears it) oauth_scopes must be a string, oauth_scopes must be space-separated RFC 6749 scope-tokens (max 4096 bytes)
oauth_client_secret non-blank string, valid UTF-8, at most 4096 bytes, no control characters no new secret supplied oauth_client_secret must be at most 4096 bytes, oauth_client_secret must be valid UTF-8 (the blank / control-character refusal keeps its existing message)

A server_url that is not valid UTF-8 is refused with the same server_url message as any other malformed URL.

A member's OAuth URLs must be public, exactly like a member's server_url (the same connector egress hosts exception applies). An admin (shared connector) may enter a private address only inside the tenant's private destination allowlist, exactly as for server_url — the token POST is SSRF-pinned at egress by the same check (see Internal identity providers). The tenant export strips any credentials from the authority of a stored server_url (only the authority; a path, query or fragment is never altered). The response status is 201 Created. The auth_value is not echoed back; the response carries auth_value_set instead.

Repeating a create is idempotent for a personal directory connector. When a caller creates a personal (scope user) connector with a non-templated catalog_slug and already owns a live connector of that slug, the call answers 200 (not 201) with the existing row unchanged plus "reused": true. Every other field of the request body (name, URL, credentials, gateway, tool policy) is ignored: nothing is applied to the existing row, and no second row is created, also under concurrent requests. Any 2xx is success. Templated entries (for example Microsoft 365 per tenant GUID, Salesforce per environment) legitimately exist more than once and are not deduplicated. The per-user connector cap is checked in the same locked step as the insert, so concurrent creates cannot exceed it.

Internal identity providers

A shared (admin-provisioned, tenant-visible) connector can sign in against an identity provider that lives inside your estate — a token endpoint on a private address, such as an in-house YouTrack Hub or Keycloak — provided the address lies inside the tenant's private destination allowlist. Its server-side OAuth token POST (the connect-time code exchange and every later refresh) uses the same address check as the connector's server_url, with no boot-time environment variable. A member connector and a group-visible shared connector stay public-only on both.

The private reach is not blind: the host is resolved, every returned address must be inside the allowlist and outside the operator denylist (siem_egress_deny_cidrs, which always wins), and the gateway dials the checked IP, so a DNS-rebind to another address is refused. Loopback, link-local, multicast, cloud-metadata (169.254.169.254, 100.100.100.200, 168.63.129.16), CGNAT (100.64.0.0/10), the documentation and benchmarking ranges and IPv6 addresses are never reachable. An allowlist is ignored while the operator denylist is empty or unreadable. The endpoint must present a publicly trusted TLS certificate — a private-CA or IP-SAN certificate is reported as a configuration error, not retried indefinitely.

Set up such a connector with manual OAuth (supply oauth_authorize_url, oauth_token_url, oauth_client_id, oauth_client_secret, oauth_scopes). Automatic discovery / Dynamic Client Registration does not work for an IdP whose metadata lives on the same private host — the metadata fetch is itself SSRF-blocked — so configure the endpoints by hand.

What a connecting user sees: if the token endpoint is loopback/link-local/metadata (a genuinely unreachable target), Connect does not send them to the IdP at all — GET /admin/v1/mcp/<id>/oauth/start bounces to the connectors page with oauth_error=setup_blocked_address. A private RFC1918 endpoint of a tenant-visible shared connector that is inside the tenant allowlist proceeds to the IdP and the exchange completes. (The tenant's connector egress hosts are the only per-deployment allowance for a connector's own targets, its token endpoint included; the deployment-wide AIG_SSRF_ALLOW is not consulted for connectors. The https://-only rule for discovered OAuth endpoints below is a separate check and still accepts a host on the tenant's connector egress list. The http:// relaxation for the discovery metadata URL and the issuer shape still reads the deployment allowlist and is not extended to a tenant-listed host; this can only narrow, because every discovery fetch is dialled through the tenant list as well.)

Templated connectors (server-side URL substitution)

Some directory connectors reach an endpoint whose URL varies per organization. For these the catalog ships a URL template containing one or more {placeholder} tokens, and the gateway substitutes rule-validated values into the trusted template server-side when you create the connector. The client's own server_url is always ignored and overwritten for a templated entry — the resolved host, scheme and path come only from the boot-constant template plus values that pass a strict allowlist, so a crafted value can never redirect the connection to another host. auth_type is forced to bearer and scope to user (these are per-user OAuth connectors).

Every placeholder is validated fail-closed; an unknown or malformed token never ships literally. The registered placeholders are:

  • {tenant_id} — Microsoft Entra Directory (tenant) GUID (used by Microsoft SharePoint, Microsoft OneDrive, Microsoft Graph). Supplied in the entra_tenant_id field.
    • Accepted shape: a canonical GUID — 32 hex digits in 8-4-4-4-12 form (e.g. 00000000-0000-0000-0000-000000000000). Nothing else.
    • Rejected (400 invalid tenant_id): the *.onmicrosoft.com domain form, values containing /, :, @, ?, #, %, \, whitespace or control characters, a GUID with a trailing path/query, an over- or under-length value, or a non-string (null/number/array). A missing value on such an entry returns 400 entra_tenant_id is required for this connector.
  • {environment} — Salesforce org environment. Supplied in the environment field; defaults to prod.
    • Accepted shape: exactly prod or sandbox (a closed enum, mapped server-side to the trusted path segment — your value never reaches the URL directly).
    • Rejected (400 invalid environment): any other value, including different casing (PROD), production, an already-mapped path (platform, sandbox/platform), the raw {environment}, or a value with surrounding whitespace/newlines.
  • {server_api_name} — Salesforce activated-server API name (e.g. sobject-reads, sobject-all). Supplied in the server_api_name field; defaults to sobject-reads.
    • Accepted shape: 1–64 characters of A–Z a–z 0–9 _ - only, substituted verbatim as the final path leaf.
    • Rejected (400 invalid server_api_name): an empty value, over 64 characters, or anything containing ., /, :, @, ?, #, %, \, whitespace, control characters (so it can neither add a path segment, traverse with .., nor change host/scheme), or a non-string.

OAuth URLs. How the OAuth authorize/token URLs are handled depends on whether the entry also templates them:

  • Tenant-templated OAuth (Microsoft Entra — SharePoint/OneDrive/Graph): the two OAuth URLs are derived from the same tenant GUID and overwritten server-side; a client-supplied oauth_authorize_url/oauth_token_url is ignored. You still supply your enterprise-app oauth_client_id (required, else 400), oauth_client_secret and oauth_scopes.
  • Manual OAuth (Salesforce): only the server_url is templated. The OAuth authorize/token URLs are your org's My Domain endpoints — you supply them (along with oauth_client_id/oauth_client_secret), and they are still SSRF-validated (a private/internal address is rejected with 400) and remain editable via PATCH. The server_url stays managed and immutable on PATCH.

Salesforce Hosted MCP

Salesforce rides the official Salesforce Hosted MCP Servers (GA 2026-04). The catalog templates the endpoint https://api.salesforce.com/platform/mcp/v1/{environment}/{server_api_name} — production resolves to .../v1/platform/<server> and sandbox to .../v1/sandbox/platform/<server>. The default preset is the read-only sObject reference server on production (sobject-reads), the safest starting point; override with environment/server_api_name for a sandbox org or a different activated server. oauth_scopes defaults to refresh_token offline_access mcp_api (the mandatory Hosted-MCP scope set) and is applied server-side when you omit it. Salesforce uses a manual External Client App (no Dynamic Client Registration): before connecting, an admin must be on Enterprise Edition or above, activate servers under Setup → MCP Servers, and create the External Client App (with PKCE required) to obtain the consumer key/secret and the My Domain OAuth URLs. Every MCP call runs as the authenticated Salesforce user, so that user's CRUD/field-level/sharing permissions apply.

Automatic OAuth setup (discovery, Client ID Metadata Document and Dynamic Client Registration)

A per-user OAuth connector needs only its server_url: the gateway reads the server's published OAuth metadata — RFC 9728 protected-resource metadata, then RFC 8414 authorization-server metadata (with the OpenID Connect discovery document as fallback) — and sets itself up as an OAuth client, in this order:

  1. Client ID Metadata Document (draft-ietf-oauth-client-id-metadata-document) — when the authorization server advertises client_id_metadata_document_supported as the JSON literal true (the string "true", 1 or any other value does not count). The gateway's client_id is then the URL of its public metadata document; nothing is registered, no secret exists and no registration limit applies. The server must not exclude the none authentication method in token_endpoint_auth_methods_supported (an absent or empty list is fine).
  2. Dynamic Client Registration (RFC 7591) — when the authorization server offers a registration_endpoint.
  3. Manual entry — otherwise (no_registration).

The SPA's Detect automatically action calls the preview route; Create then sends oauth_auto_register: true.

The gateway's client metadata document

GET /admin/auth/mcp/client-metadata.json — public, unauthenticated and read-only (an authorization server fetches it without credentials); any other method answers 404. It is the stored client_id of every connector set up through a Client ID Metadata Document, so the URL is derived from the configured MCP OAuth callback URL (auth.mcp_oauth_redirect_uri): same origin, fixed path. It requires an https callback URL; a deployment without one publishes no document (404, Cache-Control: no-store) and uses Dynamic Client Registration instead.

{
  "client_id": "https://gateway.example.com/admin/auth/mcp/client-metadata.json",
  "client_name": "Myra AI Workspace",
  "redirect_uris": ["https://gateway.example.com/admin/auth/mcp/callback"],
  "grant_types": ["authorization_code", "refresh_token"],
  "response_types": ["code"],
  "token_endpoint_auth_method": "none"
}

client_id equals the URL the document is served from, byte for byte. The client is public (PKCE, no client_secret). client_uri, logo_uri, tos_uri and policy_uri are added only when the admin SPA origin is configured over https. The response carries Cache-Control: public, max-age=3600 when the callback URL is operator-configured.

Previewing discovery

POST /admin/v1/mcp/oauth/discover

{ "server_url": "https://odoo.example.com/mcp" }

Read-only: discovers and validates the endpoints, registers nothing and writes nothing. Same caller requirements as creating a connector (MCP_AUTHOR; a viewer/demouser/finance user receives 403; no tenant → 403; refused with 403 while impersonating). It answers 503 when the deployment has no OAuth callback URL configured, and 429 (reason: "rate_limited") when the server offers only Dynamic Client Registration and the caller's registration limit is spent (a Client ID Metadata Document server is never refused for that limit) — so it never promises what the create would refuse. Returns 200:

{
  "authorize_url": "https://auth.odoo.example.com/authorize",
  "token_url": "https://auth.odoo.example.com/token",
  "scopes": "mcp.read mcp.write",
  "registration_supported": true
}

Refusals of the server_url (all 400, the same checks as creating a connector): absent or "" → server_url_required; null, a non-string, or a string that is not an http(s):// URL without whitespace or control characters (or not valid UTF-8) → invalid_server_url; more than 500 bytes → server_url_too_long; a URL carrying credentials (user:password@host) → server_url_userinfo.

scopes is the scope set the registration and the sign-in request (least privilege, MCP authorization spec order): the scope of the server's own 401 WWW-Authenticate: Bearer challenge, else the scopes_supported of its protected-resource metadata (RFC 9728), else none (the scope parameter is then omitted from the sign-in and the authorization server applies its default). The authorization server's own scopes_supported is no longer the default: it is used only as a logged fallback for a server that publishes no protected-resource metadata at all. The challenge is read with one short unauthenticated initialize request to the server (2.5 s timeout, 1 KiB read cap, same SSRF pin, only a 401 counts; any failure counts as "no challenge"). A malformed challenge scope is ignored as a whole, never partially used. Atlassian's v2 server publishes its scopes only in the resource metadata, so all of its advertised scopes (including offline_access, needed for a refresh token) are requested; the gateway's tool classes and approval holds, not the scope set, remain what limits what an agent may do. registration_supported: true means the gateway can set itself up (Client ID Metadata Document or Dynamic Client Registration). false means the endpoints are usable but the client ID/secret must be entered manually (the SPA pre-fills the two URLs and the scopes).

Creating with oauth_auto_register

With oauth_auto_register: true, POST /admin/v1/mcp repeats the discovery server-side (the client never supplies discovered values), registers the gateway as a client, and creates the connector with the discovered oauth_authorize_url, oauth_token_url, oauth_scopes and the issued oauth_client_id (the issued secret is stored encrypted and never returned). Discovery and registration happen after every other validation and before the insert — on any failure no connector is created. The connector's Connect then runs the normal per-user sign-in.

Input rules (each rejected with 400; nothing is discovered or registered):

Input Rejected Message
oauth_auto_register present (not null) but not a JSON boolean — for example "true", 1, {} oauth_auto_register must be a boolean
oauth_auto_register: true together with any oauth_* key, including one set to null oauth_auto_register cannot be combined with oauth_* fields
oauth_auto_register: true together with a catalog_slug (directory entries keep their own OAuth flow) oauth_auto_register is not available for directory connectors
oauth_auto_register: true a connector whose final scope is not user or whose auth_type is not bearer oauth_auto_register requires scope 'user' and auth_type 'bearer'
oauth_auto_register on PATCH /admin/v1/mcp/<ID> any non-null value (automatic registration is a create-time action) oauth_auto_register is only accepted when creating a connector
server_url (preview) absent, not an http:///https:// URL, empty, over 500 bytes, or containing whitespace or control characters server_url must be an http(s):// URL (max 500 bytes)
server_url (preview) carries credentials in the authority (https://user:password@host/…); answers 400 with code server_url_userinfo and nothing is dialled server_url must not contain credentials (user:password@); put them in auth_value

An absent or null oauth_auto_register, or false, keeps the ordinary create behaviour. When the deployment has no OAuth callback URL configured the create answers 503; if the issued client secret cannot be stored encrypted it answers 500 and no connector is created.

Failure reasons

A discovery or registration that cannot complete answers 422 with a reason from a closed set (a raw upstream error is never echoed):

{ "error": "oauth_discovery_failed", "reason": "no_registration" }
reason Meaning
no_metadata No usable OAuth metadata was found (every well-known document answered 404/410, was a complete non-JSON body, or advertised unusable endpoints). Any other HTTP answer (401, 403, 408, 429, 5xx, …) and a success whose body could not be read is not a definitive "no metadata" and reports unreachable instead.
no_registration Endpoints found, but the server supports neither a Client ID Metadata Document nor a usable registration_endpoint (create only — the preview reports this as registration_supported: false).
insecure_endpoint The advertised authorize or token URL is not https://, or the metadata itself would have to be fetched over plain http:// (an http:// server URL or an http:// authorization server) — in each case a deployment-allowlisted (AIG_SSRF_ALLOW) host excepted, and even then the fetch is dialled only if the tenant's connector egress list also lists that host:port (the metadata scheme rule is the one place the deployment allowlist still applies; it can only narrow). Metadata is never fetched in plaintext from a public host.
blocked_address The server, its authorization server, or a discovered endpoint is a private/internal address (or a URL the SSRF gate refuses as malformed, such as one with userinfo). For a member, the discovered authorize/token URLs must be public — the same rule as manually entered OAuth URLs.
unreachable No answer from the authorization server (connection failure, a name that does not resolve — including a discovered sign-in or registration host) the time budget ran out, or a metadata document answered a status other than 404/410 (for example 429, 403 or 503) or a success whose body could not be read (connection dropped, too large, read timeout) — retry later. A server that answers its protected-resource document while the authorization server it names does not is unreachable, not no_metadata.
registration_failed The registration endpoint refused or returned a malformed response (create only).

429 with reason: "rate_limited" is returned when a limit below is exceeded.

What is validated (untrusted metadata)

Every metadata document and registration response is treated as hostile input:

  • Every fetch is SSRF-gated and IP-pinned (each discovered URL is re-checked, not just server_url); redirects are not followed.
  • Authorization-server selection stops at the first protected-resource document that parses as JSON, even if it names no authorization_servers: the server's own origin is then tried as the issuer. A later well-known location is never consulted to "fill in" a missing field.
  • Response bodies are capped at 256 KiB; the whole discovery (and, on create, discovery plus registration) runs under one wall-clock budget — 20 s for the preview, 25 s for create — so the request always answers before the SPA's timeout.
  • An endpoint (authorization_endpoint, token_endpoint, registration_endpoint, and the authorization_servers issuer) must be an http(s) URL without whitespace or control characters and at most 2048 bytes; the authorize/token URLs must additionally be https:// unless the host:port is on the tenant's connector egress list. A malformed issuer is ignored (the server's own origin is tried instead).
  • scopes_supported keeps string elements only; a joined list over 4096 bytes makes the document unusable (never truncated into a partial scope set). The same rule applies to the resource's scopes_supported; a present but malformed one (not an array, an element that is empty or not an RFC 6749 scope-token (printable ASCII except space, " and \), or over the length cap) is ignored as a whole and logged, so the scope set stays empty rather than partial.
  • The sign-in uses PKCE with S256. When the server publishes protected-resource metadata, its resource must equal the connector's server_url (compared as a URL; the query string is ignored, so https://mcp.atlassian.com/v2/mcp?tools=all matches https://mcp.atlassian.com/v2/mcp). A matching value is stored on the connector and sent as the RFC 8707 resource parameter on the authorize request, the token exchange and every refresh. A metadata document that names a different or malformed resource is refused for auto-setup with the no_metadata reason; one that names none sends no resource. Manual-entry connectors and servers without protected-resource metadata send none. A resource in a request body is never accepted; and a stored resource that no longer matches the connector's server_url (the URL was changed) is refused at sign-in (config) and refresh rather than sent.
  • Moving a gateway auto-configured connector to another server_url through PATCH discards its client, authorize and token URLs, scopes and resource (the client is bound to the old server). The connector stays gateway-managed, so its supports_dcr is true in the connector list and the next Connect discovers and registers against the new server, storing that server's resource. A rename keeps everything. OAuth fields that the request merely repeats unchanged (as the edit dialog does on every save) count as no change; supplying a different client ID, authorize or token URL, or a new client secret makes the client manual and clears the stored resource.
  • Existing catalog connectors (Notion, Linear, Sentry, Runway, Atlassian) that still hold the unmodified auto-configured client are migrated to the narrowed scope and resource once; rows an admin edited are left alone.
  • The registration endpoint must pass the same scheme rule and the SSRF pin, or registration is reported as unsupported.
  • The issued client_id must be a string with at least one visible character, valid UTF-8, without control characters, at most 4096 bytes (the same rule as a manually entered oauth_client_id), and client_secret at most 4096 bytes. An absent (or null) client_secret means a public client; a client_secret of any other non-string type is a malformed registration (registration_failed).

Limits

Limit Scope Applies to
20 discovery runs per minute per user the preview, oauth_auto_register creates, and connect-time discovery
5 client registrations per 10 minutes per user (checked first) oauth_auto_register creates and connect-time registration
30 client registrations per 10 minutes per tenant as above

Registrations write a client at a third party from the gateway's address, hence the tighter limit; on create and connect, a user or tenant already at its registration limit is refused (create: 429; connect: the rate_limited redirect) when the server needs Dynamic Client Registration — the discovery runs first, because a Client ID Metadata Document server registers nothing and is never refused for the limit (the preview answers 429 only when registration would be offered via DCR). The same discovery, validation and limits apply when a directory connector that supports automatic registration self-registers on its first Connect (Starting a per-user OAuth connect); there a limit, and any setup failure, redirects the browser to /connectors?oauth_error=<code> (see the code table there).


One-hop connect (GET /admin/v1/mcp/connect)

GET /admin/v1/mcp/connect?slug=<catalog slug>&return_to=chat:<conversation id>

A top-level browser navigation (not a fetch call) used by the chat's connector card: one click creates or reuses the caller's own connector for a one-click directory entry, adds it to the conversation's connector selection, and sends the browser on to the provider's consent screen. Every outcome after authentication is a 302.

Not redirected: a request with no or an expired session is refused with 401 JSON, and a session under impersonation with 403 JSON, by the shared guards before the route body runs. The application therefore checks the session before navigating here and sends a signed-out user to the sign-in page.

Parameter Rules
slug required, exactly one value; 1 to 64 characters of a-z 0-9 _ -, starting with a letter or digit; must name a directory entry that the caller may create and that is one-click (needs no extra input such as a tenant GUID or API key). An unknown, repeated, malformed, templated or non-creatable slug is refused.
return_to required, exactly one value of the form chat:<conversation id> (a lowercase 36-character uuid, at most 64 bytes in total). The conversation must exist, not be deleted, and belong to the caller. A missing, repeated, malformed, foreign or unknown value is refused.

A query with more than 100 arguments is refused. All validation runs before anything is created or changed.

Cross-site guard. The route changes state on a GET, so it only serves a navigation that came from the web app itself. The request must carry exactly one Referer whose origin equals the web app's origin, and Sec-Fetch-Site, when present, must be same-origin or same-site (cross-site, none, a repeated or garbage value is refused). The guard is fail-closed: a request without a Referer (for example one sent from a page with Referrer-Policy: no-referrer, a typed-in URL or a bookmark) is refused rather than guessed at, and so is a deployment without a configured web-app origin. Accepted residual risk: a connect link rendered inside the web app (for example in a model answer) is same-site and passes the guard. The impact is bounded: it only touches the clicking user's own conversation, only one-click directory slugs, the provider still asks for consent, and the connector row is visible and removable under /connectors.

Refusals. Every refusal is a 302 to the web app with a closed ?oauth_error=<code>. Once return_to has been validated the target is the originating chat (/easy/c/<conversation id>?oauth_error=<code>); before that (guard, authentication, return_to itself) it is /connectors?oauth_error=<code>. &connector=<id> is appended to a chat target only once a connector id exists (from the selection step onward).

Code Cause
forbidden guard failed (no or foreign Referer, bad Sec-Fetch-Site), not signed in, no connector-author permission (viewer, demo user), no workspace, the connector owner is inactive
error return_to missing or invalid; a create refused for another reason (for example an invalid catalog entry)
not_found slug missing, malformed, unknown, not creatable by the caller, or not one-click
connector_limit the caller already owns the maximum number of personal connectors
rate_limited the OAuth-setup (discovery or registration) rate limit
config the OAuth callback URL is not configured, the connector's administrator-entered OAuth settings are incomplete (for example a client ID without a token or authorize URL), its resource does not match the server, or its token URL is neither https:// nor a host:port on the tenant's connector egress list
retry a transient storage or permission-read fault; retrying works
setup_* automatic OAuth setup failed, see Failure reasons

Reuse or create. The caller's own personal connector for the slug is reused if it exists, otherwise created from the directory entry (always scope user, owned by the caller, even for an admin). This is the same locked, idempotent step as POST /admin/v1/mcp above, so concurrent clicks yield exactly one connector. Precondition: at most one such (primary) connector per caller and slug; a tenant-shared connector of the same slug is not reused.

Selection. The connector id is appended to the conversation's mcp_connectors (see Per-conversation connector selection) under a row lock, so concurrent adds do not lose each other. A null selection (never chosen, every connector is in play) is left alone; an id already present is not repeated; an explicit selection that already holds 8 ids is left unchanged; a corrupt stored value is not touched.

Next hop. If the connector needs no authentication, or the caller already has a usable credential for it, the browser is redirected straight back to /easy/c/<conversation id>?connected=<connector id> (plus &selection=full when the connector will not be among the chat's tools on its next turn: an explicit selection that is full or does not include it, or a null selection where the connector is beyond the first 8 connected connectors in list order by name, created time, id). Otherwise the browser is redirected to the provider's authorize URL (starting automatic OAuth setup first when the entry needs it), and after consent the OAuth callback returns it to the same chat URL.

The setup_connector chat tool

In the web app chat the model can help a user connect a service through the built-in tool setup_connector. The tool never creates or changes a connector; it only points at the directory or asks the user to confirm.

When the user's message begins with an explicit request to connect one directory service, the gateway forces this tool on the first model call (Myra models only), so the confirmation card does not depend on the model's choice; see The setup_connector tool.

Input Type Rules
service string, required A connector name or slug, matched exactly against the directory catalog after normalising (lower-cased, every non-alphanumeric byte removed, so deep wiki and Deep-Wiki both resolve to deepwiki). At most 64 bytes, no control characters, valid UTF-8.

The tool is offered only to a signed-in person who may create connectors, and only on a chat turn that sent x-aig-turn-id (the web app chat). A plain API call never has it added to its tools, and neither does x-aig-extensions: 1 without a turn id (the model Playground), nor does an agent run or a request without a user, workspace or role. Otherwise it answers [error] setting up connectors is not available to you here.

Input Result handed back to the model
service absent [error] service is required: the connector name, e.g. "Todoist".
service not a string, empty, over 64 bytes, with control characters or invalid UTF-8 [error] service must be a connector name of at most 64 characters. (a missing or null service and a malformed one are both rejected, with different messages; so is a tool input that is not a JSON object, which gets this second message)
no directory entry has that name the list of connectors the caller can set up (The connector directory is empty. when the directory has none)
the caller has it connected and its tools were resolved and offered on this turn (including tools loadable via search_connector_tools under connector tool selection) Already connected: ...
the caller has it connected but its tools are not offered on this turn (deselected, blocked by the project's policy, dropped by discovery, or no tool loop) <Name> is connected, but its tools are not available in this chat right now (...). Check it on the Connectors page (/connectors?focus=<id>). (no card)
a one-click connector (no credentials needed or Dynamic Client Registration), the turn can deliver live frames, and the request sent an affirmative x-aig-connector-setup (1, true, yes or on; see the header table) one connector_setup frame, then Awaiting the user's confirmation in the app: a setup card for <Name> is shown...; a second call in the same reply answers A connector setup card was already shown in this reply
a one-click connector, but no card can be shown (no x-aig-connector-setup header or an unusable value, or no live channel) <Name> can be connected in one step on the Connectors page: /connectors — ask the user to open it and confirm there. No setup card is shown in this chat. (can be reconnected and /connectors?focus=<id> for an existing one); no frame
any other connector (credentials or templated) <Name> is set up on the Connectors page (/connectors); it needs credentials or settings that only that page can take. (/connectors?focus=<id> to reconnect an existing one)

Every result above (including the [error] answers, each of which ends with a period) is followed by one constant sentence, Answer the user in the language of their latest message., so the model's reply follows the user's language even when the result text itself is English. The tool's description tells the model to resolve any service name the user gives against the directory, in any language, and to call the tool before telling the user a service is unavailable.

The connector_setup frame. Sent only to a client that opted into the aig_* side channel (x-aig-turn-id) and announced that it renders the card with the request header x-aig-connector-setup: 1 (accepted 1/true/yes/on; opt-out 0/false/no/off; anything else, including a repeated header, is rejected, treated as absent and logged — see the header table). The web app chat (/easy) sends it on every send and renders the frame as a Connect card; other clients that do not send it get the Connectors link instead:

{"aig_status":"connector_setup","slug":"todoist","name":"Todoist","description_key":"mcp.catalog.todoist.description","example_actions":["mcp.catalog.todoist.action.a","mcp.catalog.todoist.action.b"],"host":"ai.todoist.net"}

description_key and example_actions are translation keys of the web app (example_actions is [] when the entry has none), host is the connector's server host. connector_id is present only when an existing connector needs to be reconnected. The card is a confirmation: the connector is created only when the user confirms it, through the normal POST /admin/v1/mcp rules above.

Getting a connector

Connector lookups (the connector routes listed here). A connector that does not exist or belongs to another tenant answers 404 { "error": "not found" }. If the connector row cannot be read (a database fault), the answer is 503 { "error": "temporarily unavailable; retry later" } — never the 404 (GET, PATCH, /trusted, DELETE, the credential GET / PUT / DELETE and /app-call; the OAuth connect start redirects with oauth_error=retry). POST /admin/v1/mcp/<ID>/call does not make this distinction yet: a read fault there still answers 404. A PATCH or /trusted change that was stored but whose read-back fails answers 200 { "id": "<ID>" } — re-read the connector for the full record.

GET /admin/v1/mcp/<ID>

auth_value is write-only. No route ever returns auth_value or oauth_client_secret, to anyone, admin included. Every read and write response (GET /mcp, GET /mcp/mine, this detail route, and the POST/PATCH responses) carries the derived boolean auth_value_set instead: true when a non-empty credential is stored on the connector row, false otherwise (including scope = "user" rows, whose credentials are held per user). Moving a tenant connector to scope = "user" (PATCH {"scope":"user"}) removes its shared credential; moving it back to "tenant" then requires a new auth_value for a bearer/header connector.

Access is not manage. This detail route is still restricted to a caller who may manage the connector: its owner, or a tenant_admin/admin. An admin-provisioned tenant-wide connector has no owner, so it is admin-only: a plain member, ki_manager, or viewer who does not own it receives 403. (A member reading their own scope = "user" connector gets 200 with auth_value_set: false — user scope rejects an auth_value at create.)

Ownership means the stored owner id equals the caller's user id, both non-empty strings. An empty owner id is treated as admin-provisioned (admin-managed only). A non-string owner id is member-owned and matches nobody: members can neither use nor manage that connector, and the member URL rules apply to it. The owned flag in the connector lists follows the same rule.


Updating a connector

PATCH /admin/v1/mcp/<ID>

Patchable fields: name, server_url, auth_type, auth_value, scope, tool_policy, and the OAuth fields (oauth_authorize_url, oauth_token_url, oauth_client_id, oauth_client_secret, oauth_scopes). The gateway_id binding is set at create time and is not patchable. A request body that is a JSON array ([], [1,2]) returns 400 malformed_body on every connector route; it is not read as an empty patch. The same scope/auth_value rules as create apply to the connector's resulting state, and so do the URL rules above (a non-http(s):// server_url, a private server_url outside the allowed range, a non-https:// or — for a member — private OAuth URL each return 400 with the same message, and the oauth_* fields follow the accepted-shape table above — an invalid present field is a 400 invalid_oauth_config, never dropped). A server_url that carries credentials in the authority is refused with 400 and code server_url_userinfo when the request changes it; resending the connector's unchanged stored server_url (for example alongside a rename) passes this check, so an existing legacy row stays editable. This check runs before the managed_field check (a directory connector's server_url PATCHed to a credential URL answers server_url_userinfo) and before a member's public-address check on a changed URL. A member who resends an unchanged stored URL that carries credentials is still refused by the member public-address check (server_url_not_public).

auth_value semantics on PATCH:

Request Result
auth_value absent or null the stored credential is kept, except when the final auth_type is none (tenant scope) or the final scope is user: then it is cleared
a new non-empty string (at most 4096 bytes) replaces the stored credential
"" with auth_type bearer/header 400 — a credential cannot be cleared that way
"" with auth_type: "none" stored credential is cleared
whitespace-only (" ") treated like ""
auth_type header (final type) with a value not of the form Header-Name: value 400 auth_type 'header' requires auth_value in the form 'Header-Name: value'; nothing changes
a non-string (number, boolean, object, array) 400 auth_value must be a string; nothing changes
longer than 4096 bytes 400 auth_value must be at most 4096 bytes
contains a control character (CR, LF, NUL, tab, ...) 400 auth_value must not contain control characters; nothing changes

Moving server_url or changing scope revokes every user's stored connection. A per-user connector's stored tokens were issued by, and for, one server. When a PATCH changes server_url to a different value (under any scope), or changes scope in either direction, the gateway deletes every user's stored credential for that connector before it writes the change. Affected users see the connector as not connected and reconnect. Other gateway nodes drop their cached copy of a credential within 60 seconds. If the revocation itself fails the request returns a 5xx and nothing is moved; retrying is safe. A rename, a policy edit, and a PATCH that re-sends the stored server_url or scope leave the stored credentials untouched.

Moving server_url can lower four-eyes. For a directory connector, the catalog's tool classes apply only on the directory entry's own (or legacy) address. A move onto that address can turn a tool the catalog lists as read from destructive into read, which lifts the two-approver hold on its unattended calls. If a move takes a tool below two approvers, it needs the MCP_TENANT_MANAGE permission. Without it the PATCH gets 403 four_eyes_requires_tenant_manage with "cause": "server_url", before any stored connection is revoked, and nothing changes. See Lowering four-eyes by reclassifying a tool for the rules. The check runs again under the connector's row lock, on the server_url stored at that moment, also when the request re-sends the server_url it read (a concurrent move is then judged too). A refusal under the lock comes after the revocation: the stored connections stay revoked and the credentials_revoked entry stays, but the connector keeps its old server_url. If the caller's permissions cannot be read, a PATCH that sends a server_url for a directory connector answers 503 and nothing changes.

Every stored credential is also bound to the server_url it was issued for. The revocation above is the first line of defence; the binding is the second, and it holds on every gateway node and when the server_url is changed by anything other than this PATCH. A credential is only ever sent to the address it was stored against. If the connector's server_url no longer matches, the credential is not used: the call asks the user to reconnect, GET /admin/v1/mcp/<ID>/credential reports exists: false, the connector reads as not connected, and the first real use deletes the stale credential (only that row, and only if it is still the one that was checked). A stored refresh token is not sent to the token URL either. Addresses are compared after normalisation: the scheme and host are case-insensitive, a default port (:443 for https, :80 for http), one trailing slash and a #fragment are ignored, and the query string is compared byte for byte. A credential with no recorded address (stored by an older gateway node during a rolling deploy) is never used and asks the user to reconnect. Credentials that exist at upgrade time are bound to the connector's current server_url only when the connector row shows no later server_url edit (created and never updated, or the credential was created more than 15 minutes after the last connector update); otherwise they are left unbound and the user reconnects. Known conservatism: this PATCH revokes on any textual change of server_url, including a respelling that the binding itself treats as the same address (for example HTTPS://Host/mcp for https://host/mcp); users reconnect in that case.

Changing the OAuth authorization server revokes every user's connection and requires the client secret again. Changing oauth_authorize_url, oauth_token_url or oauth_client_id to a different value points the connector at a different authorization server. The stored oauth_client_secret was issued by the old one and is never carried over: if a secret is stored, the PATCH must also carry a new non-blank oauth_client_secret, otherwise it returns 400 with code: "oauth_client_secret_required" and nothing changes. null, "" and an absent field all mean "no new secret supplied"; a non-string, a whitespace-only value, a value containing control characters or a value over 4096 bytes is refused with its own 400 (oauth_client_secret must be at most 4096 bytes for the size). A connector without a stored secret (a public PKCE client) needs none. When the change is accepted, the gateway deletes every user's stored credential for the connector before it writes the change, exactly as for a moved server_url, and records an audit event mcp_connector.credentials_revoked (fields and reasons only, never a secret), committed in the same transaction as the deletion of the stored connections: they are deleted and the entry exists, or neither. Its reasons list holds one or more of server_url (the server_url moved), scope (the scope changed) and oauth_endpoint (the authorize URL, token URL or client id changed). If the revocation or its audit entry cannot be written the request returns 503 (retryable) or a sanitised 500 and no connection is revoked; retrying is safe. The revocation is its own transaction and runs before the connector update, so a PATCH that is refused or fails after a successful revocation (for example while saving the group visibility) has still revoked the stored connections and keeps the credentials_revoked entry; the connector keeps its old endpoints and retrying completes the change. When one PATCH both revokes and changes the groups, the credentials_revoked entry is written before the mcp_connector.group_updated entry. Re-sending the stored values (a read-modify-write echo), or sending a new oauth_client_secret together with the unchanged stored authorize URL, token URL and client id, revokes nothing; a body that carries only oauth_client_secret is refused 400 invalid_oauth_config (any oauth_* key requires both URLs and the client id). A connect that was started before the change is refused when its callback arrives (config) if the token URL differs (the token URL it was started against is pinned in its state), so users restart the connect. A connect whose start state carries no pinned token URL (started by an older gateway node during a rolling deploy) is refused the same way. A stored refresh token is only ever sent to the token URL that issued it: each stored credential records the token URL it was issued by, and a refresh is sent only while that equals the connector's current oauth_token_url. A token request already in flight when the change is made can therefore still write a credential afterwards, but that credential stays bound to the old URL and its refresh token is never sent to the new token URL. The access token is not gated: such a credential keeps being sent to the connector's server_url until it expires (for an endpoint-only PATCH the server_url is unchanged; moving the server_url is the separate revocation described above), and only then does it read as expired and ask the user to reconnect; before that it still reads connected. This residual is bounded by the access token's lifetime. The status shown on GET /admin/v1/mcp, GET /admin/v1/mcp/mine and the setup_connector tool uses the same rule as the refresh itself: an expired credential counts as connected only if it has a refresh token bound to the connector's current oauth_token_url. Credentials stored before this binding existed are bound to the connector's token URL at upgrade time; a credential written by an older gateway node during a rolling deploy is unbound and also asks the user to reconnect. A response never carries oauth_client_secret; oauth_client_secret_set says whether one is stored.

http:// OAuth URLs on PATCH. An oauth_authorize_url / oauth_token_url that is byte-equal to the stored value is accepted as an echo (so a read-modify-write client or a rename still succeeds on a legacy row); an http:// URL that differs from the stored value is rejected 400 like on create. The echo exemption covers only the https:// rule: a re-sent stored value must still be non-empty, at most 2048 bytes, valid UTF-8 and free of whitespace and control characters. The same holds for the other re-sent stored OAuth fields: a stored hand-typed oauth_scopes (or oauth_client_id) that fails the rules above makes every save that echoes it a 400 invalid_oauth_config; the admin corrects the field in the same dialog.

A null auth_type or scope means "keep the row's current value". Changing auth_type between bearer and header on a tenant connector that already holds a credential requires a new auth_value in the same request (400 otherwise), because the stored secret was issued for the other header kind.

For a tenant-scoped (Microsoft 365) connector, the server_url, oauth_authorize_url and oauth_token_url are managed (derived from your Entra tenant ID) and immutable: a PATCH that changes any of them returns 400 … is managed for this connector and cannot be changed. Re-sending the stored value unchanged is allowed, so a rename or a scope/tool-policy edit still succeeds.

💡 Note (per-tool permissions on per-user connectors): setting a tool_policy needs the connector's tool list, which the editor loads with a tools/list handshake. For a scope = "user" connector (Slack/Gmail) this handshake runs on the caller's own stored per-user credential, so the editor's tool-enumeration control is now available when editing a saved per-user connector (previously it was hidden, so their tools could never be loaded and every remote tool — including write actions like Gmail "Create draft email" — stayed callable under "Allow by default"). Connect your own credential first, then load the tools and set per-tool exceptions; enforcement remains server-side at call time.

Switching a user-scope connector to auth_type = "none" additionally clears the caller's stored per-user credential. Because a stored credential is transmitted on presence alone, leaving it in place would keep egressing a personal/OAuth token on every tool call even though the connector is now declared no-auth; the switch therefore revokes it. This happens only on a real transition (the connector was not already none) and affects only the calling user's own credential — a rename or other edit of an already-none connector never touches a credential.


Agents that use a connector

GET /admin/v1/mcp/{cid}/agents lists your own agents that have consented to the connector, so you can see what a tool_policy change affects. The response is { connector_id, agents, truncated }; each agent has agent_id, gateway_id, name, slug, version and its contract for this connector (the same entry as in the agent contract). truncated is true when you own more than 500 agents: the limit applies to your agents before the consent filter, so a truncated list can miss agents that have consented. Only agents you own are returned, never other users' agents. A malformed id is 400 invalid_connector_id; a connector you cannot use is 404. The route is refused while impersonating (the shared personal-data guard), because it lists the impersonated user's own agents.

Reasons on blocked tools (tool_policy.reasons)

tool_policy accepts an optional reasons object that gives a short explanation for each blocked tool, for example { "default": "allow", "tools": { "export_pii": "block" }, "reasons": { "export_pii": "Exports customer PII" } }. Every key of tools and of reasons must be a non-empty tool name of at most 200 bytes, valid UTF-8, without control characters; anything else is 400 and nothing is stored. Each reasons key must also be a tool the policy blocks: "block" in tools, or any tool that tools does not allow when default is "block". A reason for a tool the policy allows is refused. Each value is a string of 1-300 bytes of valid UTF-8 without control characters. Anything else is 400. The reason is shown as the reason of a capped verdict in the agent contract.

Where the reason appears. Only the admin's text for the blocked tool of a connector the caller is bound to, in the caller's tenant — never the policy, other tools, or another connector's or tenant's reason:

Place What is shown
Agent contract (GET /admin/v1/gateways/{gw}/agents/{id}/contract, POST …/agents/contract/search) each tool { "tool", "verdict", "reason", "class" }; a blocked tool is verdict: "capped" with its reason (null = none) and its class (read / write / destructive, set by an admin or the catalog; null = not classified). A tool named only in reasons (blocked by default: "block") is listed too
Agent page (Connections, Tools and files) and the consent step the contract's capped tools, "Blocked by your organisation: ‹reason›"
Tool result for the model (chat and agent runs) Tool <name> is blocked by your organisation for the connector "<connector>": <reason>. Do not call it again; tell the user. (without a reason the sentence ends after the connector). The call is refused, nothing runs, and the chat stream reports tool_error with error: "tool_blocked"
MCP proxy (tools/call) message and data.block_reason, see MCP proxy — Errors

The reason is never written to a log line.

tool_policy carries no argument rules: a tool_policy.args key in a create or patch body (any value, null included) is refused with 400 tool_policy.args is not accepted here; use PUT /admin/v1/mcp/{cid}/arg-rules, and nothing is stored. Argument rules have exactly one writer, described under Setting argument rules.

In the connector editor. After you load a connector's tools with Test connection, the tool permissions show as one card, grouped into Read, Write, Delete and Not classified. Untick a tool to block it. A reason field then appears under that tool. It is optional and holds up to 300 bytes (an umlaut counts as 2 bytes); the editor shows the byte count and will not save a reason that is too long, contains a line break or other control character, or is not valid UTF-8. Reasons you stored earlier are kept when you save without opening the tool list. A reason is dropped when its tool is allowed again. The editor loads the unfiltered tool list (see include_blocked above), so a blocked tool keeps its kind and stays in its Read, Write or Delete group with a "‹kind› · blocked" tag. Before a list is loaded, a tool with a saved setting is grouped by the class an admin saved (tool_classes in the connector detail). Only a tool the loaded list proves the connector no longer offers appears under Not classified, and the page says so; nothing is claimed before a list is loaded or when the list was cut at 500 tools. The limits apply to everyone who uses the connector.

Tool permission policy v2 (tool_policy with version: 2)

Deprecated: the v1 document and the four-eyes alias. Tool permission policy v2 replaces the older ways of setting tool permissions. They still work exactly as before, but they are deprecated and will be removed after the sunset date. Every answer to one of these requests carries the headers Deprecation: @1794268800 and Sunset: Mon, 01 Mar 2027 00:00:00 GMT (RFC 9745 and RFC 8594). The connector POST and PATCH carry them on every answer given after the body is read, refusals included. An answer given before the body is read carries none, for example a 401 without a session or a 404 for a connector the caller cannot see. The four-eyes alias carries them on every answer it gives:

  • a POST /admin/v1/mcp or PATCH /admin/v1/mcp/{id} body whose tool_policy has no version (the v1 document {default, tools, reasons}); send a v2 document instead;
  • PATCH /admin/v1/mcp/{id}/four-eyes; set approval_2 on the class lines or tools of a v2 document instead;
  • the read-only four_eyes_required field of a connector response is deprecated too. It is derived from the document, and the field will be removed with the rest. Read the unattended cells of tool_policy instead.

A v2 body, or a body without tool_policy, carries no deprecation headers. The agent fields that this policy replaces are listed in Agents › Tool permission policy.

A tool_policy body that carries "version": 2 sets one level per tool for each of two columns: interactive (a person is at the keyboard: chat, Try it, plain chat with connectors) and unattended (everything else: scheduled, triggered and webhook runs, workflows, user and service API tokens, delegated children, chat-bridge turns, and the MCP proxy).

{
  "version": 2,
  "classes": {
    "read":        { "interactive": "allow",   "unattended": "allow" },
    "write":       { "interactive": "allow",   "unattended": "approval_1" },
    "destructive": { "interactive": "confirm", "unattended": "approval_1" }
  },
  "tools": {
    "delete_case": { "interactive": "approval", "unattended": "approval_2" },
    "export_pii":  { "interactive": "block",    "unattended": "block" }
  },
  "reasons":   { "export_pii": "Exports customer PII" },
  "approvers": { "interactive": { "users": ["<user id>", "<user id>"], "roles": ["governance_manage"] } }
}
Column Levels (least to most strict)
interactive allow (the tool runs), confirm (the user confirms it in the chat), approval (someone else approves it), block
unattended allow, approval_1 (one approver), approval_2 (two different approvers, four-eyes), block
  • Class defaults and overrides. classes sets the level of every tool of a class (the tool's class comes from Tool classes: an admin entry, then the catalog, else destructive). A tools entry overrides its class default for the columns it names. A class cell the body leaves out gets the built-in default: interactive read / write allow, destructive confirm; unattended read allow, write / destructive approval_1. The stored document always carries all three classes.
  • Accepted shape. Only the keys version (exactly the number 2), classes (keys read, write, destructive), tools, reasons and approvers (only interactive, with users = at most 50 user ids and roles = only "governance_manage"). Each cell is an object with interactive and/or unattended; a tool cell must name at least one. Tool names follow the same rule as the v1 keys (non-empty, at most 200 bytes, valid UTF-8, no control characters), at most 500 tools.
  • Rejected (400, nothing stored). An unknown level, or a level of the other column ("unattended": "approval", "interactive": "approval_1") → invalid_tool_policy. An unknown key, a version other than 2, a v1 key (default) in a v2 body → invalid_tool_policy. A reasons key for a tool the policy blocks in neither column (by its entry or by its class) → invalid_tool_policy; the reason rule is the one above (1-300 bytes, valid UTF-8, no control characters). An approver user id that is not an active user of your organisation → tool_policy_unknown_approver. Interactive approval anywhere (a class or a tool) with fewer than two possible approvers → tool_policy_no_approver: possible approvers are the listed users plus, with the governance_manage role, the organisation's users holding GOVERNANCE_MANAGE; two are needed so there is always one besides the person asking. A failed approver read is a 503 (retry).
  • Stored and returned. The canonical document is stored as sent (class cells filled) and GET /admin/v1/mcp/{id} returns it as tool_policy. four_eyes_required is written in the same update as a derived, read-only flag: true when any unattended cell is approval_2. It stays in responses for one release. It does not decide a hold: a held call needs two approvers when its own unattended level is approval_2 (or the organisation's level for it is, when the legacy consent exemption lifted the approval and untrusted input holds the call again).
  • Lowering four-eyes in the policy body is the tenant admin's. A v2 body that needs fewer approvers than the stored policy needs the MCP_TENANT_MANAGE permission, as PATCH /mcp/{id}/four-eyes does: anyone else gets 403 four_eyes_requires_tenant_manage with "cause": "tool_policy" and nothing is stored. "Fewer" means: a class line or tool that is approval_2 now (or, for a v1 policy with four-eyes on, every write / delete approval) set to less than approval_2, or a body whose derived four_eyes_required would be false while it is true now (also when the stored policy cannot be read). The check is repeated under the row lock, so a concurrent change cannot slip in between. Raising it needs no extra permission. Reclassifying a tool so that it falls below approval_2 is guarded the same way: see Lowering four-eyes by reclassifying a tool.
  • The four-eyes refusal of PATCH /mcp/{id} names its cause. Its body is { "code": "four_eyes_requires_tenant_manage", "cause": "tool_policy" | "server_url", "error": "…" }: tool_policy when the sent v2 policy needs fewer approvers, server_url when the sent server_url of a directory connector would let the catalog's tool classes lower a tool (also an echoed server_url after a concurrent move). When one body does both, the policy is checked first and the cause is tool_policy. A client reads only these two values; any other or a missing cause means "not known", and the client shows its generic refusal message, never one that blames a particular change. The tool-classes writers (PUT / DELETE /mcp/{id}/tool-classes) send no cause.
  • v1 over v2 (409). Once a connector stores a v2 document, a v1 body (no version) is refused with 409 tool_policy_version_conflict and nothing is stored, so a client that only knows the v1 form cannot silently drop the per-column levels, class blocks and approvers. Send a v2 body instead.
  • Audit. A PATCH that carries tool_policy (v1 or v2) is audited as mcp_connector.tool_policy_set with the stored document and four_eyes_required before and after; the change and its entry are committed together.
  • Blocked tools. A tool blocked in both columns is not offered at all (removed from tools/list, capped in the agent contract), exactly as a v1 block. A tool blocked in one column only is offered and refused with the blocked-tool reason (tool_blocked) on the surfaces of that column.
  • Today's v1 document still works. A body without version is the v1 document above and is stored unchanged. It reads as: a blocked tool is block in both columns; every other tool takes its class default (an explicit v1 "allow" never lifted the unattended approval, so it keeps it); four_eyes_required = true makes the unattended approval approval_2. A stored document that is neither v1 nor v2 blocks every tool in both columns.
  • Enforcement. Every level is enforced from this policy, combined with the agent's own tightening (see Agents). Unattended (agent runs, API-token invokes, chat-bridge turns, the MCP proxy): approval_1 / approval_2 hold the call for one / two approvers, block refuses it. Interactive (chat with connectors, Try it): allow runs, block refuses, confirm asks the user first with a confirmation card (see Chat tool confirmation; where no card can be shown, the call is refused with interactive_confirm); interim: approval refuses the call (interactive_approval, nothing runs) until the chat serves it. In a conversation with untrusted content, a write, delete or outbound tool at allow asks first too. A v1 document's four_eyes_required = true still makes every hold on the connector need two approvers. A workflow Connector node, connector sync and an administrator's own test call keep the block levels only, as before.

The agent's own tightening of this policy (tool_config.tool_policy, only stricter) and the contract's effective policy per tool are described in Agents — Tool permission policy.

Source policy (tool_policy with version: 3)

A version 3 document is a version 2 document plus source: the connector's trust class and, optionally, single cells that override it. The trust class decides what personal data means for this connector: whether it is masked going to the connector, whether it is masked coming back, and whether a run whose result contains personal data from this connector may be delivered to an external channel (webhooks, Mattermost / Teams / Slack, outside e-mail, other external systems). Internal delivery (the owner's e-mail, e-mail to members of your organisation, the conversation, the in-app run result) is never limited by it. The trust class governs personal data only: it never changes whether a result counts as untrusted content (every connector result still does). Built-in sources (web search, web pages, knowledge and files) are set per gateway: see Gateways — built-in sources.

{
  "version": 3,
  "classes": { "...": "..." }, "tools": { "...": "..." },
  "source": { "trust": "internal", "pii": { "delivery": "approval_1" }, "keywords": { "input": "block", "result": "flag" } }
}
Trust class Personal data going to the connector (pii.input) Coming back (pii.result) Delivery to external channels (pii.delivery)
internal (an internal system) allow (sent as is) mask allow (deliver everywhere)
external (an external service or the public web; the default) mask mask internal_only
untrusted mask mask block (do not deliver)
  • Levels, loose to strict: pii.input allow < mask < block; pii.result allow < mask; pii.delivery allow < internal_only < approval_1 < approval_2 < block; keywords.input allow < flag < block; keywords.result allow < flag < withhold. A keyword cell nobody sets takes the gateway's keyword / regex detectors (a detector that blocks gives block / withhold, one that scrubs or flags gives flag; none gives allow).
  • Accepted shape. source has only the keys trust (one of the three classes; absent = external), pii (keys input, result, delivery) and keywords (keys input, result), each cell one of its levels or JSON null (not set). source, pii and keywords must be objects (an array, [] included, is refused). source is accepted only with "version": 3. The four-eyes switch (PATCH /mcp/{id}/four-eyes) flips a version 3 document's approvals like a version 2 one and keeps its source.
  • Rejected (400 invalid_tool_policy, nothing stored). An unknown trust class or level, an unknown key, a level of another column ("result": "block"), source in a version 2 body.
  • Below the organisation's minimum (400 source_policy_below_floor). A cell you set explicitly that is looser than the tenant floor is refused: { "code": "source_policy_below_floor", "field": "tool_policy.source.pii.delivery", "floor": "approval_2", "error": "…" }. A trust class alone is never refused: the floor raises the cells it derives every time they are read, the stored document is not changed.
  • Lowering needs approval (202). A change that makes any cell looser than it is stored now (also through the trust class: external → internal, untrusted → external; or approval_2 → approval_1, removing a stricter override; removing a keyword override counts as lowering too, because the gateway default it falls back to can be allow) is a configuration change for a second person, as the trusted-subprocessor flag was. PATCH /admin/v1/mcp/{id} answers 202 { "status": "pending_approval", "approval_id": "…", "cause": "source_policy_lowered", "field": "tool_policy.source.pii.delivery" }, nothing is written and the stored document stays in force until the request is approved in Config approvals (operation set_source). This happens whether or not your organisation turned config approval on. Only a user with GOVERNANCE_MANAGE may ask for it: anyone else gets 403 source_policy_lowering_forbidden. The body must carry tool_policy alone, otherwise 400 source_policy_requires_separate_patch (a held change writes nothing, so another field would be lost). The body's other checks come first: a version conflict (409) or a body that also lowers four-eyes without MCP_TENANT_MANAGE (403 four_eyes_requires_tenant_manage) is refused and nothing is held. A platform administrator applies it directly. A tightening, and a body that leaves the cells as they are, is saved at once. When a concurrent change turns the body into a lowering between the check and the write, the write is refused with 409 source_policy_changed; reload and save again.
  • When the approval is applied the held document is checked again. The connector's stored policy (and its four-eyes flag) must still be the one the request was made against, otherwise the approval ends apply_failed with reason source_policy_stale and nothing is written (submit a new request: a later edit is never reverted). The document must still be valid for the connector's current tool classes (invalid_tool_policy), the approvers it names must still be active members (tool_policy_unknown_approver, tool_policy_no_approver), and none of its explicit cells may have fallen below a floor raised in the meantime (source_policy_below_floor).
  • Create. POST /admin/v1/mcp with a source looser than external answers 409 source_policy_needs_approval (a connector that does not exist yet cannot wait for an approval): create it with the default and lower it with PATCH. A platform administrator creates it as sent. The floor rule applies.
  • Older documents. A version 1 or 2 document, or a version 3 document without source, reads as external with no overrides, which is what every connector did before. A version 2 body sent to a connector that stores version 3 is refused with 409 tool_policy_version_conflict (it would drop the source policy); send version 3.
  • Trusted subprocessor. The connector's trusted_subprocessor flag (see PII protection on outbound tool-call arguments) reads as pii.input = allow with the source organisation, unless the source sets pii.input itself. Nothing is rewritten. PATCH /admin/v1/mcp/{id}/trusted keeps working for one more release.
  • Delivery. pii.delivery decides the run's delivery disposition: each personal-data mask in a tool result counts with the delivery level of the connector it came from, and the run takes the strictest one. approval_1 / approval_2 hold the external channel like internal_only until releasing a held delivery ships.
  • pii.input at run time (the tool-call arguments; see PII protection on outbound tool-call arguments). allow: the request's masked values are restored in the arguments sent and the personal-data refusal is skipped; under a PII mandate (pii_masking_enforced, a pii_mandatory project, a forced mandate) nothing is restored and the arguments are sent unchanged. mask: the arguments are refused when they carry a protected identifier on a PII-active gateway or under a mandate (pii_egress_blocked). block: the arguments are refused when they carry personal data (a protected identifier or a masked value of the request) on every gateway, reason guardrail_input:pii; arguments that cannot be checked keep pii_egress_blocked.
  • pii.result at run time. allow: the gateway's PII maskers skip this connector's results on the tool-result scan; never under a PII mandate (pii_masking_enforced locks it at mask through the floor, a pii_mandatory project or a forced mandate masks too). The unmasked result counts for the delivery disposition like a masked one. mask: results are masked reversibly.
  • Keyword cells at run time. Unset (or equal to the gateway's default), each keyword / regex detector keeps its own action (on arguments a scrub detector flags; arguments are never rewritten). keywords.input: block / keywords.result: withhold stricter than the default: any match of an enabled keyword / regex detector refuses the call (guardrail_input:keywords) / withholds the result. flag: a block detector's match is logged with the place instead (a scrub detector still masks a result). allow: the detectors skip the connector. A cell never enables a detector the gateway lacks.
  • Fixed families. Prompt injection, jailbreak, content safety and the untrusted-content marking are not part of source (an unknown key is 400 invalid_tool_policy); no source document changes them.
  • A connector whose row cannot be read at run time is held to the strictest cells (pii.input: block, pii.result: mask, pii.delivery: block, keywords.input: block, keywords.result: withhold).
  • Refusals by pii.input: block or a keyword cell are access decisions with reason guardrail_input:pii / guardrail_input:keywords, rule_id source_policy:<family>.input:<level> and the place in guardrail_where, without argument text (see Access decisions — Guardrail refusals). The model gets a value-free text naming the family and the place; the MCP proxy answers -32001 access denied with data.reason guardrail_input:pii or guardrail_input:keywords. The rules for all sources, including the built-in ones, are in Guardrails — Sources and trust classes.
  • Workflows. A workflow Connector node applies every cell with the same rules, as the workflow owner (the owner's role rules apply; no masked values to restore): pii.input and keywords.input on the arguments, answering 403 connector_pii_blocked / connector_keywords_blocked; keywords.result on the result on every gateway (the keyword / regex rules as defined), and pii.result allow stores the result unmasked for the owner, never under pii_masking_enforced. An unmasked result counts in the run's delivery disposition under pii.delivery and makes the run's step outputs owner-only; a masked one does not count (its placeholders are never restored) (see Workflows — Connector node).
  • The organisation's minimum as the editor shows it. GET /admin/v1/mcp/source-floor answers the tenant floor as the levels every read applies: { "pii": { "delivery": "approval_2" }, "keywords": {}, "pii_masking_enforced": true, "unreadable": false }. A cell the floor leaves free is absent; pii_masking_enforced folds in as pii.result: "mask"; a stored floor that cannot be read answers every cell at its strictest level with unreadable: true. Any member of the organisation may read it (it locks cells in the connector editor). No query parameters. 403 no_tenant without an organisation; a read fault is the retryable 503, never an empty floor.
  • Audit. A saved change is audited as mcp_connector.tool_policy_set (the document before and after); a held one as config_approval.requested, and its approval as mcp_connector.tool_policy_set under the person who asked.

Deleting a connector

DELETE /admin/v1/mcp/<ID>

The response is 204 No Content.

Error codes

Every JSON error on the connector routes (/admin/v1/mcp...) carries a top-level code next to the unchanged HTTP status and error text. Branch on code; never parse error.

invalid_json and invalid_handoff replace the earlier json_invalid and handoff_invalid; the error text is unchanged. The gateway sends only the new names; during a rolling deploy a client may briefly see either spelling, so a client that matched the old name should switch to the new one (or accept both while the deploy runs).

Route group Codes (status)
Create and update (POST /mcp, PATCH /mcp/{id}) invalid_visibility, invalid_group_ids, too_many_group_ids, invalid_connector_parameters, name_required, invalid_name, name_too_long, server_url_required, invalid_server_url, server_url_too_long, server_url_not_public, server_url_userinfo, invalid_scope, invalid_auth_type, invalid_auth_value, invalid_auth_value_shape, auth_value_required, auth_value_not_allowed, auth_value_not_allowed_for_user_scope, auth_type_change_requires_value, invalid_oauth_config, oauth_client_secret_required, invalid_tool_policy, tool_policy_no_approver, tool_policy_unknown_approver, managed_field, entra_tenant_id_required, unknown_catalog_slug, invalid_oauth_auto_register (not a boolean), oauth_auto_register_create_only (sent on update), oauth_auto_register_conflict, oauth_auto_register_unavailable (directory connector), oauth_auto_register_requires_user_bearer, trusted_subprocessor_required / invalid_trusted_subprocessor, four_eyes_required_required / invalid_four_eyes_required (absent / null or not a boolean), connector_limit_reached, duplicate_key (all 400); four_eyes_requires_tenant_manage (403, update); tool_policy_version_conflict (409, update); source_policy_below_floor, source_policy_requires_separate_patch (400); source_policy_lowering_forbidden (403, update); source_policy_needs_approval (409, create); source_policy_changed (409, update); body_too_large (413)
OAuth set-up on create/update oauth_discovery_failed (422), oauth_redirect_unconfigured (503), rate_limited (429)
Tool classes (/mcp/{id}/tool-classes) classes_required (no classes key), invalid_classes (classes is not an object, or is {} and names no tool), too_many_classes, invalid_class, invalid_tool_name, invalid_include_blocked, invalid_grandfathered, duplicate_key (400); tool_classes_too_large (400), four_eyes_requires_tenant_manage (403, PUT and DELETE), tool_classes_malformed (409)
Tool list (GET /mcp/{id}/tools) invalid_include_blocked, invalid_grandfathered (400); forbidden (403, include_blocked by a non-owner); access_denied (403); not_found (404); connector_credential_required (424); connector_upstream (502)
Argument rules invalid_tool_name, invalid_rule, unknown_tool, unknown_argument, number_not_exact, number_invalid, arg_rules_too_large, duplicate_key (400); access_denied (403); not_found (404); arg_rules_malformed (409); tool_schema_unusable (422); connector_credential_required (424); arg_rules_encode_failed (500); connector_upstream (502)
Calling a connector (JSON-RPC proxy) invalid_jsonrpc_request, include_blocked_not_allowed, duplicate_key (400, a client body with a repeated key; see "A repeated key in a request body is refused"); access_denied, tool_blocked (403); arg_rejected (422); credential_required, credential_expired (409); connector_credential_required (424); mcp_init_error, mcp_raw_unavailable, invalid_json, number_invalid, number_not_exact, number_too_long, duplicate_key (upstream reply), mcp_encode_failed, connector_upstream (502 or the upstream's own failure status; kind names the cause)
App calls app_call_fields_required, task_id_required, duplicate_key (400); invalid_app_token, app_token_scope_mismatch (401); app_not_available, tool_not_allowed, task_not_in_scope, not_conversation_owner (403); conversation_not_found (404); rate_limited (429); connector_upstream (the upstream call failed; kind names the cause)
Credential (/mcp/{id}/credential) credential_requires_user_scope, auth_value_required, invalid_auth_value, invalid_auth_value_shape, invalid_expires_at, duplicate_key (400); access_denied (403); connector_credential_required (424); connector_upstream (502)
Native-app connect (POST /mcp/connect, POST /mcp/{id}/oauth/start, POST /mcp/oauth/app-redeem) a refusal with a redirect carries the same closed oauth_error value as its error (for example forbidden 403, not_found 404, connector_limit 409, retry / config 503, setup_* 502, error 400); invalid_field with field app_challenge, app_return, code or verifier (400); invalid_handoff, verifier_mismatch (400); rate_limited (429); retry (503)
Any route unauthenticated (401), forbidden (403), no_tenant (403), not_found (404)

A connector id from another tenant, an unknown id and a private connector the caller may not use all return the same 404 { "error": "not found", "code": "not_found" }, byte for byte, so the response never reveals that a foreign id exists. A caller whose session has no tenant, or a connector record with no tenant, is treated as foreign: the same 404, and no OAuth sign-in redirect is issued.

Exceptions, which carry no new code:

  • The OAuth start and callback routes answer with a 302 redirect and a closed ?oauth_error= value, not JSON.
  • Storage faults (503 or 500) and the audited cross-tenant 404 keep their existing shared bodies.
  • A gateway-id refusal on the connector routes keeps its existing gateway_id_required or gateway_id_invalid code.
  • The 400 { "error": "content type must be application/json" } of the native-app connect routes is the shared content-type refusal and carries no code.

Outbound address validation

Every URL the gateway fetches on a tenant's behalf (connector URLs, webhooks, SIEM targets, OAuth discovery) goes through one address check, built from the IANA special-purpose address registries. One table drives every caller, so the same address gets the same verdict everywhere. Connector calls are checked at save time and again before every call, for member and shared (admin-provisioned) connectors alike; a tenant-visible shared connector may additionally reach a private address inside the tenant's private destination allowlist. A refusal reason is written to the gateway log only, never returned to the client. A shared connector saved before this check that points at a now-refused address stays listed but every call to it is refused until an admin corrects the URL.

  • Accepted: a host name, or an address that is in none of the special-purpose ranges. A name is still checked against its resolved addresses at connect time.
  • Refused: loopback, unspecified, link-local, cloud-metadata (169.254.0.0/16, 100.100.100.200, 168.63.129.16), documentation (192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24, 2001:db8::/32), benchmarking (198.18.0.0/15), multicast, reserved (240.0.0.0/4), IPv6 unique-local (fc00::/7), IPv4-compatible IPv6 (::a.b.c.d), and IPv6 outside global unicast (2000::/3).
  • Private ranges (RFC1918 and carrier-grade NAT 100.64.0.0/10): refused unless the caller is a tenant-owned destination that is allowed to reach a private network: a syslog SIEM host with self-serve private targets on, or a tenant-visible shared connector whose address is inside the tenant's private destination allowlist.
  • Cloud-metadata addresses are never reachable. This includes 100.100.100.200 and 168.63.129.16.
  • Translate forms (IPv4-mapped ::ffff:a.b.c.d, the SIIT form ::ffff:0:a.b.c.d, NAT64 64:ff9b::/96 and 6to4 2002::/16) are judged by the IPv4 address they carry. [::ffff:10.0.0.1] is therefore private, and [64:ff9b::7f00:1] is loopback.
  • Ports: an explicit port must be 1-65535; :0 and larger values are refused as malformed.
  • Shared connectors and IPv6 literals: a private target of a shared connector must be a host name or an IPv4 literal; an IPv6 literal URL is refused (fail closed).
  • Malformed hosts are refused, not guessed at: an empty label, doubled or leading dot, a zone id (%), whitespace, stray brackets, or a numeric spelling that does not parse. Decimal, hex and octal IPv4 spellings (2130706433, 0x7f000001, 0177.0.0.1) are decoded and judged like the dotted form. A host whose last label looks numeric but does not decode (for example foo.0xzz) is refused as malformed.
  • Deliberately refused although globally routable: the AS112 ranges 192.31.196.0/24 and 192.175.48.0/24, 2620:4f:8000::/48, and the AMT range 192.52.193.0/24. No connector, webhook or SIEM target needs them.

The operator siem_egress_deny_cidrs list is applied in addition, and also to the IPv4 address inside a translate form.


Calling a connector (JSON-RPC proxy)

POST /admin/v1/mcp/<ID>/call

Proxies a JSON-RPC 2.0 request body to the configured server_url using the connector's authentication. The caller must have access to the connector's tenant.

Request body — verbatim JSON-RPC 2.0:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/list",
  "params": {}
}

The response is the verbatim JSON-RPC 2.0 response from the upstream server.

The upstream is untrusted: its reply is decoded fail-closed. A response is accepted only when it is a real JSON-RPC response — a JSON object carrying a result or error. Anything else — a bare scalar (42/true/"x"/null), a top-level JSON array, or a non-response object (e.g. a bare notification) — is rejected as empty or undecodable rather than acted on. This holds identically for a plain application/json reply and a Streamable-HTTP text/event-stream reply: over SSE, interleaved progress/log notifications are skipped and only the response event is returned; a stream that carries no response event (notification-only) fails closed, never returning a notification in its place.

The response body is read-bounded to guard the worker against a hostile or buggy server: the gateway reads at most 32 MiB of the upstream reply (enough for a rich tools/list — the 500-tool × ≤16 KB-schema budget above is ≈10–12 MiB — with generous headroom). A reply that exceeds that cap (by an honest Content-Length or by streaming past it) is aborted at the read and treated as empty or undecodable — it is never buffered whole into memory. When the connector is invoked from the server-side inference tool-loop (referencing it by id in tools, not this proxy), the whole tools/call is additionally bounded by a 90-second total deadline — enforced across both the response-header read and the response-body read — so a slow-drip server that dribbles either the status line / headers or the body one byte at a time (resetting the per-receive socket timeout on each byte) cannot pin the turn. The discovery tools/list probe and this admin /call proxy carry their own total deadlines (30 s and 60 s) on the same basis.

A tools/call whose arguments break a catalog argument bound returns 422 { "error": "arg_rejected", "tool", "arg", "min", "max", "integer", "connector_id" } and is not forwarded upstream. When the arguments value itself is not a JSON object, arg is "arguments" and min / max / integer are omitted.

Unfiltered tool list for policy editors (?include_blocked=1). By default tools/list through this proxy hides every tool the connector's tool_policy blocks. A policy editor can add the query parameter include_blocked=1 to POST /admin/v1/mcp/{id}/call to get the unfiltered list. Each tool then carries a boolean blocked: true when the policy blocks it (or the stored policy cannot be read), false otherwise. Every tool with a string name carries the gateway-set blocked; an upstream blocked key is overwritten, or removed on an entry without a string name. Policy editors are tenant admins and the owner of a private connector; they are the people who can change the policy. Rules:

Request Result
parameter absent the filtered list, as before
include_blocked=1, caller may edit the policy 200, the unfiltered list with blocked on every tool
include_blocked=1, caller may not edit the policy (for example a member on a shared connector) 403 forbidden, nothing is sent upstream
any other value (0, true, empty, repeated, and so on) 400 include_blocked must be 1, whoever asks
include_blocked=1 with a method other than tools/list 400 include_blocked is only valid for tools/list

Only this parameter on this route returns blocked tools. Chat, agents, workflows, the tool loop, the consent card and GET /admin/v1/mcp/{id}/tools (without include_blocked=1) always get the filtered list, and a blocked tool still cannot be called.

Numbers from the server stay exact. A number in an MCP server's reply is passed on exactly or the call is refused by name; it is never silently rounded.

  • tools/call (and every method other than tools/list, such as resources/read) is passed through unchanged: the response body is the server's JSON-RPC message, byte for byte, so large integers and long decimals arrive as sent. A reply the gateway cannot read exactly (a non-finite number such as 1e999 or NaN, an integer with more than 4300 digits, a duplicate key in one object, or a reply it did not capture) is answered 502 with {"error": "MCP malformed: <reason>", "kind": "<reason>", "code": "<reason>"}, where code equals kind and kind is one of number_not_exact, number_invalid, number_too_long, duplicate_key, invalid_json, malformed or mcp_raw_unavailable. For invalid_json the error text keeps the earlier spelling (MCP malformed: json_invalid); match on code or kind. A reply nested more than 1000 levels answers 502 with kind: "malformed" (the JSON decoder refuses it before the exact-number checks run); invalid_json is only the defence-in-depth answer if a too-deep reply ever reached them.
  • tools/list is filtered, merged across pages and encoded exactly. A number a double cannot hold (an integer a double does not hold exactly or beyond ±2^63, a non-finite number, or a decimal with more digits than a double holds) on any page is refused: 502 with {"error": "MCP <reason>: <text naming the problem>", "kind": "<reason>", "code": "<reason>"}, for example {"error": "MCP number_not_exact: tools/list carries a number a double cannot hold", "kind": "number_not_exact", "code": "number_not_exact"}. code equals kind, one of number_not_exact, number_invalid (for example NaN), number_too_long, invalid_json, mcp_raw_unavailable (a page's raw reply was not captured) or mcp_encode_failed (the merged list could not be encoded exactly). mcp_raw_unavailable and mcp_encode_failed use the text MCP malformed: … instead of MCP <reason>: ….
  • A failing initialize is answered 502 with kind: "mcp_init_error". When the model sees that error (chat, agents, workflows), numbers in the server's error object keep their exact digits. A string error.message from the server is shown as is and wins over the error object, so code and data are not shown then.

💡 Note: This proxy is for administrative inspection (e.g. tools/list to see which tools a connector exposes). To use a connector from chat or the inference API you do not call it here — you reference it by id (tools:[{"type":"mcp","connector_id":"…"}]) and the gateway resolves and runs its tools server-side. See MCP connectors from the API.

Access layer refusals (access_denied)

Every connector call, from this proxy, the inference tool loop, workflows and connector sync, is authorized by one gateway access layer before any credential is read. A refusal is reported as access_denied with a reason (actor_invalid, tenant_mismatch, agent_token_invalid, record_write_failed, layer_error, approval_required, param_rule, param_schema_drift, param_rules_malformed): 403 from the admin proxy, 422 from a workflow node, and a tool_error event in chat and agent runs (the model sees only a generic "access layer refused" result). A connector tool_policy block is unchanged and still reports tool_blocked. An unattended agent call to a write or destructive tool that cannot be held for approval is refused with approval_required (see Unattended write calls need approval).

Each tool-call decision, allowed or refused, is recorded by the gateway as an access-decision record: who acted (user, agent, workflow or sync), the connector and tool, the decision and reason, and the tool arguments masked with the gateway's PII protector when the gateway has PII detection enabled (otherwise stored as sent and labelled unmasked), plus a SHA-256 of the original arguments. Arguments that cannot be masked are withheld, oversized ones (too_large) and ones that are not valid UTF-8 text (invalid_utf8, checked after masking) keep only the hash and store no text. The hash is always present: when the arguments cannot be canonicalised it is the SHA-256 of their exact JSON encoding (every number with all its digits), or of the fixed marker aig:unencodable-args if even that fails. Binary or malformed argument bytes never change the decision and never cause a record write failure. If the record cannot be written, an unattended call (an agent run, workflow or connector sync) is refused with reason record_write_failed rather than run unaudited. Connector sync treats this as transient and retries on the next run; an interactive chat call is not blocked. On a PII-guarded gateway, a call whose arguments contain protected data (or an argument value, key or bare string argument longer than 16,384 bytes, which cannot be inspected) is refused by the egress guard before the access layer, unless the connector's pii.input is allow (or it is marked as a trusted subprocessor, which reads the same). That refusal is recorded too, as a deny record with reason pii_egress_blocked that holds no argument text (only the SHA-256). A call refused by the connector's source policy Input cells is a deny record with reason guardrail_input:pii or guardrail_input:keywords, also without argument text. A call to a tool the agent was never offered, made through the MCP proxy endpoint, is recorded as a deny with reason tool_not_offered. A built-in tool refused by an agent's capability gate is recorded as a deny with no connector. Masking works on the JSON-escaped form of the arguments, so treat the masked text as best-effort redaction. The records are read through the Access decisions API.

For agent runs, the run's capability token must be authentic and bound to the agent. A token that has expired is refused when a sub-agent is spawned from it (the child gets no tools), and no token survives an approval pause: the resumed run receives a fresh one.

Connector kinds and the governed_query fence

Every connector resolves to a directory kind (from its immutable, create-validated catalog_slug), and that kind decides whether it may ride this JSON-RPC HTTP call path at all. The check is applied once, at the single resolve-and-call chokepoint shared by this admin proxy, agent discovery, and the chat/inference tool-loop — so no path can be reached that another path fences off.

kind Rides the JSON-RPC server_url HTTP path?
mcp (default) Yes — it is a JSON-RPC tool server.
data_source No — a content source pulled by the connector-sync engine, not a tool server.
governed_query No — a co-signed, single-use compiled artifact answered through the runner against a customer's own database, never a JSON-RPC tool server.

A data_source or governed_query connector invoked on any tool path is refused, fail-closed (returned as not found, exactly as an unknown connector) and never dials the upstream server_url. The classification keys strictly off a string catalog_slug: an absent slug means an ordinary mcp connector (it proceeds), and a malformed (non-string) slug is not silently treated as a governed query — it can neither masquerade as one nor bypass into a different treatment, so garbage cannot defeat the fence. Governed-query dispatch to the runner (and its distinct failure modes) is delivered separately; until it lands, a governed_query connector is refused everywhere it could be invoked.


Using connectors from the inference API

API callers do not need the /call proxy or a hand-built tool list to use a connector in a chat completion: reference it by id and the gateway resolves its tools and runs the tool loop server-side —

"tools": [{ "type": "mcp", "connector_id": "<connector id>" }]

The full request shape, authorization rules, rejection table, and operational notes are documented in Inference API — MCP connectors from the API.

The model's provider must have a gateway tool loop. Gemini, Vertex, Bedrock and Perplexity currently do not. What happens then depends on the caller:

  • The web chat (it sends x-aig-mcp-best-effort: 1 and attaches every connected connector to every send): the turn is answered without the connectors instead of failing. The connectors are dropped for that turn, a tools_skipped status event carries the category connectors_model (the chat shows "connectors (not supported by this model — choose a model from another provider to use them)"), and the model receives a short system notice: connectors are attached but cannot be used with this model, so it must not claim to have used one or invent results from one. Nothing failed, so no model-error row is recorded.
  • The API (no x-aig-mcp-best-effort: 1): the request is rejected with 400 model_capability_mismatch before the turn is dispatched, never answered without the connectors. It is logged and recorded in the model-error triage queue (pattern no_gateway_tool_loop). On a gateway whose PII scan already opened the response stream, the same code arrives inside the already-open 200 event stream: a provider_error event with error_class: model_capability_mismatch for a client that opted into the aig_* side channel, or an OpenAI-style {"error":{"code":"model_capability_mismatch",…}} chunk followed by [DONE] for a plain OpenAI-compatible client.

Only the exact header value 1 selects the chat behaviour; any other value is the API behaviour. (References on a non-chat endpoint or count_tokens stay 400 invalid_request on every provider.)

Per-tool shape narrowing at discovery

The connector's tools/list result is untrusted third-party input: every tool definition is narrowed fail-closed before it can reach a model or a provider wire body. Per tool:

  • name — required. Must be a non-empty string of valid UTF-8, at most 200 bytes. Anything else (missing, wrong type, oversized, invalid bytes) drops the tool. A name with the reserved agent__ prefix is dropped. A name that collides with a built-in gateway tool (for example Runway's generate_image) is offered under the catalog-slug prefix for a catalog connector and dropped for a custom one — see Tools whose name collides with a built-in.
  • description — optional. A non-string value is dropped (the tool is kept). Strings are scrubbed to valid UTF-8 (invalid bytes become U+FFFD) and capped at 4000 bytes on a character boundary.
  • inputSchema — must be a JSON object. Its top-level type is stamped "object" when absent; a schema whose type is anything else, a schema that is an array or scalar, a schema that encodes to more than 16 KB, or a schema whose encoded form contains invalid UTF-8 at any depth is replaced by the minimal empty object-schema {"type":"object","properties":{}} (the tool stays callable, without declared parameters). One level deeper, a non-object properties is replaced by {} and a required that is not an array of strings is removed. A draft-07 tuple items (an array of schemas, e.g. "items": [{"type":"string"},{"type":"string"}]) is invalid in JSON Schema draft 2020-12, which some model providers enforce for every tool of a request; wherever it appears in a sub-schema position (properties, items, anyOf/oneOf/allOf, $defs, additionalProperties, …) it is rewritten to "items": {"anyOf": [...]} (its draft-07 additionalItems is removed), and an empty tuple is removed. Values of enum, const, default and examples are never rewritten. A tuple with an element that is not a schema (a number, string, null or nested array), a schema map (such as properties) given as an array, and any schema nested deeper than about 64 sub-schema levels are replaced by the minimal empty object-schema. Deeper per-property sub-schemas are not otherwise type-validated — the schema is advisory to the model, and tool execution is authorized by the connector, not by the declared schema.
  • At most 500 tools per connector are accepted; the excess is ignored (a per-agent tool allow-list filters this capped set). The cap applies to the merged list of all tools/list pages.

Narrowing is logged (aggregate warning per connector/request) and surfaced in the request trace. The same rules are applied to entries of the gateway-internal x-aig-mcp-tools body carrier — see Inference API — per-tool shape narrowing.

When tools contains client function tools (or any other non-mcp entry), the x-aig-mcp-tools carrier cannot be sent in the same request: the gateway answers 400 invalid_request, because only one party can run the tool loop. An explicit null carrier counts as absent.

The model's context additionally carries a sanitized system notice naming each attached connector and its tools, so the model knows the connectors are available — see Connector provenance notice.


tools/list pagination

A server may split its tool list over several pages (the MCP spec's nextCursor; Atlassian's https://mcp.atlassian.com/v2/mcp?tools=all returns a paginated flat list). When the gateway sends tools/list it follows result.nextCursor inside the same MCP session, sending each follow-up request with params.cursor set to the server's cursor, and returns one merged list in page order. result.nextCursor is removed from the merged reply. Nothing changes for callers: a connector with a single page behaves exactly as before.

  • Absent or null nextCursor ends the list (last page).
  • Single page on request. If your own params already carry a cursor, the gateway sends exactly that one request and returns the server's reply untouched, nextCursor included. A params that is not a JSON object, or is an array, is also left alone.
  • Rejected (fail closed, 502, upstream_kind: "malformed"): a nextCursor that is not a string, is an empty string ("" is rejected deliberately, not treated as the end of the list), or is longer than 1024 bytes; a cursor the server has already returned in this call (a cycle); a later page that is an error, not an object, or whose tools is not an array; more than 100 pages; or pages that together exceed the 32 MiB read budget above (list too large; each later page may only read what remains of that budget). A first page that is itself an error or has no tools array is returned exactly as before.
  • 500-tool cap. Once the merged list holds more than 500 tools the gateway stops requesting pages and returns what it has. This is a deliberate early stop, not an error; the usual 500-tool cap then applies to that list.
  • Time. The 100-page limit is only a loop guard. Total time is bounded by the caller's deadline, 60 s for the admin routes and up to 30 s for agent tool discovery, and each page request is capped by it.
  • Logging. The gateway logs the page count, the merged tool count and, when a cursor is rejected, the cursor length (cursor_len), never a cursor value.

The page size a given vendor uses (for example Atlassian's) cannot be observed without a customer OAuth credential, so it is not documented here.

MCP tool results: exact numbers

When the model calls a connector tool, it receives the result member of the server's reply as the server sent it, inside the gateway's untrusted-content frame. Numbers are never rounded or re-spelled: 3.141592653589793, 0.30000000000000004 and 1234567890123456789 reach the model byte for byte. The server's key order and whitespace are kept, and 1e999 or NaN come through as sent (the gateway does not interpret them). The MCP proxy endpoint returns the same exact slice for non-text results; text content blocks are passed through as text.

A result is never refused for its numbers. Some results are refused instead of being passed on in a changed form. The model (or the proxy caller, as isError: true) then sees MCP error: the tool returned a result that could not be read exactly (<reason>). The wording is the same on both paths, and on both paths it is the gateway's own text, outside the untrusted-content frame:

Reason When
duplicate_key a result object repeats a key at any depth (for example {"a":1,"a":2}), so the value is ambiguous. Two results are decided before this check and are never refused for it: on the agent path, a result whose decoded content is media (the decoder's last-wins view decides), and on the proxy, a result whose content is all text blocks (returned as joined text blocks). Neither path rounds a number
too_deep the result is nested more than 1000 levels (the JSON decoder's own limit), so it cannot be read exactly (defence in depth; the decoder normally refuses first)
malformed key an object key inside the result is not a readable string
trailing bytes the reply has non-whitespace bytes after the result
truncated / unterminated string the reply or a string in it ends early
invalid string escape a string in the result has an escape that is not valid JSON
absent / malformed / empty / not an object the result is missing from the reply, or the reply is not well-formed JSON, is empty, or is not a JSON object
no raw message text the gateway has no raw reply text to slice

Only duplicates inside the result are refused. A duplicate result member at the envelope level is resolved last-wins, exactly as the gateway's JSON decoder does, so there is no split view between what is parsed and what the model sees.

A JSON-RPC error from the server is passed on in the same exact form; if it cannot be read exactly the model sees the MCP server returned an error that could not be read exactly (<reason>). Nothing is sent to the model in a rounded form in any of these cases. The same rule applies to workflow Connector nodes (see JSON numbers).

Many connector tools: tool selection

A turn can carry hundreds of connector tools (every connected connector is attached to every web-chat message). Models choose tools less reliably as the list grows, and providers cap the number of tools per request. Above a threshold the gateway therefore does not put every connector tool on the wire. It offers a small set and one gateway tool, search_connector_tools, which the model calls to load more. The decision is made once per turn, for the model the turn resolved to (after routing rules and fallback substitution):

Resolved model What the model gets
any model, 40 or fewer tools in total (built-in tools + connector tools) every tool, unchanged
a Claude model with native tool search on the direct Anthropic provider (no custom base URL; every configured fallback also qualifies; the connector tool definitions encode to at most 1.5 MiB) every connector tool, marked defer_loading: true, plus the previously used tools (below) loaded; search_connector_tools returns tool_reference blocks, so Anthropic expands the definitions in place
Qwen on the Myra fleet as the chat model, at most 128 tools in total and the connector tool definitions (about one token per three bytes) use at most half of the model's context window every tool, unchanged (a context window the gateway does not know leaves only the count rule)
Qwen above either limit, and every other model with a gateway tool loop (OpenAI, Mistral, OpenRouter, the other Myra models, …) the previously used tools plus up to 5 tools picked for the conversation, and search_connector_tools; each search loads up to 5 more, which are offered from the next model call on

Agent invokes are not affected: an agent's tool set is fixed by its configuration.

A large connector crosses the 40-tool threshold on its own: Atlassian's v2 server lists 249 tool names, within the 500-tool limit per connector. The admin-configured argument rules are bounded separately: argument rules can be stored for at most 200 tools per connector (256 KiB), whatever number of tools the server lists.

How the tools are picked (gateway search). The Qwen tool selector — Qwen on the Myra fleet with reasoning off and temperature 0 — reads the recent conversation (the last three user messages and the last assistant message; for a search, the model's query followed by that conversation; at most 2 KiB in total) and a compact list of the connector tools not yet loaded (name and the first sentence of each description, at most 140 bytes per tool). The list is capped at 64 KiB: above that, the tools matching the request's keywords come first and the list is cut there. It answers with a JSON list of tool names. That answer is untrusted model output: only names that exist in this turn's tool list are kept, duplicates and other values are dropped, and the list is cut to 5.

Fallback. When the selector cannot be used, the gateway ranks the tools with deterministic keyword ranking (BM25 over the tool names and descriptions) instead — for a search by the model's query alone, for the first tools of a turn by the recent conversation. It is never "load everything". That happens when:

Outcome Cause
unavailable the Myra fleet is not configured for this deployment
blocked the gateway may not send requests to the Myra fleet: data residency, the gateway's approved-provider list leaves out myra, the EU-Gov add-on is missing, the selector model is disabled on the gateway, or the organisation objects to Myra as a processor (the same checks as for any Myra model call); also when the gateway sends its Myra models to its own endpoint (a provider base-URL override) — the selector only runs on Myra's fleet
timeout no complete answer within 2 seconds (a total wall-clock limit; connect 150 ms, send 150 ms, each read 1.7 s)
error any other transport failure or a non-200 status
malformed the answer is not the expected JSON shape (an object or text where the list belongs, no choices, …)
empty the answer names no tool of this turn's list
budget the turn's selector budget is spent: after a timeout or error the rest of the turn uses keyword ranking, and a turn makes at most 7 selector calls (the first tools + 6 searches) and spends at most 4 seconds in them — a call is cut at whatever is left of the 4 seconds (reported as budget). Rankings that never reach the fleet (unavailable, blocked, no candidate tools) do not count against the 7 calls
client_abort the client left (closed the connection or pressed Stop) while the selector call was waiting. The call is closed at once instead of running to its 2-second limit, the turn stops as the user's Stop (499, aborted=1) and no keyword ranking is served and no "no match" answer is given. It is counted as outcome="client_abort" in the metric below (not as a fallback_* outcome), because it is a cut and not a selector failure

Every selector call is counted in the metric aig_tool_selector_total{outcome} (ok, client_abort or fallback_<outcome>) and logged once ([tool_ranker] … outcome=… ms=…), so the fallback rate is visible. On the Claude deferred path the gateway ranks with BM25 directly (the selector added nothing there in our measurements).

What the selector sees. The selector call runs on Myra's own EU fleet (the infrastructure the Myra models run on, unless a gateway routes them to its own endpoint — then the selector is not used). It carries the turn text exactly as the chat model receives it: on a gateway that masks personal data for an external model, the text is already masked. No connector is contacted and no third-party provider receives anything for the selection.

Previously used tools. The gateway records which connector tools each assistant turn used — a call counts once it reached the connector; a call the gateway refused (tool disabled by the connector's policy, personal data in the arguments, egress blocked, connection missing) does not — (the column chat_message.tools_used_json, each entry <connector id>/<tool name>) and loads up to 8 of them, newest first, from the last 10 recorded turns of the conversation — each only while that name still belongs to the same connector. The read is bound to the signed-in user as the conversation owner; a member driving someone else's shared conversation gets no history (a narrower set, never a wider one). A recorded value that does not parse as a list of tool names contributes nothing; a database error leaves out the history and the turn proceeds. A regenerate that resumes from saved tool results keeps the original turn's record, and the tools its searches had loaded are loaded again (within the cap).

search_connector_tools contract. One argument, query (a string). The gateway rejects, each with its own message to the model and nothing loaded: a missing or null query, a non-string, an empty or whitespace-only string, more than 500 bytes, invalid UTF-8. A search can only load tools of this turn's list; a tool that is not loaded cannot be called (the call is refused with a message telling the model to search first). The answer names the loaded tools, or says that nothing matched or that the turn's tool budget is used up (on the gateway-search path a search with no budget left is answered without ranking). The chat shows "Searching connector tools:" while a search runs. A search result that a guardrail refuses is undone: its tools are unloaded again.

The cap. On the gateway-search path the tools on the wire never exceed 40 (built-in tools + the search tool + loaded connector tools); when the built-in tools alone come close, the connector tools still get 5 slots. The Qwen all-tools path stays at or under 128.

Requests that ask for a file. When a message asks for a downloadable file (for example "an account briefing as HTML"), the first model turn is forced to produce the file, but it still sees the connector tools already loaded plus the search tool, so it can fetch connector data first. If that turn fetched connector data and showed no file, the gateway forces the file once more on the next turn, with the file tools alone (on Claude models with native tool search the deferred connector catalogue leaves the request too, and earlier search results are kept in the conversation as plain text). A turn that only searches for connector tools does not use up this second force, so the model can still call the tools it just found. A plain request ("a cover letter as docx") with no connector data needed is unchanged.

MCP Apps (sandboxed in-chat viewers)

Some connectors ship an MCP App — a self-contained HTML viewer the gateway renders in a sandboxed iframe in chat, alongside the tool's normal result (SEP-1865, stable profile 2026-01-26). Runway's video viewer is the first: a generate_video call returns a live progress/preview panel. The viewer runs entirely client-side and reaches the gateway for exactly one thing — polling a read tool for the task's status — over the bridge route below. The connector's OAuth token never enters the iframe; the bridge proxies server-side.

Every input on this path is untrusted and validated fail-closed (a value that arrives wrong is rejected, never treated the same as one that never arrived).

Tools whose name collides with a built-in

A connector tool can never take the name of a built-in gateway tool (generate_image, web_search, read_file, write_file, edit_file, …): the gateway would otherwise run its own tool with the connector's arguments. For a catalog connector, such a tool is offered to the model as <catalog slug>_<name> instead of being dropped, and the gateway calls the connector under the tool's own name. Runway's generate_image becomes runway_generate_image.

  • Prefix: the connector's catalog slug, which is fixed when the connector is created, so the name never changes. It is lowercased; every run of characters outside a-z0-9 becomes one _; leading and trailing _ are removed; at most 24 bytes; it must start with a letter.
  • Custom connectors (no catalog slug) are not renamed: a clashing tool is dropped, as before. Rename the tool on your MCP server instead.
  • Uniqueness: the prefixed name goes through the same checks as every other name, so it is never a built-in or agent__* name. The prefixed name is reserved for the renamed tool: any other tool that is merely named runway_generate_image is dropped, whichever comes first. If two catalog connectors with the same slug (for example a shared and a private Runway connection) both offer the tool, the first one wins.
  • Where the slug comes from: the gateway reads it from the connector row during its own tools/list discovery. A tool list supplied in the request body cannot name a prefix, so its clashing tools are dropped.
  • Which name is used where: the model, the tool chip and the chat history show the prefixed name. The call to the connector, the connector's tool policy (allow/block) and an agent's mcp_allow list use the tool's own name. An MCP-app viewer is told the tool's own name. An agent's approval.tools gate matches either name (see Agents).

An agent can use a connector's tool only if the agent's owner consented to it (the agent's tool_config.mcp and mcp_allow) and the connector's tool_policy allows it. The tool is neither offered to the model nor executable otherwise. The consent is checked again on every tool call against the agent's current configuration. See Agents.

When an owner adds a connector to an agent, the consent step reads the connector's tools from GET /admin/v1/mcp/{cid}/tools (see Reading the classes) and sorts them by the gateway's own class, never by the server's MCP annotations:

  • class: "read" → Read. Only these are preselected.
  • class: "write" → Write.
  • class: "destructive" → Delete.
  • A tool whose class_source is default (nobody has classified it), or whose class is absent or not one of the three values → Not classified. These are never preselected.

The class comes from an admin's explicit choice or from the gateway's catalog. A server cannot talk its way into the Read group by announcing readOnlyHint: true. If the stored classes cannot be read (tool_classes_error), every tool is Not classified and nothing is preselected. The owner's selection is what is enforced. The step also asks the contract preview (POST .../agents/contract/search) for the organisation's limits: a tool with the verdict capped is shown locked with its reason text and cannot be granted, and under a default: "block" policy only the tools the policy allows are listed. If the tool list or the preview cannot be read, or the connector lists more than 500 tools (counted across all tools/list pages), nothing is preselected and nothing is granted.

Tool names: allowed characters and duplicates across connectors

Every connector tool name the gateway offers to a model fits the strictest provider rule, ^[A-Za-z0-9_-]{1,64}$:

  • Every byte outside A-Z a-z 0-9 _ - becomes _ (repo.create issue → repo_create_issue; a non-ASCII character becomes one _ per byte).
  • A name longer than 64 bytes is cut to 55 bytes, followed by _ and 8 hex characters of an MD5 hash of the full name, so two long names that share their beginning stay distinct.
  • If the result equals a built-in tool name, the built-in rule above applies.

The same tool name on two connectors (for example create_issue on GitHub and on GitLab) keeps both tools. Each is offered as <prefix>__<name>, for example github__create_issue and gitlab__create_issue:

  • Prefix: the connector's catalog slug, normalized as above (lowercase, runs outside a-z0-9 become one _, edges trimmed, at most 24 bytes, must start with a letter). A connector without a catalog slug (a custom connector), or whose slug leaves nothing usable, gets c plus 8 hex characters of an MD5 hash of the connector id. The display name is never used: it is your own text, which the gateway masks wherever else it reaches a model. The prefix is never agent. When two connectors would get the same prefix, each gets _ and 4 hex characters of its id's hash appended.
  • Only names that really collide in this turn are prefixed. A name offered by one connector keeps its plain form, so connecting a second connector with the same tool name changes the first one's name from then on.
  • The same name twice from one connector: the first one is kept.
  • Which name is used where: as for built-in collisions — the model, the tool chip and the chat history show the offered name; the call to the connector, the connector's tool policy and an agent's mcp_allow list use the tool's own name. An agent's approval.tools gate matches the tool by every name it can be offered under for its connector (own name, rewritten name, each <prefix>__<name> form), so a gate holds whether or not the collision is present in a run (see Agents).
  • Two prefixes that would still coincide (a suffixed prefix equal to another connector's plain or suffixed prefix) get _ and the full 32-hex hash of their connector id instead, which no other prefix can equal.
  • Reserved names: every <prefix>__<name> form a connector's tool can take is reserved for that tool whenever the connector offers it, collision or not. Another tool that is merely named github__create_issue is dropped while GitHub offers create_issue in the same message. The "previously used" history is bound to the connector, so a name the model saw as GitHub's is never loaded from history for a different connector in a later message.
  • A name in the reserved agent__ namespace is dropped even when two connectors offer it.
  • A tool the model cannot see (an app-only MCP-app tool), or a tool list entry without a connector, never causes a collision and never takes a name from a connector's visible tool.
  • A name whose allowed-character form is a built-in tool name (web.search → web_search) follows the built-in rule above (<catalog slug>_web_search), not this one.

Tool → viewer association (_meta.ui)

A tool declares a viewer via the nested _meta.ui object on its tools/list entry (the deprecated flat _meta["ui/resourceUri"] form is ignored):

  • resourceUri — a ui://… string, at most 512 bytes, valid UTF-8, no control/space bytes. A missing or malformed value drops only the viewer (the tool still works); it is never fetched as anything but a ui:// resource.
  • visibility — an array of "model" / "app". Absent → the spec default ["model","app"]. Malformed (not an array, or any other element) → fails closed to ["model"] — a garbage visibility can never grant app-callability. A tool whose visibility omits "model" is withheld from the model's tool list (it stays reachable only through the bridge below).

A tool result whose structuredContent holds a number a double cannot hold, a non-finite number or a duplicate object key gets no viewer; the model still receives the result (see the refusal list under reloading a viewer below).

Fetching the viewer (resources/read)

The gateway reads the ui:// resource through the same connector call path as tools/call — inheriting tenant isolation, the per-user credential, the SSRF pin, and the 32 MiB cap, under a 30-second fetch deadline. The response is accepted only when:

  • contents[0].mimeType is exactly text/html;profile=mcp-app (a different type, a trailing space, or an absent type → rejected);
  • exactly one of text (a string) or blob (base64 that decodes) is present (neither, both, or an undecodable blob → rejected);
  • the decoded HTML is at most 512 KB (larger → rejected);
  • any _meta.ui.csp domain list keeps only https://host / https://*.host origins (up to 32 each; http://, javascript:, a bare *, paths, and malformed entries are dropped), and prefersBorder is kept only when a real boolean.

A rejection yields no viewer — the tool's result renders natively. The viewer HTML is never stored; it is always re-fetched from the connector (one source of truth).

POST /admin/v1/mcp/{id}/app-call

The sandboxed viewer's only server reach. Member-accessible (authenticated user + tenant). Body:

{ "appToken": "<gateway-minted token>", "tool_name": "get_task", "task_id": "<optional>" }
  • appToken — an HMAC token the gateway minted for this turn (type-tagged, domain-separated from the session JWT). The route verifies its signature, type, and expiry. The signature is checked with the active master key first and, during a master-key rotation, with the verify-only secondary key; a token signed by any other key → 401 invalid app token. It then checks that its bound user, tenant, connector, and conversation match the authenticated caller + path + a conversation the caller owns. A missing or non-string appToken, or a missing or empty tool_name → 400. An expired or garbage token → 401 invalid app token; a user/tenant/connector mismatch → 401 app token scope mismatch; an unknown conversation → 404; a conversation of another user → 403 not your conversation. An unknown or unusable connector → 404; a connector that is not scope = "user" → 403 app_not_available.
  • tool_name — authorized only against the connector's immutable catalog_slug allowlist of non-generative, task-scoped read tools (Runway: get_task; exact, case-sensitive match). Anything else — generate_video, an unknown tool — → 403 tool_not_allowed.
  • task_id — which task of the token's signed task set to read. The set is derived once, server-side, from the tool result's structuredContent (taskId, taskIds[], and for a task_batch_pending result items[].taskId; each a string of A–Z a–z 0–9 _ -, at most 128 characters; at most 16 per viewer). A result with more than 16, or with any present-but-malformed id (a non-string, a bad character, a non-list taskIds), places no viewer and renders natively — a partially scoped batch would leave a tile polling a task outside its token. A batch item with no taskId (e.g. a failed tile) is simply not scoped.
    • absent and the set has one task → that task;
    • absent and the set has several → 400 task_id_required (never silently the first tile's task);
    • present (including JSON null) and not a string in the set → 403 task_not_in_scope.
  • arguments are ignored: the gateway constructs { "id": <task_id> } server-side (id is get_task's required argument), so the viewer can never reach a task outside its token or pass extra parameters.

Rate-limited per (user, connector) to 240 calls per 60 s, checked before the token; over the limit → 429. The upstream result is relayed to the viewer as the server's message byte for byte (numbers keep every digit; the same wording and 502 kinds as the /call proxy apply, e.g. a duplicate key is refused); a dead or missing per-user grant returns 409 (credential_expired / credential_required) so the SPA prompts a reconnect. A call that breaks a catalog argument bound would return the same 422 arg_rejected body as the /call proxy; no viewer tool carries a bound today.

GET /admin/v1/conversations/{conv}/mcp-app/{tool_use_id}

Rehydrates a committed turn's viewer on reload. Scoped to a conversation the caller owns (a foreign conv/tool_use_id → 404). Re-fetches the HTML from the connector and mints a fresh app-token (so a reload never hits an expired token), returning the descriptor the SPA renders; the token's task set is re-derived from the stored structuredContent. The snapshot is stored and returned value-exact: every number reads back as the same value (3.141592653589793 is never rounded to 14 digits; 1.50 may be returned as 1.5, 1e2 as 100, and key order may change). A result whose structuredContent holds a number a double cannot hold exactly (an integer a double does not hold exactly, a decimal whose digits a double would silently change), a non-finite number (NaN, Infinity) or a duplicate object key places no viewer and renders natively; the model still receives the tool result unchanged. Returns 404 when no viewer scope is stored for that turn, and 500 (mcp app scope unavailable) when the stored snapshot has no usable task scope. Other failures: 429 (rate limited; 120 reloads per 60 s per user and conversation), 404 (the connector is gone or belongs to another tenant), 403 (app_not_available — the connector is not a scope = "user" app), 502 (viewer resource unavailable — the connector resource could not be re-fetched), 500 (token mint fault).

Live viewer frame

While a turn streams, the viewer arrives as an aig_status: "mcp_app" frame (to clients that receive the gateway's status frames). Its structuredContent is value-exact, the same values the reload route returns: 3.141592653589793 is never rounded to 14 digits, 1.50 may arrive as 1.5, and key order may change. On a turn that is buffered for a response-phase guardrail (a scrub or block rule), the viewer is delivered together with the buffered answer, before the answer text, instead of being dropped.

Reloading a viewer — the mcp_apps message field

So the SPA knows which turns carry a viewer after a reload, the conversation read (GET /admin/v1/conversations/{id}) now returns an mcp_apps array on each assistant message (parallel to files and images). Each entry is a secret-free stub — never the HTML, the CSP, or the token:

{ "tool_use_id": "…", "connectorId": "…", "toolName": "generate_video" }

The SPA renders one <McpAppViewer> per stub and fetches the full descriptor (fresh HTML + a freshly minted token) lazily from the reload route above when the viewer scrolls into view. Only claimed viewers (committed onto a persisted message) appear; the list is empty on an ordinary turn.

How the SPA renders the viewer (sandbox + CSP)

The viewer frame sits inside the application's navigation fence (a host document with policy frame-src 'none', the viewer's parent — see Response headers): the viewer cannot navigate itself anywhere, and no framed URL loads inside it — a declared frameDomains list is applied to the viewer's own policy, but the fence blocks every framed URL regardless (srcdoc / about:blank child frames still render). The host relays the bridge's messages: the viewer's window.parent is the host, and messages it receives carry event.origin "null" (the host is an opaque origin) — check event.source === window.parent, never an origin string, and post to window.parent, never to window.top (the app ignores a message whose source is not its own frame).

The frontend renders the descriptor's HTML in an iframe with sandbox="allow-scripts" only — never allow-same-origin — so the document runs in an opaque (null) origin: it cannot read the gateway's cookies, localStorage, or the parent DOM, and the per-user token (held by the host, forwarded only to /app-call) never enters it. A strict Content-Security-Policy is injected as the first <head> child, built only from the connector's declared csp domains (and re-validated client-side, fail-closed):

  • script-src 'unsafe-inline' — the inline viewer script only; the declared resourceDomains are deliberately not granted here (no remote code execution from a shared-wildcard host);
  • img-src / media-src data: blob: + resourceDomains, style-src 'unsafe-inline' / font-src data: + resourceDomains — the viewer's media/styles load only from declared hosts;
  • connect-src / frame-src / base-uri ← the matching declared list, else 'none'; default-src 'none', object-src 'none', form-action 'none'.

Because the viewer is an about:srcdoc document it also inherits the application page's own Content-Security-Policy, and the browser enforces both — a load must pass each. The page policy therefore also lists Runway's declared media hosts (https://*.cloudfront.net, https://*.runwayml.com, https://*.amazonaws.com) in img-src / media-src / font-src / style-src (response headers); a viewer whose media lives on any other host has those loads blocked by the page policy even if it declares them, and any viewer that declares one of these three hosts may load media from it. The same holds for the other declared lists: the page policy's connect-src / frame-src list only 'self', the app's own API hosts, Matomo, the EU-captcha hosts and the ad-conversion tag hosts, and it sets base-uri 'self'. A declared origin that equals or wildcard-covers any of those page hosts is dropped from every list before the viewer policy is built (case- and port-insensitive; e.g. https://*.google.com, https://*.com, https://www.google.com:443), so a viewer can never use our analytics, ad, captcha or API hosts as a sink; only the three media wildcards above stay declarable. So a viewer's declared connectDomains / baseUriDomains are in practice always blocked (except the application's own origin, which the page policy allows as 'self' — a viewer can reach it only without cookies, from its opaque origin), and frameDomains are always blocked (the navigation fence above allows no framed URL) — Runway's viewer declares none; it reaches its tools only through the host bridge above.

The host↔viewer postMessage bridge validates every inbound message fail-closed (it must come from the viewer frame's own window — the fence host, which relays only the viewer it currently shows — with the opaque "null" origin, be a JSON-RPC 2.0 message with a known method, and a well-formed params shape); a message without a valid id is dropped, a request with a valid id but malformed params is answered with JSON-RPC error -32602. Outbound messages are built from an explicit whitelist and carry only non-secret tool results, never a token.

Accepted viewer → host methods and what the host does with each — the viewer only proposes; every effect on the workspace needs a click on host-rendered UI. The viewer can shift that UI (its own resize moves the page in a thread scrolled to the bottom), so every host control (Insert into message, Expand, Open link) is armed: it is unclickable for 500 ms after any layout change the viewer causes and after it moved on screen or scrolled back into view, and a mouse press counts only if the mouse really moved onto it since then (a button slid under a still cursor takes no press; touch, keyboard and assistive-technology activation are not affected):

Method Accepted shape Rejected (-32602) Host behaviour
ui/initialize, ui/notifications/initialized, ui/notifications/size-changed, ping as before — lifecycle; height clamped to 180–720 px
tools/call name 1–200 chars; optional arguments object whose optional own id is a non-empty string ≤ 128 chars arguments present but not an object; id present but not such a string (incl. null) proxied to /app-call with {appToken, tool_name, task_id?} — no other argument
ui/message role: "user", content: 1–8 {type:"text", text} blocks, each ≤ 8000 chars; joined, invisible characters stripped (\p{Cf} and \p{Default_Ignorable_Code_Point} — bidi controls, zero-width characters, tag block, variation selectors, Hangul fillers, combining grapheme joiner — plus C0/C1 controls except tab/newline, U+2028/2029 and U+2800; ZWNJ is removed; the Cf and Default_Ignorable sets follow the Unicode tables of the user's browser, so newly assigned characters are covered as browsers adopt them; unpaired UTF-16 surrogates are removed; tag characters are removed (subdivision flags show as 🏴); U+FE0E/FE0F survive only directly after a symbol, digit, #/* or emoji base, one per base — a stricter subset of the rule the gateway applies to fields you type (the gateway also accepts them after CJK ideographs) — all other variation selectors (including the CJK U+E0100 block, stricter than the gateway) are removed; ZWJ survives only between two pictographic characters (emoji, ©, ®, ™, arrows …), so at most one invisible joiner sits between two adjacent pictographic characters), 1–8000 chars any other role, a non-text block, empty, too long shown as a prompt chip above the viewer; reply {}. Only Insert into message (a host click) puts it into the composer as an editable draft — never sent. Composer not writable → error -32000
ui/open-link url: https: only, ≤ 4096 chars, no user:pass@ any other scheme, userinfo, a trailing-dot host, unparsable (and, refused with -32000, a link to the workspace's own origin) confirm dialog (host name + full normalised URL, Cancel focused, Open armed 500 ms after it last appeared or moved; a click on it while unarmed restarts that wait, and a mouse press counts only if the mouse really moved onto the button since it last appeared, changed or moved on screen; touch/pen taps, keyboard and assistive-technology activation are not affected); needs a user gesture in the page (navigator.userActivation; a browser without that API is treated as having one — the dialog is the control); off for the viewer after two dismissals (Cancel, ×, Escape or backdrop); refused → -32000 + a visible hint
ui/request-display-mode mode: inline | fullscreen other modes never changes host state — answered {mode: <current>}. Full screen is the host's Expand button only

ui/update-model-context is not implemented (dropped). The host sends ui/notifications/host-context-changed (theme, displayMode) when either changes, and advertises hostInfo.title "Myra AI Workspace (claude-compatible)": viewers such as Runway's offer their draft-producing buttons only to hosts that place ui/message as an editable draft instead of auto-sending it — which this host does.

Accepted residual (security review): because the media-bearing directives must allow the connector's declared resourceDomains for the generated media to display, a hostile viewer could beacon the user's own signed media URL + prompt to another host under the same shared wildcard. The per-user OAuth token stays server-side regardless. A gateway media-proxy removes this residual.


PII protection on outbound tool-call arguments

What happens to the arguments is decided by the connector's pii.input cell (its source policy; mask by default):

pii.input Arguments sent Refused when
allow the request's masked values restored (the real values); under a PII mandate unchanged, nothing restored never for personal data (keyword cells still apply)
mask (default) unchanged on a PII-active gateway or under a PII mandate, an argument carries a protected structured identifier (below): pii_egress_blocked
block unchanged on every gateway, an argument carries personal data, a protected structured identifier or a masked value of the request: guardrail_input:pii (model text [blocked: what would be sent to <connector> contains personal data, and this source's data protection does not allow personal data to be sent to it (personal data, tool_args:<tool>). It was NOT sent. Do not retry with the personal data; tell the user if the task needs it.])

Arguments that cannot be checked completely (below) are refused under mask and block with pii_egress_blocked. A PII mandate is pii_masking_enforced, a pii_mandatory project or a forced agent invoke. The rest of this section describes the mask rule.

When a chat model calls an MCP tool, the arguments the model generates egress to the connector's MCP server. On a PII-active gateway (one carrying a pii_protector guardrail) — or under a PII mandate from any source: a tenant with pii_masking_enforced, a pii_mandatory project, or a forced agent invoke (an unresolvable project tier blocks tool egress outright, earlier) — those arguments are inspected before they are sent. A tool call is blocked (refused, never sent) when an argument carries a protected structured identifier: a checksum-valid German ID (Steuer-ID, USt-IdNr, SV-Nr, KV-Nr, Personalausweis), an IBAN, a credit-card number, an email address, a JWT, an API key, a [MYRA-REDACT-…] token echo, a configured custom_pii keyword, or — on a gateway whose pii_protector enables dk_recognizers — a separated Danish CPR number (010190-1234, 010190 1234), or a bare one under an argument key whose name is a CPR word ({"cpr": "0101901234"}, also nested — a bare 10-digit number under any other key is not blocked; see Danish CPR recognizer; the labelled Danish CVR / account / passport / driving-licence numbers are masked, not blocked). Free-text names and places are not blocked — the tool needs the real value to function. A blocked call returns a model-facing message so the model can retry without the protected data. An argument object that cannot be fully inspected (unparseable or excessively nested) is treated as unsafe and blocked (fail-closed). So is an argument value, key or bare string argument longer than 16,384 bytes: it is too long to be inspected completely, so the call is refused rather than sent partly unchecked. The model is told that a tool argument is longer than 16384 bytes, that the call was not sent, and to send shorter arguments (split the content across several calls if the tool allows it). A value of exactly 16,384 bytes is still inspected and sent. The length is counted in bytes, so multibyte characters (umlauts, euro signs, emoji) use up the limit faster than plain letters.

Escape hatch — trusted_subprocessor. A connector column trusted_subprocessor (boolean, default false) marks a connector as a vetted EU/DPA subprocessor. It is read as pii.input = allow (source organisation) unless the source policy sets pii.input itself, so a trusted connector skips the argument block and gets the request's masked values restored; under a PII mandate its arguments are sent unchanged (nothing restored), as before. Prefer setting pii.input in the source policy; the flag and its route stay for existing clients. A workflow Connector node still reads the flag directly (it does not apply the source cells yet).

Set the flag with PATCH /admin/v1/mcp/<ID>/trusted (body { "trusted_subprocessor": true | false }). The route requires the GOVERNANCE_MANAGE permission and is refused while impersonating. A missing value is rejected with 400 trusted_subprocessor_required, a null or non-boolean one with 400 invalid_trusted_subprocessor; another tenant's connector is 404. The change is always captured by four-eyes approval for a tenant admin — the response is 202 with a pending_approval status and an approval_id until a second administrator approves it — while a platform admin applies it directly (200 with the connector, audited as mcp_connector.trusted_subprocessor). On the direct path the flag and its audit entry are committed together; if the entry cannot be written, nothing is changed and the call answers 503 { "error": "temporarily unavailable; retry later" } (retryable) or a sanitised 500. A connector deleted while the call is in flight answers 404 and records no entry. When a held change is applied on approval, the flag and its mcp_connector.trusted_subprocessor audit entry are committed together; if the entry cannot be written, nothing is applied (the approval stays pending on a 503, or ends as 409 apply_failed). See Config approvals.

Four-eyes approval of held tool calls (four_eyes_required)

A connector column four_eyes_required (boolean, default false) makes every tool call held on that connector need two different people: the person whose account the call would use approves first (the item moves to awaiting_second), then a different user holding GOVERNANCE_MANAGE (admin, tenant admin or AI manager) makes the final approve or deny. The same person can never give both approvals, and a first approval alone never releases the call.

Set it with PATCH /admin/v1/mcp/<ID>/four-eyes (body { "four_eyes_required": true | false }). Deprecated: every answer of this route carries Deprecation: @1794268800 and Sunset: Mon, 01 Mar 2027 00:00:00 GMT; use approval_2 in a v2 policy instead. The route requires the MCP_TENANT_MANAGE permission and is refused while impersonating. A missing value is rejected with 400 four_eyes_required_required (the doubled suffix is deliberate: the field is named four_eyes_required and the rule appends _required), a null or non-boolean one with 400 invalid_four_eyes_required (nothing is written); another tenant's connector is 404. On success it answers 200 with the connector. The change applies at once and only to tool calls held from then on: the setting is recorded on each hold when it is created, so a hold that already exists keeps the rule it was created under. The hold also records which connector required the second person, and the approval card names that connector even after its setting changes. On a connector with a v2 tool_policy (see Tool permission policy v2) this route is an alias kept for existing clients: true turns every unattended approval_1 of the document (class defaults and tool entries) into approval_2, false turns every approval_2 back into approval_1, in the same write as the flag; the audit entry then also records the document before and after. The flag then follows the document: a v2 document with no unattended approval to flip keeps four_eyes_required at false, and the response says so. A v1 or absent policy is left as it is. The change is audited as mcp_connector.four_eyes_set; the flag and its audit entry are committed together, so when the entry cannot be written nothing is changed and the call answers 503 { "error": "temporarily unavailable; retry later" } (retryable) or a sanitised 500. A connector deleted while the call is in flight answers 404 and records no entry.

This block applies to the inference tool-loop path only. The JSON-RPC /call proxy above carries a user's own arguments (a manual, user-initiated call, not model-generated egress) and is out of scope for this control.


Tool-argument bounds (catalog connectors)

Some directory connectors expose a numeric tool argument whose own input schema declares no range, and the service then silently clamps whatever it receives. For these arguments the gateway enforces a range itself, before the call leaves the gateway. The check applies on every path that sends a tools/call: the chat and inference tool loop, agents (including resumed approval batches), the JSON-RPC /call proxy and a workflow Connector node. It is keyed on the connector's immutable catalog_slug. A custom connector (no catalog_slug) is not bounded.

Connector Tool Argument Accepted
runway generate_video duration a whole number of seconds from 4 to 15

The range is taken from Runway's own tool description (seedance-2 4–15 s, Kling 5/10/15 s, veo-3.1 8 s). Inside that range, a model-specific value is still Runway's decision; Runway reports the real length back in its result. Arguments that already carry their own enum / minimum / maximum in the connector's schema are validated by the service and are not repeated here.

Accepted:

  • The argument absent, so the service applies its own default.
  • No arguments at all.
  • A number inside the range.

Rejected:

  • The argument present but not a finite number: JSON null, a string such as "10", a boolean, an object, NaN or ±Infinity.
  • A number outside the range.
  • A fraction where a whole number is required (for example 7.5).
  • arguments present but not a JSON object (null, a string, a number, or an array).

A rejected call is never sent, so nothing is generated or billed. An administrator's tool-policy block takes precedence: a disabled tool reports disabled, not out of range.

Surface Result of a rejected call
Chat / inference tool loop tool result [rejected: 'duration' for '<tool>' must be a whole number between 4 and 15. The tool was NOT called …], which the model relays to the user
/call proxy 422 arg_rejected (see above)
Workflow Connector node 422 connector_call_failed, audited as call_arg_rejected

These bounds are range rules on the shared argument-rule evaluator (see argument rules); there is no separate mechanism, and the behaviour above is unchanged.

Argument rules

Tool arguments are checked by one pure, fail-closed evaluator. A rule set maps an argument name to a list of rules; every rule of an argument must pass (AND). Arguments not named in the rule set are not checked.

Kind Fields Passes when
one_of values, ignore_case the value equals one of values
none_of values, ignore_case the value is a string or finite number that matches no entry of values (see below)
prefix value, ignore_case the string starts with value
suffix value, ignore_case the string ends with value
not_contains value, ignore_case the string does not contain value
pattern value, ignore_case the whole string matches the PCRE pattern (full match, UTF-8)
range min, max, integer a finite number within the range (whole number when integer)

Absent versus malformed. An argument that is absent is denied unless every rule of that argument is optional (the catalog bounds are; a rule set supplied as rule text cannot set optional). A value that is present but malformed is always denied: JSON null, an object, a value of the wrong type, or an empty array. Absent and malformed never share a permissive outcome. An array value must be a plain array (a table with extra keys or gaps is malformed and denied) and is checked element by element (every element must pass; at most 1000 elements); nested objects inside an array are denied.

one_of versus none_of. one_of compares strictly by type: the string "5" does not match the number 5. none_of is a deny-list and an upstream may coerce between the two, so it denies the value when any of these holds: the value's type (string or finite number) has no entry of that type in values (a wrong type is denied); an entry of the same type is equal; or the value and any entry (string or number) are numerically equal, where a string is read with Lua tonumber (so "05", "5.0", "0x5", "5e0" and " 5" all equal 5 and "5"). Only a value that matches nothing, with its type represented in values, passes. Examples with values: ["5", 7]: 5 and "5" are denied, 7 is denied, "x" and 6 pass. none_of is a best-effort deny-list: it reads numbers the way the gateway does and cannot foresee every server's own coercion (for example "0_5", fullwidth digits, or a value truncated at a NUL byte). When a constraint is security-relevant, use one_of, range or pattern, which fail closed.

Limits. Rule text is at most 16 KiB; at most 32 arguments, 16 rules per argument, 64 values per rule (each 1 to 512 bytes), patterns 1 to 256 bytes, argument names 1 to 128 bytes. A rule set that exceeds a limit, names an unknown kind or field, or has a pattern that does not compile is rejected as a whole. ignore_case is ASCII-only for prefix, suffix, not_contains, one_of and none_of, uses Unicode folding for pattern, and is rejected on range and on one_of/none_of with numeric entries.

Pattern safety. A string longer than 4096 bytes fails a pattern rule (it is denied, not truncated). Catastrophic backtracking is bounded by the regex engine's match limit, and a match error is a deny. A single check is also budgeted (64 pattern executions, 0.1 s of cumulative pattern time); exceeding it denies the call.

Numbers must be exact. A number in values, min or max is stored exactly, with up to 17 significant digits, and reads back with the same digits: 9007199254740991, 12345678901234568 and 0.30000000000000004 are all accepted by the API. A number that is not exact is refused with 400 number_not_exact and nothing is stored: a literal that is not its own 64-bit double (9007199254740993, 123456789012345678, 0.100000000000000001), or a whole number written in digits only that lies beyond ±2^63 (10000000000000000000). Send such an identifier as a string. The stored text is the shortest text that reads back as the same number:

  • a whole number below 2^63 is stored as plain digits;
  • a whole number of 2^63 or more is stored in exponent form (1e20 is stored and echoed as 1e+20); it can be set only through the API, in exponent form;
  • a fraction is stored as its shortest round-trip text (0.30000000000000004 stays, 1.50 becomes 1.5);
  • a literal -0 in the request body is stored and echoed as 0 (the body decoder turns it into 0); -0.0 is kept as -0.

The 256 KiB limit on a connector's stored rules counts this exact stored text. If the gateway cannot encode a rule set exactly, the write answers 500 arg_rules_encode_failed and nothing is stored. If a number cannot be encoded while the rules are parsed, PUT and the dry run POST /admin/v1/mcp/{id}/arg-rules/test answer 400 invalid_rule with the error number could not be encoded and nothing is stored. The web app's rule builder is stricter than the API: it accepts a number only when the text you typed is the number it stores and the number survives a trip through JSON unchanged. Whole numbers up to 9007199254740991 (2^53 - 1) and decimals such as 0.30000000000000004, 1.50 or 1e2 are fine; a whole number above 2^53 (9007199254740992, 12345678901234568, 1152921504606847000), a number of more than 17 significant digits such as 0.100000000000000001, a literal that is not its own double and any non-finite number are refused there. Set such a whole number through the API (digits up to 2^63, exponent form beyond). A rule that already holds one, in any position (a list that also holds text, a list entry, a min or max bound, or a field the web app does not know), is shown read-only in the web app with a problem (number_api_only): the web app does not display such a number (the rule shows only its kind and argument; read the exact value with GET /admin/v1/mcp/{id}) and never sends such a rule back, because the browser would rewrite the number (1152921504606846976 would go out as 1152921504606847000). You can delete the rule there, but the tool's rule set cannot be saved from the web app until it is removed; edit it through the API. When the server refuses a save, the web app shows the server's own answer, its code and the reason text (for example invalid_rule: ... or number_not_exact: ...), not a generic message.


Setting argument rules

PUT /admin/v1/mcp/{cid}/arg-rules stores the argument rules for one tool of a connector. It is the only way to set them. The caller must own the connector, the same as PATCH: a connector the caller cannot use is 404, one that is visible but not owned is 403.

{ "tool": "send_mail", "rules": { "to": [ { "kind": "suffix", "value": "@example.com" } ] } }
  • tool is a tool name (a non-empty string of at most 200 bytes, valid UTF-8, no control characters). rules maps an argument name to a list of rules, with the kinds and fields from Argument rules. rules must be present and an object: an absent, null or non-object rules is 400 and is never read as a removal.
  • rules: {} removes the tool's entry and answers 200. A removal needs no tool list from the server.
  • The gateway reads the connector's live tools/list with the caller's credential and ratifies the rules against the tool's inputSchema.properties: every argument named in rules must be declared there. The names declared at that moment are stored with the rules (schema_args).
  • Success is 200 { tool, schema_args, rules }: the stored entry, with schema_args the argument names declared by the live schema at that moment. A removal answers 200 { tool, removed: true }. The rules stored are re-encoded from the parsed rule set; the request body is never stored as sent.
Status Code Meaning
400 parse reason rules is not valid argument rules (unknown kind, bad field, too many rules, ...); malformed_body for a JSON array body, plus the tool-name errors
400 duplicate_key an object in the body repeats a key (at any depth); see "A repeated key in a request body is refused" at the top of this page
400 number_not_exact / number_invalid a number in the body is not exact (a rule number such as 9007199254740993), or is not valid JSON; see Numbers must be exact and "Numbers in a request body are exact or refused" at the top of this page
400 unknown_tool the live tool list has no tool of that exact name
400 unknown_argument a rule names an argument the tool's schema does not declare
400 arg_rules_too_large the connector's stored rules would exceed 256 KiB or 200 tools
401 unauthenticated no user
403 no tenant no tenant context
403 access_denied / forbidden the access layer refused the schema read (the body carries reason), or the caller does not own the connector
404 not found the connector is unknown or not visible to the caller
409 arg_rules_malformed the stored rules cannot be read; nothing is overwritten (that would drop other tools' rules). Reset them with DELETE /admin/v1/mcp/{cid}/arg-rules
413 the body is larger than 64 KiB
422 tool_schema_unusable the tool has no inputSchema.properties object (a tool without declared arguments cannot carry rules), more than 256 properties, or a property name that is not a string of 1-128 bytes
424 connector_credential_required the connector needs a valid credential to read its tool schema; the body carries reason (the 424 body)
500 arg_rules_encode_failed the rules could not be encoded exactly; nothing is stored
502 connector_upstream the server could not be reached, or returned an unusable tool list

Nothing is stored on any refusal. A successful set or removal is audited as mcp_connector.arg_rules_set. The record carries the state before and after, read under the row lock: before is { tool, rule_count } (rule_count absent when the tool had no entry) and after is { tool, rule_count }, or null for a removal. Rule values are never recorded. The write and its audit entry are committed together: when the entry cannot be written nothing is stored and the call answers 503 { "error": "temporarily unavailable; retry later" } (retryable) or a sanitised 500; a refusal records no entry.

GET /admin/v1/mcp/{id} returns the stored rules decoded as arg_rules (an object keyed by tool name). A stored value that cannot be decoded (including the text null, an array or a scalar) is returned as arg_rules: null with arg_rules_error: "malformed"; an empty or SQL NULL column is simply absent. Enforcement reads the column the same way: absent means no rules, malformed refuses the connector's calls with param_rules_malformed. The connector list and the tenant export omit arg_rules, as they omit tool_policy.

DELETE /admin/v1/mcp/{cid}/arg-rules clears the whole column (all tools' rules), whatever its state, and is the recovery path for a malformed column. It has the same access rules as the PUT (404 when the connector is not visible, 403 when not owned) and answers 200 { "reset": true }. It is audited as mcp_connector.arg_rules_reset with before = { malformed: true } or { tool_count } and no after. The clear and its audit entry are committed together: when the entry cannot be written nothing is cleared and the call answers 503 { "error": "temporarily unavailable; retry later" } (retryable) or a sanitised 500.

Enforcement. Rules apply to every tools/call of the connector, from every actor (user chat, agent, workflow, the /call proxy), interactive or not. They only restrict: a rule never grants a tool that tool_policy, owner consent or the access layer refuse. They are checked after tool_policy, so a blocked tool still reports tool_blocked. A refusal is access_denied (see Access layer refusals), is recorded as an access decision, and the call never reaches the MCP server.

Reason Rule id When
param_rule param_rule:<arg>:<kind>:<tool> an argument fails a rule, or arguments is not an object (param_rule:arguments:shape:<tool>), or the call carries no string tool name while the connector has rules (param_rule:arguments:nameless:)
param_schema_drift param_schema_drift:<tool> the call carries an argument that was not declared when the rules were saved
param_rules_malformed the stored rules cannot be read; the connector's calls are refused rather than run unchecked

Schema drift. The rules are ratified against the schema as it was when the admin saved them. If the server later adds an argument, a call that uses it is refused with param_schema_drift until an admin saves the tool's rules again, which re-ratifies against the live schema. Arguments the server added that a call does not use change nothing, and the check needs no tools/list at call time. The rule id never contains the argument name the caller supplied.

Testing argument rules (dry run)

POST /admin/v1/mcp/{cid}/arg-rules/test evaluates a draft rule set against sample arguments and answers what enforcement would do, without saving anything. The rule builder's "Test" box uses it. It needs the same rights as the PUT (404 when the connector is not visible, 403 when not owned), and is checked before the body is read.

{ "tool": "send_mail", "rules": { "to": [ { "kind": "suffix", "value": "@example.com" } ] }, "arguments": { "to": "a@evil.test" } }

Success is always 200 with every key present; the keys that do not apply are explicit JSON null:

{ "tool": "send_mail", "allowed": false, "arg": "to", "kind": "suffix", "reason_code": "param_rule", "rule_id": "param_rule:to:suffix:send_mail" }
  • The check is the one enforcement uses (the same function as the decide refusal), so reason_code and rule_id are exactly what the access decision record would carry. An allowed call has allowed: true and arg, kind, reason_code and rule_id all null.
  • rules is validated like the PUT (400 with the parse reason; a number that does not survive the storage encoder is refused). rules: {} means no rules and allows everything, whatever arguments is. tool is only echoed back; the tool list is not read, so unknown_tool and unknown_argument are not reported here.
  • arguments is evaluated as the gateway would evaluate the call. An absent arguments is a call that carried none: the first rule on a required argument refuses it. A null, array or scalar arguments is not a 400 but a result: allowed: false, arg: "arguments", kind: "shape", rule_id: "param_rule:arguments:shape:<tool>". Absent and null therefore give different answers.
  • Schema drift is not evaluated. Drift is a property of the stored, ratified schema_args, and a draft has none, so param_schema_drift never appears here.
  • Nothing is stored, no audit event is written, no access decision is recorded, and the MCP server is never called.
  • Errors: 400 (malformed_body for an array body, number_not_exact / number_invalid for a number that is not exact or not valid JSON, duplicate_key for a repeated object key, tool-name and rules errors), 401 no user, 403 no tenant or not the owner, 404 connector not visible, 413 body over 64 KiB.

Tool classes

Every tool of a connector has a class: read, write or destructive. The class says how dangerous a call of that tool is, so that unattended agents can be held on the dangerous ones (see Enforcement). The class of a tool is decided by exactly one rule, in this order:

  1. Admin entry: the class an admin stored for that tool on the connector (class_source: "admin").
  2. Catalog entry: the class the gateway's own connector catalog records for that tool of that catalog connector (class_source: "catalog").
  3. Default: destructive (class_source: "default"). A tool nobody classified is destructive, the most dangerous class. There is no separate "unclassified" class on this API; an unreviewed tool is never treated as read.

The class fails closed. If the connector's stored classes cannot be read (malformed column), every tool of it resolves to destructive / default, even where the catalog would say read. A tool name that is empty or not a string is destructive as well.

Catalog-classified tools. Only tools whose behaviour was checked against the server's saved tools/list are classified by the catalog, and a class there is the gateway's own statement, not a copy of the server's annotations:

Catalog connector Tools Class
DeepWiki ask_wiki_question, read_wiki_contents, read_wiki_structure read
Microsoft Learn microsoft_docs_search, microsoft_code_sample_search, microsoft_docs_fetch read
Context7 resolve-library-id, query-docs read
GitMCP match_common_libs_owner_repo_mapping, fetch_generic_documentation, search_generic_documentation, search_generic_code, fetch_generic_url_content read
Runway get_task read
Runway generate_video (starts a paid generation job; nothing is deleted or overwritten) write

The OAuth catalog connectors below are classified from the vendor's own published tool documentation (the vendor's repository or help pages, never a third-party summary). Each tool was classified by its documented behaviour under this rubric: read only retrieves, searches or lists, and causes no state change that anyone could see; write creates or modifies data, sends a message, posts a comment, starts a job or creates a draft, and deletes nothing (sending a message or posting is write, not destructive); destructive deletes, trashes or removes, overwrites or replaces existing content wholesale, moves or merges with data loss, or changes sharing, permissions or visibility. A tool that dispatches other operations takes the class of the most dangerous thing it can run. Both write and destructive tools are held for unattended agents (see Enforcement). Where a tool could be either, the higher class applies. The class follows each vendor's own description of the action, so near-identical actions (archiving, hiding, removing reactions or stars) can land in different classes across vendors; both write and destructive are held for unattended agents, so this never lets such a call run unheld. The vendor's own annotations (readOnlyHint, destructiveHint) were read but never copied.

Catalog connector read write destructive Coverage Sources retrieved Vendor sources
GitHub 63 42 30 full 2026-10-21 README, remote server
Notion 39 15 14 full 2026-10-21 supported tools
Linear 11 0 3 partial 2026-10-21, 2026-10-22 MCP docs, dated changelog entries (Linear's changelog)
Sentry 12 2 1 full 2026-10-21 tool definitions
Atlassian (Jira) and Confluence (one list) 168 83 37 partial 2026-10-22 README, supported tools, v1 supported tools (archived copy)
Gmail 5 4 2 partial 2026-10-21 setup guide, tool reference
Google Drive 6 2 0 full 2026-10-21 setup guide, tool reference
Slack 10 7 0 partial 2026-10-22 MCP server docs
Asana 19 6 2 full 2026-10-21 tools reference
Microsoft SharePoint 16 6 13 full 2026-10-22 SharePoint MCP tools reference (preview)
Microsoft OneDrive 8 2 7 full 2026-10-22 OneDrive MCP tools reference (preview)
Microsoft SharePoint (previous server mcp_SharePointListsTools) 7 4 3 partial 2026-10-22 Lists tools reference, Microsoft Learn page, Japanese locale — the only archived capture (archived copy)
Microsoft OneDrive (previous server mcp_ODSPRemoteServer) 9 2 5 partial 2026-10-22 SharePoint and OneDrive reference (archived copy)
Salesforce 33 12 10 full 2026-10-22 servers reference, sobject-all
Todoist 21 9 17 full 2026-10-27 README, tool registry and each tool's source file in the same pinned Doist repository (v13.7.0)

The vendor removed (SharePoint and OneDrive, previous servers) or replaced (Atlassian's v1 list) the pages marked "archived copy"; the unmodified Internet Archive copies of the vendor's own pages are used as the vendor's official content, and each source record keeps the vendor's original URL next to the archive URL. Linear publishes no tool list, so its tool names come from Linear's own dated changelog entries (partial coverage).

Todoist is classified from the source of Doist's open-source todoist-mcp server (v13.7.0), which the hosted endpoint is built from; Todoist publishes no separate tool reference. The 47 tool names are checked against that source, not against a live tools/list. view-attachment is destructive although the vendor marks it read-only: the model chooses the URL that is fetched with the user's Todoist credentials, and the source does not show the host being restricted. export-project-template is destructive because its link format makes a copy that anyone holding the link can open.

The vendor sources above are the primary tool-list documents; the classification of every individual tool is listed by GET /admin/v1/mcp/{cid}/tools (class_source: "catalog").

Coverage full means the vendor documents every tool the hosted server offers. partial means the vendor's list is incomplete or the server's tool set varies by plan or configuration, so a tool that is not in the table stays destructive / default until an admin classifies it. A tool the vendor does not document is never guessed. Salesforce additionally classifies tools only on its own hosted server endpoints (the platform and sandbox server names the catalog knows), and the Microsoft connectors only on a tenant URL of the catalog's own shape. The two Microsoft connectors also keep the classification of their previous servers (mcp_SharePointListsTools, mcp_ODSPRemoteServer), so a connection added before the move to the current servers keeps that server's tool classes; the two tool lists are never mixed. Atlassian and Confluence use the same rule: the catalog cards point at https://mcp.atlassian.com/v2/mcp?tools=all, and a connection still on https://mcp.atlassian.com/v1/mcp keeps its tool classes until Atlassian retires that endpoint on 2027-03-01. After that date Atlassian serves its v2 tool set on the v1 URL: the connection keeps working. Tools the catalog classifies keep their class; the execute* dispatchers and any tool the catalog does not list count as destructive / default and are held for approval. Replace it with a connection on the v2 card (a new sign-in; v1 tokens and registrations are not reused). The classes match the exact URL only: any other form of the Atlassian URL stays destructive / default. Until the v1 connection is deleted, a v2 connection added next to it lists the same tools twice.

The catalog classes apply only to the catalog's own server. A connector created from a catalog entry keeps its catalog_slug, but its server_url can be changed afterwards. The catalog classes are used only while the connector's server_url is the one the catalog entry defines (or, for templated entries, a URL the catalog itself would produce). A connector pointed at any other server resolves its unclassified tools to destructive / default, since the catalog's statement is about that vendor's server, not the one now behind the URL. Admin entries are not affected by this check.

Every other tool of every connector is destructive until an admin classifies it.

Known limit. The catalog classes are pinned to the vendors' published documentation as of the retrieval dates listed above. No live tools/list from a real account has been captured yet, so a tool the live server exposes under a name the documentation does not list is unclassified (destructive, held) until reviewed, and a documented name the server does not expose has no effect.

Annotations are only a suggestion

An MCP server describes its tools with annotations (readOnlyHint, destructiveHint). They are the server's own claim and are never used as the class: a hostile or careless server must not be able to declare its own call read. GET .../tools returns them condensed as suggested_class, which an admin can use as a starting point. It is never stored and never read by the class rule above. Only explicit JSON booleans count (the string "true", 1 or null count as nothing).

Annotations suggested_class
destructiveHint: true destructive (wins over a contradictory readOnlyHint: true)
readOnlyHint: true read
readOnlyHint: false and destructiveHint: false write
anything else absent (no suggestion)

Two deliberate deviations from the MCP specification, both toward asking a human: the specification defaults an absent destructiveHint to true, but the gateway suggests nothing rather than labelling every unannotated tool destructive; and a readOnlyHint: true together with destructiveHint: true is destructive instead of undefined.

Reading the classes

GET /admin/v1/mcp/{cid}/tools reads the connector's live tools/list with the caller's credential and answers 200 { "tools": [ { "name", "title"?, "class", "class_source", "suggested_class"?, "description"?, "blocked"?, "grandfathered"? } ], "tool_classes_error"?, "tools_truncated"?, "grandfathered_agents"?, "grandfathered_agents_truncated"?, "grandfathered_error"? }. Any caller who can use the connector may read it (404 when the connector is not visible). The server's list is untrusted: names, titles and descriptions are narrowed, entries that are not objects or have no valid name are skipped, and at most a bounded number of tools is returned (tools_truncated: true when it was cut). title is the server's human-readable label for the tool, shown next to the name; it is absent when the server sends none. tool_classes_error: "malformed" appears when the stored classes cannot be read (all tools then show destructive / default).

Blocked tools (include_blocked=1). By default, tools an admin blocked in tool_policy are not listed. The owner (a tenant admin, or the owner of a private connector) can add include_blocked=1 to get the unfiltered list; each tool then carries a boolean blocked. The editor and the "Classify tools" page load GET /tools?include_blocked=1, so a blocked tool can still be classified. Any other value (0, true, empty, repeated) is 400 include_blocked must be 1; a caller who may use the connector but not edit it receives 403 forbidden for include_blocked=1.

Agents that keep running without approval (owner only). Agents whose consent was granted before tool classes existed keep running the connector's tools without a per-call approval until the agent's tools are confirmed again. For the owner, each tool whose class is write or destructive, that is not blocked and that at least one agent snapshot still grants carries grandfathered: true (the key is absent otherwise, and absent for every non-owner); the answer also carries grandfathered_agents: the number of agents granted at least one such tool. Read tools and blocked tools never count. Archived agents count; deleted agents never do. The count reflects the agents' stored consent snapshots: an agent whose current consent no longer includes the tool is still counted, so the number is an upper bound in that sense. The count keys follow these rules:

  • They are absent for a caller who can only use the connector (never 0), so a member learns nothing about other people's agents. Absent also means "not asked", so a client must not read it as zero.
  • grandfathered_agents_truncated: true means more agents exist than the gateway counts in one request (5000); the number is then a lower bound, and the per-row grandfathered marks may be incomplete as well.
  • grandfathered_error: "unavailable" replaces grandfathered_agents when the count could not be read. The listing itself still succeeds.

Skipping the count (grandfathered=0). A caller that only needs the classes, such as the agent consent step, can add grandfathered=0 to skip the owner-only count: none of the grandfathered keys are then returned. grandfathered=1 or no parameter keeps the behaviour above. Any other value is 400 grandfathered must be 0 or 1.

Status Code Meaning
400 message include_blocked or grandfathered has an invalid value (see above)
401 unauthenticated no user
403 no tenant / forbidden no tenant context, or include_blocked=1 from a caller who does not own the connector
403 access_denied the access layer refused the read (the body carries reason)
404 not found the connector is unknown or not visible
424 connector_credential_required the connector needs a valid credential to list its tools; the body carries reason (the 424 body)
502 connector_upstream the server could not be reached or returned an unusable tool list

GET /admin/v1/mcp/{id} returns the stored admin entries decoded as tool_classes (an object of tool name to class; absent when none), with tool_classes_error: "malformed" and no tool_classes when the column cannot be read. The connector list and the tenant export omit tool_classes.

The 424 body

A connector-credential 424 carries { "error": "<human-readable message>", "code": "connector_credential_required", "reason": "<reason>", "connector_id": "...", "connector_name": "..." }. Clients must key on code and reason, never on error (a sentence that may change). reason is one of credential_required, credential_expired, tool_blocked, upstream_auth (a tenant-scoped connector whose stored credential the upstream server rejected with 401/403; a per-user connector's rejection is not this reason) or credential_unreadable (a tenant-scoped connector whose stored credential the gateway could not decrypt; nothing was sent upstream); any other or absent value means an unknown failure. The same body is returned by the tool listing, PUT /admin/v1/mcp/{cid}/arg-rules and PUT /admin/v1/mcp/{id}/credential.

Setting classes

PUT /admin/v1/mcp/{cid}/tool-classes is the only way to set classes. A tool_policy.classes key in a v1 create or patch body (any value, null included; in a v2 body classes holds the class default levels instead) is refused with 400 tool_policy.classes is not accepted here; use PUT /admin/v1/mcp/{cid}/tool-classes. The caller must own the connector, the same as PATCH.

{ "classes": { "search_issues": "read", "create_issue": "write", "old_tool": null } }
  • classes is an object of tool name to "read", "write" or "destructive". null removes that tool's admin entry (the tool falls back to the catalog, then to destructive). Tools not named keep their entry: a request is a merge, applied under the connector's row lock.
  • Tool names follow the same rules as the tool_policy keys. At most 100 tools per request; at most 500 stored per connector.
  • Any bad key or value rejects the whole request and nothing is stored. A missing, null, array, string or empty classes is 400; so are a class that is not one of the three strings (including admin and unclassified).
  • Success is 200 { "tool_classes": { ... } }, the whole stored map after the merge, or null when it is now empty.
  • A change that lowers a tool's four-eyes level needs MCP_TENANT_MANAGE (see below).
Status Code Meaning
400 message invalid classes (see above), or tool_classes_too_large when the stored map would exceed its cap
401 / 403 no user / no tenant, or the caller does not own the connector
403 four_eyes_requires_tenant_manage the change lowers a tool below its two-approver level and the caller lacks MCP_TENANT_MANAGE; nothing is stored
404 not found the connector is unknown or not visible
409 tool_classes_malformed the stored classes cannot be read; nothing is overwritten (that would drop other tools' classes). Reset them with DELETE
413 the body is larger than 64 KiB

A successful set is audited as mcp_connector.tool_classes_set. before and after hold only the tools the request changed (before omits a tool that had no entry, after omits a removed tool). The write and its audit entry are committed together: when the entry cannot be written nothing is stored and the call answers 503 { "error": "temporarily unavailable; retry later" } (retryable) or a sanitised 500; a refusal records no entry.

DELETE /admin/v1/mcp/{cid}/tool-classes clears the whole column (every admin entry), whatever its state, and is the recovery path for a malformed column. It has the same access rules as the PUT, including the four-eyes rule below (after a reset each tool takes its catalog class, else destructive), and answers 200 { "reset": true } (404 when the connector is not visible, 403 when not owned). It is audited as mcp_connector.tool_classes_reset with the prior state ({ malformed: true } or a count) and no after. The clear and its audit entry are committed together: when the entry cannot be written nothing is cleared and the call answers 503 { "error": "temporarily unavailable; retry later" } (retryable) or a sanitised 500.

Lowering four-eyes by reclassifying a tool

A tool's class picks the class line of the connector's tool permission policy that applies to it. Moving a tool to a less strict class can therefore lower its unattended approval. When that change takes a tool from two approvers (unattended approval_2) to fewer, it is a four-eyes change. It needs the MCP_TENANT_MANAGE permission, the same as PATCH /mcp/{id}/four-eyes and lowering four-eyes in the policy body. The connector owner alone (the creator of a private connector, a ki_manager on a group connector) gets 403 { "code": "four_eyes_requires_tenant_manage", "error": "lowering a two-approver (four-eyes) level needs the permission to manage tenant connectors" }. Nothing is stored and no audit entry is written.

  • Where it applies. It covers PUT (for example write or destructive to read, or removing an admin entry so a less strict catalog class applies) and DELETE (a reset that lets a less strict catalog class apply). The check compares each tool's unattended level before and after the change. It considers every tool named by the stored entries, the new entries or the catalog.
  • Moving server_url. A directory connector's catalog classes apply only while its server_url is the directory entry's own address (or its previous, legacy one, which has its own classes). On a connector whose server_url can be edited, PATCH /admin/v1/mcp/<ID> with a different server_url can therefore change classes too: onto the directory address, a tool the catalog lists as read stops being destructive. The same check applies to that move. It compares each tool's unattended level on the stored address and on the new one, and considers every tool named by the admin entries or by the catalog classes of either address. When the same PATCH also sends a tool_policy, the level after the move is read under that new policy. A rename, or a PATCH that re-sends the stored server_url, is not a move. A connector that is not from the directory has no catalog classes, so its server_url never changes a class.
  • Two approvers. A change counts as lowering in either of two cases. First, the connector's four_eyes_required is on and the tool moves from write or destructive to read: an unattended call to a read tool is not held, and a held call needs two approvers whenever the flag is on. This applies whatever the policy version, even when a v2 tools entry sets the tool's level. It does not apply when the policy blocks the tool unattended as read. Second, the policy level that applies to the tool goes from approval_2 to less: for a v2 policy, the class line; for a v1 policy (or none) with the flag on, every write or destructive approval.
  • Stored policy cannot be read. The tool is judged as if there were no policy and the four_eyes_required flag decides. A malformed policy is never more permissive than none.
  • What stays the owner's. Lowering a single approval (approval_1 to allow, for example write to read with four-eyes off) and raising a class need no extra permission. The same holds for the policy body.
  • Concurrency. The check runs under the connector's row lock, on the stored classes, policy and four-eyes flag. A concurrent four-eyes or policy change cannot slip in between.
  • Failure. If the caller's permissions cannot be read, the call answers 503 and nothing is stored.

Where the class shows today

The least-privilege list ranks every right by the class of its tool (destructive first), and a whole-connector right or a connector that no longer exists ranks as destructive. The agent consent step groups tools by the class from GET /admin/v1/mcp/{cid}/tools (see How the agent consent step classifies tools); a tool whose class is only the server-side default shows as unclassified there and is never pre-selected.

Tool class enforcement

The class of a tool decides whether an unattended agent may call it on its own:

  • read: never held. The call runs.
  • write and destructive: the call is held for the credential holder's approval (or refused where no hold is possible), unless the agent's grandfathered consent covers the tool. A tool whose class cannot be resolved is destructive.
  • Interactive use (a human at the keyboard in the playground or chat) is not held by this rule.

The hold itself is described where it happens: Unattended write calls need approval (agents, runs, the review item), Calls that need approval (external agents through the MCP proxy) and access decisions (the approval_required and untrusted_egress records). A write or destructive call from a run started by untrusted content is held additionally, as untrusted_egress, unless it is fully pinned; see Untrusted content.

What a class change means. Setting or removing a class changes the hold from the next call on. A catalog read tool is therefore no longer held for unattended agents, because the catalog now says it only retrieves. Everything unclassified stays held: a tool outside the catalog list, a tool of a connector pointed at a foreign server_url, and any tool of a connector whose stored classes cannot be read. An admin entry always wins over the catalog, in both directions: an admin can lift a tool to read or tighten a catalog read tool to write or destructive.

Connectors in a project that forbids external egress

A Tier-1 (local_only) project blocks externally-egressing tools. For MCP connectors this is per-connector, not all-or-nothing: a connector that stays inside the estate — one owned by the same tenant whose server_url is a private/internal address — is kept, gets its normal tools/list call, and its tools run. Only references that would egress outside the estate (a different tenant, or a public server_url) are dropped. Nothing leaves the estate either way.

What happens to the dropped (external) references depends on the surface:

Surface Signal Behaviour
Interactive chat sends x-aig-mcp-best-effort: 1 The external references are dropped and the turn proceeds — on local tools plus any kept in-estate connectors. A tools_skipped notice lists connectors_policy.
Raw inference API header absent (or any value other than 1) Any in-estate connectors are kept and the turn proceeds; the request is refused 403 forbidden only when every referenced connector is external.

The model is told the same thing: whenever external references were dropped because the project's access tier is Local only (on the chat surface, and on the raw API when in-estate connectors were kept), the gateway adds a system note. The note says the external connectors were switched off by that setting. The model then explains it (in a project chat: use the connector in a chat outside the project, or ask a project owner to change the access tier) instead of saying the connector does not exist. The note and the connectors_policy chip appear only when the tier is known to be local_only. A drop under a tier that could not be confirmed (a failed lookup, or a project that no longer resolves) is reported as a transient connectors drop instead.

So a 403 now means all referenced connectors are external — a request mixing an in-estate connector with external ones keeps the in-estate one and proceeds (the external refs are dropped, with the chat notice above). The split exists so an auto-attached convenience connector cannot silently kill a chat turn, while a raw caller whose connectors are all external still gets an explicit refusal.

A run under a no-egress restriction (for example a direct request that sends the no-egress header) stays fail-closed regardless: every connector reference is dropped — there is no in-estate exception on that path — and the best-effort opt-in is honoured only when the block comes from the project tier, never the run profile.

Previously the chat surface was refused too. On a gateway with a PII detector that refusal arrived as an empty 200 stream (the scanning_pii event had already committed the response), so the user saw no answer and an "access denied" banner on every turn in such a project.

When a connector is dropped: the tools_skipped notice

Separately from the policy drop above, a connector that fails discovery on the interactive chat surface (best-effort) is dropped for that turn so one flaky connector never fails the whole chat — the turn proceeds on the remaining tools. The gateway then emits a tools_skipped SSE status event whose connectors array names each dropped connector and why:

{ "aig_status": "tools_skipped", "tools": ["connectors"],
  "connectors": [ { "id": "<connector id>", "name": "<display name>", "reason": "<class>" } ] }

reason is one of a fixed set (any other value is treated as unavailable):

reason Meaning User-facing action
credential_required A user-scope connector the caller has not connected yet. Connect it (Settings → Connections).
credential_expired A user-scope connector whose stored credential the provider rejected. Reconnect it (Settings → Connections).
auth A shared / tenant-scope connector whose stored token the provider rejected (HTTP 401/403). The caller cannot fix it. A tenant administrator must update the connector's token under MCP Connectors.
unavailable The connector was unreachable this turn (timeout, 5xx, connection refused, or an egress block). Retry later; if it persists, check the connector's URL.

The notice is live-session only (not persisted). A drop whose connector name cannot be resolved falls back to the coarse connectors category token with no per-connector detail. The connector name is a tenant-admin-authored string and is sanitized (length-capped, control characters stripped) before it appears in the notice. The name in this client event is the real name; in the notice the MODEL receives, on a gateway that masks personal data, the name — like the "connectors attached" notice's names — is masked by the PII detectors first (the tool descriptions and schemas the MCP server publishes are sent as the server wrote them) (see PII Protector — Sub-agent and connector labels).


Getting my credential status

GET /admin/v1/mcp/<ID>/credential

Member-accessible (requires tenant + authenticated user; not tenant_admin). Reports whether the calling user holds a credential for the connector; the stored secret value itself is never returned.

Field Type Notes
exists boolean true when the caller has a stored credential
expires_at unix seconds | null null when no expiry is set or no credential exists

Returns 403 when there is no tenant context, 401 when unauthenticated, 404 when the connector is not found in the caller's tenant, and 503 on a transient read fault of the connector or the credential store (fail-closed, so a blip never reads as "no connector" or "no credential").


Storing my credential

PUT /admin/v1/mcp/<ID>/credential

Member-accessible (requires tenant + authenticated user; not tenant_admin). Stores or replaces the calling user's per-user credential for a connector. Only valid for connectors with scope = "user".

Once stored, a per-user credential is always transmitted to the MCP server as a Bearer token, regardless of the connector's declared auth_type — the presence of the credential is what makes the call authenticated. A connector left at auth_type = "none" therefore still sends a personal token if one has been stored; auth_type on a user-scope connector only governs whether a missing credential is fatal (bearer → the call is rejected with a reconnect prompt, none → the call proceeds unauthenticated).

Field Type Required Notes
auth_value string yes must be a non-empty (not whitespace-only) string of at most 4096 bytes with no control characters (CR, LF, NUL, tab, ...); it must be the bare token: printable ASCII without spaces, so a Bearer prefix or a non-ASCII character is 400
expires_at unix seconds no when set, must be a whole future timestamp within 100 years (a non-integer, past, or milliseconds-magnitude value is rejected; a value that is not an exact double, for example 1893456000.0000001, is refused with 400 number_not_exact)
refresh_token string no absent or JSON null means none. A non-string, blank, control-character-containing or longer-than-4096-byte value is refused with 400 and code: "invalid_refresh_token" before anything is stored. A valid value is bound to the connector's current oauth_token_url (a connector without one stores it unbound, so it is never refreshed)

The credential is bound to the connector's server_url. The server_url the connector had when the request was handled is recorded with the credential. If an administrator moves the server_url while the verification is in flight, the credential is still written, but it is bound to the old address and is never used: the user sees the connector as not connected and reconnects. See Updating a connector.

The credential is verified against the provider before it is stored. After the shape checks above, the gateway performs the same tools/list handshake it uses everywhere else, authenticated with the pasted token (the token is passed as a validation candidate — nothing is written until it succeeds). This closes the old defect where any text was accepted and the connector read "Connected" forever while a later tools/list failed with a generic 502. Outcomes:

  • Verified → the credential is stored; response { "ok": true }.
  • Rejected by the provider (a 401/403 on the handshake, or the connector otherwise reports the credential unusable) → 424 with { "error": <message>, "code": "connector_credential_required", "reason", "connector_id", "connector_name" } (see the 424 body). Nothing is stored — the row does not read "Connected". This is the product's own connector-credential code, never a 502.
  • Unreachable / unverifiable (the connector did not answer — network error, protocol error, or the discovery deadline was exceeded) → 502 with { "error": <message>, "code": "connector_upstream" }. Nothing is stored (fail-closed: an unverifiable credential must not read "Connected"); this is a connectivity problem, distinct from a bad credential — retry when the connector is reachable.

Because the validation reuses the shared call chokepoint, it inherits its SSRF pinning and tool-policy guards, and a token pasted here that the provider rejects can never leave a working credential behind, nor mutate any existing stored credential (the candidate is never persisted).

Other returns: 400 when the connector is not scope = "user", when auth_value is missing, null, empty, not a string, over 4096 bytes, contains a control character or is not a bare token, or when expires_at is not a whole future unix-seconds value within 100 years; 404 when the connector is not found in the caller's tenant or not visible to the caller; 403 when there is no tenant context, or access_denied (with reason) when the access layer refuses the verification call; 401 when unauthenticated; 503 on a transient read fault of the connector; 500 on an unexpected credential store failure.

Note (OAuth-obtained credentials): a credential minted by the OAuth connect flow derives its expires_at from the provider's expires_in, which does not pass through this route's validator. To keep a misconfigured or hostile token endpoint from returning an expiry that would overflow the storage column and fail the connection, such a provider-derived expiry is clamped to a BIGINT-safe far-future bound at storage time. The OAuth callback therefore never 500s on a pathological token response.


Starting a per-user OAuth connect

GET /admin/v1/mcp/<ID>/oauth/start

Begins the per-user "Sign in with <service>" round-trip for an OAuth connector. The browser navigates to this URL (it is not called as JSON), and the gateway responds with a 302 redirect to the provider's authorization page; the PKCE verifier is held server-side under an opaque state nonce — stored in the database (single-use, DB-backed so an active-active start/callback across sites still completes) — and the public callback completes the flow and stores the caller's per-user credential.

The route is available only to a caller holding MCP_AUTHOR (the connector-authoring permission — the built-in member/ki_manager/tenant_admin/admin roles or a custom role granting it; a viewer, demouser, or finance user is refused) and only for a scope = "user" connector — a tenant-scoped connector routes on its shared credential and is refused.

Refusals redirect, they do not answer JSON. Because the browser navigates here, every refusal is a 302 to the application's connectors page, /connectors?oauth_error=<code>, which shows a translated message; the reason detail is only logged. The codes:

Code When
forbidden No user on the session, no MCP_AUTHOR permission, no tenant, or the connector is not user-scoped
not_found The connector is not in the caller's tenant or not visible to the caller
config The deployment has no OAuth callback URL configured, or the connector's administrator-entered OAuth settings are incomplete (for example a client ID without a token or authorize URL), or the stored token URL is neither https:// nor a host:port on the tenant's connector egress list (setup answers config before any redirect to the provider), or, at the callback, the stored OAuth client secret cannot be decrypted with the gateway's master keys (the code is then not exchanged: the gateway never sends the exchange without the secret)
retry The caller's permissions or the connector could not be read, or the OAuth state could not be stored (transient)
rate_limited The discovery or registration limit was reached
setup_in_progress Another request is registering this connector's OAuth client right now
setup_no_metadata · setup_no_registration · setup_registration_failed · setup_unreachable · setup_insecure_endpoint · setup_blocked_address The automatic setup (below) failed: the server publishes no OAuth metadata · offers no automatic registration · refused it · could not be reached in time · advertises non-HTTPS endpoints · points to a private or internal address
setup_failed The automatic setup failed otherwise (for example the registered client could not be stored)

The connect is pinned to the server_url it started against. The state entry records the connector's server_url. If the connector was moved before the callback arrives, the callback answers config without exchanging the code and stores nothing; the user restarts the connect. The same applies to the native-app hand-off: the app redeem checks the pinned server_url. A token exchange already in flight when the connector moves can still write a credential, but it is bound to the address the connect started against, so it is never used for the new server_url.

The public callback (GET /admin/auth/mcp/callback) uses the same channel: credential_expired, config, store_failed, forbidden, retry (a transient fault, or an unknown, expired or replayed state — restart the connect), cancelled (the user declined at the provider, ?error=access_denied), not_found, setup_blocked_address (the token endpoint resolves to an address this connector may not reach), and error (anything else, including a CSRF-cookie mismatch). The callback never places the provider's own error text or an internal failure kind in the URL — only these codes. On success it redirects to /connectors?connected=<connector id> (without return_to; see below).

Returning to the originating chat (return_to). oauth/start accepts one optional query parameter, return_to=chat:<conversation id>, so a connect begun from a chat comes back to that chat instead of the connectors page. The value must be exactly chat: followed by a lowercase UUID (at most 64 bytes) and may appear once; the conversation must be one of the caller's own, non-deleted conversations. The gateway stores the validated conversation id server-side in the single-use state entry; the callback never reads a target from its own URL, so a crafted callback link cannot choose where the browser lands. With a valid return_to:

  • success redirects to /easy/c/<conversation id>?connected=<connector id>, plus &selection=full when the connector will not be among the chat's tools on its next turn. The server decides this after the visibility checks, from the stored connector id and the caller's own connector list, and records it in the state entry: an explicit selection that is full, an explicit selection with room that simply does not include the connector, or an implicit selection where the connector is beyond the first 8 connected. If the selection or connector list cannot be read, the start answers retry and stores no state;
  • an error that occurs after return_to was validated (at oauth/start) or after the state was consumed (at the callback, including a provider-side ?error= response that carries your own CSRF cookie) redirects to /easy/c/<conversation id>?oauth_error=<code>&connector=<connector id>, using the codes above. The connector value is the id of the connector that failed (for oauth/start the uuid-shaped connector id from the request path, echoed back; for the callback the id stored with the state; for one-hop connect the connector the server just created or reused; it is added only to the chat return and is always a lowercase 36-character UUID, any other value is dropped). The /connectors page never carries it. A provider-side ?error= maps to cancelled for access_denied and to error for anything else, but only when the CSRF cookie matches the state; a foreign state consumes nothing;
  • an error before that point stays on /connectors?oauth_error=<code>. At oauth/start: unauthenticated, no MCP author permission (forbidden, for example viewer or demo users), no tenant, and impersonation. At the callback: a CSRF cookie mismatch, a missing code or state, an unknown or expired state (retry), a fault while consuming the state, an undecodable state entry, and a provider error whose state does not match the cookie.

An absent return_to behaves exactly as before. A return_to that is present but not valid is refused fail-closed: malformed or over-long values, a second occurrence, an absolute or protocol-relative URL, another user's conversation, an unknown or deleted conversation, and a query cut off at the 100-argument cap. The reply is 302 to /connectors?oauth_error=error with no state stored, no cookie set and no redirect to the provider. A database fault while checking the conversation answers 302 to /connectors?oauth_error=retry. If the conversation is deleted after the connect started, the callback still redirects to its /easy/c/<id> URL (the SPA shows its not-found state); the credential is stored either way. A stored target that is corrupt makes the callback redirect to /connectors?oauth_error=error without exchanging the code.

Authorization-response issuer (iss, RFC 9207). To defeat authorization-server mix-up, every connect re-discovers the server's OAuth metadata (the same validated, rate-limited discovery as above) and records the expected issuer in the single-use, 10-minute state entry together with whether the server advertises authorization_response_iss_parameter_supported: true (only the literal JSON true counts). The callback then checks the iss query parameter before the authorization code is exchanged:

Callback iss Outcome
Absent, server advertises support refused
Present and different from the recorded issuer (exact string comparison — no case, prefix or trailing-slash tolerance) refused, even when the server does not advertise support
Malformed — repeated, empty, control bytes, longer than the URL cap, or a plain-http URL that is not deployment-allowlisted (AIG_SSRF_ALLOW; the same issuer scheme rule as discovery) refused
Present and equal, or absent when support is not advertised accepted

A refusal redirects to /connectors?oauth_error=error, burns the state and never contacts the token endpoint. A state entry written before this check existed carries no expectation and is accepted as before; an entry whose expectation fields have the wrong type is treated as corrupt and refused. When the issuer cannot be established (the server publishes no usable issuer) a present, well-formed iss is accepted with a logged warning, because there is nothing to compare it with.

At connect time the discovery has two further refusals: a transient failure of the re-discovery (the server is unreachable, or a metadata document answers anything other than a success, 404 or 410 — for example 429 or a 5xx) redirects with setup_unreachable and stores no state, and a server that advertises authorization_response_iss_parameter_supported but whose issuer is unusable redirects with config. A definitive "no metadata" answer lets the connect proceed without an expectation, as before. Any non-success answer other than 404/410, or an unreadable success body, from a metadata candidate is a transient unreachable outcome (it no longer falls back to the server origin); an SSRF or pin refusal, then an insecure endpoint, still take precedence. Each connect therefore performs one discovery and is charged to the per-user discovery limit (20 per minute); a connector whose server_url no longer resolves bounces instead of connecting. The expectation applies only while the connector's stored authorization URL equals the discovered one.

Accepted oauth_error values (application side). The value is a link parameter anyone can craft, so the connectors page shows a code's message only for exactly one value from the closed set above. An empty value shows nothing; an unknown value, the generic error, or a repeated oauth_error parameter shows the generic message "Connecting failed. Please try again."; the raw value is never displayed. connected= shows the success message only for a connector in the user's list.

connector and selection on the chat return. The server appends &connector=<id> to a chat oauth_error return and &selection=full to a chat connected return (see above). The web app reads both, fail-closed (a connector that is not exactly a lowercase UUID is ignored; a selection that is not exactly full fails closed, see below). On ?oauth_error with a connector it marks the newest setup card of that connector; without a usable connector, or when no card matches, it shows the mapped error as a note on the conversation. On ?connected without selection=full it sends its one continuation message. With selection=full the server is saying the connector will not be among the chat's tools on the next turn (the same flag is returned by oauth/start chat returns): the web app sends no continuation and the card shows the matching hint (maximum of 8 connectors reached, or connector not selected for this chat); after a reload the Tools picker shows which connectors the chat uses. A selection value that is neither absent nor exactly full fails closed: no continuation, and a note that the return could not be confirmed. The hint is not persisted; after a reload it is gone. The card itself starts a connect with a plain navigation to GET /admin/v1/mcp/connect?slug=<slug>&return_to=chat:<conversation id> (a reconnect card navigates to oauth/start for its connector); the web app creates and patches nothing.

Not redirected: an expired session is refused by the session check before this route runs (401 JSON) — the application therefore checks the session before navigating here and sends a signed-out user to the sign-in page; and a session under impersonation is refused by the shared personal-data guard (the connectors list offers no Connect then).

Note (automatic client registration). For a one-click connector with no pre-registered OAuth client, the first connect uses a Client ID Metadata Document when the server supports it (see Automatic OAuth setup); otherwise it performs RFC 7591 Dynamic Client Registration against the server's discovered registration endpoint. The gateway negotiates the client type from the authorization server's advertised token_endpoint_auth_methods_supported: it registers a confidential client (client_secret_post) by default, and a public client (token_endpoint_auth_method=none, relying on PKCE) when — and only when — the server advertises none and does not offer client_secret_post. A public client stores no secret; the authorization-code exchange and token refresh omit client_secret and are carried by the PKCE verifier. A missing or malformed methods list never downgrades a connector to a public client. The discovery and registration are validated and rate-limited exactly as described in Automatic OAuth setup; for a connector a member registered, the discovered sign-in URLs must be public. A limit redirects with oauth_error=rate_limited.


Connector OAuth from the mobile apps (app mode)

The Android and iOS apps cannot run the per-user connect in their web view (a provider login must open in the system auth browser, RFC 8252) and the system browser shares no cookies with the web view. App mode therefore reuses the single-use handoff of the native app sign-in: the provider code is parked server-side, the app receives only a 64-hex handoff code, and only the web view holding the PKCE verifier can redeem it. The browser flows above are unchanged; app mode is a separate set of routes.

1. Start (authenticated JSON POST from the web view).

  • POST /admin/v1/mcp/<ID>/oauth/start or POST /admin/v1/mcp/connect?slug=<slug>&return_to=chat:<conversation>, the same checks and chat-return rules as the GET forms.
  • Body { "app_challenge": "<43 chars base64url, SHA-256 of the verifier>", "app_return": "intent" | "link" | "scheme" }. Both fields are mandatory and the Content-Type must be application/json (otherwise 400 { "error": "content type must be application/json" }); an absent, half-sent or malformed pair is 400 and nothing is stored (a POST start exists only for the app).
  • Answer 200, no Set-Cookie, in one of two shapes. { "authorize_url": "https://<app host>/admin/auth/mcp/app-authorize?id=<single-use id>" }: open exactly that URL in the system auth session. { "redirect": "<URL on the SPA origin>" }, possible for POST /admin/v1/mcp/connect when the connector needs no authorization (auth_type none) or the member already has a usable credential: navigate the web view to it and open nothing. Any refusal is { "error": "<code>", "code": "<code>", "redirect": "<URL>" }, from the same closed oauth_error set as the browser flow (code equals error; a value outside the set is error). The redirect is /connectors?oauth_error=<code>, or, once return_to has been validated, the originating chat: /easy/c/<conv>?oauth_error=<code>&connector=<id> (&connector=<id> only once a connector id exists). The HTTP status follows the code:

    error code Status
    forbidden 403
    not_found 404
    connector_limit 409
    retry, config 503
    setup_failed, setup_unreachable, setup_blocked_address and any other setup_* 502
    any other code (for example credential_expired, error) 400
  • A malformed or absent app pair is not a connector refusal: it answers 400 { "error": "<reason>", "code": "invalid_field", "field": "app_challenge" | "app_return" } with no redirect and stores nothing (field names the absent field of a half-sent pair, else the malformed one; both absent is app_challenge). The reasons are app_challenge and app_return are required (both absent), app_challenge and app_return must be sent together (only one sent), invalid app_challenge (not exactly 43 base64url characters, or not a string) and invalid app_return (not intent, link or scheme).

  • The provider URL itself is never returned to the web view: it is stored under the single-use id (120 s).

2. Owned start URL (system browser). GET /admin/auth/mcp/app-authorize?id=g<channel><32 hex> is public, consumes the id and answers 302 to the stored provider URL. A malformed id (absent, repeated, wrong length or prefix) answers 400 { "error": "invalid id" } and consumes nothing. A well-formed id that is unknown, expired or replayed, or a user agent that is not eligible for the requested channel, answers over the app channel with error=unsupported|try_again&page=connectors and never redirects to a provider. A stored provider URL that is not https (http is accepted only on a test environment), is longer than 2048 characters, or contains control or space characters is refused the same way, try_again over the app channel, and the row is consumed (defence in depth: the URL was validated when it was written and is checked again here). An id presented by an ineligible device is not consumed: it stays valid, within its 120 s, for an eligible device. The hop is rate limited to 60 requests per 60 s per client (429 { "error": "rate limited" }).

3. Callback (system browser, no cookie). The provider returns to GET /admin/auth/mcp/callback?state=a<channel><32 hex>&code=.... The callback does no token exchange and stores no credential; it consumes the state, checks iss as for the browser flow, parks the provider code in a handoff row (120 s) and redirects on the requested channel to the 64-hex code. Channel eligibility is decided from the callback's User-Agent exactly as for sign-in (link: Apple Safari; scheme: iPhone below iOS 17.4 and the setting oauth_app_scheme_return; intent: Android, an explicit-package intent: URI with extra aig_code). An ineligible channel is error=unsupported&page=connectors, and an unknown, expired or unusable state or a store fault is error=try_again&page=connectors, both on the same channel; no code is minted in either case. A provider decline (access_denied) or any other provider, iss or code failure on a usable state is not an error redirect: the callback mints a normal #code=<64 hex> (Android S.aig_code) whose handoff row records cancelled or error, and the redeem (step 4 below) answers it with 200 { "redirect": "…?oauth_error=cancelled|error[&connector=<id>]" } (see the table row "The provider declined or the exchange failed"). A client must therefore always navigate the redeem's redirect and never treat receiving a code as success.

4. Redeem (authenticated JSON POST from the web view). POST /admin/v1/mcp/oauth/app-redeem, body { "code": "<64 lowercase hex>", "verifier": "<43-128 chars of [A-Za-z0-9._~-]>" }, rate limit 30 per 60 s per client (429).

Checks run in this order; the table says whether the handoff code is consumed. Every redirect value is a URL on the SPA origin (the origin may differ from the admin host); the table shows its path and query.

Case Result Code consumed
Impersonating session 403 { "error": "impersonation_forbidden" } no
Rate limit (30 per 60 s per client) 429 { "error": "rate limited", "code": "rate_limited" } no
Content-Type is not application/json, the code is not 64 lowercase hex, or the verifier is not 43-128 chars of [A-Za-z0-9._~-] 400 { "error": "invalid code", "code": "invalid_field", "field": "code" } or 400 { "error": "invalid verifier", "code": "invalid_field", "field": "verifier" } (the Content-Type refusal is 400 { "error": "content type must be application/json" } before the body is read) no
No session identity 403 { "error": "forbidden", "code": "forbidden", "redirect": "/connectors?oauth_error=forbidden" } (the session middleware answers 401 earlier for a request without a session) no
Caller check refused (no MCP_AUTHOR permission or no tenant; demouser receives 403 { "error": "forbidden" } without redirect, from the demo write-deny) 403 { "error": "forbidden", "code": "forbidden", "redirect": "/connectors?oauth_error=forbidden" } no
Caller check could not be completed 503 { "error": "retry", "code": "retry", "redirect": ... } no
Storage fault while consuming 503 { "error": "retry", "code": "retry" } no
Unknown, expired or replayed code, or a code of another kind (a sign-in code is not accepted here and vice versa) 400 { "error": "invalid or expired code", "code": "invalid_handoff" } n/a
The stored handoff is unusable 400 { "error": "bad handoff", "code": "invalid_handoff" } yes (burned)
The session user is not the user who started the flow (checked before the verifier) 403 { "error": "forbidden", "code": "forbidden", "redirect": ... }, nothing stored yes (burned)
Verifier does not match the challenge 400 { "error": "invalid verifier", "code": "verifier_mismatch" }, nothing stored yes (burned)
The provider declined or the exchange failed 200 { "redirect": ... }, nothing stored. The redirect is /connectors?oauth_error=<code> or, with a chat return, /easy/c/<conversation>?oauth_error=<code>&connector=<id> (absolute on the SPA origin; path and query are the contract) yes
The session user is deactivated (disabled or deleted) 200 { "redirect": "/connectors?oauth_error=forbidden" }, no exchange, nothing stored yes
Valid the token exchange and the credential write run now, as the session user, through the same finish as the browser callback; 200 { "redirect": "<URL on the SPA origin>" } (/connectors?connected=<id>, or the chat return with selection=full where the browser flow adds it) yes

A client must tolerate a missing redirect on a 403.

5. What the web view does (SPA). In the Android and iOS apps the web view starts the connect itself and never navigates to the provider.

  • It sends the start POST of step 1 with a fresh PKCE challenge and the return channel the app advertises in window.__myraNativeCaps.oauthSession (link, scheme or intent). It stores the verifier in localStorage under aig_app_oauth as { verifier, ts, kind: "connector" }; a record without kind is a sign-in record, and a record with any other kind is treated as absent.
  • It hands the authorize_url to the native bridge only if it is an https URL (without userinfo or fragment, already in normalized form) with exactly the path /admin/auth/mcp/app-authorize and a single id of the form g<channel><32 hex> for the channel it requested. The SPA does not pin the host, because the server derives the admin origin from the registered callback URL, which may differ from the SPA origin; the native shell pins the exact owned origin and path before it opens anything. The Android app (it advertises the connectorOAuth capability) accepts exactly https://<admin host>/admin/auth/mcp/app-authorize?id=gi<32 lowercase hex> for its own environment's admin host (production ai-api-admin.myra.eu) and returns through the intent: APP_COMPLETE channel with page=connectors. The iOS app (it also advertises connectorOAuth; an iPad below iOS 17.4 advertises neither) accepts exactly https://<admin host>/admin/auth/mcp/app-authorize?id=g<l|s><32 lowercase hex> with the letter bound to its oauthSession (link→l, scheme→s) for its own environment's admin host, and returns through that session's callback with page=connectors. Anything else, including a provider URL, is refused and nothing is opened. The SPA enters app mode only when the app advertises connectorOAuth: true (together with a valid oauthSession). An app without it (the capability absent, or any value other than the boolean true) shows "update the app or connect from the web" and starts nothing: no request is sent, the bridge is not called and no verifier is written. On the chat setup card that message replaces the Connect button (there is no "Try again", which could not succeed); Remove stays when the card offers it. Decided before the click: the unsupported note is shown up front, never as a toast after a click, and on exactly one surface per entry point: the chat setup card replaces Connect with the note (no Connect, no "Try again"; a connected row still wins), and the /connectors page shows one page note and hides the OAuth Connect and Reconnect buttons (non-OAuth connectors are unaffected). There are two messages. connectors.toast.errUnsupported ("update the app or connect from the web") is for a build that does not advertise connectorOAuth: true. connectors.toast.errUnsupportedDevice ("accounts cannot be connected in the app on this device, please connect from a web browser") is for a shell that advertises connectorOAuth but cannot connect: no usable oauthSession, or the iOS scheme channel (iPhone below iOS 17.4) while the server does not enable it. For the scheme channel the SPA reads app_scheme from GET /admin/auth/methods and offers Connect only when it is exactly true; false, an absent or malformed field, and a failed probe (one that errors or does not answer within 10 seconds) all mean "not enabled" (fail closed), and Connect stays disabled while the probe is pending. The probe reports app_scheme: false while OAuth sign-in (oauth_login_enabled) is off, so the scheme channel then also shows the web note. Plain browsers always use the browser flow.
  • The app returns to /auth/app-complete#code=<64 hex> or #error=<try_again|unsupported>&page=connectors. For a connector record the page redeems with step 4 and follows the redirect only when it resolves to /connectors or the chat path on the SPA origin; any other value lands on /connectors?oauth_error=try_again. A 200 with a provider decline is shown on /connectors like in the browser flow, so receiving #code is never treated as success by itself.
  • The verifier record is removed after a 200 only. A refused or failed redeem keeps it so that a foreign or junk code cannot end a connect that is still in flight; the record expires on its own.

The handoff row is bound to the start's user id, connector id, PKCE challenge, chat return target and selection flag, so the redeem cannot be pointed at another connector or user.

Accepted residual risk (open redirect to the provider URL). The go hop sends the browser to the provider authorize URL of a connector the minting member controls. A member's private connector may name any public https authorize host. Mitigations: the id is single use and valid for 120 s, it is honoured only for a mobile browser eligible for the id's channel, the hop is rate limited (60 per 60 s per client), and the minting user and connector are logged. The attacker gains only an admin-origin-branded, per-victim, 2-minute link to a URL they could send directly. As for sign-in, an attacker-started flow can have its handoff code intercepted on a device where a malicious app owns the myraai:// scheme (iPhone below iOS 17.4, behind oauth_app_scheme_return) or the package name eu.myra.myraai (Android without the real app). The code is useless without the verifier, which never leaves the victim's web view, and a redeem by a different session user is refused and burns the code.


Deleting my credential

DELETE /admin/v1/mcp/<ID>/credential

Member-accessible (requires tenant + authenticated user; not tenant_admin). Removes the calling user's per-user credential for the connector. The response is { "ok": true }. Returns 403 when there is no tenant context, 401 when unauthenticated, 404 when the connector is not found in the caller's tenant or not visible to the caller, 503 on a transient read fault of the connector, 500 on a credential delete failure.


Tool-result media (images)

When a connector's tools/call result includes an image content block, the gateway renders it in the chat and persists it with the reply (the same pipeline as the first-party image tool: inline display, download, and document export), instead of flattening the whole result to text. This is what lets an MCP tool (for example an image-generation connector) show an image in chat.

Accepted shape. The gateway reads image blocks that are direct members of the result's content list (the MCP spec defines content as a flat list of content blocks; an image nested inside another block, or returned outside content, is left on the text path), each of the MCP form:

{ "type": "image", "data": "<base64>", "mimeType": "image/png" }
  • data must be a non-empty base64 string of the raw image bytes.
  • The stored/rendered type is derived from the image's own magic bytes, not from the declared mimeType — a mimeType that disagrees with the bytes is ignored (the bytes win). Accepted raster types: image/png, image/jpeg, image/webp, image/gif.
  • Text blocks in the same result are passed to the model verbatim — so a tool that returns a thumbnail image plus a text block carrying a full-resolution download URL still delivers that URL. Any top-level fields other than content (for example structuredContent, _meta) are not forwarded once an image block is present; put anything the model needs in a text block.

What is rejected (the image is dropped and the model is told, in a short note, that an image could not be displayed — the raw bytes are never placed in the model-facing text):

  • a non-raster declared or actual type — image/svg+xml and text/html are rejected (an SVG/HTML payload stored as a renderable type would be an XSS vector; rejecting by magic bytes closes it);
  • bytes whose magic does not match a supported raster type, or that are not valid base64;
  • an image larger than 12 MiB decoded;
  • an image whose pixel dimensions exceed the gateway's safe-decode ceiling, or whose header cannot be measured (fail-closed — this bounds a decompression/canvas bomb in the inline and PDF-export renderers).

Images returned by MCP tools share the per-reply image budget (4 images per assistant turn) with the first-party image tool; beyond that, further images are not shown and the model is told the limit was reached. On a conversation that cannot be saved (an ephemeral "ghost" turn), a returned PNG is delivered live to the browser and stored nowhere; other formats on a ghost turn are reported as not shown rather than silently dropped.

Out of scope (handled separately): a full-resolution image referenced only by a URL inside the result, and video content — these are not fetched or rendered by this path; only inline image content blocks are.

⚠️ PII note. The outbound tool-call argument PII/egress guard still applies to everything the gateway sends to the MCP server. It does not inspect PII depicted inside an image the tool returns (or inside a reference image sent for editing): the gateway's PII scanning is text-based and cannot read personal data rendered as pixels. Treat image bytes exchanged with an external connector accordingly.

Tool-result media (audio)

When a connector's tools/call result includes an audio content block (for example a Runway generateAudio / text-to-speech connector), the gateway surfaces it in chat as an inline <audio controls> player and persists it with the reply — the exact audio analog of the image path above, sharing its pipeline and per-reply budget.

Accepted shape. The gateway reads audio blocks that are direct members of the result's content list (same scope boundary as images — an audio block nested inside another block, or referenced only by a URL / embedded resource, is left on the text path), each of the MCP form:

{ "type": "audio", "data": "<base64>", "mimeType": "audio/mpeg" }
  • data must be a non-empty base64 string of the raw audio bytes.
  • The stored/played type is derived from the audio's own magic bytes, not from the declared mimeType — a mimeType that disagrees with the bytes is ignored (the bytes win). Accepted types: audio/mpeg (mp3), audio/wav, audio/ogg, audio/mp4 (m4a), audio/aac, audio/webm.
  • Text blocks in the same result are passed to the model verbatim (a tool returning a clip plus a transcript delivers both). The raw base64 is never placed in the model-facing text — the model sees only a short "an audio clip was played to the user" note.

What is rejected (the clip is dropped and the model is told, in a short note, that an audio clip could not be played — the raw bytes are never surfaced):

  • bytes whose leading magic does not match one of the six supported types (a PNG/JPEG/SVG/HTML/plain-text payload declared as audio is rejected — the stored type becomes a gateway constant echoed into the player's data: URL, so a non-audio payload can never ride), or that carry a reserved/malformed header field, or that are not valid base64;
  • a clip larger than 20 MiB decoded.

A magic-valid header is the gate (audio has no decode-canvas/"pixel bomb" analog — an <audio> element never allocates from a header-declared duration); this is not an absolute "anything else is impossible" guarantee, but a blob crafted behind a valid audio header can only ever render in <audio> under a gateway-constant mime, never as markup or script.

Audio returned by MCP tools shares one per-reply media budget (4 media per assistant turn) with generated images — image + audio together cannot exceed it. On a conversation that cannot be saved (an ephemeral "ghost" turn), a returned clip is delivered live to the browser as a download and stored nowhere.

Serve route. A persisted clip's bytes are fetched by the SPA from GET /conversations/{conversationId}/audio/{audioId} (base64 in a JSON body, like the generated-image route). Both path parameters are untrusted: the route first authorizes the conversation to the calling user, then returns the clip only if its id belongs to that conversation — a foreign or absent id yields 404, a conversation the caller does not own yields 403 (no cross-conversation/cross-user access).

⚠️ PII note. As with images, the gateway's text-based PII scanning cannot read personal data spoken inside an audio clip a tool returns. Treat audio bytes exchanged with an external connector accordingly.

Repeated identical calls

An identical repeat of a successful call in the same reply is not run again. This applies to connector tools that are not read-only and to the built-in generate_image, create_video and remove_background tools. The model receives a [duplicate] note instead of a second execution; to repeat an action on purpose, vary the arguments. The memo lives for one reply; a call made before an approval hold is not deduplicated after the resume.