servers icon indicating copy to clipboard operation
servers copied to clipboard

Docker Image 1.0.2 Breaks Linux Users with Letter at Start of Path

Open jvanvolken opened this issue 8 months ago • 4 comments

Describe the bug This 1.0.2 breaks linux users who's paths start with a letter. i.e. /h/path/to/data. We were very confused when our linux paths were converted to windows paths:

This error does not happen with mcp/filesystem:sha256-35fcf0217ca0d5bf7b0a5bd68fb3b89e08174676c0e0b4f431604512cf7b3f67; it only happens with mcp/filesystem:1.0.2.

To Reproduce Steps to reproduce the behavior:

  1. Docker pull mcp/filesystem:1.0.2
  2. Configure with a linux path that starts with a /h/ or other letter
  3. Start up mcp server

Expected behavior Should mount the correct path without changing it.

Logs This is the error when the gateway tries to configure the mcp server: Running mcp/filesystem:1.0.2 with [run --rm -i --init --security-opt no-new-privileges --cpus 1 --memory 2Gb --pull never -l docker-mcp=true -l docker-mcp-tool-type=mcp -l docker-mcp-name=filesystem -l docker-mcp-transport=stdio --network none -v /h/<username>/MCP_Development/data:/h/<username>/MCP_Development/data] and command [/h/<username>/MCP_Development/data]

mcp-gateway  | - filesystem: Error accessing directory H:\<username>\MCP_Development\data: Error: ENOENT: no such file or directory, stat 'H:\<username>\MCP_Development\data'
mcp-gateway  | - filesystem:     at async Object.stat (node:internal/fs/promises:1039:18)
mcp-gateway  | - filesystem:     at async file:///app/dist/index.js:44:23
mcp-gateway  | - filesystem:     at async Promise.all (index 0)
mcp-gateway  | - filesystem:     at async file:///app/dist/index.js:42:1 {
mcp-gateway  | - filesystem:   errno: -2,
mcp-gateway  | - filesystem:   code: 'ENOENT',
mcp-gateway  | - filesystem:   syscall: 'stat',
mcp-gateway  | - filesystem:   path: 'H:\\<username>\\MCP_Development\\data'
mcp-gateway  | - filesystem: }
mcp-gateway  |   > Can't start filesystem: failed to connect: calling "initialize": EOF

Additional context N/A

jvanvolken avatar Mar 18 '26 14:03 jvanvolken

I investigated this issue and found something interesting:

Looking at the current path-utils.ts on main, the code appears to handle Linux paths correctly:

const isUnixPath = p.startsWith('/') && (
  p.match(/^\/mnt\/[a-z]\//i) ||
  (process.platform !== 'win32') ||  // Should be TRUE in Linux Docker
  ...
);

On a Linux Docker container, process.platform === 'linux', so the condition (process.platform !== 'win32') should be true, which should preserve Unix paths like /h/username/... without converting them to Windows format.

Question: Is there a chance the mcp/filesystem:1.0.2 Docker image was built from an older version of the code that didn't have this platform detection logic? The fix may already exist on main but not be in the released Docker image.

If so, rebuilding the Docker image from the current main branch might resolve this issue.

(I noticed the package tags are typescript-servers-0.6.x while the Docker image uses 1.0.2 versioning, so there may be a versioning/release pipeline difference.)

owendevereaux avatar Mar 19 '26 05:03 owendevereaux

Sorry for the delayed response to your question(s).

I'm not sure what was included in the 1.0.2 image, we just know it doesn't work for our use-case. The image versioning is not automatically tied to the main branch versioning, wish it was!

I would normally love to rebuild the image myself, however in our particular air-gapped environment its easier to get images from Docker hub approved versus the alternative you're suggesting.

jvanvolken avatar Mar 26 '26 14:03 jvanvolken

Hi, I've been looking into this and traced the root cause.

Proposed approach: 1. Verify whether path-utils.ts on main already has the correct platform detection logic. 2. If the fix exists on main, this may be a Docker image build/release issue rather than a code fix — check if the Docker image build process pulls from the correct branch/tag. 3. If code changes are needed, fix path normalization in path-utils.ts to properly detect Linux platform in Docker containers and preserve Unix-style paths (especially paths starting with /h/, /u/, etc. that could be misinterpreted as Windows drive letters). 4. Add tests for Linux path handling in Docker context.

I'll open a draft PR shortly. Happy to adjust based on your preference.

majiayu000 avatar Apr 03 '26 16:04 majiayu000

Closing: superseded by the v2 release.

Thank you for reporting this, and apologies for the long wait for a response.

Since this was filed, the reference servers have been rebuilt for the 2026-07-28 MCP specification (#4857) and released as v2 (2.0.0 on npm for the TypeScript servers, 2026.10.19 on PyPI for the Python servers). Each server now runs on v2 of its SDK, and the behavior described here has either been fixed or no longer exists in the same form. Path normalization now converts /h/... style paths to drive letters only on Windows, so Linux paths that start with a single letter are left unchanged.

This is not a judgment on whether the problem was real; it's a consequence of the code it describes having been replaced. This is happening as part of the backlog triage in #4875.

If this still happens on the v2 release, we'd genuinely like to know. Please open a fresh issue with the version you're running and steps to reproduce, and we'll look at it. Note that this repository accepts contributions as issues rather than pull requests; see CONTRIBUTING.md.

Thanks for taking the time to report it.

cliffhall avatar Oct 19 '26 17:10 cliffhall