summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/commands/mcpCommand.ts
diff options
context:
space:
mode:
authorHarold Mciver <[email protected]>2025-08-04 17:38:23 -0400
committerGitHub <[email protected]>2025-08-04 21:38:23 +0000
commit99ba2f6424b8873df3857f03b729e236710bbc32 (patch)
tree73f6b72d6fdc7d546114705b4deb133aadbd4cdb /packages/cli/src/ui/commands/mcpCommand.ts
parent93f8fe3671babbd3065d7a80b9e5ac50c42042da (diff)
Update MCP client to connect to servers with only prompts (#5290)
Diffstat (limited to 'packages/cli/src/ui/commands/mcpCommand.ts')
-rw-r--r--packages/cli/src/ui/commands/mcpCommand.ts17
1 files changed, 14 insertions, 3 deletions
diff --git a/packages/cli/src/ui/commands/mcpCommand.ts b/packages/cli/src/ui/commands/mcpCommand.ts
index dc5442cc..11c71f1a 100644
--- a/packages/cli/src/ui/commands/mcpCommand.ts
+++ b/packages/cli/src/ui/commands/mcpCommand.ts
@@ -94,7 +94,15 @@ const getMcpStatus = async (
const promptRegistry = await config.getPromptRegistry();
const serverPrompts = promptRegistry.getPromptsByServer(serverName) || [];
- const status = getMCPServerStatus(serverName);
+ const originalStatus = getMCPServerStatus(serverName);
+ const hasCachedItems = serverTools.length > 0 || serverPrompts.length > 0;
+
+ // If the server is "disconnected" but has prompts or cached tools, display it as Ready
+ // by using CONNECTED as the display status.
+ const status =
+ originalStatus === MCPServerStatus.DISCONNECTED && hasCachedItems
+ ? MCPServerStatus.CONNECTED
+ : originalStatus;
// Add status indicator with descriptive text
let statusIndicator = '';
@@ -260,11 +268,14 @@ const getMcpStatus = async (
message += ' No tools or prompts available\n';
} else if (serverTools.length === 0) {
message += ' No tools available';
- if (status === MCPServerStatus.DISCONNECTED && needsAuthHint) {
+ if (originalStatus === MCPServerStatus.DISCONNECTED && needsAuthHint) {
message += ` ${COLOR_GREY}(type: "/mcp auth ${serverName}" to authenticate this server)${RESET_COLOR}`;
}
message += '\n';
- } else if (status === MCPServerStatus.DISCONNECTED && needsAuthHint) {
+ } else if (
+ originalStatus === MCPServerStatus.DISCONNECTED &&
+ needsAuthHint
+ ) {
// This case is for when serverTools.length > 0
message += ` ${COLOR_GREY}(type: "/mcp auth ${serverName}" to authenticate this server)${RESET_COLOR}\n`;
}