Repository navigation
Claude: default to strict MCP configuration #64970
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e124037
43e8f4e
0fa4e37
76424a9
89202d3
78842e1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -232,7 +232,7 @@ func (e *ClaudeEngine) GetExecutionSteps(workflowData *WorkflowData, logFile str | |
| // the --mcp-config argument (kept outside shellJoinArgs for runtime ${RUNNER_TEMP} expansion), | ||
| // and the allowed-tools string (reused for the comment annotation). | ||
| func (e *ClaudeEngine) buildClaudeCliArgs(workflowData *WorkflowData, toolsWithMountedCLIs map[string]any, logFile string) (claudeArgs []string, mcpConfigArg string, allowedTools string) { | ||
| claudeArgs = append(claudeArgs, "--print", "--no-chrome") | ||
| claudeArgs = append(claudeArgs, "--print", "--no-chrome", "--strict-mcp-config") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ Good addition! The
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added a code comment explaining why ambient MCP config is always disabled; this follow-up is in commit |
||
|
|
||
| if workflowData.EngineConfig != nil && workflowData.EngineConfig.MaxTurns != "" { | ||
| claudeLog.Printf("Setting max turns: %s", workflowData.EngineConfig.MaxTurns) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -111,6 +111,10 @@ func TestClaudeEngine(t *testing.T) { | |
| t.Errorf("Expected --print flag in step: %s", stepContent) | ||
| } | ||
|
|
||
| if !strings.Contains(stepContent, "--strict-mcp-config") { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 The new test assertion for
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added an assertion that |
||
| t.Errorf("Expected --strict-mcp-config in CLI args even without MCP servers: %s", stepContent) | ||
| } | ||
|
|
||
| if !strings.Contains(stepContent, "--permission-mode acceptEdits") { | ||
| t.Errorf("Expected --permission-mode acceptEdits in CLI args: %s", stepContent) | ||
| } | ||
|
|
@@ -654,6 +658,10 @@ func TestClaudeEngineWithMCPServers(t *testing.T) { | |
| t.Errorf("Expected --mcp-config in CLI args when MCP servers are configured: %s", stepContent) | ||
| } | ||
|
|
||
| if !strings.Contains(stepContent, "--strict-mcp-config") { | ||
| t.Errorf("Expected --strict-mcp-config in CLI args when MCP servers are configured: %s", stepContent) | ||
| } | ||
|
|
||
| // When MCP servers are configured, GH_AW_MCP_CONFIG SHOULD be present | ||
| if !strings.Contains(stepContent, "GH_AW_MCP_CONFIG: ${{ runner.temp }}/gh-aw/mcp-config/mcp-servers.json") { | ||
| t.Errorf("Expected GH_AW_MCP_CONFIG environment variable when MCP servers are configured: %s", stepContent) | ||
|
|
@@ -688,6 +696,10 @@ func TestClaudeEngineWithSafeOutputs(t *testing.T) { | |
| t.Errorf("Expected --mcp-config in CLI args when safe-outputs are configured: %s", stepContent) | ||
| } | ||
|
|
||
| if !strings.Contains(stepContent, "--strict-mcp-config") { | ||
| t.Errorf("Expected --strict-mcp-config in CLI args when safe-outputs are configured: %s", stepContent) | ||
| } | ||
|
|
||
| // When safe-outputs is configured, GH_AW_MCP_CONFIG SHOULD be present | ||
| if !strings.Contains(stepContent, "GH_AW_MCP_CONFIG: ${{ runner.temp }}/gh-aw/mcp-config/mcp-servers.json") { | ||
| t.Errorf("Expected GH_AW_MCP_CONFIG environment variable when safe-outputs are configured: %s", stepContent) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
.changeset/major-strict-claude-mcp-config.mdwith a major changeset and migration guidance to declare MCP servers through workflowmcp-servers:frontmatter (commit89202d3).