Skip to main content

Configure the Sanctioned MCP Portal

Task

Connect to a remote MCP server directly, explore its tools, then create a sanctioned MCP portal with Access authentication to govern that access.

What is MCP?

Model Context Protocol (MCP) is an open standard that lets AI agents and tools connect to external data sources, APIs, and business systems in a structured way.

Why MCP is useful

  • Gives AI agents access to real business systems (CRMs, databases, internal tools)
  • Standardizes how agents discover and call tools — no custom one-off integrations
  • Enables agentic workflows where AI can take actions, not just answer questions
  • Works across MCP clients (Claude Desktop, MCP Inspector, custom agents)

The security problem

Without governance, MCP creates serious risks:

RiskDescription
Shadow MCPEmployees connect to unvetted MCP servers without IT knowledge
No identity checkAny MCP client can connect — no authentication required
No audit trailNo logs of who called which tools or what data was accessed
Data exfiltrationSensitive data can flow to unmanaged MCP servers
Supply chain riskUnvetted MCP servers may contain malicious tool definitions
Tool injectionAttackers can manipulate tool descriptions to influence AI behavior

Why Cloudflare

Cloudflare provides a governed MCP path:

  • MCP Portal — centralizes tool discovery and access for approved MCP servers
  • Access — enforces identity-based authentication before any tool call
  • Gateway — blocks direct/shadow MCP traffic outside the sanctioned portal
  • Logs — full audit trail of every tool invocation with user identity

Architecture

The lab flow follows this progression:

Phase 1: Direct access works (unsanctioned)

MCP Inspector → Direct MCP Server URL → Tools accessible, no auth, no logs

Phase 2: Sanctioned portal created

MCP Inspector → MCP Portal → Access Auth → MCP Server → Tools accessible, logged

Phase 3: Direct access blocked

MCP Inspector → Direct MCP Server URL → BLOCKED by Gateway
MCP Inspector → MCP Portal → Access Auth → MCP Server → Still works ✓

Step 1: Check the MCP Server Health

Before connecting with MCP Inspector, verify the MCP server is reachable.

  1. Open your browser and navigate to the health endpoint provided by the facilitator:
https://kiwistore-mcp.mythingy.io/health
  1. You should see JSON like this:
{
"server": "KiwiCart Ops MCP",
"version": "1.0.0",
"mcp_endpoint": "/mcp",
"tools": [
"get_product_catalog",
"get_shipping_policy",
"get_return_policy",
"lookup_order_status",
"get_current_promotions",
"get_nz_store_locations"
],
"status": "ok"
}

Expected Result

The health endpoint returns JSON with "status": "ok" and lists all 6 tools. This confirms the server is reachable.

Two endpoints available

The MCP server exposes two identical endpoints:

  • Standard: https://kiwistore-mcp.mythingy.io/mcp (has "mcp" in path)
  • Stealthy: https://kiwistore-shadow.mythingy.io/pcm (no "mcp" in hostname or path)

In this step, use the standard endpoint to verify direct access works. The stealthy endpoint will be used later to test defense-in-depth detection.

info

The /health endpoint is a simple status check. The actual MCP endpoint is /mcp — that's where MCP Inspector will connect.


Step 2: Connect Directly with MCP Inspector

Now connect MCP Inspector to the MCP server directly — without any portal or Access policy.

  1. Open MCP Inspector at http://localhost:5173 (it should already be running from the previous page)
tip

If you haven't set up MCP Inspector yet, go to Install MCP Inspector first.

  1. In MCP Inspector, configure the connection:
SettingValue
URLhttps://kiwistore-mcp.mythingy.io/mcp
Transport TypeStreamable HTTP
Connection TypeDirect
Important
  • Use Transport Type: Streamable HTTP (not SSE or stdio)
  • Use Connection Type: Direct (not Via Proxy)
  • The URL must end with /mcp — do not use the root URL or /health
  1. Click Connect

Expected Result

The connection succeeds. You are now connected directly to the MCP server with no authentication.


Step 3: Explore the Tools

After connecting, MCP Inspector shows the available tools.

  1. Click the Tools tab in MCP Inspector
  2. You should see 6 tools listed:
ToolDescription
get_product_catalogReturns the full KiwiCart product catalog
get_shipping_policyReturns NZ shipping policy and delivery times
get_return_policyReturns return and refund policy
lookup_order_statusLook up order status by order ID
get_current_promotionsReturns active public promotions
get_nz_store_locationsReturns NZ store locations with click-and-collect
  1. Click on each tool to see its description and input schema

Expected Result

All 6 tools are visible with descriptions. Tools that take parameters (like lookup_order_status) show their input schema.


Step 4: Run a Tool

Test a tool to confirm the server responds correctly.

Test 1: Get the product catalog

  1. Select get_product_catalog
  2. Click Run Tool
  3. Review the response — you should see the full product list with prices:
[
{
"id": "kiwi-buds-pro",
"name": "KiwiBuds Pro",
"category": "Audio",
"price": 149,
"currency": "NZD",
...
},
...
]

