Create an OAuth connect URL for a Claude Managed custom MCP server
POST
/agents/{id}/claude/managed-mcp/oauth-connect-urlAuthorization
AuthorizationOAuth2 access token · headerrequiredScopes:
api:writeor
AuthorizationBearer token (JWT) · headerrequiredPath parameters
idstringrequiredRequest body
requiredapplication/jsonserverClaudeManagedMcpServerDtorequiredShow propertiesHide properties
authModestringAuthentication mode for this MCP server.
Allowed:
nonebeareroauthbearerTokenstring | nullBearer token to store for bearer-token MCP servers.
credentialConfiguredbooleanWhether Leadtime already has a stored credential for this MCP server.
idstringStable local id for an existing MCP row.
namestringDisplay name for the MCP server. If omitted, Leadtime derives one from the URL.
oauthCredentialobject | nullOAuth credential details for an OAuth MCP server.
Show propertiesHide properties
accessTokenstring | nullclientIdstring | nullclientSecretstring | nullexpiresAtstring | nullrefreshTokenstring | nullscopestring | nulltokenEndpointstring | nulltokenEndpointAuthTypestring | nullAllowed:
noneclient_secret_basicclient_secret_posturlstringrequiredHosted MCP server URL.
Responses
201
401Unauthorized - Invalid or missing authentication token
403Forbidden - Insufficient API scopes or permissions
Request
curl -X POST "https://leadtime.app/api/public/agents/string/claude/managed-mcp/oauth-connect-url" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"server": {
"authMode": "none",
"bearerToken": "string",
"credentialConfigured": true,
"id": "string",
"name": "string",
"oauthCredential": {
"accessToken": "string",
"clientId": "string",
"clientSecret": "string",
"expiresAt": "string",
"refreshToken": "string",
"scope": "string",
"tokenEndpoint": "string",
"tokenEndpointAuthType": "none"
},
"url": "string"
}
}'const response = await fetch("https://leadtime.app/api/public/agents/string/claude/managed-mcp/oauth-connect-url", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"server": {
"authMode": "none",
"bearerToken": "string",
"credentialConfigured": true,
"id": "string",
"name": "string",
"oauthCredential": {
"accessToken": "string",
"clientId": "string",
"clientSecret": "string",
"expiresAt": "string",
"refreshToken": "string",
"scope": "string",
"tokenEndpoint": "string",
"tokenEndpointAuthType": "none"
},
"url": "string"
}
})
});import requests
response = requests.post(
"https://leadtime.app/api/public/agents/string/claude/managed-mcp/oauth-connect-url",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
json={
"server": {
"authMode": "none",
"bearerToken": "string",
"credentialConfigured": True,
"id": "string",
"name": "string",
"oauthCredential": {
"accessToken": "string",
"clientId": "string",
"clientSecret": "string",
"expiresAt": "string",
"refreshToken": "string",
"scope": "string",
"tokenEndpoint": "string",
"tokenEndpointAuthType": "none"
},
"url": "string"
}
},
)Response
No example response.
Unauthorized - Invalid or missing authentication token
Forbidden - Insufficient API scopes or permissions