openai/codex · error
{method} exceeded the pagination limit of {MAX_MCP_CATALOG_P
Error message
{method} exceeded the pagination limit of {MAX_MCP_CATALOG_PAGES} pages What it means
Error "{method} exceeded the pagination limit of {MAX_MCP_CATALOG_PAGES} pages" thrown in openai/codex.
Source
Thrown at codex-rs/codex-mcp/src/pagination.rs:45
pub(crate) async fn collect_paginated_with_limit<T, F, Fut>(
method: &str,
overall_timeout: Option<Duration>,
max_items: usize,
mut fetch: F,
) -> Result<Vec<T>>
where
F: FnMut(Option<PaginatedRequestParams>) -> Fut,
Fut: Future<Output = Result<(Vec<T>, Option<String>)>>,
{
let collect = async {
let mut collected = Vec::new();
let mut cursor = None;
let mut seen_cursors = HashSet::new();
let mut page_count = 0;
loop {
if page_count == MAX_MCP_CATALOG_PAGES {
return Err(anyhow!(
"{method} exceeded the pagination limit of {MAX_MCP_CATALOG_PAGES} pages"
));
}
page_count += 1;
let params = cursor.as_ref().map(|next: &String| {
PaginatedRequestParams::default().with_cursor(Some(next.clone()))
});
let (items, next_cursor) = fetch(params).await?;
if items.len() > max_items.saturating_sub(collected.len()) {
return Err(anyhow!(
"{method} exceeded the catalog limit of {max_items} items"
));
}
collected.extend(items);
let Some(next_cursor) = next_cursor else {
return Ok(collected);
};View on GitHub (pinned to 339751715c)
Solutions
- Narrow the listing request (filters or prefixes) so fewer pages are needed; the server may also be misbehaving by returning unbounded pages.
When it happens
Trigger: Thrown at codex-rs/codex-mcp/src/pagination.rs:45 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of openai/codex@339751715c (2026-08-25).
Data as JSON: /api/errors/55701acc5e3deb6f.
Report an issue: GitHub.