fix: handle paginated MCP tools/list responses
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 76/100
Research direction
Start in raven/agent/tools/mcp.py, where ClientSession.list_tools() is called during MCP connection and discovered tools are registered. Trace the discovery flow and existing test layout, then verify single-page and multi-page servers, repeated cursors, and pagination failures. Done means all pages are registered without infinite loops or silent failures, with unit tests covering the acceptance criteria.
Written by the indexing model from the issue text.
Description
Problem
Raven currently calls ClientSession.list_tools() once when connecting to an MCP server and registers only the tools contained in that single response:
https://github.com/EverMind-AI/Raven/blob/main/raven/agent/tools/mcp.py
MCP tools/list responses are paginated and may include a nextCursor. If a server exposes more tools than its page size, Raven does not follow that cursor, so every tool after the first page is silently omitted.
This is not specific to one integration: any large MCP server that paginates tool discovery can be affected.
Real-world example
vercel-labs/agent-browser exposes a paginated MCP server:
agent-browser mcp --tools all
Its MCP implementation returns at most 64 tools per tools/list page, while the all profile exposes more than 100 tools. Raven therefore registers only the first page and cannot discover or invoke the remaining tools.
- agent-browser MCP documentation: https://agent-browser.dev/commands#agent-browser-mcp
- agent-browser pagination implementation: https://github.com/vercel-labs/agent-browser/blob/main/cli/src/mcp.rs
The default agent-browser core profile currently fits within one page, so the issue is easy to miss until a larger profile or MCP server is connected.
Expected behavior
Raven should continue requesting tools/list with the returned nextCursor until no cursor remains, then register tools from every page.
Conceptually:
all_tools = []
cursor = None
while True:
page = await session.list_tools(cursor)
all_tools.extend(page.tools)
cursor = page.nextCursor
if not cursor:
break
Acceptance criteria
- Single-page MCP servers continue to work unchanged.
- Multi-page MCP servers have all tools registered.
- Pagination stops when
nextCursoris absent orNone. - A repeated cursor cannot cause an infinite loop.
- Pagination failures produce a visible error rather than silently reporting a complete tool catalog.
- Unit tests cover both single-page and multi-page discovery.
Why this matters
Without pagination support, large MCP integrations can appear connected successfully while exposing only part of their tool surface. This creates difficult-to-diagnose failures because no connection error is raised and the missing tools simply do not appear in Raven.
- Dominant language
- Python
- Stars
- 4.1k
- Forks
- 94
- Avg merge
- 10h 2m
- Merged PRs (30d)
- 376
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from EverMind-AI/Raven
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
EverMind-AI/Raven#798 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
EverMind-AI/Raven#797 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
EverMind-AI/Raven#640 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
EverMind-AI/Raven#479 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
EverMind-AI/Raven#474 · 2 comments ·
Maintainers usually reply within 1 day
All issues in EverMind-AI/Raven
Similar issues
-
bug server
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sportsdataverse/sportsdataverse-py#641 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
googleapis/google-cloud-python#18532 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day