Summarize extensions and MCP servers on startup (#3977)

This commit is contained in:
Billy Biggs
2025-07-18 20:45:00 +02:00
committed by GitHub
parent 9dadf22958
commit 18c3bf3a42
11 changed files with 218 additions and 64 deletions

View File

@@ -13,6 +13,7 @@ interface ContextSummaryDisplayProps {
geminiMdFileCount: number;
contextFileNames: string[];
mcpServers?: Record<string, MCPServerConfig>;
blockedMcpServers?: Array<{ name: string; extensionName: string }>;
showToolDescriptions?: boolean;
}
@@ -20,11 +21,17 @@ export const ContextSummaryDisplay: React.FC<ContextSummaryDisplayProps> = ({
geminiMdFileCount,
contextFileNames,
mcpServers,
blockedMcpServers,
showToolDescriptions,
}) => {
const mcpServerCount = Object.keys(mcpServers || {}).length;
const blockedMcpServerCount = blockedMcpServers?.length || 0;
if (geminiMdFileCount === 0 && mcpServerCount === 0) {
if (
geminiMdFileCount === 0 &&
mcpServerCount === 0 &&
blockedMcpServerCount === 0
) {
return <Text> </Text>; // Render an empty space to reserve height
}
@@ -39,10 +46,27 @@ export const ContextSummaryDisplay: React.FC<ContextSummaryDisplayProps> = ({
}`;
})();
const mcpText =
mcpServerCount > 0
? `${mcpServerCount} MCP server${mcpServerCount > 1 ? 's' : ''}`
: '';
const mcpText = (() => {
if (mcpServerCount === 0 && blockedMcpServerCount === 0) {
return '';
}
const parts = [];
if (mcpServerCount > 0) {
parts.push(
`${mcpServerCount} MCP server${mcpServerCount > 1 ? 's' : ''}`,
);
}
if (blockedMcpServerCount > 0) {
let blockedText = `${blockedMcpServerCount} blocked`;
if (mcpServerCount === 0) {
blockedText += ` MCP server${blockedMcpServerCount > 1 ? 's' : ''}`;
}
parts.push(blockedText);
}
return parts.join(', ');
})();
let summaryText = 'Using ';
if (geminiMdText) {