MCP server portals·续1
Manual credentials require per-user authentication. Leave Require user auth enabled when you add the server to a portal. The server remains in Waiting status until the first user completes upstream OAuth. Cloudflare then retrieves the server's tools and prompts and changes its status to Ready.
MCP Apps
MCP Apps ↗︎ — tools that declare a UI resource in their description — will also be available after successfully connecting to an MCP server. A list of MCP clients that support MCP Apps is available in the Extension Support Matrix ↗︎.
Server status
The MCP server status indicates the server's connection and tool and prompt synchronization status in Cloudflare Access.
| Status | Description |
|---|---|
| Error | The server could not be reached or returned an error. Refer to error details to identify and fix the cause. |
| Sync Required | The server's OAuth credentials can no longer be refreshed and the server needs to be reauthenticated. To fix the issue, reauthenticate the server. |
| Waiting | The server's tools and prompts are being synchronized. A server with manual OAuth credentials remains in this state until its first user completes upstream OAuth. |
| Ready | The server connected successfully and its tools and prompts were synchronized. This status does not guarantee that the server will connect or return resources when queried. |
Error details
When an MCP server is in the Error or Sync Required state, hover over its status in the dashboard to view available diagnostic information. The API returns these details in the error_details object:
| Field | Description |
|---|---|
status_code |
The HTTP status code returned by the MCP server, if available. |
mcp_code |
The MCP protocol error code, if the server returned an MCP error. |
retryable |
Whether the error is likely to be temporary and the connection is worth retrying. |
is_upstream |
true if the MCP server returned the error; false if the connection to the MCP server failed. |
cause |
The underlying error message. |
If is_upstream is true, use status_code, mcp_code, and cause to troubleshoot the MCP server. If it is false, verify that the server URL is correct and reachable. Retry the sync when retryable is true; otherwise, correct the reported cause before trying again. Reauthenticate the server only when the error points to expired or invalid credentials.
Reauthenticate the MCP server
To reauthenticate an MCP server in Cloudflare Access:
- In the Cloudflare dashboard ↗︎, go to Zero Trust > Access controls > MCP Portals.
- Go to the MCP servers tab.
- Select the server that you want to reauthenticate, then select Edit.
- Select Authenticate server.
You will be redirected to log in to your OAuth provider. The account used to authenticate will serve as the new admin credential for this MCP server.
Synchronize the MCP server
For servers that use DCR, Cloudflare Access synchronizes tools and prompts approximately every two hours. During synchronization, Cloudflare connects to your MCP server using the admin credential and fetches the current list of tools and prompts. If the admin credential's OAuth access token has expired, Cloudflare refreshes it automatically using the stored refresh token before connecting.
Resources are not synchronized or stored. When an MCP client sends a resources/list request, the portal fetches resources live from the upstream servers. Servers that cannot connect or respond are omitted from the result.
Note
Synchronization uses the admin credential, not individual user credentials. If the admin credential's refresh token has expired or been revoked, the server status will change to Sync Required and you will need to reauthenticate the server. This will not impact end users' ability to connect to the MCP server. It will impact the ability to fetch tool and prompt information or additions and removals.
To manually refresh the MCP server in Zero Trust:
- In the Cloudflare dashboard ↗︎, go to Zero Trust > Access controls > MCP Portals.
- Go to the MCP servers tab and find the server that you want to refresh.
- Select the three dots > Sync capabilities.
The MCP server page will show the updated list of tools and prompts. By default, new tools and prompts are automatically enabled. For mappings with default_disabled set to true, they remain hidden until explicitly enabled.
You can also trigger a sync via the API. The sync endpoint returns the current server state after synchronization, including the updated server status, tool count, and error details if the sync failed.
Upstream OAuth callback URLs
MCP server portals use upstream OAuth callback URLs to authorize administrators and end users so they can access MCP servers.
OAuth providers typically exact-match the full URI, including the path.
If your upstream OAuth provider restricts redirect URIs, add the URLs that match your server's configuration:
| OAuth configuration | Use the Cloudflare-hosted OAuth callback on? | Redirect URIs to allowlist at the upstream provider |
|---|---|---|
| Automatic (DCR) | No | The dashboard callback URL for administrator authorization. If users authorize with their own credentials, also add https://<your-portal-hostname>/servers-callback for each portal using this server. |
| Automatic (DCR) | Yes | The dashboard callback URL for administrator authorization. If users authorize with their own credentials, also add https://oauth-callbacks.cloudflareaccess.com/cdn-cgi/access/outbound-oauth-callback. |
| Manual OAuth credentials | Not available | https://oauth-callbacks.cloudflareaccess.com/cdn-cgi/access/outbound-oauth-callback. The dashboard DCR callback URL is not used for this configuration. |
For automatic (DCR) servers, expand Advanced settings to access the Use the Cloudflare-hosted OAuth callback setting.
For manual OAuth configured through the API, register the shared Cloudflare callback URL with the upstream provider. Set is_shared_oauth_callback_enabled to true. Cloudflare uses the shared callback URL regardless of the value of registration_info.redirect_uris, so you can omit this field. You cannot override the shared callback URL.
Dashboard callback URL
When Cloudflare registers the OAuth client using DCR, the dashboard uses the following callback URL:
https://dash.cloudflare.com/<account-tag>/one/access-controls/ai-controls/mcp-server/oauth-callback/<server-id>
The dashboard callback URL is scoped to the account and server.
Add the dashboard callback URL to the OAuth provider's redirect URI allowlist before authorizing the upstream MCP server. Otherwise, authorization may fail.
DCR uses the dashboard callback URL even when the Use the Cloudflare-hosted OAuth callback setting is on.
End users never use the dashboard callback URL to authorize the upstream MCP server.
Portal callback URL
When a user authorizes an upstream MCP server that requires per-user OAuth, the portal performs an OAuth authorization code flow with the upstream server on the user's behalf. As part of this flow, the portal registers a callback URL (redirect_uri) with the upstream server. The upstream server redirects to this URL after the user authorizes access.
When the Use the Cloudflare-hosted OAuth callback setting is off, the portal uses a callback URL on your portal domain:
https://<your-portal-hostname>/servers-callback
Add the callback URL to the OAuth provider's redirect URI allowlist.
Use /servers-callback, not /server-callback, for automatic (DCR) servers when the shared callback setting is off. Manual OAuth servers use the shared Cloudflare callback URL instead.
Shared Cloudflare callback URL
When you configure an MCP server with manual OAuth credentials in the dashboard, Cloudflare uses the following shared callback URL for dashboard and per-user authorization:
https://oauth-callbacks.cloudflareaccess.com/cdn-cgi/access/outbound-oauth-callback
The Use the Cloudflare-hosted OAuth callback setting is not available when you configure manual OAuth credentials in the dashboard.
When Cloudflare uses DCR to register the OAuth client, turn on Use the Cloudflare-hosted OAuth callback to use the shared callback URL for per-user authorization. If the setting is off, per-user authorization uses the portal-scoped callback URL.
Use the shared callback URL if the upstream OAuth provider limits the number of allowed redirect URIs or if you want one callback URL for a server across multiple portals. DCR still uses the dashboard callback URL for administrator authorization, regardless of whether the Use the Cloudflare-hosted OAuth callback setting is on. The setting is off by default. Configure it separately for each MCP server that uses DCR.
To turn on the setting, go to Zero Trust > Access controls > MCP Portals > MCP servers, add or edit an MCP server that uses DCR, and turn on Use the Cloudflare-hosted OAuth callback under Basic information > Advanced settings.
Create a portal
To create an MCP server portal:
- In the Cloudflare dashboard ↗︎, go to Zero Trust > Access controls > MCP Portals.
- Select Add MCP server portal.
- Enter any name for the portal.
- Under Custom domain, select a domain from an active zone in your account. You can optionally specify a subdomain.
- Add MCP servers to the portal.
- (Optional) Under MCP servers, configure the tools and prompts available through the portal.
- (Optional) Configure Require user auth for servers that support OAuth: -
Enabled: (default) User will be prompted to utilize their own login credentials to establish a connection with the MCP server. -Disabled: Users who are connected to the portal will automatically have access to the MCP server via its admin credential. - Add Access policies to define the users who can connect to the portal URL.
Caution
Independent MFA, purpose justification, and temporary authentication will not be enforced for MCP servers that are authorized through an MCP portal. For example, if independent MFA is enabled on a policy assigned to a server, users will not be prompted to perform MFA to authorize the server after authenticating to the portal. Refer to Policy limitations for details. 9. Select Add an MCP server portal. 10. (Optional) Customize the login experience for the portal.
Users can now connect to the portal at https://<subdomain>.<domain>/mcp using an MCP client.
Customize login settings
Cloudflare Access automatically creates an Access application for each MCP server portal. You can customize the portal login experience by updating Access application settings:
- In the Cloudflare dashboard ↗︎, go to Zero Trust > Access controls > Applications.
- Find the portal that you want to configure, then select the three dots > Edit.
- To configure identity providers for the portal:
- Go to Authentication.
- Select the identity providers that you want to enable for your application.
- (Recommended) If you plan to only allow access via a single identity provider, turn on Apply instant authentication. End users will not be shown the Cloudflare Access login page. Instead, Cloudflare will redirect users directly to your SSO login event.
- To customize the block page:
- Go to Additional settings.
- Custom block pages: Choose what users will see when they are denied access to the application.
- Cloudflare default: Reload the login page and display a block message below the Cloudflare Access logo. The default message is
That account does not have access, or you can enter a custom message. - Redirect URL: Redirect to the specified website.
- Custom page template: Display a custom block page hosted in Cloudflare One.
- Cloudflare default: Reload the login page and display a block message below the Cloudflare Access logo. The default message is
- Select Save.
Manage tools and prompts
When you add an MCP server to a portal, all of its tools and prompts are available to portal users by default. You can customize which tools and prompts are exposed, rename them with aliases, and override their descriptions.
Turn off individual tools or prompts
To hide specific tools or prompts from portal users:
- In the Cloudflare dashboard ↗︎, go to Zero Trust > Access controls > MCP Portals.
- Find the portal you want to configure, then select the three dots > Edit.
- Under Servers, select the server name to open its tools panel.
- Scroll down to the Tools section, then turn off the toggle next to any tool or prompt that you want to hide from users.

- Select Save.
Turned-off tools will not appear in the portal's tool list. Users will not be able to call them.
Use an allowlist pattern
By default, all tools and prompts from an MCP server are available in the portal. You can invert this behavior so that all capabilities are hidden by default and only explicitly turned-on tools and prompts are exposed. This is useful when an MCP server has many capabilities but you only want to expose a curated subset.
To configure an allowlist via the API, set default_disabled to true on the server-to-portal mapping, then explicitly list the tools you want to expose in updated_tools. To expose prompts, list them in updated_prompts in the same way.
When a portal update includes servers, the supplied array replaces the complete server-to-portal mapping. Include every attached server and preserve its existing mapping fields. Omitting a server removes it from the portal, and omitting a mapping field resets that field to its default value.
