Verify an unsaved MCP setup
Explicitly check a stable MCP setup before saving it.
/api/v1/mcp-integrations/verify-setupconst response = await fetch("https://api.smallworld.sh/api/v1/mcp-integrations/verify-setup", {
method: "POST",
headers: { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json" },
body: JSON.stringify({
"id": "72b98ef7-4750-4521-b11d-82c114aa56f4",
"url": "https://mcp.example.com/mcp",
"authMode": "oauth2",
"oauthApp": {
"clientId": "your-client-id",
"clientSecret": "write-only-secret"
}
}),
});
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#
idUUIDrequiredThe integrationId reserved by detection. Omit to allocate an ID during creation.
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.
Responses#
Returns status, message, registration, and optional clientSecretRequired. Status is ready, unverified, needs_setup, credentials_required, provider_restricted, or verification_failed. HTTP 200 can report unsuccessful setup; inspect status. ready and unverified permit activation.
{
"status": "unverified",
"message": "OAuth app configured. Connection not yet tested.",
"registration": "owner_app",
"clientSecretRequired": true
}
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.
Use the reserved ID from detection with the same URL and sign-in mode. A changed URL requires detection again.