Skip to content
Start here

Update a MCP Portal

client.zeroTrust.access.aiControls.mcp.portals.update(stringid, PortalUpdateParams { account_id, allow_code_mode, description, 4 more } params, RequestOptionsoptions?): PortalUpdateResponse { id, hostname, name, 8 more }
PUT/accounts/{account_id}/access/ai-controls/mcp/portals/{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

portal id

maxLength32
minLength1
params: PortalUpdateParams { account_id, allow_code_mode, description, 4 more }
account_id: string

Path param

allow_code_mode?: boolean

Body param: Allow remote code execution in Dynamic Workers (beta)

description?: string

Body param

maxLength512
hostname?: string

Body param

name?: string

Body param

maxLength350
secure_web_gateway?: boolean

Body param: Route outbound MCP traffic through Zero Trust Secure Web Gateway

servers?: Array<Server>

Body param

server_id: string

server id

maxLength32
minLength1
default_disabled?: boolean
on_behalf?: boolean
updated_prompts?: Array<UpdatedPrompt>
name: string
alias?: string
maxLength40
description?: string
enabled?: boolean
updated_tools?: Array<UpdatedTool>
name: string
alias?: string
maxLength40
description?: string
enabled?: boolean
ReturnsExpand Collapse
PortalUpdateResponse { id, hostname, name, 8 more }
id: string

portal id

maxLength32
minLength1
hostname: string
name: string
maxLength350
servers: Array<Server>
id: string

server id

maxLength32
minLength1
auth_type: "oauth" | "bearer" | "unauthenticated"
One of the following:
"oauth"
"bearer"
"unauthenticated"
hostname: string
formaturi
name: string
maxLength350
prompts: Array<Record<string, unknown>>
tools: Array<Record<string, unknown>>
created_at?: string
formatdate-time
created_by?: string
default_disabled?: boolean
description?: string | null
maxLength512
error?: string
last_successful_sync?: string
formatdate-time
last_synced?: string
formatdate-time
modified_at?: string
formatdate-time
modified_by?: string
on_behalf?: boolean
status?: string
updated_prompts?: Array<UpdatedPrompt>
name: string
description?: string
enabled?: boolean
portal_alias?: string
server_alias?: string
updated_tools?: Array<UpdatedTool>
name: string
description?: string
enabled?: boolean
portal_alias?: string
server_alias?: string
allow_code_mode?: boolean

Allow remote code execution in Dynamic Workers (beta)

created_at?: string
formatdate-time
created_by?: string
description?: string
maxLength512
modified_at?: string
formatdate-time
modified_by?: string
secure_web_gateway?: boolean

Route outbound MCP traffic through Zero Trust Secure Web Gateway

Update a MCP Portal

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

const portal = await client.zeroTrust.access.aiControls.mcp.portals.update('my-mcp-portal', {
  account_id: 'a86a8f5c339544d7bdc89926de14fb8c',
});

console.log(portal.id);
{
  "result": {
    "id": "my-mcp-portal",
    "hostname": "exmaple.com",
    "name": "My MCP Portal",
    "servers": [
      {
        "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",
        "default_disabled": true,
        "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",
        "on_behalf": true,
        "status": "status",
        "updated_prompts": [
          {
            "name": "name",
            "description": "description",
            "enabled": true,
            "portal_alias": "portal-tool-alias",
            "server_alias": "server-tool-alias"
          }
        ],
        "updated_tools": [
          {
            "name": "name",
            "description": "description",
            "enabled": true,
            "portal_alias": "portal-tool-alias",
            "server_alias": "server-tool-alias"
          }
        ]
      }
    ],
    "allow_code_mode": true,
    "created_at": "2019-12-27T18:11:19.117Z",
    "created_by": "created_by",
    "description": "This is my custom MCP Portal",
    "modified_at": "2019-12-27T18:11:19.117Z",
    "modified_by": "modified_by",
    "secure_web_gateway": false
  },
  "success": true
}
Returns Examples
{
  "result": {
    "id": "my-mcp-portal",
    "hostname": "exmaple.com",
    "name": "My MCP Portal",
    "servers": [
      {
        "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",
        "default_disabled": true,
        "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",
        "on_behalf": true,
        "status": "status",
        "updated_prompts": [
          {
            "name": "name",
            "description": "description",
            "enabled": true,
            "portal_alias": "portal-tool-alias",
            "server_alias": "server-tool-alias"
          }
        ],
        "updated_tools": [
          {
            "name": "name",
            "description": "description",
            "enabled": true,
            "portal_alias": "portal-tool-alias",
            "server_alias": "server-tool-alias"
          }
        ]
      }
    ],
    "allow_code_mode": true,
    "created_at": "2019-12-27T18:11:19.117Z",
    "created_by": "created_by",
    "description": "This is my custom MCP Portal",
    "modified_at": "2019-12-27T18:11:19.117Z",
    "modified_by": "modified_by",
    "secure_web_gateway": false
  },
  "success": true
}