MCP Security Best Practices: What Every Enterprise Team Needs to Know in 2026

The Model Context Protocol (MCP) gives AI agents the ability to call real tools: querying databases, writing files, calling APIs, and triggering workflows. That power comes with real security risk. As of mid-2026, MCP adoption is accelerating in enterprise environments, yet most teams are deploying MCP servers with the same informal practices they used in early prototyping. That gap is where breaches happen.

This guide covers the foundational security practices every team should implement before running MCP in production. You do not need to be a security expert to apply them.


MCP security is different from traditional API security

MCP servers act as intermediaries between your AI agent and your systems. A compromised or misconfigured MCP server does not just leak data; it can allow an agent to take actions on your behalf across every tool that server can reach. Traditional API security focuses on authenticating the caller. MCP security also requires controlling what actions an authenticated caller can take, with which tools, and under what conditions.

The MCP specification defines the protocol, but it deliberately leaves security enforcement to the platform. That means the security posture of your MCP deployment depends entirely on the platform or tooling you choose to run it on.


Best practice 1: run every MCP server in an isolated container

The single most important thing you can do is ensure each MCP server runs in its own isolated container with minimal permissions. If an MCP server is compromised, container isolation limits the blast radius to that one server rather than your entire environment.

Isolation means the server cannot access the host filesystem, cannot reach other servers on the network, and cannot escalate privileges. Stacklok enforces this by default: every MCP server the platform manages runs in a container, and network access and filesystem permissions are governed by configurable JSON profiles. Teams should treat any platform that does not enforce isolation by default as unsuitable for production use.


Best practice 2: enforce per-request identity, not shared credentials

Many early MCP setups use a single API key or service account shared across all users and agents. This approach means you cannot audit who did what, and a leaked credential grants access to everyone’s tools.

The correct approach is per-request identity: every call to an MCP server carries the identity of the specific user or agent making the request, authenticated via a standard protocol like OIDC or OAuth 2.0. Stacklok’s embedded authorization server supports OIDC/OAuth SSO, including integration with Okta, Microsoft Entra ID, and Google Workspace. No credentials are stored locally on the user’s machine or in the agent process.


Best practice 3: build a curated, approved MCP server registry

Open MCP server ecosystems mean developers can pull and run any server they find online. Without governance, this creates supply chain risk: a malicious or poorly maintained server can be deployed into your environment without review.

The solution is a curated internal registry. An administrator reviews and approves MCP servers before they are available to developers. Developers discover and deploy only from that approved catalog. Stacklok provides a built-in registry with a developer portal, integrated with the official MCP Registry, so admins can maintain a trusted catalog without blocking developer productivity.

Before trusting any MCP server, verify its provenance. Look for servers that publish signed artifacts with verifiable provenance attestation. At Stacklok, supply chain attestation is a first-class feature rather than an afterthought.


Best practice 4: log everything, and route logs to your SIEM

If you cannot see what your MCP servers are doing, you cannot detect an incident. Every MCP request, tool call, and response should produce a structured log entry that captures: which user or agent made the request, which tool was called, what parameters were passed, and what the result was.

These logs need to route into your existing observability and security tooling. Stacklok natively supports OpenTelemetry and Prometheus, and integrates out of the box with Grafana, Datadog, Honeycomb, Splunk, and New Relic. A Fortune 500 financial services firm deployed Stacklok on Kubernetes specifically because it could integrate with their existing New Relic observability stack while enforcing data retention policies required by their compliance team.


Best practice 5: apply least-privilege tool access

Developers naturally want access to everything. In a production MCP environment, that instinct creates unnecessary risk. An agent that can only read a database should not have write access. An agent working on code review should not have access to customer data tools.

Implement role-based access control (RBAC) at the tool level: define which users and agents can call which tools, and block everything else by default. This is sometimes called a zero-trust posture for MCP: deny all, permit by exception. Stacklok enforces centralized policy that applies across coding agents like Cursor and Claude Code, so the same access rules apply whether a developer is working from their laptop or a CI pipeline.


Which Platform Fits Your Security Requirement

If your team is cloud-native and operates Kubernetes: Stacklok’s deploys a Kubernetes Operator, integrates with existing Helm and GitOps workflows, and provides the full security stack described above. This is the most complete option for platform engineering teams managing MCP at scale.

If your team needs a self-hosted deployment for compliance reasons: Stacklok runs entirely in your private cloud with no SaaS dependencies. SaaS-only gateways are not viable for organizations with data residency or off-premises processing restrictions.

If your team is small and just getting started: A simpler open-source MCP runner may be sufficient initially. Plan your migration path to a governed platform before you expand MCP access to production systems or sensitive data.

Need to ensure your MCP footprint is secure? Here are some additional questions you should ask:

The biggest risk is over-privileged access combined with no audit trail. A default MCP setup often uses shared credentials and no container isolation, which means a single compromised server can reach all connected systems, and there is no log to reconstruct what happened. Fixing these two issues should be the first priority for any production deployment.

The MCP specification defines the protocol for tool communication but intentionally leaves security enforcement to the platform. Authentication, authorization, isolation, and logging are all platform responsibilities. Enterprises should evaluate MCP platforms specifically on how they address these gaps, not assume the spec covers them.

MCP server supply chain attestation means that the server image running in your environment can be cryptographically verified against a known, signed artifact, which is analogous to container image signing in Docker Content Trust or Sigstore. Stacklok’s ToolHive, founded by the team behind Kubernetes and with deep roots in supply chain security tooling, builds server signing and provenance attestation into the platform. Most SaaS-first MCP gateways do not publish documentation on server image provenance.

Stacklok enforces centralized policy for coding agents across the enterprise. When a developer uses Cursor or Claude Code, every MCP tool call routes through Stacklok’s policy engine, which applies the same RBAC, identity, and audit logging controls as any other MCP client. This prevents the common pattern where developer tools bypass the security controls applied to production agents.

May 22, 2026

How-To