All posts

Production access control for MCP servers on Kubernetes

Many teams assume that a single service‑account token baked into an MCP server is sufficient for production access control. The reality is that static credentials give every operator unrestricted, invisible access to the entire cluster. In most production environments the MCP server runs inside Kubernetes with a long‑lived token. Engineers, CI pipelines, and even automated bots all share that token. When a user runs a command, the request travels directly from the client to the Kubernetes API s

Free White Paper

Kubernetes API Server Access + Customer Support Access to Production: The Complete Guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free. No spam. Unsubscribe anytime.

Many teams assume that a single service‑account token baked into an MCP server is sufficient for production access control. The reality is that static credentials give every operator unrestricted, invisible access to the entire cluster.

In most production environments the MCP server runs inside Kubernetes with a long‑lived token. Engineers, CI pipelines, and even automated bots all share that token. When a user runs a command, the request travels directly from the client to the Kubernetes API server, bypassing any gate that could enforce per‑request policies. No audit trail is captured, no sensitive response fields are hidden, and no human can approve risky operations before they happen.

Why production access control matters for MCP servers

Production workloads often process personally identifiable information, financial records, or proprietary code. A rogue command, whether intentional or the result of a compromised credential, can exfiltrate data, delete resources, or pivot laterally across the cluster. Without granular, just‑in‑time enforcement, a single leaked token opens the entire production surface.

Regulators and internal auditors expect evidence that every privileged action was authorized, recorded, and, when needed, masked. They also expect that service accounts are scoped to the minimum set of permissions required for a specific job. When those expectations are not met, organizations face compliance gaps and increased blast radius.

What the current setup gets wrong

The existing setup provides three essential pieces: identity verification via OIDC, a static Kubernetes bearer token, and a deployment of the MCP server inside the cluster. This satisfies the basic requirement of “who can connect.” However, it stops short of any enforcement because the request reaches the API server directly. There is no place to inspect the command, no workflow to require approval, and no mechanism to mask returned secrets.

In other words, the setup decides who may start a session, but it does not control what happens once the session is active. The missing enforcement layer leaves production access control incomplete.

How hoop.dev enforces production access control on Kubernetes

hoop.dev inserts a Layer 7 gateway between the identity source and the Kubernetes API. The gateway runs an agent inside the same network as the cluster, so it can proxy the connection without exposing credentials to the end user.

When a user authenticates via OIDC or SAML, hoop.dev validates the token, extracts group membership, and maps the identity to a set of fine‑grained policies. Those policies dictate which namespaces, resources, or verbs the user may invoke. Before any command reaches the API server, hoop.dev evaluates the request against the policy.

  • Just‑in‑time approval: If a command exceeds the baseline policy, hoop.dev routes the request to an approval workflow. A designated approver can grant or deny the operation in real time.
  • Inline data masking: Responses that contain sensitive fields, such as secret values or token strings, are masked by hoop.dev before they are returned to the client.
  • Session recording: hoop.dev records every request and response pair, providing a complete audit log that can be reviewed for forensic analysis.
  • Command blocking: Dangerous verbs like delete or exec can be blocked outright unless explicitly allowed.

All of these enforcement outcomes exist because hoop.dev sits in the data path. The setup layer alone cannot provide them.

Continue reading? Get the full guide.

Kubernetes API Server Access + Customer Support Access to Production: Architecture Patterns & Best Practices

Free. No spam. Unsubscribe anytime.

Architectural flow for a production‑grade MCP server

1. Deploy the hoop.dev gateway using the standard Docker Compose or Kubernetes manifest. The deployment includes an agent that runs in the same namespace as the MCP server.

2. Register the Kubernetes cluster as a connection in hoop.dev. Provide the cluster URL and a short‑lived service‑account token that the gateway will use to authenticate on behalf of users.

3. Define production access control policies in hoop.dev’s policy editor. These policies reference OIDC groups, namespace scopes, and allowed verbs.

4. When an operator invokes the MCP server, the request first hits hoop.dev. The gateway checks the policy, may trigger an approval step, masks any sensitive data in the response, and records the session.

5. After the request is approved and processed, the response flows back through hoop.dev to the client, ensuring that no unapproved or unmasked data ever leaves the cluster.

Benefits of the gateway approach

Because hoop.dev is the sole enforcement point, organizations gain a single source of truth for production access control. Auditors can query the recorded sessions to prove that every privileged action was authorized. Security teams can tighten policies without redeploying the MCP server, and developers retain the same client experience, only the endpoint changes.

Additionally, the gateway model isolates the enforcement logic from the MCP server itself. Even if the server is compromised, the policies enforced by hoop.dev remain intact, preventing further abuse.

Getting started

To try this pattern, follow the getting‑started guide for the gateway deployment. The guide walks you through installing the agent, registering a Kubernetes connection, and defining a basic production access control policy.

For deeper details on policy language, masking capabilities, and approval workflows, explore the learn section. Both resources are kept up to date with the latest best practices.

Next steps

Once the gateway is operational, consider extending the model to other production services such as databases or internal HTTP APIs. The same principles, identity‑aware proxy, just‑in‑time approval, masking, and recording, apply across the board.

Ready to contribute or customize the gateway? The project is open source and welcomes community contributions. Visit the GitHub repository to clone the code, file issues, or submit pull requests.

Open source

Save the open-source gateway for agent data access

Hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.

Star and save the repo →More posts