Skip to content

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

Open

Description

@jvanvolken

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

Activity

  1. owendevereaux commented on Mar 19, 2026

    @owendevereaux

    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.)

  2. jvanvolken commented on Mar 26, 2026

    @jvanvolken
    Author

    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.

  3. majiayu000 commented on Apr 3, 2026

    @majiayu000

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions