UNPKG

@code-yeongyu/senpi

Version:

Coding agent CLI with read, bash, edit, write tools and session management

31 lines • 1.43 kB
import { computeMcpExposurePolicy } from "./policy.js"; export function getMcpCatalogExposureStatus(catalog, serverConfig, settings) { const policy = computeMcpExposurePolicy(catalog, serverConfig, settings); if (policy.filteredEntries.length === 0) { return { hint: "No MCP tools matched includeTools/excludeTools filters.", toolCount: 0, mode: policy.mode }; } // Report the total exposed tools; in search mode note how many are active now. const hint = policy.mode === "search" ? `search mode: ${policy.activeEntries.length} active now, ${policy.registeredEntries.length} searchable via tool_search` : undefined; return { hint, toolCount: policy.registeredEntries.length, mode: policy.mode }; } export async function getMcpServerExposureStatus(name, connection, serverConfig, settings) { try { const result = await connection.client.listTools({}, { timeout: 500 }); const catalog = result.tools.map((tool) => ({ annotations: tool.annotations, connection, description: tool.description, requestTimeoutMs: serverConfig.requestTimeoutMs, schema: tool.inputSchema, server: name, tool: tool.name, })); return getMcpCatalogExposureStatus(catalog, serverConfig, settings); } catch { return { toolCount: null }; } } //# sourceMappingURL=status.js.map