MCP is a useful protocol. The 2026-07-28 revision gives agent hosts stateless, per-request discovery and invocation surfaces for tools, resources, prompts, authorization, elicitation, and other negotiated capabilities. Durable tasks are a separately negotiated extension.
That does not make an MCP server production-safe by default.
In ContextOS, MCP sits behind the Adapter Mesh and the Tool Gateway. The model never calls an MCP tool directly. The model proposes a step; the Gateway resolves the capability from the compiled tool manifest, validates arguments, evaluates native ActionRisk, emits a conservative v1 approval-mode projection when required, brokers credentials, executes the adapter, and records the result.
October 16 contract revision: the protocol references retain the explicitly named core revision; extension versions and host support need separate negotiation and pinning. The adapter manifest below is an illustrative application profile, not an exported canonical schema or evidence of active enforcement. This repository supplies reference validators, not a deployed MCP gateway.
The production rule
A production adapter must answer five questions without reading a prompt:
| Question | Required proof |
|---|---|
| What can this adapter do? | capability manifest with tools, resources, prompts, schemas, protocol version, transport, and owner. |
| How risky is each operation? | capability class, native ActionRisk, and a v1 approval-mode compatibility projection where required. |
| Who can invoke it? | auth contract, scopes, tenant rules, RunContext claims, and policy bindings. |
| What evidence does it return? | structured output, evidence refs, audit metadata, retry and error semantics. |
| Can it be replayed or audited later? | toolCall, toolResult, W3C trace context, idempotency, DecisionRecord linkage, version pins. |
If the answer is “the model knows” or “the prompt says,” the adapter is not ready.
MCP object types have different trust semantics
MCP exposes several surfaces. ContextOS should not treat them all as tools.
| MCP surface | Use it for | ContextOS treatment |
|---|---|---|
| Tool | model-invocable operation | map to a governed capability with schema, ActionRisk, and policy. |
| Resource | readable artifact or template | treat as evidence or context with source, classification, and access control. |
| Prompt | repeatable prompt artifact | version and evaluate; never treat as authority. |
| State handle | explicit application state reference | treat as an opaque identifier; re-authorize it on every call and apply a bounded lifetime. |
| Elicitation | user input or auth handoff | consent-bound, rate-limited, recorded in lineage. |
| Tasks extension | durable request state | opt in per request; map to resumable tool execution and deferred DecisionRecord states. |
The MCP Tasks extension allows a server to return an asynchronous task handle instead of a final result after the client opts in through per-request capabilities. ContextOS should still bind every task to authorization context, trace ids, timeouts, approval gates, and DecisionRecords. The extension is not wire-compatible with the experimental task surface from 2025-11-25; legacy support needs a separately tested profile.
The adapter manifest
MCP discovery tells you what the server says it can do. The ContextOS manifest tells production what is allowed to depend on it.
{
"adapter_id": "adp_payments_mcp",
"protocol": "mcp",
"protocol_version": "2026-07-28",
"transport": {
"kind": "streamable_http",
"endpoint_ref": "https://payments.example.com/mcp"
},
"auth": {
"type": "oauth2",
"initial_scopes": ["payments.read"],
"step_up_scopes": {
"payments.issue_refund": ["payments.refund.write"]
},
"allow_token_passthrough": false
},
"capabilities": [
{
"capability_id": "payments.lookup_transaction",
"mcp_tool_name": "payments_lookup_transaction",
"capability_class": "observe",
"action_risk": {
"effect": "none",
"authority": "service",
"reversibility": "read_only",
"interaction": "api",
"data_scope": "CONFIDENTIAL"
},
"approval_mode_compatibility_projection": "read_only",
"decision_bindings": ["support.refund.eligibility"],
"output_schema_ref": "schema://payments.lookup_transaction.output.v1",
"evidence_keys": ["transaction_id", "status", "settlement_ref"]
},
{
"capability_id": "payments.issue_refund",
"mcp_tool_name": "payments_issue_refund",
"capability_class": "act",
"action_risk": {
"effect": "external_state",
"authority": "human_approved",
"reversibility": "compensatable",
"interaction": "api",
"data_scope": "CONFIDENTIAL"
},
"approval_mode_compatibility_projection": "destructive",
"requires_approval_gate": "GATE_FINANCE_APPROVAL",
"idempotency": {
"required": true,
"dedup_window_seconds": 86400
},
"evidence_keys": ["refund_id", "transaction_id", "reversal_token"]
}
]
}The manifest lets a reviewer inspect declared risk. It cannot authenticate the requester or observe an active boundary. Current owner/tenant/audience/all-ancestor grants, native risk, cumulative guardrails, exact stored full-action approval/quorum, actual sandbox/credential/data controls and external preconditions precede dispatch. Applicable policy-expression errors stop compilation with structured diagnostics. A declared dedup window is not proof the provider implements it; verify semantics/window and reconcile unknown effects.
Narrow tools beat broad tools
Bad MCP tool:
{
"name": "payments_request",
"description": "Call the payments API",
"inputSchema": {
"type": "object",
"properties": {
"method": { "type": "string" },
"path": { "type": "string" },
"payload": { "type": "object" }
}
}
}Narrow illustrative capability descriptions (the action_risk_ref field is adapter metadata, not a standard MCP Tool property):
[
{
"name": "payments_lookup_transaction",
"description": "Read a settled transaction by id.",
"action_risk_ref": "risk://payments.lookup_transaction.v1"
},
{
"name": "payments_issue_refund",
"description": "Issue a refund against an existing settled transaction.",
"action_risk_ref": "risk://payments.issue_refund.v1"
}
]The second design lets ContextOS expose lookup without exposing refund. It lets the Critic require evidence before refund. It lets the Tool Gateway require idempotency only where a write can happen. It lets policy bind payments.issue_refund to a finance approval gate.
Task handling for long-running tools
Long-running work is where weak adapters usually leak state. A production MCP task should produce a ContextOS state transition:
MCP Tasks cancellation is cooperative; an acknowledgement is not verified stop and a provider effect may still complete. Map task states explicitly to canonical RunStatus and separate effect outcomes rather than treating DEFERRED as an execution lifecycle. Protected atomic task/run/operation/approval/budget stores and enforced generation fencing govern wake/resume, with current authority/approval/boundary/precondition checks. Preserve original shared capacity across peers, children, reviewers and retries; unknown effects retain reservations and stable operation identity. Key-only retry, task replay or release rollback cannot prove reversal.
If task state is accessible by guessing a task id, the adapter is unsafe. If task state can outlive the run without retention policy, the adapter is unauditable. If task cancellation does not preserve audit metadata, incident response will have a blind spot.
Threats the manifest should make visible
OWASP’s MCP Top 10 project frames MCP-specific risks such as model misbinding, scope creep, context spoofing, prompt-state manipulation, insecure memory references, and contextual prompt injection. ContextOS maps those risks into manifest checks:
| Risk | Manifest control |
|---|---|
| Scope creep | per-capability ActionRisk, a conservative compatibility projection, and scoped credentials. |
| Tool confusion | stable capability_id, owner, version, and schema refs. |
| Prompt injection through tool descriptions | treat descriptions as untrusted UI text; authority lives in policy. |
| Insecure memory references | resources carry classification, source id, and access rules. |
| Hidden model calls | sampling routes through AI Gateway policy and budget. |
| Long-running task leakage | task ids bound to auth context, TTL, trace, and audit. |
The point is not to avoid MCP. The point is to put MCP behind the same production boundary as every other adapter.
Govern actual purpose/readers/recipients/processors/residency and retention across collection, inference, tool input/output, telemetry, cache, memory, export and delegation. Resource metadata or tool descriptions cannot authorize disclosure. Track derived copies with correction/deletion receipts; pending or externally unknown propagation remains incomplete. Exact profiles and current independent conformance require useful, denial and fault evidence for the actual workflow, implementation, release and environment. A valid manifest, schema or protocol test is insufficient alone.
Adapter readiness checklist
- Each capability is named by business operation, not raw endpoint.
- Read and write operations are separate tools.
- Every input and output has JSON Schema.
- Every write-class operation declares verified provider idempotency or explicit reconciliation/no-safe-retry semantics; a key alone never permits a retry.
- Every capability declares native
ActionRisk; v1 consumers also receive a conservative approval-mode projection. - Auth uses least-privilege step-up scopes; token passthrough is off by default.
- Resources carry source, MIME type, size, classification, and evidence identity.
- Elicitation, multi-round requests, explicit state handles, and the Tasks extension have explicit policy bindings.
- Gateway tests cover protocol, schema, auth, policy, replay, and evaluator behavior.
Research base
- ContextOS spec: Build an Adapter, Model Context Protocol, Adapter Mesh, and Tool Manager.
- MCP official docs: 2026-07-28 specification, Tasks extension, Tools, Resources, and Authorization.
- OWASP MCP Top 10 for MCP-specific security failure modes.
