Skip to main content

Endpoints

MethodPathPurpose
POST/integrationsCreate integration
GET/integrationsList integrations
GET/integrations/:idGet integration
PATCH/integrations/:idUpdate integration
DELETE/integrations/:idArchive integration
POST/integrations/:id/validateValidate connectivity
GET/integrations/:id/oauthGet OAuth config
PUT/integrations/:id/oauthReplace OAuth config
DELETE/integrations/:id/oauthRemove OAuth config
POST/integrations/:id/connectionAdd user token
GET/integrations/:id/connectionGet connection status
DELETE/integrations/:id/connectionRevoke connection
id path params are UUIDs.

Create integration

curl -X POST https://api.kontext.dev/api/v1/integrations \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "GitHub",
    "url": "https://mcp.github.com/sse",
    "category": "gateway_remote_mcp",
    "authMode": "oauth",
    "oauth": {
      "provider": "github",
      "scopes": ["repo", "read:user"]
    }
  }'

Request body

FieldTypeRequiredDescription
namestringYesDisplay name
urlstringYesMCP endpoint URL of the integration
categorystringNo"gateway_remote_mcp" (default) or "internal_mcp_credentials"
authModestringNo"oauth", "user_token", "server_token", or "none" (default)
oauthobjectNoOAuth configuration. Fields: provider?, issuer?, scopes?
capabilitiesobjectNoDeclared capabilities: { tools?, resources?, prompts? }
credentialSchemaobjectNoSchema for user-provided credentials
serverTokenstringConditionalRequired when authMode is "server_token"

Categories

  • gateway_remote_mcp — A remote MCP integration accessed through the Kontext gateway. Kontext proxies requests and handles auth.
  • internal_mcp_credentials — A credential-only integration. Kontext stores and brokers credentials but does not proxy MCP traffic.

Auth modes

ModeDescription
oauthUsers authenticate via OAuth. Kontext manages the token lifecycle.
user_tokenUsers provide a personal access token or API key manually.
server_tokenA single shared token configured at the organization level.
noneNo authentication required.

List integrations

curl "https://api.kontext.dev/api/v1/integrations?limit=50" \
  -H "Authorization: Bearer $TOKEN"
Returns a paginated list of all integrations in the organization. Query parameters: limit, cursor, and optional name substring filter.

Get integration

curl https://api.kontext.dev/api/v1/integrations/11111111-1111-4111-8111-111111111111 \
  -H "Authorization: Bearer $TOKEN"

Response fields

Response shape: { "integration": { ... } }
FieldTypeDescription
idstringIntegration ID
namestringDisplay name
urlstringBase URL
categorystring"gateway_remote_mcp" or "internal_mcp_credentials"
authModestringAuthentication mode
oauthobject?OAuth configuration (if applicable)
capabilitiesobject?Declared capabilities
credentialSchemaobject?Schema for user credentials
serverTokenConfiguredbooleanWhether a server token is set
validationStatusstringLast validation result ("pending", "valid", "invalid")
validationMessagestring?Human-readable validation message
lastValidatedAtstring?ISO 8601 timestamp of last validation
userConnectionobject?Current user’s connection status
createdAtstringISO 8601 timestamp
updatedAtstringISO 8601 timestamp

Update integration

curl -X PATCH https://api.kontext.dev/api/v1/integrations/11111111-1111-4111-8111-111111111111 \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "name": "GitHub Enterprise" }'
Partial update. Send only the fields you want to change.

Archive integration

curl -X DELETE https://api.kontext.dev/api/v1/integrations/11111111-1111-4111-8111-111111111111 \
  -H "Authorization: Bearer $TOKEN"
Archives the integration. It will no longer be available for new connections, but existing data is preserved.

Validate connectivity

curl -X POST https://api.kontext.dev/api/v1/integrations/11111111-1111-4111-8111-111111111111/validate \
  -H "Authorization: Bearer $TOKEN"
Tests whether Kontext can reach the integration’s URL and authenticate. Updates the validationStatus, validationMessage, and lastValidatedAt fields on the integration.

Get OAuth config

curl https://api.kontext.dev/api/v1/integrations/11111111-1111-4111-8111-111111111111/oauth \
  -H "Authorization: Bearer $TOKEN"
Returns the OAuth configuration for the integration. Only available when authMode is "oauth".

Response fields

Response shape: { "oauth": { ... } }
FieldTypeDescription
providerstringOAuth provider identifier
issuerstringToken issuer URL
scopesstring[]Requested OAuth scopes

Replace OAuth config

curl -X PUT https://api.kontext.dev/api/v1/integrations/11111111-1111-4111-8111-111111111111/oauth \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "github",
    "scopes": ["repo"]
  }'
Full replacement — you must include all OAuth fields. Existing user connections may need to re-authenticate.

Remove OAuth config

curl -X DELETE https://api.kontext.dev/api/v1/integrations/11111111-1111-4111-8111-111111111111/oauth \
  -H "Authorization: Bearer $TOKEN"
Removes the OAuth configuration. You need to set a different authMode before removing OAuth, or the integration will have no auth.

Add user token

curl -X POST https://api.kontext.dev/api/v1/integrations/11111111-1111-4111-8111-111111111111/connection \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "token": "ghp_xxxxxxxxxxxx" }'
Stores a personal access token or API key for the current user on this integration. Used when authMode is "user_token".

Get connection status

curl https://api.kontext.dev/api/v1/integrations/11111111-1111-4111-8111-111111111111/connection \
  -H "Authorization: Bearer $TOKEN"
Returns the current user’s connection status for this integration.

Response fields

Response shape: { "connection": { ... } }
FieldTypeDescription
connectedbooleanWhether a credential is stored
statusstring"connected" or "disconnected"
expiresAtstring?ISO 8601 expiry timestamp
displayNamestring?Display name from the provider

Revoke connection

curl -X DELETE https://api.kontext.dev/api/v1/integrations/11111111-1111-4111-8111-111111111111/connection \
  -H "Authorization: Bearer $TOKEN"
Removes the current user’s stored credential for this integration. For OAuth connections, this also revokes the token with the upstream provider when possible.
The OAuth config, connection, and revoke endpoints are REST-only. Use the Management SDK for the core CRUD operations (create, list, get, update, archive, validate).