ADC

Server access control for MCP Gateway

MCP clients can connect to any backend MCP server, which can introduce critical security risks, such as data exfiltration, unauthorized tool usage, and enterprise policy bypasses.

To mitigate these risks, NetScaler® enforces server-level access control using allow list and block list policies at the gateway to deliver the following:

  • Ensures that only approved MCP servers are accessible.
  • Prevents unauthorized or malicious MCP endpoints.
  • Provides centralized governance for MCP access.
  • Provides a clear rejection response for disallowed requests.

This feature enables administrators to control the MCP servers that clients can access using NetScaler MCP Gateway. It uses content switching and responder policies to enforce allow or deny behavior based on request attributes, such as headers.

Important considerations

The feature relies on client-provided headers, for example x-netscaler-target-mcp-server. We recommend that you:

  • Configure a deny policy as default.
  • Combine with authentication and rate limiting for full security.

Prerequisites

Ensure that the following requirements are met:

  • An MCP Gateway is configured on NetScaler using content switching and load balancing virtual servers.
  • Backend MCP servers are configured.
  • The client sends the target MCP header.

Configure allow list and block list using the CLI

Configure allow lists using content switching policies and enforce block lists using responder policies.

Sample allow list configuration

add cs policy allow_app1 "HTTP.REQ.HEADER(\"x-netscaler-target-mcp-server\").CONTAINS(\"app1.com\")"

bind cs vserver mcp_cs -policyName allow_app1 -priority 10 -gotoPriorityExpression NEXT
<!--NeedCopy-->

Sample block list configuration

add responder action deny_res_act respondwith q<"HTTP/1.1 403 Forbidden\r\nContent-Type: application/json\r\nContent-Length: 42\r\nConnection: close\r\n\r\n{\"error\":\"Unauthorized MCP server access\"}">

add responder policy deny_res_pol "HTTP.REQ.HEADER(\"x-netscaler-target-mcp-server\").CONTAINS(\"untrusted.com\")" deny_res_act

bind cs vserver mcp_cs -policyName deny_res_pol -priority 100 -gotoPriorityExpression END -type REQUEST
<!--NeedCopy-->

Sample default deny policy

add responder policy default_deny "TRUE" deny_res_act

bind cs vserver mcp_cs -policyName default_deny -priority 1000 -gotoPriorityExpression END -type REQUEST
<!--NeedCopy-->

Troubleshooting

Request blocked unexpectedly

Verify whether the header value matches the policy.

Unauthorized access is allowed

Check the policy priority order.

Client errors

Confirm the JSON response formatting.

Server access control for MCP Gateway