Skip to main content

Module schema

Module schema 

Source
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§

SchemaDiff
Result of diffing two schema snapshots for a single MCP method.

Enums§

PageStatus
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 result payload.