Skip to main content
PATCH
/
organization
/
mcp-servers
/
{server_id}
Python
import os
from datagrid_ai import Datagrid

client = Datagrid(
    api_key=os.environ.get("DATAGRID_API_KEY"),  # This is the default and can be omitted
)
mcp_server = client.organization.mcp_servers.update(
    server_id="server_id",
)
print(mcp_server.id)
{
  "object": "mcp_server",
  "id": "<string>",
  "name": "<string>",
  "icon_url": "<string>",
  "base_url": "<string>",
  "transport": "<string>",
  "protocol_version": "<string>",
  "authorization_secret_id": "<string>",
  "status": "<string>",
  "metadata": {
    "requires_oauth": true,
    "oauth_configured": true,
    "tool_count": 123,
    "last_synced_at": "<string>"
  },
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}
Updates a registered MCP server. Common uses:
  • rotate endpoint URL (base_url)
  • change display name
  • set or clear server-level authorization (authorization or authorization_secret_id)
Datagrid automatically attempts a tool re-sync when MCP connectivity/auth fields are updated. If both authorization and authorization_secret_id are sent, authorization takes precedence. Ownership note:
  • authorization creates or rotates a Datagrid-managed secret for this MCP server.
  • authorization_secret_id switches the server to an existing caller-managed secret reference.
  • Clearing auth removes the MCP server’s reference. Datagrid only auto-deletes secrets that it created from authorization.
curl -X PATCH https://api.datagrid.com/v1/organization/mcp-servers/SERVER_ID \
  -H "Authorization: Bearer $DATAGRID_API_KEY" \
  -H "Datagrid-Teamspace: $DATAGRID_TEAMSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "authorization": "Bearer rotated-token"
  }'

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

server_id
string
required

The ID of the MCP server.

Body

application/json
name
string
Maximum string length: 255
base_url
string<uri>

The HTTPS URL of the MCP server.

transport
enum<string> | null
Available options:
http
Maximum string length: 64
icon_url
string | null
Maximum string length: 1024
protocol_version
string | null
Maximum string length: 32
authorization_secret_id
string | null

Secret ID containing the full Authorization header value to use when calling this MCP server. Set to null to clear.

authorization
string | null

Raw Authorization header value (for example, 'Bearer '). Datagrid stores it as a secret and links it to this server. Set to null to clear. If both authorization and authorization_secret_id are provided, authorization takes precedence.

Maximum string length: 64000

Response

Updated MCP server

object
enum<string>
required
Available options:
mcp_server
id
string
required
name
string
required
icon_url
string | null
required
base_url
string<uri>
required
transport
string
required
protocol_version
string | null
required
authorization_secret_id
string | null
required

Secret ID containing the full Authorization header value used for this registered MCP server.

status
string
required
metadata
object
required

Safe subset of server metadata exposed to API consumers.

created_at
string<date-time>
required
updated_at
string<date-time>
required