By NHI Mgmt Group Editorial TeamBased on WorkOS: “The Vercel MCP + WorkOS AuthKit template: deploy secure MCP servers globally in 5 minutes” (July 8, 2025)

TL;DR: Secure MCP server templates on Vercel Edge reduce the friction of adding authentication to AI tool servers, but they also expose a sharper governance issue: public and private tools can coexist unless authorization is enforced at the tool level, according to WorkOS. The real control question is whether identity checks are attached to execution paths, not just to the server wrapper.


At a glance

What this is: This is a WorkOS analysis of an MCP server auth pattern for Vercel Edge that keeps public and private tools in one server while pushing authorization decisions down to the tool level.

Why it matters: It matters because IAM teams need to treat MCP servers as mixed-trust execution surfaces, where authentication at the wrapper does not by itself prove least privilege for every tool call.


Context

MCP server auth becomes a governance problem when one server exposes both public and private tools. In that design, authentication at the server boundary does not automatically answer which execution paths should be allowed to act on user data, which is the core identity question for MCP deployments on the edge.

The article frames that problem through Vercel Edge and WorkOS AuthKit, but the underlying issue is broader than either vendor. Identity controls have to follow the tool, the session context, and the action being requested, otherwise a single authenticated wrapper can hide very different privilege requirements inside the same server.

For IAM and NHI teams, this is a useful example of how agent-facing infrastructure collapses old assumptions about where authorization lives. The question is no longer whether the server is authenticated, but whether each tool invocation carries the right trust boundary.


Key questions

Q: What breaks when MCP servers do not require authentication?

A: When MCP servers do not require authentication, the access boundary disappears. Attackers and scanners can enumerate tools directly, invoke exposed functions, and abuse those surfaces as if they were intended users. That turns an integration protocol into a public attack surface and makes later authorisation checks largely irrelevant.

Q: Why do mixed public and private MCP tools create governance risk?

A: They collapse different trust levels into one runtime surface. A public health-check tool may share helpers, context, or deployment logic with a sensitive data tool, which can blur the real privilege boundary. Teams need to decide whether the mixed design is intentional, documented, and enforceable at tool level.

Q: How should teams validate JWT-based identity in edge MCP deployments?

A: They should test token verification, claim mapping, and user-context propagation as one chain. If any step is loose, downstream tools may inherit a weaker identity than the request deserves. The goal is to ensure that claims become a reliable authorization input, not just a parsed token payload.

Q: When does an MCP server need tool-level authorization instead of route-level auth?

A: Whenever the server hosts tools with different privilege needs. Route-level auth can be enough for a single-purpose endpoint, but mixed MCP servers need per-tool decisions because public and private actions can coexist in the same process. The authorization model should match the granularity of the action being taken.


Technical breakdown

How the authHandler pattern separates server auth from tool auth

The pattern wraps the MCP server in a single authentication handler, then passes identity context into each tool through authInfo. That lets the platform authenticate a request once while leaving individual tools to decide whether they require a verified user context. In practice, this is an execution-wrapper model: the server gate handles authentication plumbing, while the tool layer enforces action-specific authorization. The benefit is cleaner composition, but the risk is false confidence if teams assume the wrapper itself has solved authorization. In MCP deployments, the real control point is not the route alone, it is the tool invocation path that consumes the context.

Practical implication: Treat server-level authentication as ingress control, not proof that every tool is properly authorised.

Mixed public and private tools in one MCP server

The template deliberately allows tools such as ping or status to remain public while sensitive tools like data creation require authentication. That creates a mixed-trust server, where the same endpoint hosts both unauthenticated and authenticated actions. Technically, this is different from simple login protection because authorization is evaluated per tool, not per server. The governance challenge is avoiding privilege bleed between tool classes. If public tools can call shared helper functions or share context carelessly, the server wrapper can look secure while sensitive execution still relies on implicit trust. Mixed-mode designs need explicit privilege boundaries at the tool and helper level.

Practical implication: Inventory which MCP tools are public, which are protected, and which helpers can touch sensitive data.

JWT verification and user context in edge deployments

The example verifies a token, resolves a user profile, and attaches claims and user data into authInfo.extra for downstream use. That is a common edge pattern because it avoids stateful sessions and keeps request handling stateless. The trade-off is that identity becomes highly dependent on token correctness, scope handling, and what is preserved in the context object. In agent-facing systems, this matters because tools may be invoked at machine speed and can chain actions quickly once a token is accepted. The control boundary therefore shifts from session persistence to token validation and context propagation.

Practical implication: Validate token handling, claim trust, and context propagation as part of the authorization design.


NHI Mgmt Group analysis

Tool-level authorization is the real control boundary in MCP servers. A wrapper that authenticates the request does not by itself prove that each tool should execute. Once public and private tools share the same server, the governing question becomes whether privilege is evaluated at the action path rather than the transport path. Practitioners should treat the tool as the unit of authority, not the server envelope.

Mixed-trust MCP servers create an identity blast radius if helper functions are shared carelessly. A public ping route and a private data-creation route can look isolated while still inheriting the same context, utilities, and execution surface. That makes privilege leakage more subtle than a simple exposed endpoint. The practical conclusion is that shared code must be reviewed as part of the authorization boundary, not just the deployment boundary.

