MCP gateway

The MCP gateway provides an authorization and policy enforcement layer between MCP clients and an upstream MCP server. It proxies requests to the MCP server while applying additional authorization controls to tool calls.

The gateway is configured in the Admin Console and runs as a separate component that retrieves its configuration from your Strivacity instance.

You can use the gateway to:

  • Expose protected resource metadata for the MCP server.
  • Restrict individual tools based on OAuth scopes.
  • Apply fine-grained authorization policies to tool calls.
  • Send gateway audit information to a syslog destination.

Before you begin

Before creating an MCP gateway:

  1. Configure the MCP server as a protected resource.
  2. Prepare an application and client configuration that can authorize access to the protected resource.
  3. Determine the upstream URL where the gateway can reach the MCP server and the public URL through which clients will access the gateway.

Configure the protected resource

Create a protected resource for the MCP server under Policies → Protected resources.

When configuring the resource:

  1. Select the MCP server resource type. A generic protected resource can also be used.

  2. Set the Resource URL to the public MCP endpoint exposed through the gateway, for example:

    https://mcp.example.com/mcp

  3. Add the scopes used by the MCP server.

  4. Add any additional scopes that the MCP gateway will enforce through tool restrictions or fine-grained authorization.

The protected resource URL and the MCP gateway's public URL should refer to the same MCP endpoint.

Prepare the application

Configure an application that clients can use to obtain authorization for the protected MCP server.

  1. Create or open an application and configure its Application identifier.
  2. Create an OIDC client template using dynamic templates.
  3. Configure the callback URL options required by the clients that will connect to the MCP server.
  4. Configure the application's client routing rules.
  5. Enable CIMD and/or DCR as required.
  6. For each applicable routing rule:
    1. Select the client template.
    2. Select the protected resource created for the MCP server.
    3. Configure the condition that determines when the rule applies.

For example, a routing rule can evaluate the requested resource parameter and select the client template and protected resource for requests targeting the MCP server.

Create an MCP gateway

Go to Agentic AI → MCP gateways and create an MCP gateway.

The gateway configuration provides the client ID and client secret used by the deployed gateway component to connect to your Strivacity instance.

Store these credentials securely. The client secret cannot be treated as public configuration.

Configure audit

Audit configuration is optional.

To send gateway audit information to a syslog destination, configure:

  • Host
  • Protocol
  • Port

Use values appropriate for your syslog deployment.

Create a gateway policy

Create a policy for the MCP server the gateway will proxy.

Upstream and public URLs

Configure:

  • Upstream URL: The MCP server URL that the gateway uses to forward requests.
  • Public URL: The MCP endpoint exposed to clients through the gateway.

For example:

  • Upstream URL: http://mcp-server:8000/mcp
  • Public URL: https://mcp.example.com/mcp

The Public URL should match the URL configured for the protected resource.

Protected resource metadata

Configure how the gateway exposes protected resource metadata.

For proxy mode:

  • Set Mode to Proxy.
  • Set Upstream metadata URL to the metadata endpoint exposed by the upstream MCP server.
  • Set Public metadata URL to the metadata endpoint exposed through the gateway.

For example:

  • Upstream metadata URL:
    http://mcp-server:8000/.well-known/oauth-protected-resource/mcp
  • Public metadata URL:
    https://mcp.example.com/.well-known/oauth-protected-resource/mcp

Configure tool restrictions

Tool restrictions let the gateway require specific OAuth scopes before an MCP tool can be called.

This is separate from authorization enforced directly by the upstream MCP server.

To add a tool restriction:

  1. Open the gateway policy and select Tool restrictions.
  2. Optionally, select the protected resource to make its configured scopes available for selection.
  3. Enter the Tool name.
  4. Select the Required scopes.
  5. Add additional restrictions as needed.
  6. Save the policy.

For example, a tool named echo can require an additional scope such as mcp:extra. A client without the required scope cannot use that tool through the gateway.

Configure fine-grained authorization

Fine-grained authorization lets the gateway evaluate an OPA Rego policy for MCP tool calls.

The policy can use information about the request, including the tool being called and its arguments, to determine the authorization decision.

A fine-grained authorization policy can:

  • Allow the tool call.
  • Deny the tool call and return an error message.
  • Require an additional OAuth scope.

Configure the Rego policy and specify its entry point as a package and variable. The default entry point is:

mcp/decision

The Admin Console validates the policy configuration before it can be saved.

Fine-grained authorization can be used when scope requirements depend on more than the tool name alone. For example, the same tool can require an additional scope only for a particular operation or set of arguments.

Deploy the MCP gateway

The MCP Gateway runs as a separate component and retrieves its configuration from your Strivacity instance.

Configure the gateway with:

  • The Strivacity tenant or issuer containing the MCP gateway configuration.
  • The gateway client ID.
  • The gateway client secret.

For example:

MCP_GATEWAY_TENANT=<tenant-or-issuer>
MCP_GATEWAY_CLIENT_ID=<client-id>
MCP_GATEWAY_CLIENT_SECRET=<client-secret>

Use the client ID and secret generated for the MCP gateway in the Admin Console.

After the gateway starts, clients connect to the Public URL configured in the gateway policy rather than connecting directly to the upstream MCP server.


Did this page help you?