Feature Request: session-scoped tool inventory API (list MCP-discovered tools loaded into a session)
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- csharp, go, python, typescript
调研方向
首先阅读 createSessionRpc 的实现以及现有的 session.rpc.{mcp,skills,plugins,extensions}.list() 封装。检查 CONTRIBUTING 中关于 Python、Go 和 .NET 对等性的要求,并查看 api.schema.json,即使服务器端 RPC 处理程序位于此仓库之外。完成的标准是:受支持的 SDK 绑定能够公开一致的会话范围 tools.list 结果,前提是内部 RPC 变得可用。
由索引模型根据 Issue 内容生成。
描述
Problem
No public API enumerates the tools loaded into a session — built-ins merged with MCP-discovered tools from SessionConfig.mcpServers. Closest existing surfaces don't cover it:
client.rpc.tools.list({ model? })is server-scoped — built-ins only, no session-loaded MCP tools.session.rpc.mcp.list()returns server connection status (name,status,error?,source?), not tools or counts per server.session.mcp_servers_loadedevent fires once on session startup but carries the same server-status-only payload — no tool list.session.mcp_server_status_changedcarries{ serverName, status }only.session.tools_updatedevent payload is just{ model: string }.
A session can report mcp.status: "connected" and still expose zero tools (wrong CLI flags, version mismatch, schema error) — there's no SDK-side way to detect this.
Why it's needed
- Operational visibility. Confirm before the first turn that an MCP server actually contributed the expected tools, not just that its process started.
- Diagnostic UIs. Surface per-server tool counts to operators of BYOK / multi-MCP deployments.
- Test assertions. Verify a given MCP wiring exposes the expected tool set without spawning a parallel
tools/listprobe. - Parity with prior MCP clients. Other MCP integrations (e.g.
@ai-sdk/mcp) expose discovered tools as an enumerable map; consumers migrating to copilot-sdk lose this.
Contribution scope
api.schema.json ships from the closed @github/copilot npm package (the public github/copilot-cli repo is just the installer). The server-side RPC handler must live in the internal CLI — external contributors can only touch SDK bindings/wrappers in this repo, not the underlying RPC implementation.
Proposed solution
Add a session-scoped tools.list RPC, mirroring the existing client.rpc.tools.list() but reflecting per-session config:
// in createSessionRpc:
tools: {
list: async (): Promise<SessionToolsListResult> =>
connection.sendRequest("session.tools.list", { sessionId }),
handlePendingToolCall: /* unchanged */,
}
export interface SessionToolsListResult {
tools: Tool[]; // namespacedName populated for MCP tools (e.g. "playwright/browser_navigate")
}
Returns built-ins (post-excludedTools/availableTools filtering) + MCP-contributed tools. Consistent with existing session.rpc.{mcp,skills,plugins,extensions}.list() shape. Parity in Python/Go/.NET per CONTRIBUTING.
A leaner alternative: enrich McpServer with toolCount?: number and/or tools?: string[]. Less consistent with the existing pattern but lighter.
Related
- #944 — same underlying gap, surfaced as a question.
- #735 — adjacent (manipulating session tool set without teardown).
Environment
@github/copilot-sdk@0.3.0
- 主要语言
- Java
- 星标
- 10.5k
- 派生
- 1.5k
- 平均合并
- 1 天 9 小时
- 30 天内合并 PR
- 130
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/copilot-sdk 的其他 Issue
-
agentic-workflows
难度 2/5 1-3 小时 新手友好度 65/100
github/copilot-sdk#2760 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
github/copilot-sdk#2759 ·
-
documentation
难度 1/5 1 小时以内 新手友好度 85/100
github/copilot-sdk#2758 ·
-
agentic-workflows
难度 2/5 1-3 小时 新手友好度 68/100
github/copilot-sdk#2709 · 1 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 78/100
github/copilot-sdk#2673 ·
查看 github/copilot-sdk 的全部 Issue
相似的 Issue
-
area/plugin
难度 2/5 1-3 小时 新手友好度 75/100
kestra-io/plugin-kestra#190 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
apache/rocketmq-dashboard#5064 ·