Skip to content
Start here

Update a MCP Server

client.ZeroTrust.Access.AIControls.Mcp.Servers.Update(ctx, id, params) (*AccessAIControlMcpServerUpdateResponse, error)
PUT/accounts/{account_id}/access/ai-controls/mcp/servers/{id}

Updates an MCP portal configuration.

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
ParametersExpand Collapse
id string

server id

maxLength32
minLength1
params AccessAIControlMcpServerUpdateParams
AccountID param.Field[string]

Path param

AuthCredentials param.Field[string]optional

Body param

Description param.Field[string]optional

Body param

maxLength512
Name param.Field[string]optional

Body param

maxLength350
ReturnsExpand Collapse
type AccessAIControlMcpServerUpdateResponse struct{…}
ID string

server id

maxLength32
minLength1
AuthType AccessAIControlMcpServerUpdateResponseAuthType
One of the following:
const AccessAIControlMcpServerUpdateResponseAuthTypeOAuth AccessAIControlMcpServerUpdateResponseAuthType = "oauth"
const AccessAIControlMcpServerUpdateResponseAuthTypeBearer AccessAIControlMcpServerUpdateResponseAuthType = "bearer"
const AccessAIControlMcpServerUpdateResponseAuthTypeUnauthenticated AccessAIControlMcpServerUpdateResponseAuthType = "unauthenticated"
Hostname string
formaturi
Name string
maxLength350
Prompts []map[string, unknown]
Tools []map[string, unknown]
CreatedAt Timeoptional
formatdate-time
CreatedBy stringoptional
Description stringoptional
maxLength512
Error stringoptional
LastSuccessfulSync Timeoptional
formatdate-time
LastSynced Timeoptional
formatdate-time
ModifiedAt Timeoptional
formatdate-time
ModifiedBy stringoptional
Status stringoptional

Update a MCP Server

package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  server, err := client.ZeroTrust.Access.AIControls.Mcp.Servers.Update(
    context.TODO(),
    "my-mcp-server",
    zero_trust.AccessAIControlMcpServerUpdateParams{
      AccountID: cloudflare.F("a86a8f5c339544d7bdc89926de14fb8c"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", server.ID)
}
{
  "result": {
    "id": "my-mcp-server",
    "auth_type": "unauthenticated",
    "hostname": "https://example.com/mcp",
    "name": "My MCP Server",
    "prompts": [
      {
        "foo": "bar"
      }
    ],
    "tools": [
      {
        "foo": "bar"
      }
    ],
    "created_at": "2019-12-27T18:11:19.117Z",
    "created_by": "created_by",
    "description": "This is one remote mcp server",
    "error": "error",
    "last_successful_sync": "2019-12-27T18:11:19.117Z",
    "last_synced": "2019-12-27T18:11:19.117Z",
    "modified_at": "2019-12-27T18:11:19.117Z",
    "modified_by": "modified_by",
    "status": "status"
  },
  "success": true
}
Returns Examples
{
  "result": {
    "id": "my-mcp-server",
    "auth_type": "unauthenticated",
    "hostname": "https://example.com/mcp",
    "name": "My MCP Server",
    "prompts": [
      {
        "foo": "bar"
      }
    ],
    "tools": [
      {
        "foo": "bar"
      }
    ],
    "created_at": "2019-12-27T18:11:19.117Z",
    "created_by": "created_by",
    "description": "This is one remote mcp server",
    "error": "error",
    "last_successful_sync": "2019-12-27T18:11:19.117Z",
    "last_synced": "2019-12-27T18:11:19.117Z",
    "modified_at": "2019-12-27T18:11:19.117Z",
    "modified_by": "modified_by",
    "status": "status"
  },
  "success": true
}