Register an MCP server
Save a remote MCP integration after detection and setup, or as an inactive draft.
/api/v1/mcp-integrationsconst response = await fetch("https://api.smallworld.sh/api/v1/mcp-integrations", {
method: "POST",
headers: { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json" },
body: JSON.stringify({
"id": "72b98ef7-4750-4521-b11d-82c114aa56f4",
"key": "example-mcp",
"name": "Example MCP",
"url": "https://mcp.example.com/mcp",
"authMode": "oauth2",
"oauthApp": {
"clientId": "your-client-id",
"clientSecret": "write-only-secret"
},
"scopes": [
"read"
],
"worldIds": [
"2d1f771b-4f3a-429c-a96c-5316cb55fa30"
],
"defaultPolicy": "ask"
}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
const result = await response.json();
Use your server-side apiKey. Replace the example IDs.
Request body#
idUUIDThe integrationId reserved by detection. Omit to allocate an ID during creation.
keystringrequiredUnique command key in the workspace; shares the namespace and key rules of custom integrations.
namestringrequiredNon-empty display name, at most 60 characters.
descriptionstringDescription, at most 500 characters. Defaults to an empty string.
urlstringrequiredRemote MCP server URL. Must be public HTTPS, except loopback HTTP in development.
authMode"none" | "oauth2" | "api_key"requiredThe sign-in mode detected or selected for this server.
scopesstring[] | nullOAuth scopes, or null to request the server's advertised scopes. OAuth only.
apiKeyHeaderstring | nullAPI-key mode only: header name. Null sends Authorization: Bearer <key>. End-user API keys are configured through the connection API.
oauthAppobjectOAuth only: clientId and optional clientSecret. Supplied values are encrypted. Client secrets are write-only; the separate OAuth app endpoint can return the client ID.
authorizationServerUrlstringOAuth issuer override when the server does not advertise its authorization server.
worldIdsUUID[]Worlds in this workspace where the new integration is enabled; defaults to none.
saveAsDraftbooleanSave without activating or requiring successful setup. Defaults to false.
defaultPolicy"ask" | "allow" | "deny"Initial tool policy; defaults to ask.
Responses#
Returns identity, URL, sign-in mode, callback URL, scopes, setup status/message, enablement, acknowledged tool changes, and timestamps. OAuth client credentials and end-user credentials are never returned.
{
"id": "72b98ef7-4750-4521-b11d-82c114aa56f4",
"key": "example-mcp",
"name": "Example MCP",
"description": "Record tools",
"url": "https://mcp.example.com/mcp",
"authMode": "oauth2",
"authorizationServerUrl": null,
"oauthAppRequired": true,
"scopes": [
"read"
],
"apiKeyHeader": null,
"redirectUri": "https://api.example.com/api/integrations/oauth/mcp/72b98ef7-4750-4521-b11d-82c114aa56f4/callback",
"enabled": true,
"setupStatus": "unverified",
"setupMessage": "OAuth app configured. Connection not yet tested.",
"toolChanges": {
"added": [],
"changed": [],
"removed": []
},
"createdAt": "2026-10-22T10:00:00.000Z",
"updatedAt": "2026-10-22T10:00:00.000Z"
}
More about this endpoint
Verification can contact the MCP and OAuth servers and register an OAuth client. Detection only discovers metadata; it never registers a client. Identical setup checks share cached work under the existing retry rules.
At most 20 MCP integrations per workspace. Configuration reads never reveal owner OAuth client secrets. Use generic integration configuration to enable a saved draft.