diff --git a/app/Mcp/Servers/EinundzwanzigServer.php b/app/Mcp/Servers/EinundzwanzigServer.php index 11a7982..f1cf08c 100644 --- a/app/Mcp/Servers/EinundzwanzigServer.php +++ b/app/Mcp/Servers/EinundzwanzigServer.php @@ -67,6 +67,16 @@ Parameter sind nur ein optionaler Fallback, falls die ID bereits bekannt ist. TXT)] class EinundzwanzigServer extends Server { + /** + * tools/list wird vom Paket cursor-paginiert (Default 15/Seite). Manche Clients + * (z. B. der Claude.ai-Web-Connector) laden nur die erste Seite und folgen dem + * nextCursor nicht – dann fehlt die Hälfte der Tools. Wir heben die Seitengröße an, + * sodass alle Tools auf eine Seite passen. + */ + public int $maxPaginationLength = 100; + + public int $defaultPaginationLength = 100; + /** * The tools registered with this MCP server. * diff --git a/tests/Feature/Mcp/EinundzwanzigServerTest.php b/tests/Feature/Mcp/EinundzwanzigServerTest.php index a6c7a03..4dde26d 100644 --- a/tests/Feature/Mcp/EinundzwanzigServerTest.php +++ b/tests/Feature/Mcp/EinundzwanzigServerTest.php @@ -22,3 +22,13 @@ it('registers every domain tool on the server', function () { ->and($tools)->toContain(UpdateCourseEventTool::class) ->and($tools)->toContain(SearchCitiesTool::class); }); + +it('serves every tool on a single tools/list page', function () { + $reflection = new ReflectionClass(EinundzwanzigServer::class); + $tools = $reflection->getProperty('tools')->getDefaultValue(); + $defaultPerPage = $reflection->getProperty('defaultPaginationLength')->getDefaultValue(); + + // Some MCP clients (e.g. the Claude.ai web connector) only load the first + // tools/list page and do not follow the nextCursor, so every tool must fit on it. + expect($defaultPerPage)->toBeGreaterThanOrEqual(count($tools)); +});