Skip to content

Commit 0f1fe5e

Browse files
qozleclaude
andauthored
fix: forward MCP_TIMEOUT, MCP_TOOL_TIMEOUT, MAX_MCP_OUTPUT_TOKENS to action step (#1162)
These three env vars are read directly from process.env by the Claude CLI subprocess to configure MCP server behavior. Users setting them in their workflow had no reliable way to make them reach the CLI: - Job-level env: shadowed by the step's explicit env: block - Step-level env: on the calling workflow step is not inherited by composite action steps - GITHUB_ENV from a prior step: same shadowing problem - settings input: writes to ~/.claude/settings.json, not process.env The fix is to add explicit ${{ env.VAR }} passthrough lines for all three vars, matching the existing pattern already used for OTEL_*, AWS_*, and Vertex configuration (lines 271-317). No TypeScript changes are needed; the forwarding chain in parse-sdk-options.ts is already correct. Fixes #1152 Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 6e2bd52 commit 0f1fe5e

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,15 @@ runs:
312312
ANTHROPIC_DEFAULT_HAIKU_MODEL: ${{ env.ANTHROPIC_DEFAULT_HAIKU_MODEL }}
313313
ANTHROPIC_DEFAULT_OPUS_MODEL: ${{ env.ANTHROPIC_DEFAULT_OPUS_MODEL }}
314314

315+
# MCP configuration — these env vars are read directly from process.env by the
316+
# Claude CLI subprocess. They must be listed explicitly here because this step's
317+
# env: block shadows the calling workflow's job-level env vars (GitHub Actions
318+
# composite action behavior). Set these in your workflow's job-level env: or via
319+
# a prior step that writes to $GITHUB_ENV.
320+
MCP_TIMEOUT: ${{ env.MCP_TIMEOUT }}
321+
MCP_TOOL_TIMEOUT: ${{ env.MCP_TOOL_TIMEOUT }}
322+
MAX_MCP_OUTPUT_TOKENS: ${{ env.MAX_MCP_OUTPUT_TOKENS }}
323+
315324
# Telemetry configuration
316325
CLAUDE_CODE_ENABLE_TELEMETRY: ${{ env.CLAUDE_CODE_ENABLE_TELEMETRY }}
317326
OTEL_METRICS_EXPORTER: ${{ env.OTEL_METRICS_EXPORTER }}

0 commit comments

Comments
 (0)