JWT-backed edge auth shifts the governance burden from sessions to claims. Stateless edge patterns reduce session bloat, but they also increase dependence on correct token verification, claim mapping, and user-context propagation. This is a better fit for MCP than stateful middleware chains, yet it also means identity assurance lives or dies on the quality of the token-to-tool path. IAM teams should evaluate whether their trust model is claim-bound and tool-aware.

Authentication simplicity can hide authorization ambiguity in autonomous-adjacent tool servers. As AI agents increasingly call MCP servers, the important issue is not whether an identity check exists somewhere in the stack, but whether the check constrains the exact action being requested. That assumption matters across NHI and agentic AI governance because it defines where least privilege is actually enforced. The implication is to anchor authorization at execution time, not presentation time.

MCP server auth is becoming an identity architecture pattern, not just an implementation detail. The article points to a broader shift where developers want secure defaults without sacrificing the composability of edge-native systems. That is useful, but only if governance keeps pace with mixed tool sets, delegated context, and rapidly expanding agent access. Practitioners should treat MCP auth as part of the enterprise identity model, not a local code pattern.

From our research library:

  • 24,008 unique secrets were exposed in MCP configuration files in 2025 alone, the protocol's first year of widespread adoption, according to the State of Secrets Sprawl 2026.
  • 70% of organisations grant AI systems more access than they would give a human employee performing the exact same job, according to the 2026 Infrastructure Identity Survey.

What this signals

MCP deployments are moving identity enforcement closer to execution, which is the right direction for agents and tools that share a server but not a trust level. The programme implication is simple: if the tool can act differently based on identity, the authorization control must sit where the tool is invoked, not where the server is exposed.

Mixed-trust MCP server: a single server that hosts both public and authenticated tools will force teams to define privilege boundaries more precisely than classic API gateways do. That changes review scope for IAM, PAM, and NHI governance because the risk is no longer just access to the endpoint, but access to the wrong action inside the endpoint.


For practitioners

  • Map authorization to each MCP tool Document which tools are public, which require user context, and which helper functions can reach sensitive data. Review the tool-level authorization boundary before treating the server wrapper as sufficient.
  • Separate public and private execution paths Keep health-check style tools isolated from tools that create, read, or modify user data. Where shared utilities are unavoidable, audit them as part of the trust boundary because they can silently widen access.
  • Validate token-to-context propagation Test how JWT claims become user context in authInfo.extra and confirm that downstream tools do not accept missing or malformed identity state. This is where edge auth often becomes brittle.
  • Review MCP deployments as mixed-trust systems Assume a single MCP server can host both authenticated and unauthenticated operations. Set governance rules for mixed-trust design so that authorization decisions are explicit at the tool layer.

Key takeaways

  • The article shows that MCP authentication can be wrapped around a server without solving the harder problem of per-tool authorization.
  • Public and private tools can coexist safely only when the trust boundary is explicit and shared helpers do not leak privilege across actions.
  • For IAM and NHI governance, the important control question is whether identity checks constrain the exact execution path that an MCP tool uses.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 and OWASP Agentic AI Top 10 address the attack and risk surface, while NIST CSF 2.0 and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-04 — Insecure AuthenticationThe article centers on how MCP servers authenticate requests before tool execution.
NHI-05 — Overprivileged NHIMixed public and private tools can widen privilege beyond what each action needs.
Recommendation — Apply NHI-04 to verify that MCP requests are authenticated before any sensitive tool runs. Use NHI-05 to scope each MCP tool to the minimum identity context it needs.
OWASP Agentic AI Top 10ASI03 — Identity & Privilege AbuseAgent-facing tool servers create privilege boundaries that can be abused if not enforced per action.
Recommendation — Map MCP tool authorization to ASI03 and prevent action-level privilege drift.
NIST CSF 2.0PR.AA-05 — Access Permissions, Entitlements and AuthorizationsThe article is fundamentally about access decisions at the tool level.
Recommendation — Apply PR.AA-05 to align each MCP tool's permissions with its required entitlement.
NIST SP 800-53 Rev 5IA-9 — Service AuthenticationMCP servers and tools authenticate as services and workloads in an edge context.
Recommendation — Use IA-9 to authenticate MCP service interactions before tool execution.

Key terms

  • MCP Server: An MCP server is a tool endpoint that connects an AI agent to external systems and data sources through Model Context Protocol. Because it extends what the agent can reach, it becomes part of the identity and access surface and must be reviewed like any other privileged connector.
  • Tool-level Authorization: Tool-level authorization is the practice of checking permissions on each discrete action a client asks an MCP server to perform. It matters because LLMs can generate dynamic requests, so access control must be enforced where the action is executed, not only where the request is formed.
  • Authentication Handler: An authentication handler is the component that executes the logic for an authentication scheme. It validates credentials, creates an authentication ticket when successful, and returns a failure or no result when it cannot authenticate the request. Handlers also drive challenge and forbid responses.
  • Mixed-Trust Server: A mixed-trust server hosts both public and protected operations in the same runtime. That design can be efficient, but it increases governance pressure because security teams must prove that unauthenticated paths cannot inherit privileges intended only for authenticated tools.

Deepen your knowledge

NHI governance, agentic AI identity, and machine identity security are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are building or maturing an IAM programme, it is worth exploring.
NHIMG Editorial Note
Published by the NHIMG editorial team on June 8, 2026.
Updated on October 8, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org