Skip to main content
POST
Register an MCP server
Registers an upstream MCP server. Four things are worth knowing before you call it, each of which is a refusal rather than a surprise later:
  • allowed_tools defaults to empty, and empty means no tools. A server created without it advertises nothing on tools/list and refuses every tools/call. The response says so in meta.note when that happens. This is deliberate — a governed gateway does not open by default.
  • server_type: "collection" is refused with 422 unsupported_server_type. The forwarder does not serve that type, so the row would fail every call. Only upstream is served.
  • transport must be streamable_http. Anything else is 422 unsupported_transport; the gateway does not speak the legacy SSE transport.
  • upstream_url goes through the SSRF chokepoint at write time and again at connect time. A URL that resolves to a private or link-local address is refused, not dialled.
auth selects how the server reaches its upstream: {"mode": "secret"} (the default) resolves one credential from your secret store per connection, and {"mode": "passthrough"} makes each caller supply their own — see how the server authenticates upstream. A literal credential in auth.headers is refused at write time; reference a Secret with {{secret_id:<uuid>}}. MCP servers are a plan entitlement — creating one beyond your plan’s allowance is refused. Requires the create capability on ai_gateway. See the control-plane overview for authentication, the {data, meta} envelope, pagination and error types.

Authorizations

Authorization
string
header
required

OAuth 2.1 authentication — recommended for new integrations. Access tokens (kc_ prefix) are minted at the root-host token endpoint https://api.knoxcall.com/oauth/token and passed as Authorization: Bearer <access_token>. Public clients must use PKCE with the authorization_code grant; confidential clients may use client_credentials. The first-party SDKs and the knoxcall login CLI handle token minting, caching, refresh, and DPoP for you.

Path Parameters

gatewayId
string<uuid>
required

The parent AI gateway UUID.

Body

application/json
name
string
required
slug
string
required

Lowercase letters, numbers and hyphens.

upstream_url
string<uri>
required

A public https:// MCP endpoint. Private, loopback, link-local and cloud-metadata destinations are refused.

description
string | null
server_type
enum<string>
default:upstream

collection is rejected with 422 unsupported_server_type — the forwarder does not serve it yet.

Available options:
upstream
transport
enum<string>
default:streamable_http

Only streamable_http is accepted. The gateway's connect path always builds a Streamable HTTP transport, so accepting sse would store a silent protocol mismatch.

Available options:
streamable_http
allowed_tools
string[]

Empty (the default) means the server advertises nothing.

pii_inspection
boolean
default:true
auth
object

Upstream auth for an MCP server. A secret reference is the only supported path: every header value must contain a {{secret_id:<uuid>}} (or legacy {{secret:<name>}}) placeholder. A literal is refused with 422 plaintext_auth — it would sit in cleartext in the control plane.

pii_redact_policy_id
string<uuid> | null

A PII policy THIS tenant owns (AIGW-151). A policy id you do not own is refused 422 — the FK is id-only, so the ownership check is the control.

firewall_policy_id
string<uuid> | null
guardrail_webhook_url
string<uri> | null

https only; no embedded credentials; SSRF-checked at write time.

guardrail_webhook_secret_id
string<uuid> | null
guardrail_webhook_mode
enum<string>
Available options:
off,
request,
response,
both
guardrail_webhook_timeout_ms
integer
Required range: 100 <= x <= 10000
guardrail_webhook_failure_action
enum<string>
Available options:
fail_open,
fail_closed

Response

The registered MCP server.

data
object

An MCP server KnoxCall proxies and governs. connect_url and resource are deliberately different values — see their descriptions.

meta
object

Metadata included with every API response.