A VS Code extension that provides language model tools for converting file paths between Linux/WSL and Windows formats. When Copilot, an MCP server, or another LLM-powered tool needs to translate a path, it can call these tools automatically.
This is especially useful when working with MCP servers in a WSL workspace. Workspace-scoped MCP servers run inside the WSL distro and naturally produce Linux paths, but global MCP servers run on the Windows host and produce Windows paths. When the LLM mixes results from both, path conversion is needed.
This is implemented as a VS Code extension rather than an MCP server so that it can detect when it's running inside a WSL remote workspace and automatically read the distro name from the environment — no user configuration required.
How to use
- Install from the VS Code Marketplace.
- Install the extension in your WSL distro: open a WSL workspace, go to the Extensions view, and click the "Install in WSL" button under Local - Installed. This needs to be done once per distro.
To auto-install in every WSL distro, add this to your VS Code settings:
"remote.WSL.defaultExtensions": ["drwilco.wsl-path-lm-tools"]
Once installed, the tools are available to Copilot, MCP servers, and other LLM-powered tools automatically — no further configuration needed.
How it works
The extension registers two tools via the vscode.lm API:
| Tool |
Example input |
Example output |
linux_path_to_windows |
/mnt/c/Users/file.txt |
C:\Users\file.txt |
|
/home/user/file |
\\wsl.localhost\Ubuntu\home\user\file |
windows_path_to_linux |
C:\Users\file.txt |
/mnt/c/Users/file.txt |
|
\\wsl.localhost\Ubuntu\home\user\file |
/home/user/file |
Tools are only registered when running inside a WSL workspace (detected via WSL_DISTRO_NAME environment variable). The distro name is read from the environment — no configuration needed.
Linux → Windows:
/mnt/<drive>/... → <DRIVE>:\...
- Any other absolute path →
\\wsl.localhost\<distro>\...
Windows → Linux:
<DRIVE>:\... → /mnt/<drive>/...
\\?\<DRIVE>:\... → /mnt/<drive>/... (verbatim drive)
\\wsl.localhost\<distro>\... → /...
\\wsl$\<distro>\... → /...
\\?\UNC\wsl.localhost\<distro>\... → /...
Limitations
- Network UNC paths (
\\server\share\...) are not supported. There is no deterministic mapping between a Windows network path and a Linux mount point — WSL requires manual mounting via mount -t drvfs.
Requirements
- VS Code ≥ 1.100.0
- A WSL remote workspace (the extension does nothing on local Windows workspaces)
Development
npm install
npm run compile # Build
npm run lint # Type-check without emitting
npm test # Compile + run tests
npm run watch # Rebuild on change
Project structure
src/
pathConverter.ts # Pure path conversion logic (no VS Code dependency)
pathConverter.test.ts # Tests using node:test
extension.ts # Extension entry point — registers LM tools
The conversion logic is pure TypeScript with zero runtime dependencies. No shelling out to wslpath.