Test 2: Look up an order

  1. Select lookup_order_status
  2. Enter the parameter:
    • order_id: ORD-10042
  3. Click Run Tool
  4. Review the response:
{
"order_id": "ORD-10042",
"status": "Shipped",
"items": ["KiwiBuds Pro", "KiwiCharge Pad"],
"total": "$198 NZD",
"eta": "Arriving in 2 business days"
}

Test 3: Try an invalid order

  1. Select lookup_order_status
  2. Enter: ORD-99999
  3. Click Run Tool
  4. Response should say: Order ORD-99999 not found. Valid test orders: ORD-10042, ORD-10043, ORD-10044, ORD-10045

Invalid order response

Expected Result

All tool calls return correct data. The MCP server is fully functional.

This is the problem

You just connected to a live MCP server and called business tools — with no login, no identity check, no audit trail. Any MCP client on the internet can do the same. This is shadow MCP.


Step 5: Add the MCP Server to AI Controls

Now register this MCP server in your Cloudflare Zero Trust tenant so it can be governed.

  1. Go to dash.cloudflare.com/one
  2. Select your Lab account
  3. Navigate to Access controls > AI controls

Navigate to AI controls

  1. Go to the MCP servers tab
  2. Click Add an MCP server
  3. Configure:
FieldValue
NameKiwiCart MCP
HTTP URLhttps://kiwistore-mcp.mythingy.io/mcp
Authentication TypeNone
  1. Add an existint Access Policies Select existing access policies:
    • Policies: IT admins

Add MCP server

  1. Click Confirm
  2. Click Save and connect server
  3. Wait for the status to change to Ready

Expected Result

The server status shows Ready. Cloudflare has connected to the server and discovered all 6 tools.


Step 6: Create an MCP Server Portal

  1. Still in Access controls > AI controls
  2. Click Add MCP server portal
  3. Configure:
FieldValue
NameKiwiCart Portal
Custom domainSelect your lab domain, set subdomain to mcp-portal (or similar) mcp-portal.<your-lab-domain>
  1. Under MCP servers, click on Select existing MCP servers and choose KiwiCart MCP
  2. Optionally review which tools are enabled — all 6 should be on by default
  3. Add an existint Access Policies Select existing access policies:
    • Policies: IT admins

Add MCP portal

  1. Click Add MCP server portal

Expected Result

The portal is created. Your portal URL is:

https://mcp-portal.<your-lab-domain>/mcp

Step 7: Connect to the Portal via MCP Inspector

  1. Go back to MCP Inspector at http://localhost:5173
  2. Disconnect from the direct URL if still connected
  3. Configure the connection:
SettingValue
URLhttps://mcp-portal.<your-lab-domain>/mcp
Transport TypeStreamable HTTP
Connection TypeDirect
  1. Click Connect
  2. A browser window opens — authenticate with your SAML credentials (itadmin@acmecorp.com / #Savetheinternet)

Authenticate

  1. Select the server to authorise KiwiCart MCP and click done

Authorize

  1. After authentication, confirm:
    • You are connected
    • Tools tab shows all 6 tools - name should start with kiwi-cart-mcp
    • You can run get_product_catalog and get the same response as before

Connected

Expected Result

  • Portal prompts for authentication (Access login flow)
  • After auth, tools are visible and callable
  • This is the sanctioned path: identity-verified, logged, governed

Step 8: Review Portal Logs

  1. Go back to Access controls > AI controls
  2. Find your KiwiCart Portal, click on the name of the portal then View more button

View more

  1. Click Logs

Logs

  1. Review the log entries:
FieldWhat You Should See
TimeTimestamp of your tool calls
StatusSuccess for each call
Useritadmin@acmecorp.com
ServerKiwiCart MCP
FeatureThe tool name (e.g., get_product_catalog)
DurationResponse time in ms

Expected Result

Every tool call made through the portal is logged with user identity. This is the observability that direct MCP access does not provide.


Validation

  • Health endpoint returns JSON with "status": "ok"
  • Direct MCP connection worked with Connection Type: Direct
  • All 6 tools visible in the Tools tab
  • Successfully ran get_product_catalog and lookup_order_status
  • MCP server added to AI controls with status Ready
  • MCP portal created with Access policy
  • Connected to portal via MCP Inspector with SAML authentication
  • Tool calls work through the portal
  • Portal logs show tool call history with user identity

Troubleshooting

Health endpoint returns 404 or error
  • Verify the URL ends with /health (not /mcp)
  • Check with the facilitator that the MCP server is deployed
  • Try opening the root URL / — it should also return the health JSON
Connection Error in MCP Inspector
  • Verify the URL ends with /mcp (not /health or just the root)
  • Verify Transport Type is set to Streamable HTTP
  • Verify Connection Type is set to Direct (not Via Proxy)
  • Check that the remote server is reachable (test /health in browser first)
No tools visible after connecting
  • Click the Tools tab explicitly — tools may not show on the main panel
  • Try clicking List Tools if the button is available
  • Disconnect and reconnect
MCP server status shows Error in AI controls
  • Verify the HTTP URL is correct and includes /mcp
  • The server must be reachable from Cloudflare's network
  • Try clicking Sync capabilities to refresh
Portal authentication loop
  • Clear browser cookies for your lab domain
  • Ensure your identity provider is configured in Zero Trust (M0)
  • Try an incognito window
  • Verify the Access policy includes @acmecorp.com