Securing the Model Context Protocol (MCP) in production: Streamable HTTP, authorization boundaries and OpenBao vault
The 2026-07-28 MCP specification connects AI agents to enterprise tools over stateless HTTP requests. In production, security belongs in deterministic server code rather than instructions inside the system prompt. Five visual plates break down transport hardening, OAuth 2.1 boundaries, OpenBao secrets and correlated logs.
How does stateless Streamable HTTP work in MCP 2026-07-28?
The MCP 2026-07-28 specification retires persistent transport sessions and builds Streamable HTTP on independent requests behind standard load balancers. Mandatory Mcp-Method and Mcp-Name headers drive gateway routing and rate limits without replacing JSON-RPC payload validation. Servers validate the Origin header and replace transport sessions with explicit state handles.
Which OAuth 2.1 authorization boundaries apply to remote MCP servers?
Remote MCP servers publish Protected Resource Metadata under RFC 9728 and replace deprecated dynamic client registration with Client ID Metadata Documents (CIMD). Clients verify the RFC 9207 iss parameter before redeeming authorization codes to prevent issuer mix-up attacks. Every access token enforces a dedicated server audience (RFC 9068) with zero downstream passthrough.
Why isolate secrets outside local configuration files in OpenBao?
Writing plaintext API keys inside local JSON configuration files for stdio MCP servers exposes credentials on every workstation. The local configuration stores only a reference while OpenBao holds the secret value and issues a short-lived lease at launch, without replacing OAuth 2.1 over remote HTTP. Sandboxed processes start without ambient credentials and block outbound requests to link-local metadata endpoints.
Which five deterministic guardrails protect MCP tools in production?
Experiments in arXiv:2611.21259 demonstrate that system prompt instructions break under indirect prompt injections and malicious tool chaining. Five deterministic code guardrails close that attack surface: OpenBao leases, split read and write surfaces, untrusted output quarantine, correlated traces and kill-switches. Tool schemas stay cryptographically pinned with one-shot approvals and fail-closed defaults.
How should MCP calls be logged in VictoriaLogs with a kill-switch?
Every tool call propagates OpenTelemetry trace context inside request metadata to link incoming prompts and downstream effects in append-only VictoriaLogs storage. Spans record method, tool name and error status without ever persisting raw arguments or outputs containing personal data or secrets. Call budgets and a kill-switch immediately halt runaway loops while revoking active leases.
Official sources
Sources: official MCP 2026-07-28 specification announcement, MCP 2026-07-28 authorization specification, arXiv:2611.21259 on agentic authorization and trust boundaries, RFC 9207 (OAuth 2.0 Authorization Server Issuer Identification), RFC 9068 (JWT Profile for OAuth 2.0 Access Tokens) and OpenBao documentation. See also our private MCP servers sheet, our 2026 local AI hardware comparison and our guide to EU AI Act duties for local open-weight servers.
Frequently asked questions
Are Mcp-Method and Mcp-Name headers enough to authorize an MCP call?
No, those HTTP headers only drive gateway routing, filtering and rate-limiting before body inspection. The MCP server must confirm header consistency against the JSON-RPC payload and reject any mismatch. Real authorization always requires an OAuth 2.1 token bound to the target server audience.
Does OpenBao replace OAuth 2.1 for an MCP server?
No, each mechanism governs a distinct transport regime. For remote Streamable HTTP servers, the specification requires OAuth 2.1 with RFC 9728 discovery and RFC 9207 issuer validation. For local stdio servers, OpenBao removes plaintext keys from JSON configuration files by injecting short-lived leases at process launch.
Why does a system prompt fail to stop indirect prompt injection?
A language model does not enforce a formal separation between system instructions and untrusted data returned by external tools. Experiments in arXiv:2611.21259 demonstrate that adversarial payloads trigger unauthorized tool calls whenever guardrails stay inside the prompt. Only deterministic policies enforced by server code establish a reliable boundary.