PUT
/
api
/
v1
/
mcp-servers
/
{server_id}
curl --request PUT \
  --url https://api.kambrium.com/api/v1/mcp-servers/{server_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "connection_id": "conn_123abc",
  "name": "Updated Connection Name",
  "description": "Updated description",
  "api_key": "pk_new_key",
  "oauth2_client_secret": "new_secret",
  "config": {}
}'
{
  "message": "Connection updated successfully",
  "connection": {
    "connection_id": "conn_123abc",
    "mcp_server_id": "mcp_456def",
    "server_type": "pipedrive",
    "name": "My Pipedrive Connection",
    "description": "Connection to Pipedrive CRM",
    "status": "active",
    "auth_method": "api_key",
    "oauth2_client_id": "oauth_client_123",
    "oauth2_scopes": [
      "<string>"
    ],
    "config": {},
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z"
  }
}

Overview

This endpoint updates an existing MCP server connection, allowing users to modify settings like access type, API key, and enable/disable status.

Prerequisites

  • Valid OAuth Token - Bearer token with mgmt.write scope
  • Existing Connection - Valid MCP server connection ID

Request

PUT /api/v1/mcp-servers/{server_id}

Path Parameters

ParameterTypeRequiredDescription
server_idintegerYesThe MCP server connection ID

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token from OAuth authentication
Content-TypestringYesMust be application/json

Request Body

{
  "agent_enabled": false,
  "access_type": "read",
  "api_key": "updated-api-key"
}

Request Fields

FieldTypeRequiredDescription
agent_enabledbooleanNoWhether the connection is enabled for agent use
access_typestringNoAccess level: “read”, “write”, or “individual”
api_keystringNoUpdated API key for the integration

Access Types

  • read - Read-only access to integration data
  • write - Full read/write access to integration data
  • individual - Custom access with specific tool selections

Response

Success Response (200 OK)

{
  "success": true,
  "data": {
    "id": 123,
    "mcp_server_name": "Pipedrive",
    "api_key_verification_status": "pending",
    "oauth2_client_id": "client_abc123",
    "oauth2_scopes": ["mcp.read"],
    "agent_enabled": false,
    "disabled_tools": [],
    "created_at": "2025-06-27T10:30:00Z"
  }
}

Response Fields

FieldTypeDescription
successbooleanWhether the request was successful
data.idintegerUnique identifier for the connection
data.mcp_server_namestringHuman-readable name of the integration
data.api_key_verification_statusstringAPI key validation status after update
data.oauth2_client_idstringOAuth2 client ID for MCP server communication
data.oauth2_scopesarrayOAuth2 scopes granted for this connection
data.agent_enabledbooleanWhether the connection is enabled for agent use
data.disabled_toolsarrayList of disabled tool IDs
data.created_atstringISO timestamp when connection was created

Error Responses

Connection Not Found (404)

{
  "detail": "MCP server 123 not found or not accessible"
}

Bad Request (400)

{
  "detail": "Invalid access type specified"
}

Unauthorized (401)

{
  "detail": "Authentication credentials were not provided."
}

Forbidden (403)

{
  "detail": "You do not have permission to update this connection."
}

Internal Server Error (500)

{
  "detail": "Failed to update MCP server: database error"
}

Examples

Enable/Disable Connection

curl -X PUT "https://api.kambrium.com/api/v1/mcp-servers/123" \
  -H "Authorization: Bearer your_oauth_token" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_enabled": false
  }'

Update Access Type

curl -X PUT "https://api.kambrium.com/api/v1/mcp-servers/123" \
  -H "Authorization: Bearer your_oauth_token" \
  -H "Content-Type: application/json" \
  -d '{
    "access_type": "read"
  }'

Update API Key

curl -X PUT "https://api.kambrium.com/api/v1/mcp-servers/123" \
  -H "Authorization: Bearer your_oauth_token" \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "new-api-key-value"
  }'

Multiple Updates

curl -X PUT "https://api.kambrium.com/api/v1/mcp-servers/123" \
  -H "Authorization: Bearer your_oauth_token" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_enabled": true,
    "access_type": "write",
    "api_key": "updated-api-key"
  }'

Implementation Notes

Partial Updates

  • Only provided fields are updated
  • Omitted fields retain their current values
  • Empty or null values are handled appropriately

API Key Verification

  • When api_key is updated, verification status resets to “pending”
  • API key is validated asynchronously against the target integration
  • Invalid API keys will be marked as “failed” after verification

Access Type Changes

  • Changing access type may affect OAuth scopes
  • Tool access permissions are updated accordingly
  • Some access type changes may require re-authentication

Database Persistence

  • All updates are immediately persisted to the database
  • Changes are validated before being applied
  • Database constraints are enforced

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

server_id
string
required
Example:

"srv_123abc"

Body

application/json

Response

200 - application/json

MCP server connection updated successfully

The response is of type object.