Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken path escapes in windows #414

Open
whaaaley opened this issue Dec 25, 2024 · 5 comments
Open

Broken path escapes in windows #414

whaaaley opened this issue Dec 25, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@whaaaley
Copy link

whaaaley commented Dec 25, 2024

Describe the bug
Here's some example output navigating to my wsl nixos.

{
  `path`: `\\\\wsl.localhost\
ixos\\home\
ixos\\projects\	rpg`
}

Removing escapes from the path in the json causes issues:
image

To Reproduce
Steps to reproduce the behavior:

  1. Access a directory starting with n or t

Expected behavior
Go to path, no escaping breaking the path

Logs
n/a

Additional context
More escapes do nothing I was doing it wrong, that does fix it, but the visual bug remains

Edit: It's kinda fixed kinda not. The write sends stuff of into the ether but it thinks it's correct.

@whaaaley whaaaley added the bug Something isn't working label Dec 25, 2024
@adithyakpb
Copy link

don't know if i am doing this right, but not able to add a directory path containing spaces. Logs show the following error.
image
image

is there any workaround? i did try escape sequences, single nested quotes, forward slashes.

On a single glance going through the code, the argument handling from the JSON is rudimentary. JSON does not allow single backslashes.

Let me know if I am wrong anywhere or if there is a better way to do this.

@michaelfromyeg
Copy link
Contributor

@whaaaley what was the final config file you ended up with? Hitting similar path issues when trying to run an MCP server on Windows and have it access files under WSL.

@whaaaley
Copy link
Author

whaaaley commented Dec 29, 2024

@michaelfromyeg I just cloned my project into another distro with a different pathname that didn't conflict. It seemed safer that way.

@michaelfromyeg
Copy link
Contributor

@whaaaley thanks for the reply! In case other people come along, I actually have this working with "\" escapes:

{
    "mcpServers": {
        "filesystem": {
            "command": "npx",
            "args": [
                "-y",
                "@modelcontextprotocol/server-filesystem",
                "\\\\wsl.localhost\\Ubuntu\\home\\mdema\\code\\michaeldemar.co",
                "\\\\wsl.localhost\\Ubuntu\\home\\mdema\\code\\michaeldemar.co-v5"
            ]
        }
    }
}

I have the MCP server running on Windows (since I don't think Claude can connect to an MCP server running with my Ubuntu instance) and this can read the files on WSL.

Maybe fixed?

@michaelfromyeg
Copy link
Contributor

image

Claude renders '\n' as a new line, e.g., it's trying to read the Next.js config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants