Fix MCP config not being passed to Claude CLI

The MCP servers (including github_comment server) were configured but not passed to Claude. This caused the "update_claude_comment" tool to be unavailable.

Changes:
- Write MCP config to a file at $RUNNER_TEMP/claude-mcp-config.json
- Add mcp_config_file output from prepare.ts
- Pass MCP config file via --mcp-config flag in claude_args
- Use fs/promises writeFile to match codebase conventions
This commit is contained in:
km-anthropic
2025-08-08 16:39:33 -07:00
parent 1b4fc382c8
commit 5bdb1e4ae0
3 changed files with 12 additions and 8 deletions

View File

@@ -6,6 +6,7 @@
*/
import * as core from "@actions/core";
import { writeFile } from "fs/promises";
import { setupGitHubToken } from "../github/token";
import { checkWritePermissions } from "../github/validation/permissions";
import { createOctokit } from "../github/api/client";
@@ -57,8 +58,11 @@ async function run() {
githubToken,
});
// Set the MCP config output
// Write MCP config to a file and set the file path as output
const mcpConfigPath = `${process.env.RUNNER_TEMP}/claude-mcp-config.json`;
await writeFile(mcpConfigPath, result.mcpConfig);
core.setOutput("mcp_config", result.mcpConfig);
core.setOutput("mcp_config_file", mcpConfigPath);
// Step 6: Get system prompt from mode if available
if (mode.getSystemPrompt) {