Skip to content

Limit MCP catalog pagination - #36039

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/961a1bfa5fe8a265daf56e342a919c980cd720fa
Jul 29, 2026
Merged

Limit MCP catalog pagination#36039
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/961a1bfa5fe8a265daf56e342a919c980cd720fa

Conversation

@copyberry

@copyberry copyberry Bot commented Jul 29, 2026

Copy link
Copy Markdown

Limit MCP catalog pagination

Why

MCP catalog discovery must not allow a server to keep pagination running or
growing without bounds.

What changed

  • Apply the shared pagination collector to tool, resource, and resource-template
    discovery.
  • Limit each catalog to 100 pages and 1,024 items, and reject pagination cursors
    larger than 64 KiB or any repeated cursor.
  • Bound the entire pagination operation by the configured tool timeout, falling
    back to 30 seconds when no timeout is configured.

Testing

Add unit coverage for every limit and an end-to-end MCP test that preserves
valid multi-page tools while excluding a server that returns an oversized
cursor.

copyberry Bot pushed a commit that referenced this pull request Jul 29, 2026
## Why

MCP catalog discovery must not allow a server to keep pagination running or
growing without bounds.

## What changed

- Apply the shared pagination collector to tool, resource, and resource-template
  discovery.
- Limit each catalog to 100 pages and 1,024 items, and reject pagination cursors
  larger than 64 KiB or any repeated cursor.
- Bound the entire pagination operation by the configured tool timeout, falling
  back to 30 seconds when no timeout is configured.

## Testing

Add unit coverage for every limit and an end-to-end MCP test that preserves
valid multi-page tools while excluding a server that returns an oversized
cursor.

GitOrigin-RevId: 961a1bfa5fe8a265daf56e342a919c980cd720fa
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/961a1bfa5fe8a265daf56e342a919c980cd720fa branch from 6f5870e to 7241ec3 Compare July 29, 2026 22:34
## Why

MCP catalog discovery must not allow a server to keep pagination running or
growing without bounds.

## What changed

- Apply the shared pagination collector to tool, resource, and resource-template
  discovery.
- Limit each catalog to 100 pages and 1,024 items, and reject pagination cursors
  larger than 64 KiB or any repeated cursor.
- Bound the entire pagination operation by the configured tool timeout, falling
  back to 30 seconds when no timeout is configured.

## Testing

Add unit coverage for every limit and an end-to-end MCP test that preserves
valid multi-page tools while excluding a server that returns an oversized
cursor.

GitOrigin-RevId: 961a1bfa5fe8a265daf56e342a919c980cd720fa
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/961a1bfa5fe8a265daf56e342a919c980cd720fa branch 2 times, most recently from cc735a7 to 3e3ae08 Compare July 29, 2026 22:37
@copyberry
copyberry Bot merged commit 3e3ae08 into main Jul 29, 2026
32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/961a1bfa5fe8a265daf56e342a919c980cd720fa branch July 29, 2026 22:38
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

5 participants