Fix filesystem and playwright MCP server configurations in stress test#844
Fix filesystem and playwright MCP server configurations in stress test#844
Conversation
- Fix filesystem server: Move directory paths from env vars to entrypointArgs - Fix playwright server: Remove duplicate --init flag from allowed-hosts list - Add comprehensive tests for both server configurations - All config tests passing (16.5s runtime) Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
|
@copilot please review this PR |
PR Review SummaryThis PR successfully fixes both MCP server configuration issues identified by the nightly stress test. Changes Made1. Filesystem Server Fix (commit 611acf8)
2. Playwright Server Fix (commit 611acf8)
Testing✅ Added Configuration StructureThe changes follow the correct pattern where:
Both fixes are minimal, focused, and address the root causes identified in the stress test report. |
There was a problem hiding this comment.
Pull request overview
Updates the nightly MCP stress-test workflow configuration to align with how the gateway builds docker run commands, and adds regression tests to ensure Docker runtime flags vs container entrypoint args are placed correctly when loading config from stdin.
Changes:
- Switched filesystem MCP server config from
env.ALLOWED_PATHSto passing allowed directories viaentrypointArgs. - Simplified Playwright
--allowed-hosts/--allowed-originsvalues by removing redundant non-wildcard entries. - Added stdin config loading tests to validate container/arg ordering for filesystem and Playwright servers.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
internal/config/config_test.go |
Adds regression tests validating docker run arg ordering (runtime args before image; entrypoint args after). |
.github/workflows/nightly-mcp-stress-test.md |
Updates stress-test MCP server configs for filesystem and Playwright to match expected argument semantics. |
Comments suppressed due to low confidence (1)
internal/config/config_test.go:1396
- This test only asserts that "--init" is not present after the container name, but the reported regression also involved "--network host" being passed to the Playwright binary. Add an assertion that "--network" (and its "host" value) do not appear after the container name as well, so the test fully covers the misplacement/duplication scenario it’s meant to prevent.
// Verify Docker flags do NOT appear as duplicate entrypoint args after container
for i := containerIdx + 1; i < len(server.Args); i++ {
assert.NotEqual(t, "--init", server.Args[i], "Docker flag --init should not appear after container name")
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Check that /workspace is passed as an entrypoint arg (after the container name) | ||
| containerIdx := -1 | ||
| for i, arg := range server.Args { | ||
| if arg == "mcp/filesystem" { | ||
| containerIdx = i | ||
| break | ||
| } | ||
| } | ||
| require.NotEqual(t, -1, containerIdx, "Container name not found in args") | ||
|
|
||
| // Verify that /workspace appears after the container name as an entrypoint arg | ||
| hasWorkspaceArg := false | ||
| for i := containerIdx + 1; i < len(server.Args); i++ { | ||
| if server.Args[i] == "/workspace" { | ||
| hasWorkspaceArg = true | ||
| break | ||
| } | ||
| } | ||
| assert.True(t, hasWorkspaceArg, "Expected /workspace as entrypoint arg after container name") |
There was a problem hiding this comment.
The filesystem test verifies that "/workspace" appears after the container name, but it would still pass if "/workspace" were accidentally included both before and after the image (e.g., if it were incorrectly added as a Docker runtime arg too). Consider adding a check that "/workspace" does not appear anywhere before the container name to make the placement guarantee stricter.
This issue also appears on line 1393 of the same file.
Nightly stress test detected configuration errors in two MCP servers: filesystem expected directories as CLI arguments but received environment variables, and playwright had redundant host list entries.
Changes
filesystem server
env.ALLOWED_PATHStoentrypointArgs: ["/workspace"]playwright server
localhost;localhost:*;127.0.0.1;127.0.0.1:*tolocalhost:*;127.0.0.1:*Configuration structure
Gateway converts workflow YAML to Docker commands following this pattern:
args: Docker runtime flags (e.g.,--init,--network host) - before containerentrypointArgs: Application arguments - after containerTesting
Added
TestLoadFromStdin_FilesystemServerConfigandTestLoadFromStdin_PlaywrightServerConfigto validate argument placement and prevent similar configuration errors.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
example.com/tmp/go-build1254119737/b275/launcher.test /tmp/go-build1254119737/b275/launcher.test -test.testlogfile=/tmp/go-build1254119737/b275/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true /opt/hostedtoolcache/go/1.25.6/x64/src/runtime/cgo 6765506/b184/ ache/Python/3.12.12/x64/bin/as --gdwarf-5 --64 -o as 6765�� d -n 10 -I docker-buildx --gdwarf-5 --64 -o docker-buildx(dns block)invalid-host-that-does-not-exist-12345.com/tmp/go-build3908585129/b001/config.test /tmp/go-build3908585129/b001/config.test -test.testlogfile=/tmp/go-build3908585129/b001/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true go1.25.6 -c=4 -nolocalimports -importcfg /tmp/go-build2196765506/b210/importcfg -pack /opt/hostedtoolcache/go/1.25.6/x64/src/net/http/httptest/httptest.go conf�� go k/gh-aw-mcpg/gh-aw-mcpg/tools.go--gdwarf2 ache/Python/3.12.12/x64/bin/bash--64 k/gh-aw-mcpg/gh-/opt/hostedtoolcache/go/1.25.6/x64/pkg/tool/linux_amd64/compile k/gh-aw-mcpg/gh--o k/gh-aw-mcpg/gh-/tmp/go-build2196765506/b125/_pkg_.a .o(dns block)nonexistent.local/tmp/go-build1254119737/b275/launcher.test /tmp/go-build1254119737/b275/launcher.test -test.testlogfile=/tmp/go-build1254119737/b275/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true /opt/hostedtoolcache/go/1.25.6/x64/src/runtime/cgo 6765506/b184/ ache/Python/3.12.12/x64/bin/as --gdwarf-5 --64 -o as 6765�� d -n 10 -I docker-buildx --gdwarf-5 --64 -o docker-buildx(dns block)slow.example.com/tmp/go-build1254119737/b275/launcher.test /tmp/go-build1254119737/b275/launcher.test -test.testlogfile=/tmp/go-build1254119737/b275/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true /opt/hostedtoolcache/go/1.25.6/x64/src/runtime/cgo 6765506/b184/ ache/Python/3.12.12/x64/bin/as --gdwarf-5 --64 -o as 6765�� d -n 10 -I docker-buildx --gdwarf-5 --64 -o docker-buildx(dns block)this-host-does-not-exist-12345.com/tmp/go-build1254119737/b284/mcp.test /tmp/go-build1254119737/b284/mcp.test -test.testlogfile=/tmp/go-build1254119737/b284/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true /tmp/go-build2196765506/b218/_pkg_.a 6765506/b184/ p/bin/as -p github.com/githu-unsafeptr=false -lang=go1.25 as 6765�� d -n 10 --debug-prefix-map ache/go/1.25.6/x64/pkg/tool/linux_amd64/vet -I /opt/hostedtoolcmod -I ache/go/1.25.6/x64/pkg/tool/linuf() { test "$1" = get && echo "******"; }; f sto-w(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This section details on the original issue you should resolve
<issue_title>[mcp-stress-test] Server Configuration Failures Detected - filesystem & playwright</issue_title>
<issue_description>The nightly stress test detected 2 servers with configuration errors (not authentication issues).
Test Summary
Failed Servers
1. filesystem - Command Arguments Error
Container: mcp/filesystem
Issue Type: Configuration Error
Error:
Analysis:
The filesystem server expects allowed directories as positional command-line arguments, but the configuration is passing them as environment variables (
ALLOWED_PATHS). The docker command structure needs to be updated.Current Configuration Issue:
The server is launched with environment variable but expects positional args.
Suggested Fix:
Update configuration to pass directories as positional arguments:
{ "filesystem": { "type": "stdio", "container": "mcp/filesystem", "args": ["/workspace", "/additional/path"] } }Or update the docker args to include the directory paths:
{ "filesystem": { "type": "stdio", "command": "docker", "args": ["run", "--rm", "-i", "-v", "/tmp/mcp-test-fs:/workspace:rw", "mcp/filesystem", "/workspace"] } } `````` **Suggested Investigation:** - [ ] Review filesystem server documentation for correct argument format - [ ] Update gateway configuration to pass directories correctly - [ ] Test with simple single directory first - [ ] Consider if server should be updated to support env vars --- ### 2. playwright - Duplicate Flag Error **Container:** mcr.microsoft.com/playwright/mcp **Issue Type:** Configuration Error **Error:** `````` error: unknown option '--init' `````` **Analysis:** The docker command includes the `--init` flag twice - once as a docker option (correct) and once passed to the playwright binary (incorrect). The playwright binary doesn't recognize the `--init` flag and fails. **Current Configuration Issue:** `````` docker run --rm -i --init --network host mcr.microsoft.com/playwright/mcp --output-dir ... --init --network hostNotice
--initand--network hostappear twice.Suggested Fix:
Remove the duplicate flags from the playwright server arguments:
{ "playwright": { "type": "stdio", "command": "docker", "args": [ "run", "--rm", "-i", "--init", "--network", "host", "-v", "/tmp/gh-aw/mcp-logs:/tmp/gh-aw/mcp-logs:rw", "mcr.microsoft.com/playwright/mcp", "--output-dir", "/tmp/gh-aw/mcp-logs/playwright", "--allowed-hosts", "localhost,localhost:*,127.0.0.1,127.0.0.1:*", "--allowed-origins", "localhost;localhost:*;127.0.0.1;127.0.0.1:*" ] } }Suggested Investigation:
--initand--network hostfrom args arrayGateway Logs
From the gateway logs, both issues are clearly configuration-related, not authentication or protocol issues:
filesystem:
playwright:
Test Configuration Used
The test used the following configuration:
Impact
These configuration issues prevent 2 MCP servers from launching:
Both are fixable with configuration changes and don't require code modifications.
Next Steps
Priority: High - Fix filesystem configuration
/workspacemountPriority: High - Fix playwright configuration
--initand--network hostflagsRe-run stress test to verify fixes
Update documentation with correct configuration examples
Generated by Nightly MCP Stress Test
Test Session: stress-test-20260208-034257
Full Test Results: See workflow run artifacts at
/tmp/mcp-stress-results/✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.