mirror of
https://github.com/davidkaya/aryx.git
synced 2026-07-29 07:58:47 +02:00
feat: discover MCP tools via protocol probing for approval pill
When MCP server configs declare wildcard tools (empty tools array), the Copilot SDK has no API to list individual tool names. Add direct MCP protocol probing using @modelcontextprotocol/sdk to discover available tools from each accepted server. - Add McpToolProber service supporting stdio/SSE/HTTP transports - Probe accepted MCP servers on project load, acceptance, and rescan - Store probed tools on DiscoveredMcpServer and McpServerDefinition - Use probed tools in listApprovalToolDefinitions when declared tools are empty, so the approval pill shows individual tool toggles - Remove unused isMcpServerApprovalKey helper - Fix effectiveAutoApprovedCount Math.max workaround in ChatPane - Add comprehensive tests for probed tool behavior - Update ARCHITECTURE.md tooling integration section Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -27,7 +27,6 @@ import { isScratchpadProject, type ProjectRecord } from '@shared/domain/project'
|
||||
import { resolveSessionToolingSelection, type SessionRecord } from '@shared/domain/session';
|
||||
import {
|
||||
groupApprovalToolsByProvider,
|
||||
isMcpServerApprovalKey,
|
||||
listApprovalToolDefinitions,
|
||||
type RuntimeToolDefinition,
|
||||
type SessionToolingSelection,
|
||||
@@ -135,8 +134,7 @@ export function ChatPane({
|
||||
let count = 0;
|
||||
for (const group of groups) {
|
||||
if (group.serverApprovalKey && effectiveAutoApproved.has(group.serverApprovalKey)) {
|
||||
// Server-level approval: count as 1 approved group even with 0 declared tools
|
||||
count += Math.max(group.tools.length, 1);
|
||||
count += group.tools.length;
|
||||
} else {
|
||||
count += group.tools.filter((t) => effectiveAutoApproved.has(t.id)).length;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user