Load and use MCP server prompts as slash commands in the CLI (#4828)

Co-authored-by: harold <haroldmciver@google.com>
Co-authored-by: N. Taylor Mullen <ntaylormullen@google.com>
This commit is contained in:
christine betts
2025-07-25 20:56:33 +00:00
committed by GitHub
parent de96887789
commit eb65034117
19 changed files with 761 additions and 100 deletions

View File

@@ -0,0 +1,19 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { Config } from '../config/config.js';
import { DiscoveredMCPPrompt } from '../tools/mcp-client.js';
export function getMCPServerPrompts(
config: Config,
serverName: string,
): DiscoveredMCPPrompt[] {
const promptRegistry = config.getPromptRegistry();
if (!promptRegistry) {
return [];
}
return promptRegistry.getPromptsByServer(serverName);
}