Skip to main content

Overview

From Tyk Operator v1.4.0, you can manage Model Context Protocol (MCP) servers declaratively using the TykMcpProxyDefinition custom resource. The Operator reconciles the resource into a Tyk-managed MCP proxy, so the same GitOps workflow you use for ApiDefinition and TykOasApiDefinition resources also applies to MCP servers. A TykMcpProxyDefinition points at a ConfigMap that holds the MCP OAS document. The Operator reads the document from the ConfigMap and synchronizes it to Tyk. Access to tools, resources, prompts, and the underlying JSON-RPC methods is controlled through the existing SecurityPolicy resource, extended with MCP-specific fields.

Prerequisites

  • Tyk Operator v1.4.0 or later installed in the cluster.
  • A Tyk Gateway / Dashboard with MCP proxy support enabled.
  • A ConfigMap containing the MCP OAS document under a known key (for example mcp.json).

Custom Resource Reference

Kind: TykMcpProxyDefinition Group / Version: tyk.tyk.io/v1alpha1 Scope: Namespaced Short name: tykmcp (usable as kubectl get tykmcp)

Spec

Status

kubectl get tykmcp -o wide surfaces Domain, ListenPath, Enabled, and SyncStatus as printed columns.

Quick Start

The example below proxies a mock MCP server reachable at http://mock-mcp-server.default.svc.cluster.local:7878.

1. Store the MCP OAS document in a ConfigMap

2. Create the TykMcpProxyDefinition

Apply both manifests and verify with:
If you update the ConfigMap, the Operator detects the change (via latestConfigMapHash) and pushes the new OAS document to Tyk on the next reconciliation.

Securing an MCP Proxy with a SecurityPolicy

The SecurityPolicy resource is extended with two MCP-aware blocks inside each entry of access_rights_array:
  • mcp_access_rights — allow/block lists for MCP tools, resources, and prompts.
  • json_rpc_methods_access_rights — allow/deny lists keyed by JSON-RPC method.
  • mcp_primitives — per-primitive rate limits.
  • json_rpc_methods — rate limits keyed by JSON-RPC method (tools/call, tools/list, resources/read, prompts/get, …).
For background on the underlying gateway feature, see the MCP proxy policies documentation. Reference an MCP proxy by setting kind: TykMcpProxyDefinition on the access entry.

Allow / block lists

Per-primitive and JSON-RPC rate limits

rate and per are declared as Float64 strings in the CRD schema — quote the values in YAML or kubectl apply will reject the manifest.
type in mcp_primitives accepts tool, resource, or prompt.

Verifying

The Status block reports the reconciled listenPath, domain, enabled flag, and latestTransaction.status. Failed reconciliations also surface as Kubernetes events on the resource.