@@ -210,8 +210,44 @@ This is a test workflow for GitHub remote mode configuration.
210210 if strings .Contains (lockContent , `command = "docker"` ) {
211211 t .Errorf ("Expected no Docker command but found it in:\n %s" , lockContent )
212212 }
213+ } else if tt .engineType == "claude" {
214+ // Claude passes MCP config as CLI argument, not in a setup step
215+ // Check for --mcp-config flag with JSON string
216+ if ! strings .Contains (lockContent , `--mcp-config` ) {
217+ t .Errorf ("Expected --mcp-config CLI flag but didn't find it in:\n %s" , lockContent )
218+ }
219+ // Check for mcpServers in the JSON config string
220+ if ! strings .Contains (lockContent , `mcpServers` ) {
221+ t .Errorf ("Expected mcpServers in JSON config but didn't find it in:\n %s" , lockContent )
222+ }
223+ // Check for the expected URL in the JSON
224+ if tt .expectedURL != "" && ! strings .Contains (lockContent , strings .ReplaceAll (tt .expectedURL , "/" , "\\ /" )) {
225+ // Also try without escaped slashes (depends on JSON generation)
226+ if ! strings .Contains (lockContent , tt .expectedURL ) {
227+ t .Errorf ("Expected URL %s in JSON config but didn't find it in:\n %s" , tt .expectedURL , lockContent )
228+ }
229+ }
230+ // Check for Authorization header with token in the JSON
231+ if tt .expectedToken != "" {
232+ expectedAuthHeader := `"Authorization":"Bearer ` + tt .expectedToken + `"`
233+ // Also check without spaces (minified JSON)
234+ expectedAuthHeaderMinified := strings .ReplaceAll (expectedAuthHeader , " " , "" )
235+ if ! strings .Contains (lockContent , expectedAuthHeader ) && ! strings .Contains (lockContent , expectedAuthHeaderMinified ) {
236+ t .Errorf ("Expected Authorization header with token %s in JSON config but didn't find it in:\n %s" , tt .expectedToken , lockContent )
237+ }
238+ }
239+ // Check for X-MCP-Readonly header if this is a read-only test
240+ if strings .Contains (tt .name , "read-only" ) {
241+ if ! strings .Contains (lockContent , `X-MCP-Readonly` ) {
242+ t .Errorf ("Expected X-MCP-Readonly header in JSON config but didn't find it in:\n %s" , lockContent )
243+ }
244+ }
245+ // Should NOT contain Docker configuration
246+ if strings .Contains (lockContent , `"command":"docker"` ) && strings .Contains (lockContent , `"command": "docker"` ) {
247+ t .Errorf ("Expected no Docker command but found it in:\n %s" , lockContent )
248+ }
213249 } else {
214- // Check for JSON format
250+ // Check for JSON format (Copilot and other engines)
215251 if ! strings .Contains (lockContent , `"type": "http"` ) {
216252 t .Errorf ("Expected HTTP configuration but didn't find 'type: http' in:\n %s" , lockContent )
217253 }
@@ -257,8 +293,13 @@ This is a test workflow for GitHub remote mode configuration.
257293 if ! strings .Contains (lockContent , `command = "docker"` ) {
258294 t .Errorf ("Expected Docker command but didn't find it in:\n %s" , lockContent )
259295 }
296+ case "claude" :
297+ // Claude passes MCP config as CLI argument, check for Docker in JSON
298+ if ! strings .Contains (lockContent , `"command":"docker"` ) && ! strings .Contains (lockContent , `"command": "docker"` ) {
299+ t .Errorf ("Expected Docker command in JSON config but didn't find it in:\n %s" , lockContent )
300+ }
260301 default :
261- // For Claude , check for Docker command
302+ // For other engines , check for Docker command in JSON
262303 if ! strings .Contains (lockContent , `"command": "docker"` ) {
263304 t .Errorf ("Expected Docker command but didn't find it in:\n %s" , lockContent )
264305 }
0 commit comments