Skip to content
Start here

Update a MCP Portal

zero_trust.access.ai_controls.mcp.portals.update(strid, PortalUpdateParams**kwargs) -> PortalUpdateResponse
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
account_id: str
id: str

portal id

maxLength32
minLength1
allow_code_mode: Optional[bool]

Allow remote code execution in Dynamic Workers (beta)

description: Optional[str]
maxLength512
hostname: Optional[str]
name: Optional[str]
maxLength350
secure_web_gateway: Optional[bool]

Route outbound MCP traffic through Zero Trust Secure Web Gateway

servers: Optional[Iterable[Server]]
server_id: str

server id

maxLength32
minLength1
default_disabled: Optional[bool]
on_behalf: Optional[bool]
updated_prompts: Optional[Iterable[ServerUpdatedPrompt]]
name: str
alias: Optional[str]
maxLength40
description: Optional[str]
enabled: Optional[bool]
updated_tools: Optional[Iterable[ServerUpdatedTool]]
name: str
alias: Optional[str]
maxLength40
description: Optional[str]
enabled: Optional[bool]
ReturnsExpand Collapse
class PortalUpdateResponse:
id: str

portal id

maxLength32
minLength1
hostname: str
name: str
maxLength350
allow_code_mode: Optional[bool]

Allow remote code execution in Dynamic Workers (beta)

created_at: Optional[datetime]
formatdate-time
created_by: Optional[str]
description: Optional[str]
maxLength512
modified_at: Optional[datetime]
formatdate-time
modified_by: Optional[str]
secure_web_gateway: Optional[bool]

Route outbound MCP traffic through Zero Trust Secure Web Gateway

Update a MCP Portal

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
portal = client.zero_trust.access.ai_controls.mcp.portals.update(
    id="my-mcp-portal",
    account_id="a86a8f5c339544d7bdc89926de14fb8c",
)
print(portal.id)
{
  "result": {
    "id": "my-mcp-portal",
    "hostname": "exmaple.com",
    "name": "My MCP Portal",
    "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",
    "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
}