Expand description
MCP schema capture: types, pagination merging, and diff logic.
This module understands the structure of MCP discovery responses
(initialize, tools/list, resources/list, prompts/list,
resources/templates/list) and provides:
- Pagination detection: Determine if a response is a single page or part of a paginated sequence (MCP cursor-based pagination).
- Page merging: Combine paginated responses into a single snapshot.
- Schema diffing: Compare two snapshots to detect added, removed, and modified items (tools, resources, prompts).
This is pure protocol logic — no HTTP, no storage, no hashing. The proxy and storage layers consume these functions.
Structs§
- Schema
Diff - Result of diffing two schema snapshots for a single MCP method.
Enums§
- Page
Status - Pagination state for an MCP list response.
Functions§
- detect_
page_ status - Determine pagination status from the request body and response body.
- diff_
schema - Diff two schema payloads for a list method.
- is_
schema_ method - Check if an MCP method is a schema discovery method whose response should be captured.
- merge_
pages - Merge paginated list responses into a single combined
resultpayload.