WhoBuilt

Your Insecure MCP Server Won't Survive Production

Apr 8, 2026· 25 min· 1.8K views·Watch on YouTube

Speakers

Tun Shwe, AI lead at Lenses, explains how to design and secure production MCP servers with Jeremy Fronæ at an AI Engineer session.

Agent interfaces create security risks

Tun says MCP servers should be designed around how agents discover tools, retry requests, and use limited context. Each behavior creates a security risk: tool descriptions can carry hidden instructions, retries can resend sensitive conversation history, and unfiltered responses can expose PII or credentials. He recommends curating tools and minimizing the information they return.

Five principles for secure design

Tun presents five design principles: combine fine-grained operations into outcome-focused tools, constrain inputs with schemas, write complete tool documentation, return only needed data, and limit permissions at the tool or resource level. For example, an agent that only needs to check an order should not get a user-deletion tool. He argues these design choices reduce attack surface before OAuth is added.

Moving from local use to production

Local standard I/O setups can work as a single-user walled garden, but remote, shared MCP services need Streamable HTTP and controls such as OAuth, token management, TLS, CORS configuration, and rate limiting. Tun describes this shift as a security cliff. He cites Stacklok load tests in which 20 of 22 standard I/O requests failed with 20 simultaneous connections.

OAuth flows for remote MCP

Tun walks through the limits of long-lived API keys, which may be unscoped, shared, and passed through without validation. He explains OAuth 2.1 flows using dynamic client registration, PKCE, consent, and token exchange, then describes CIMD, where a client exposes metadata at a public URL. He says CIMD avoids a growing registration database and can bind redirect URIs to client metadata, while noting that enterprise authorization needs further controls.

Enterprise controls beyond OAuth

Tun says OAuth scopes alone do not provide tool-level permissions, so enterprise setups also need role-based access control for individual tools and resources. He recommends masking sensitive fields, logging which agent called which tool and what data it returned, and tracing requests end to end. These controls help organizations govern and audit agent activity.

Takeaways

  • Expose outcome-focused tools with constrained inputs to reduce attack surface.
  • Write complete tool descriptions and return only the data an agent needs.
  • Treat remote deployment as a security boundary that requires transport, authentication, and operational controls.
  • Use short-lived scoped tokens, and assess client registration flows for identity and phishing risks.
  • Add tool-level authorization, data masking, audit logs, and end-to-end tracing for enterprise governance.

Mentioned in this talk

Search inside this talk

What was claimed 9

  • role at
    Tun Shwe is AI lead at Lenses
    “I lead AI at Lenses.”
    YouTube
    Unverified2 sources· Talk
  • role at
    Jeremy Frenay is AI engineering at Lenses
    “I work on AI engineering at Lenses.”
    YouTube
    Unverified1 source· Talk
  • feature
    Lenses: Provides a data operating fabric between agents and data
    “Lenses is a data operating fabric that sits between your agents and data.”
    YouTube
    Unverified1 source· Talk
  • feature
    FastMCP: Created by Jeremy Lowin
    “Jeremy Lowin, the creator of FastMCP”
    YouTube
    Unverified1 source· Talk
  • feature
    secure agentic design: Limit tools, constrain inputs, document tools clearly, minimize returned data, and scope permissions narrowly
    “I've got five principles here”
    YouTube
    Unverified1 source· Talk
  • metric
    Stacklok: 20 out of 22 requests failed with 20 simultaneous connections using standard I/O transport
    “20 out of 22 requests failed with just 20 simultaneous connections.”
    YouTube
    Unverified1 source· Talk
  • feature
    OAuth: Supports short-lived, scoped tokens
    “short-lived, scoped tokens via OAuth 2.1”
    YouTube
    Unverified1 source· Talk
  • feature
    CIMD: Uses a client owner's public metadata URL as the client ID
    “the client owner exposes the client ID on a public URL”
    YouTube
    Unverified1 source· Talk
  • feature
    CIMD: Preferred approach since November 2025
    “has been the preferred approach since November 2025”
    YouTube
    Unverified1 source· Talk

Related talks