UNPKG

pyb-ts

Version:

PYB-CLI - Minimal AI Agent with multi-model support and CLI interface

36 lines (35 loc) 1.31 kB
import { listMCPServers, getClients } from "@services/mcpClient"; import { PRODUCT_COMMAND } from "@constants/product"; import chalk from "chalk"; import { getTheme } from "@utils/theme"; import { LIST_ITEM } from "@constants/figures"; const mcp = { type: "local", name: "mcp", description: "Show MCP server connection status", isEnabled: true, isHidden: false, async call() { const servers = listMCPServers(); const clients = await getClients(); const theme = getTheme(); if (Object.keys(servers).length === 0) { return `${LIST_ITEM} No MCP servers configured. Run \`${PRODUCT_COMMAND} mcp\` to learn about how to configure MCP servers.`; } const serverStatusLines = clients.sort((a, b) => a.name.localeCompare(b.name)).map((client) => { const isConnected = client.type === "connected"; const status = isConnected ? "connected" : "disconnected"; const coloredStatus = isConnected ? chalk.hex(theme.success)(status) : chalk.hex(theme.error)(status); return `${LIST_ITEM} ${LIST_ITEM}${client.name}: ${coloredStatus}`; }); return [`${LIST_ITEM} MCP Server Status`, ...serverStatusLines].join("\n"); }, userFacingName() { return "mcp"; } }; var mcp_default = mcp; export { mcp_default as default }; //# sourceMappingURL=mcp.js.map