Register an MCP endpoint
const url = 'https://example.com/v1/mcp/endpoints';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"endpointId":"example","name":"example","transport":"stdio","config":{"transport":"stdio","command":"example","args":["example"],"env":{"additionalProperty":"example"}},"secretRef":{"envName":"example","name":"example"},"auth":{"scheme":"basic","username":"example","secretRef":{"envName":"example","name":"example"}},"catalogConnectionId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","secretEnv":{"additionalProperty":{"envName":"example","name":"example"}},"instructions":"example","metadata":{},"sendTraceparent":true,"readOnlyTools":["example"],"scopeKind":"tenant","scopeId":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/mcp/endpoints \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "endpointId": "example", "name": "example", "transport": "stdio", "config": { "transport": "stdio", "command": "example", "args": [ "example" ], "env": { "additionalProperty": "example" } }, "secretRef": { "envName": "example", "name": "example" }, "auth": { "scheme": "basic", "username": "example", "secretRef": { "envName": "example", "name": "example" } }, "catalogConnectionId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "secretEnv": { "additionalProperty": { "envName": "example", "name": "example" } }, "instructions": "example", "metadata": {}, "sendTraceparent": true, "readOnlyTools": [ "example" ], "scopeKind": "tenant", "scopeId": "example" }'Body is a full MCPEndpoint plus the scope to register it in (scopeKind + scopeId); authorization checks that scope. Server validates the closed transport enum + the config.transport matches transport guardrail + per-variant required fields (command for stdio; url for http-sse / streamable-http), and refuses unknown fields. secretRef, auth and secretEnv name secrets in the deployment’s store (plaintext secrets never cross the wire), and never a model provider’s key (400 provider-key-refused), a texts registration’s account key (400 connection-key-refused) or an identity provider’s secret (400 identity-provider-key-refused). A credential in plaintext config.headers or a stdio endpoint’s config.env is refused (400 invalid-mcp-endpoint, reason credential-in-headers or credential-in-env), and so is one of MCP’s own headers in config.headers (Mcp-Session-Id, Mcp-Protocol-Version, Mcp-Method, Mcp-Name, Mcp-Param-…; reason transport-header-in-config). Where each secret it names is read is recorded on it now (secretScopes): the first of its own scope, its project’s org and the workspace that has the secret and that the caller administers, else the broadest they administer; the runtime reads it there only. An auth with scheme: connection names no secret: it’s checked against the server’s app entries and connections (the app, its mcpServers, its owners and permissions, and catalogConnectionId), and the runtime reads the server’s Protected Resource Metadata through its egress guard; each refusal is 400 invalid-mcp-endpoint with its reason. A deployment with KINDGI_TENANT_HOST_ACCESS=deployed (the default outside development) refuses a stdio endpoint, which would run a command on the server’s host: 403 host-access-denied.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Responses
Section titled “Responses”MCP endpoint registered.
object
Examplegenerated
{ "endpointId": "example"}Validation failed (see details.reason); a connection auth’s own reasons are unknown-app, origin-not-listed, owner-not-allowed, unknown-permission, catalog-connection-required, invalid-catalog-connection-id, catalog-connection-without-connection-auth, catalog-connection-not-found, catalog-connection-not-yours, resource-metadata-unreadable, issuer-mismatch and resource-mismatch. Or provider-key-refused: secretRef names a model provider’s key (details.secret, details.providerId). Or connection-key-refused: a secret it names is the account key of a texts connection app registration (details.secret, details.appId), which only that registration names. Use a key of its own: a new API key from the provider, stored under its own name. A copy of this one under another name reaches the same account. Or identity-provider-key-refused: a secret it names is an identity provider’s secret, an OIDC client secret or a SAML signing or decryption key (details.secret, details.identityProviderId), which only sign-in names. If one app registration serves both, give it a second secret of its own (a second client secret), store that under its own name and use that name. Or reserved-name-prefix: it names a secret under the reserved kindgi. prefix (details.secret).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}host-access-denied: a stdio endpoint on a deployment that refuses commands on its host (KINDGI_TENANT_HOST_ACCESS=deployed or isolated); or authz-denied. Without an authorization store, key-project-mismatch (details.keyProjectId): the API key or session is limited to a project, and this writes above it, to the workspace, an org or a team (with a store, that is permission-denied).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}MCP endpoint already registered at that id. Or env-not-served: this runtime keeps every value under the env it serves (whoami’s servedEnv, with refusesOtherEnvs), and the secret reference names another. Name it under details.servedEnv. Nothing is stored. Or idempotency-key-in-flight (with Retry-After): a request with the same Idempotency-Key still runs, so this one wasn’t run; send it again after Retry-After to get that request’s answer.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”The request body is over the API’s limit (request-too-large; details.maxBytes says how much).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}rate-limit-exceeded with details.limit: "schema-compile-time", on a server with a compile budget (Kindgi Cloud): this workspace’s schemas spent details.budgetMs compiling in the last 60 seconds. Nothing was stored; Retry-After says when to send it again. Or rate-limit-exceeded with details.limit: "api-requests", on a runtime that sets workspace limits (Kindgi Cloud): this workspace’s limit on API requests a minute is reached, so the request wasn’t run; Retry-After says when to send it again.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”Server error (unmapped domain code or framework crash).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The Idempotency-Key store (idempotency-store-unavailable) or the authorization store (authz-backend-unavailable) couldn’t be reached before the request ran, or the database was too busy for its authorization check (database-busy), so nothing was changed; Retry-After (whole seconds) says when to try again with the same key. Or tenant-state-unavailable (with Retry-After), on a runtime serving many workspaces: the workspace’s state couldn’t be read, so nothing was changed.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”See also
GET /v1/mcp/endpoints: List MCP endpointsGET /v1/mcp/endpoints/{endpointId}: Fetch an MCP endpointPOST /v1/mcp/endpoints/{endpointId}/unregister: Unregister an MCP endpointGET /v1/mcp/endpoints/{endpointId}/resources: List resources at a remote MCP endpoint- Kindgi 0.1.9
- Error code
authz-backend-unavailable - Error code
authz-denied - Error code
connection-key-refused - Error code
database-busy - Error code
env-not-served - Error code
host-access-denied - Error code
idempotency-key-in-flight - Error code
idempotency-store-unavailable - Error code
identity-provider-key-refused - Error code
key-project-mismatch - Error code
permission-denied - Error code
provider-key-refused - Error code
rate-limit-exceeded - Error code
request-too-large - Error code
reserved-name-prefix - Error code
tenant-state-unavailable - Every error code