Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Open Context Protocol (OCP)

Status: v0.1-draft — pre-review. Open for feedback; do not build production dependencies on a draft. See GOVERNANCE.md.

MCP standardized how agents call tools. The Open Context Protocol standardizes the layer underneath: how the context that feeds a model is represented, governed and proven — independent of which engine produced it.

Why a protocol

Every context engine (retrieval layer, compression proxy, memory system, agent harness) answers the same questions with private formats today:

  • What exactly entered the model's context, and where did it come from?
  • What is this pipeline allowed to read, execute and remember?
  • Which governance rules were active, and can a third party verify any of this after the fact?

Private answers don't compose. An auditor cannot verify five vendors' bespoke logs; a platform team cannot enforce one policy across three engines; an agent cannot hand context to another agent without a shared representation. OCP defines the exchange formats for exactly these five surfaces:

Part Surface One line
1 Context-IR What entered the context: items, sources, tokens, safety flags, verification hashes
2 Capability Vocabulary What a pipeline may do: namespaced capability identifiers and their semantics
3 Policy Packs Declarative governance rules: redaction patterns, tool allow/deny, budgets, retention
4 Evidence Chain Tamper-evident audit records: hash chains, signatures, offline verification
5 Event Vocabulary Governance-relevant runtime events: tool calls, violations, budget signals

Deliberately out of scope: compression algorithms, retrieval ranking, routing heuristics, ML models — everything that makes one implementation better than another. OCP defines what is exchanged, never how it is produced well. (See ADR-0001.)

OCP and MCP are complementary

MCP OCP
Standardizes Tool/resource invocation between model hosts and servers Context representation, governance and evidence
Layer Agent ↔ tool transport Context pipeline ↔ auditor / policy / other pipelines
Typical question "How do I call this tool?" "What entered the context, was it allowed, can you prove it?"

An agent stack typically speaks both: MCP to reach tools, OCP to represent, govern and prove the context those tools produce. OCP is not a transport — its objects travel over MCP results, HTTP bodies, files or queues unchanged.

Repository layout

spec/ocp-v0.1-draft.md     The specification (normative)
spec/schemas/*.schema.json JSON Schemas (draft 2020-12) for every wire object
adr/                       Architecture decision records (the protocol/product cut)
GOVERNANCE.md              Versioning, RFC process, path to shared governance

Conformance

A conformance suite (test vectors + harness) is planned as a standalone package; schema validity is the floor, not the ceiling. The reference implementation is LeanCTX — its CI validates real engine output against these schemas on every commit.

License

Attribution: "Open Context Protocol, © LeanCTX maintainers & contributors."

About

Open Context Protocol (OCP) — open wire format for governed context exchange: Context-IR, capabilities, policy packs, evidence chain, events. CC-BY 4.0 (prose) / Apache-2.0 (schemas).

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors