File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -63,12 +63,13 @@ You are in a git worktree at ${workspacePath}
6363/**
6464 * Build MCP servers context XML block.
6565 * Only included when at least one MCP server is configured.
66+ * Note: We only expose server names, not commands, to avoid leaking secrets.
6667 */
6768function buildMCPContext(mcpServers : MCPServerMap ): string {
68- const entries = Object .entries (mcpServers );
69- if (entries .length === 0 ) return " " ;
69+ const names = Object .keys (mcpServers );
70+ if (names .length === 0 ) return " " ;
7071
71- const serverList = entries .map (([ name , command ] ) => ` - ${name }: \` ${ command } \` ` ).join (" \n " );
72+ const serverList = names .map ((name ) => ` - ${name } ` ).join (" \n " );
7273
7374 return `
7475<mcp>
Original file line number Diff line number Diff line change @@ -82,12 +82,13 @@ You are in a git worktree at ${workspacePath}
8282/**
8383 * Build MCP servers context XML block.
8484 * Only included when at least one MCP server is configured.
85+ * Note: We only expose server names, not commands, to avoid leaking secrets.
8586 */
8687function buildMCPContext ( mcpServers : MCPServerMap ) : string {
87- const entries = Object . entries ( mcpServers ) ;
88- if ( entries . length === 0 ) return "" ;
88+ const names = Object . keys ( mcpServers ) ;
89+ if ( names . length === 0 ) return "" ;
8990
90- const serverList = entries . map ( ( [ name , command ] ) => `- ${ name } : \` ${ command } \` ` ) . join ( "\n" ) ;
91+ const serverList = names . map ( ( name ) => `- ${ name } ` ) . join ( "\n" ) ;
9192
9293 return `
9394<mcp>
You can’t perform that action at this time.
0 commit comments