Model Context Protocol (MCP)
The MCP 2026-07-28 integration profile for mapping tools, resources, prompts, input requests, and durable tasks into ContextOS controls.
MCP is an important interoperability protocol for the ContextOS Action plane. It is not the ContextOS authority model and it is not required by the core contract. A deployment may use MCP, A2A, OpenAPI, direct functions, or custom connectors; each path must still pass through the same policy, identity, risk, evidence, and audit boundary.
What MCP owns—and what ContextOS owns
| Concern | MCP | ContextOS integration profile |
|---|---|---|
| Wire contract | JSON-RPC messages, protocol version, capabilities, errors | Normalizes the exchange into ContextOS envelopes and trace lineage |
| Tool/resource discovery | Lists tools, resources, templates, and prompts | Treats discovery as untrusted input; admission comes from a pinned adapter manifest |
| User input | input_required results and multi-round-trip requests | Applies consent, approval, redaction, and authority checks before answering |
| Durable work | Optional io.modelcontextprotocol/tasks extension | Links task handles to the run, budget, policy verdict, and replay evidence |
| Authorization | MCP HTTP authorization profile | Intersects protocol authorization with tenant, principal chain, delegation, policy, and capability constraints |
| Action risk | Not an MCP protocol responsibility | Evaluates native ActionRisk and emits the v1 ApprovalMode compatibility projection |
| Audit | Trace-context propagation conventions | Persists policy decisions, tool envelopes, evidence refs, mutations, and decision lineage |
MCP annotations, tool descriptions, icons, prompts, resources, and server identity are metadata—not permission. The Tool Gateway must not allow a discovered object to grant itself a capability, scope, destination, or approval.
The additive Execution Contract binds selected exact profiles and current observations to the admitted run. Actual network/code/memory/effect/delegation features activate the corresponding controls; protocol support does not satisfy them. A production host must enforce current authority, exact approvals, active boundaries, credential/egress/data mediation, reservations and provider-safe recovery. The repository’s synthetic reference cases are separate from runtime conformance evidence.
Version and capability negotiation
For the 2026-07-28 profile:
- Optionally call
server/discoverto learn supported protocol versions, capabilities, extensions, and server identity. - Put
io.modelcontextprotocol/protocolVersionand client capabilities in every request’s_meta; include client identity as recommended by the protocol. - Verify the server identity and result metadata on every response.
- Fail visibly on
UnsupportedProtocolVersionError; do not silently downgrade. - Cache list/read results only according to their required
ttlMsandcacheScope, and invalidate on the corresponding change notification.
{
"protocol": "mcp",
"protocol_version": "2026-07-28",
"transport": "streamable_http",
"server_features": ["tools", "resources", "prompts"],
"extensions": ["io.modelcontextprotocol/tasks"]
}The adapter manifest pins a tested profile. It must not copy a live discovery response into production without review.
ContextOS host role
An implementation of ContextOS may act as an MCP host and run one or more MCP clients. The spec repository itself is not a host runtime.
- MCP server: exposes tools, resources, prompts, and optional extensions.
- MCP client: maintains the protocol relationship with one server.
- Host implementation: coordinates clients and applies product-level consent and security.
- ContextOS Tool Gateway: performs deterministic admission, policy, risk, credential, idempotency, evidence, and audit checks around a protocol call.
Request lifecycle
- The Conversation Manager materializes the
RunContextand the compiler emits only admitted capabilities. - The Planner proposes a capability; the Critic checks the compiled manifest, argument shape, and evidence requirements.
- The Tool Gateway resolves the pinned adapter and re-evaluates identity, policy, native action risk, approval state, destination, data scope, budget, and idempotency.
- The MCP client sends a self-contained request with its version, capabilities, identity, and W3C trace context in
_meta. - The server returns
completeorinput_required; a negotiated Tasks extension may instead returnresultType: "task". - A complete result is validated and normalized into a
ToolResultEnvelope. An input request is independently authorized before the original MCP request is retried withinputResponses. - The run records the protocol version, server identity, capability, policy decision, evidence, artifacts, mutations, latency, and any durable task handle.
ContextOS session_id remains a run/orchestration concept. It must not be represented as an MCP protocol session in the 2026-07-28 profile.
Keep protocol request IDs distinct from stable action/operation identity. Changed business arguments or destinations need a newly bound proposal and any required approval; inputResponses cannot rewrite an approved action. Transport reissue rules never authorize blind redispatch after a possible external commit.
MCP object mapping
| MCP object | ContextOS treatment |
|---|---|
| Tool | Candidate capability; requires a pinned binding, schemas, risk ceiling, policy bindings, idempotency semantics, and evidence contract |
| Resource / template | Candidate evidence input; retains source, classification, freshness, integrity treatment, and content hash |
| Prompt | Versioned prompt artifact; never policy authority |
| Elicitation input request | Consent-bound request for structured data or an out-of-band interaction |
| Tasks extension handle | Durable external-work handle bound to the originating run and authorization context |
| MCP App | Optional presentation surface; UI output is untrusted until validated like any other tool result |
| Skills over MCP | Experimental extension surface; useful for discovery, but never a permission grant |
ActionRisk binding
ActionRisk is the native ContextOS declaration. ApprovalMode remains required in the v1 tool envelope as a conservative compatibility projection.
{
"capability_id": "payments.issue_refund",
"protocol_tool": "payments_issue_refund",
"action_risk": {
"effect": "external_state",
"authority": "user_delegated",
"reversibility": "compensatable",
"interaction": "api",
"data_scope": "CONFIDENTIAL",
"decision_ttl_seconds": 120
},
"approval_mode": "destructive",
"requires_approval_gate": "GATE_FINANCE_APPROVAL",
"idempotency": { "required": true }
}Policy evaluates the vector and actual arguments immediately before execution. It also verifies that the legacy approval_mode is no less conservative than the deterministic projection of the vector. A favorable value in one dimension never cancels a denial in another.
Multi-round-trip input
MCP 2026-07-28 replaces server-initiated Roots, Sampling, and Elicitation requests with the multi-round-trip request pattern:
- the server returns
resultType: "input_required"and typedinputRequests; - the host decides which requests it supports and may show the user a consent or approval surface;
- ContextOS records the request, responder identity, redactions, and authority decision; and
- the client retries the original operation with
inputResponsesand a new request id.
Input requests are not trusted more than the originating tool. They cannot widen the tool’s registered authority or bypass a ContextOS approval gate.
Tasks extension
Use io.modelcontextprotocol/tasks for long-running operations that need a durable handle, polling, cancellation, or mid-flight input. The 2026 extension uses tasks/get and tasks/update; it has no tasks/list operation and no blocking tasks/result call.
| MCP task state | ContextOS interpretation |
|---|---|
working | External work continues under the pinned run and budget policy |
input_required | Pause; independently authorize the requested input or approval |
completed | Fetch/accept the final result and normalize it into ToolResultEnvelope |
failed | Emit a typed failure with retryability and partial-effect evidence |
cancelled | Keep cancellation terminal unless the protocol exposes a new task |
Task cancellation is cooperative. A tasks/cancel acknowledgment does not prove work stopped, and a terminal remote task label does not prove an external effect was prevented or reversed. Keep controller stop acknowledgments and effect reconciliation separate, with current executor ownership on resume. The official Tasks overview describes the transport lifecycle; ContextOS adds the local authority/accounting obligations.
Every task request must be authenticated and authorized. Task identifiers need high entropy and must remain scoped to the same user, tenant, client, and resource relationship as the original operation. A task handle is a reference, not a bearer capability.
Transport, authorization, and trace
- stdio: local/private integrations; JSON-RPC only on stdout/stdin, logs on stderr, explicit install consent, sandboxing, and minimal filesystem/network access.
- Streamable HTTP: shared integrations; validate
Origin, authenticate every request, use the required MCP headers, and constrain egress and redirects. - No protocol-session assumptions: do not implement
Mcp-Session-Id, the removed HTTP GET event endpoint,Last-Event-ID, or resumable redelivery in the2026-07-28profile. Any permitted reissue uses a new request id while retaining the original operation identity and provider key. Resolve uncertain write safety before reissue; a key alone provides no remote guarantee. - Authorization: bind credentials to the authorization-server issuer and resource, validate issuer information, use least privilege, and never pass through a token minted for another audience.
- Trace: propagate
traceparent,tracestate, and approvedbaggagekeys through MCP_meta; keep sensitive principal details in ContextOS records rather than baggage.
Deprecated and legacy features
Roots, Sampling, and Logging remain available only during MCP’s deprecation window. New adapters should not add them:
| Deprecated surface | Migration |
|---|---|
| Roots | Pass explicit resource URIs, path arguments, or server configuration under ContextOS path policy |
| Sampling | Route model calls through the deployment’s AI Gateway so budgets, lineage, and evaluation stay visible |
| Logging | Use stderr for stdio and OpenTelemetry for structured operational telemetry |
| HTTP+SSE | Migrate to Streamable HTTP |
| Dynamic Client Registration | Prefer Client ID Metadata Documents when the authorization server supports them |
Keep a separate 2025-11-25 compatibility adapter only when an existing server requires its initialize/session lifecycle. Label every related test, config, and trace with that profile.
Conformance checklist
- Protocol version and compatibility profile are pinned.
server/discoveror an equivalent compatibility probe is tested.- Every request carries version and capability metadata; unsupported versions fail visibly.
- Discovery is separated from ContextOS admission.
- Each tool binding declares native
ActionRiskplus the v1ApprovalModeprojection. - Input-required retries preserve policy, consent, identity, trace, budget, and idempotency state.
- Task handles are authenticated, scoped, unguessable, and linked to the originating run.
- Cache scope and TTL are honored.
- Deprecated features are absent from new builds or isolated behind a legacy profile.
- Tool results are schema-validated and emit evidence, mutation, postcondition, and failure metadata needed by replay.
Authoritative protocol references: MCP 2026-07-28 specification, key changes, multi-round-trip requests, Streamable HTTP, authorization, and Tasks extension.