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.

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 proxy’s 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 proxy’s 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.

Managing a proxy generated from a Tyk-managed REST API

The example above proxies a remote MCP server. The same TykMcpProxyDefinition and ConfigMap pattern also manages a proxy generated directly from a Tyk-managed REST API, which the Operator reconciles identically. Two things differ in the OAS document itself:
  • upstream.url is an adapter target (for example tyk://a1b2c3d4e5f647a8b9c0d1e2f3a4b5c6/mcp) instead of a remote https:// URL. See The upstream adapter target for what this value means.
  • The document carries an x-tyk-mcp-server extension alongside x-tyk-api-gateway, holding the tool catalog: which of the source API’s operations are exposed as tools, and any name, description, or parameter overrides.
Authoring this via the Operator means hand-writing the tool catalog in the x-tyk-mcp-server extension yourself. The Dashboard’s guided wizard has no Operator equivalent. See REST API to MCP x-tyk-mcp-server extension for the full field reference.

Example

This assumes a Tyk-managed REST API with ID a1b2c3d4e5f647a8b9c0d1e2f3a4b5c6 already exists, managed via the Dashboard, the Gateway API, or its own TykOasApiDefinition resource.
Apply both manifests the same way as the Quick Start example above. SecurityPolicy resources reference this proxy identically to one fronting a remote MCP server. Nothing about policy configuration differs based on the proxy’s upstream type.

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.