MCP tools/list fetched as a single page — tools beyond the first page are silently dropped
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- typescript
- Lĩnh vực
- api
Hướng nghiên cứu
Bắt đầu tại packages/opencode/src/mcp/index.ts và kiểm tra cả đường dẫn client.listTools() tiêu chuẩn lẫn đường dẫn yêu cầu listToolsLenient(), chú ý đến việc xử lý nextCursor. Thêm một test tools/list nhiều trang để xác minh rằng các tool từ mọi trang đều được thu thập và được giữ lại trong tập tool đã đăng ký cũng như cache.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
The MCP client retrieves a server's tool list with a single tools/list request and never follows the nextCursor pagination marker. Any server that paginates its tool catalog will have every tool past the first page silently omitted — no error, no warning.
Details
Two code paths are affected, both in packages/opencode/src/mcp/index.ts:
- Standard path —
client.listTools(). In@modelcontextprotocol/sdk@1.26.0this issues a single request and does not loop over pagination:async listTools(params, options) { const result = await this.request({ method: 'tools/list', params }, ListToolsResultSchema, options); ... } - Lenient fallback —
listToolsLenient()callsclient.request({ method: "tools/list", params: {} }, ...), a single request that ignoresnextCursoreven thoughLenientListToolsResultSchemamodels that field.
Because neither path advances the cursor, tools beyond the first page are dropped from the registered tool set and from the tool-list cache.
Impact
Minor→Medium. Only affects servers whose tool catalog is large enough to paginate; most servers return all tools in one page. When it does occur, the failure is silent — affected tools simply never appear.
Suggested fix
- Loop on
nextCursor, concatenatingtools, in both the standard and lenient paths before returning/caching. - Add a test with a multi-page
tools/listresponse to verify all pages are collected.
- Ngôn ngữ chính
- TypeScript
- Star
- 813
- Fork
- 134
- Merge trung bình
- 2 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 65
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của AltimateAI/altimate-code
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
AltimateAI/altimate-code#1359 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
AltimateAI/altimate-code#1323 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
AltimateAI/altimate-code#1288 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
AltimateAI/altimate-code#1285 ·
-
privacy: Altimate Base consent dialog no longer discloses persistent per-installation identifier Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
AltimateAI/altimate-code#1284 ·
Tất cả issue của AltimateAI/altimate-code
Issue tương tự
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
-
Mend: dependency security vulnerability untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100