anthropics / anthropics/claude-ai-mcp
Claude.ai web client does not follow nextCursor pagination on tools/list
- Vorherrschende Sprache
- Keine Sprachdaten
- Sterne
- 471
- Forks
- 76
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
## Bug Description
When an MCP server returns paginated results for `tools/list` with a `nextCursor` token, the Claude.ai web client only processes the first page of tools and does not issue follow-up requests with the cursor to retrieve remaining tools. This causes tools beyond the first page to be silently missing from the conversation.
## Steps to Reproduce
1. Set up a remote MCP server that registers more tools than the server's default page size (e.g., 21 tools with a page size of 15)
2. Connect the MCP server to Claude.ai as a custom connector
3. Start a new conversation and observe available tools
**Expected:** All 21 tools are available in the conversation.
**Actual:** Only the first 15 tools appear. The remaining 6 tools are silently missing.
## Root Cause
The MCP specification defines cursor-based pagination for `tools/list`. When more results exist, the server returns a `nextCursor` field in the response. The client is expected to issue subsequent requests with that cursor until no `nextCursor` is returned.
For example, [Laravel MCP](https://github.com/laravel/mcp) (the official Laravel package for building MCP servers) defaults to a page size of 15 via `$defaultPaginationLength = 15` in its `Server` base class. With 21 registered tools, the first `tools/list` response includes 15 tools plus a `nextCursor`, expecting the client to request the second page containing the remaining 6 tools.
The Claude.ai web client appears to only process the first response and never follows the `nextCursor`.
## MCP Specification Reference
From the [MCP Pagination specification (2025-03-26)](https://modelcontextprotocol.io/specification/2025-03-26/server/utilities/pagination):
> **Operations Supporting Pagination:**
> - `tools/list` - List available tools
>
> **Implementation Guidelines:**
> Clients **SHOULD** support both paginated and non-paginated flows.
> Clients **SHOULD** treat a missing `nextCursor` as the end of results.
## Current Workaround
Server developers can increase their pagination page size to return all tools in a single page:
```php
// In your MCP Server class (Laravel MCP example)
public int $defaultPaginationLength = 50;
```
This avoids the issue but shouldn't be necessary — the client should follow pagination as per the spec.
## Related Issues
- **anthropics/claude-code#8237** — Same issue in Claude Code CLI, [marked as completed](https://github.com/anthropics/claude-code/issues/8237) (Sep 2025). The fix was not ported to the Claude.ai web client.
- **anthropics/claude-code#3141** — [MCP Resources Pagination Support](https://github.com/anthropics/claude-code/issues/3141) for `ListMcpResourcesTool` (similar pagination gap for resources).
## Environment
- **Client:** Claude.ai web (claude.ai) — Pro plan
- **MCP Server:** Laravel MCP v0.x (`laravel/mcp` package) via remote HTTP + OAuth 2.1
- **Protocol version:** 2025-03-26
- **Total tools registered:** 21
- **Tools visible in Claude.ai:** 15 (first page only)
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Bewertung
Dieses Issue wurde noch nicht bewertet.