fix: remove unnecessary GitHub comment server inclusion in agent mode (#549)

The GitHub comment MCP server was being included in agent mode even when no comment tools were explicitly allowed. This fix ensures the server is only included in tag mode where it's always needed for updating Claude comments.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Ashwin Bhat
2025-09-07 13:33:21 -07:00
committed by GitHub
parent 9975f36410
commit 1a8e7d330a

View File

@@ -74,10 +74,6 @@ export async function prepareMcpConfig(
tool.startsWith("mcp__github_inline_comment__"), tool.startsWith("mcp__github_inline_comment__"),
); );
const hasGitHubCommentTools = allowedToolsList.some((tool) =>
tool.startsWith("mcp__github_comment__"),
);
const hasGitHubCITools = allowedToolsList.some((tool) => const hasGitHubCITools = allowedToolsList.some((tool) =>
tool.startsWith("mcp__github_ci__"), tool.startsWith("mcp__github_ci__"),
); );
@@ -89,7 +85,7 @@ export async function prepareMcpConfig(
// Include comment server: // Include comment server:
// - Always in tag mode (for updating Claude comments) // - Always in tag mode (for updating Claude comments)
// - Only with explicit tools in agent mode // - Only with explicit tools in agent mode
const shouldIncludeCommentServer = !isAgentMode || hasGitHubCommentTools; const shouldIncludeCommentServer = !isAgentMode;
if (shouldIncludeCommentServer) { if (shouldIncludeCommentServer) {
baseMcpConfig.mcpServers.github_comment = { baseMcpConfig.mcpServers.github_comment = {