(self, args: str, context: CommandContext)
| 84 | ``OutputStyleCommand`` pattern); ``run()`` returns text without touching ``ctx.ui``.""" |
| 85 | |
| 86 | async def run(self, args: str, context: CommandContext) -> InteractiveOutcome: |
| 87 | parts = (args or "").strip().split() |
| 88 | if parts and parts[0].lower() in _MGMT_ARGS: |
| 89 | # TS enable/disable/reconnect/settings — need the unported MCP |
| 90 | # connection-manager subsystem. |
| 91 | return InteractiveOutcome(message=_NOT_SUPPORTED, display="system") |
| 92 | |
| 93 | servers = _collect_mcp_servers() |
| 94 | if not servers: |
| 95 | return InteractiveOutcome( |
| 96 | message="No MCP servers configured.", display="system" |
| 97 | ) |
| 98 | lines = [f"• {s['name']} — {_status_summary(s)}" for s in servers] |
| 99 | return InteractiveOutcome( |
| 100 | message="MCP servers:\n" + "\n".join(lines), display="system" |
| 101 | ) |
| 102 | |
| 103 | |
| 104 | MCP_COMMAND = McpCommand( |
no test coverage detected