Skip to content
Start here

Sync MCP Server Capabilities

client.ZeroTrust.Access.AIControls.Mcp.Servers.Sync(ctx, id, body) (*AccessAIControlMcpServerSyncResponse, error)
POST/accounts/{account_id}/access/ai-controls/mcp/servers/{id}/sync

Syncs an MCP server’s capabilities and returns the updated server state, including any connection errors.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
MCP Portals Write
ParametersExpand Collapse
id string

portal id

maxLength32
minLength1
body AccessAIControlMcpServerSyncParams
AccountID param.Field[string]
ReturnsExpand Collapse
type AccessAIControlMcpServerSyncResponse struct{…}
Error stringOptional
ErrorDetails AccessAIControlMcpServerSyncResponseErrorDetailsOptional
Cause stringOptional

Underlying error message

IsUpstream boolOptional

True = MCP server returned an error. False = couldn’t reach the server

McpCode float64Optional

MCP protocol error code

Retryable boolOptional

Whether the error is transient and worth retrying

StatusCode float64Optional

HTTP status code from the server

Status stringOptional

Sync MCP Server Capabilities

package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/cloudflare-go"
  "github.com/stainless-sdks/cloudflare-go/option"
  "github.com/stainless-sdks/cloudflare-go/zero_trust"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  response, err := client.ZeroTrust.Access.AIControls.Mcp.Servers.Sync(
    context.TODO(),
    "my-mcp-portal",
    zero_trust.AccessAIControlMcpServerSyncParams{
      AccountID: cloudflare.F("a86a8f5c339544d7bdc89926de14fb8c"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Error)
}
{
  "result": {
    "error": "error",
    "error_details": {
      "cause": "cause",
      "is_upstream": true,
      "mcp_code": 0,
      "retryable": true,
      "status_code": 0
    },
    "status": "status"
  },
  "success": true
}
Returns Examples
{
  "result": {
    "error": "error",
    "error_details": {
      "cause": "cause",
      "is_upstream": true,
      "mcp_code": 0,
      "retryable": true,
      "status_code": 0
    },
    "status": "status"
  },
  "success": true
}