Version: 0.1
Context defines a structured packet for transmitting what a user is seeing, selecting, or marking in a web interface to an AI agent or chat system.
The packet is transport-agnostic. It can be sent over MCP, HTTP, browser extension messaging, postMessage, SDK calls, or stored for later use.
- Explicit beats scraping. Prefer app-authored semantic metadata when available.
- User intent matters. Packets should preserve the gesture or capture mode that created them.
- Privacy is part of the format. Redaction and consent metadata are required.
- Provenance is required. Consumers should know who produced a packet and how.
- Packets are structured first. Prompt strings can be derived from packets, but should not be the canonical form.
- Transport is separate from the data model. MCP is a major bridge, not the owner of the packet shape.
Every packet MUST include:
protocol: currentlyaskable.contextversion: currently0.1source: where the context came fromcapture: how the context was capturedprivacy: redaction and consent stateprovenance: producer and method
The initial capture modes are:
text-selection: selected text or rangeelement-focus: focused, hovered, clicked, or selected UI elementviewport: visible page regionfull-page: full document or app pageregion: rectangular regionlasso: freeform selected regioncircle: user circled a regionsemantic: app-provided context without a DOM elementcustom: implementation-specific mode
Gestures describe what the user or runtime did:
clickhoverfocuskeyboarddragcirclelassoprogrammaticcustom
target describes the main thing the user pointed at.
Fields:
text: safe text representationrole: semantic or accessibility rolelabel: human-readable labelselector: optional selector or durable app identifierbounds: viewport-relative rectanglemetadata: app-provided structured data or stringscreenshot: optional visual crop
surrounding can include:
ancestors: parent context chainnearby: related nearby itemsvisible: visible annotated itemshistory: recent context entries
Consumers SHOULD treat surrounding context as secondary. The target is the user's primary context.
privacy is required.
Fields:
redacted: whether redaction/sanitization was appliedconsent:explicit,implicit, ornoneomitted: optional list of omitted fields or categories
Consumers SHOULD NOT assume unredacted packets are safe to send to a model. Producers SHOULD redact sensitive data before packet construction whenever possible.
provenance is required.
Fields:
producer: package, app, extension, or service namemethod:app,dom,extension,mcp, ormanual
MCP servers SHOULD expose Context packets as structured JSON from tools or resources.
Recommended MCP surface:
- Resource:
context://schema - Tool:
get_current_context - Tool:
get_context_schema - Tool:
format_context_for_prompt
MCP tools SHOULD return packets, not only prompt strings.
Packet versions follow semver-like compatibility:
- Patch-level schema clarifications do not change the packet
version. - Additive optional fields may remain in
0.1while the format is experimental. - Breaking changes require a new packet version.
Consumers SHOULD ignore unknown optional fields unless their validator is intentionally strict.