MCP tools/list fetched as a single page — tools beyond the first page are silently dropped
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 冷清
- 技术栈
- typescript
- 领域
- api
调研方向
从 packages/opencode/src/mcp/index.ts 开始,检查标准的 client.listTools() 路径和 listToolsLenient() 请求路径,并注意 nextCursor 的处理。添加一个多页 tools/list 测试,验证每一页中的工具都会被收集,并保留在已注册工具集和缓存中。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- TypeScript
- 星标
- 813
- 派生
- 134
- 平均合并
- 2 天 3 小时
- 30 天内合并 PR
- 65
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
AltimateAI/altimate-code 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
AltimateAI/altimate-code#1359 ·
-
难度 2/5 1-3 小时 新手友好度 84/100
AltimateAI/altimate-code#1323 ·
-
难度 2/5 1-3 小时 新手友好度 86/100
AltimateAI/altimate-code#1288 ·
-
难度 1/5 1 小时以内 新手友好度 92/100
AltimateAI/altimate-code#1285 ·
-
privacy: Altimate Base consent dialog no longer discloses persistent per-installation identifier 未关闭
难度 1/5 1 小时以内 新手友好度 88/100
AltimateAI/altimate-code#1284 ·
查看 AltimateAI/altimate-code 的全部 Issue
相似的 Issue
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 1/5 1 小时以内 新手友好度 85/100
-
Mend: dependency security vulnerability untriaged
难度 2/5 1-3 小时 新手友好度 70/100