Add Mcp Content Ladder

tasks26/26
Created openspec/changes/add-mcp-content-ladder/tasks.mdView on GitHub →

1. Contract and response shape

  • 1.1 Implement the fixed read_record_field input schema from design.md, including selector exclusivity and bound checks.
  • 1.2 Implement the fixed read_record_field output schema from design.md, and configure MCP output-schema validation for structuredContent.
  • 1.3 Add content_ladder metadata to search, query_records, and fetch for resource-backed fields.
  • 1.4 Implement URL-safe record and field resource handles for pdpp://record/{handle} and pdpp://field-window/{handle}.
  • 1.5 Update MCP server instructions without repeating long connector or recovery prose.

2. Adapter implementation

  • 2.1 Add the bounded field-window read tool and route reads through existing grant-enforced resource-server APIs.
  • 2.2 Add record and field MCP resource templates and resources/read handlers.
  • 2.3 Add resource_link blocks to tool results where the MCP SDK supports them.
  • 2.4 Update search, query_records, and fetch formatting to expose the content ladder without requiring prose parsing.
  • 2.5 Keep binary/blob fields metadata-only by default, with resource/export handles rather than large base64 text.

3. Resource-server substrate

  • 3.1 Prove resource-server APIs can return bounded text windows.
  • 3.2 Add the resource-server field-window endpoint when existing APIs cannot satisfy the bounded-read contract.
  • 3.3 Preserve grant enforcement for stream, field, time-range, resource, and connection constraints on window/resource reads.
  • 3.4 Add SQLite and Postgres conformance tests for the field-window substrate.

4. Compatibility and regression coverage

  • 4.3 Add structured-content-aware client assertions that follow content_ladder metadata without parsing prose.
  • 4.4 Add resource-aware client simulation that follows resource_link URIs through resources/read.
  • 4.5 Add full tests for invalid selector combinations, default bounds, max bounds, out-of-grant reads, malformed handles, stale cursors, and binary fields.
  • 4.6 Add regression coverage that no adapter-owned opaque-only marker is emitted as the sole path to long content.
  • 4.7 Extend existing token-budget tests so the new ladder does not regress default tools/list, search, query, or fetch budgets.
  • 4.8 Add a resources/list independence test: a resource_link returned by a tool is readable even when it is not listed by resources/list.

5. Documentation and closeout

  • 5.1 Update MCP package documentation with content-ladder examples and client compatibility notes.
  • 5.2 Add a concise compatibility matrix for Codex, Claude Code/Desktop, Gemini CLI, Hermes, opencode, Cursor, ChatGPT, and Claude app surfaces where evidence exists.
  • 5.3 Run openspec validate add-mcp-content-ladder --strict.
  • 5.4 Run the MCP server test suite and targeted compatibility simulations.
  • 5.5 Record MCP spec version details for tool-result, resource-link, output-schema, and resource-read semantics.
  • 5.6 Record live-client smoke gaps as residual risks rather than claiming unsupported client behavior.