When using edit_file on Windows, passing a standard absolute Windows path is rejected as being outside the allowed directory, even though the file is located inside the configured project directory.
Changing the same path to a Unix/MSYS-style path allows the operation to proceed.
Example
The following call uses a native Windows path:
edit_file [
dryRun=false,
path=C:\Users\<USERNAME>\IdeaProjects\WashlyServer\src\test\kotlin\com\washly\server\integration\support\ApiIntegrationTest.kt,
replaceAll=false
]
It fails with:
Access denied - path is outside allowed directories:
/C:\Users\<USERNAME>\IdeaProjects\WashlyServer\src\test\kotlin\com\washly\server\integration\support\ApiIntegrationTest.kt
not in /C/Users/<USERNAME>/IdeaProjects
The error appears to prepend / to the Windows path without converting its backslashes or drive-letter syntax. This produces:
However, the allowed directory is represented as:
/C/Users/<USERNAME>/IdeaProjects
Calling the tool again with the manually converted path succeeds:
MCP_DOCKER_edit_file [
dryRun=false,
path=/C/Users/<USERNAME>/IdeaProjects/WashlyServer/src/test/kotlin/com/washly/server/integration/support/ApiIntegrationTest.kt,
replaceAll=false
]
The tool then returns the expected diff output.
Expected behavior
The tool should normalize native Windows paths before checking whether they are inside an allowed directory.
For example:
C:\Users\<USERNAME>\IdeaProjects\WashlyServer\...
should be recognized as equivalent to:
/C/Users/<USERNAME>/IdeaProjects/WashlyServer/...
Actual behavior
The native Windows path is converted to an invalid mixed-format path:
This causes the allowed-directory validation to fail even though the target file is within the configured project directory.
Environment
- Host operating system: Windows
- Tool:
edit_file
- Allowed directory:
/C/Users/<USERNAME>/IdeaProjects
- rust-mcp-filesystem.enable_roots is on, SIDE NOTE: this needs docs on what it does I still don't know what it does
When using
edit_fileon Windows, passing a standard absolute Windows path is rejected as being outside the allowed directory, even though the file is located inside the configured project directory.Changing the same path to a Unix/MSYS-style path allows the operation to proceed.
Example
The following call uses a native Windows path:
It fails with:
The error appears to prepend
/to the Windows path without converting its backslashes or drive-letter syntax. This produces:However, the allowed directory is represented as:
Calling the tool again with the manually converted path succeeds:
The tool then returns the expected diff output.
Expected behavior
The tool should normalize native Windows paths before checking whether they are inside an allowed directory.
For example:
should be recognized as equivalent to:
Actual behavior
The native Windows path is converted to an invalid mixed-format path:
This causes the allowed-directory validation to fail even though the target file is within the configured project directory.
Environment
edit_file/C/Users/<USERNAME>/IdeaProjects