wslgate
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@wslgaterun npm test in my Ubuntu WSL distro and show me the output"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
wslgate
The bridge AI agents on Windows need to reach WSL — MCP server + CLI in one package.
Agents like Claude Code run on Windows, but the code lives in WSL. The maintainers know it:
anthropics/claude-code#3396
("execute commands in WSL instead of Windows") has been one of the most-upvoted feature requests
on that repo. Until every agent ships native WSL support, wslgate gives any MCP-compatible
client the same capability — and gives you a CLI for the same operations by hand.
Tools (MCP)
Tool | Description |
| run a bash command in WSL, get stdout/stderr/exit code |
| read a file (accepts |
| write a file (base64-safe, no quoting bugs) |
| list a directory |
| convert paths |
| list installed distributions |
All file/exec tools take an optional distro (Ubuntu, Debian, …) — multi-distro,
default distro when omitted. Start with --read-only to disable wsl_exec/wsl_write_file.
Related MCP server: Freya MCP Server
Install / run
npx wslgate-mcp # MCP stdio server
npx wslgate-mcp --read-only # read-only modeClaude Desktop / Claude Code config:
{
"mcpServers": {
"wsl": { "command": "npx", "args": ["-y", "wslgate-mcp"] }
}
}Or install globally for the CLI: npm install -g wslgate
wslgate distros
wslgate exec --distro Ubuntu -- "ls -la /mnt/c/Users/me"
wslgate read C:\Users\me\.bashrc
wslgate translate C:\Projects\app
wslgate ls /mnt/c/Windows
echo "hi" | wslgate write /tmp/hello.txt
wslgate mcp --read-onlyHonest technical notes
Every operation is a
wsl.exe --exec bash -lc ...invocation — one process, real exit codes, no\\wsl$UNC tricks.wsl --listoutput is UTF-16LE on Windows;wslgatedetects and decodes it (BOM or heuristic).Files are written via
base64 -dso content with quotes,$or newlines survives the trip.Paths are validated/quoted with strict single-quote shell escaping before hitting bash.
On machines without WSL you get a clear "is WSL installed?" error instead of a stack trace.
Development
npm install
npm test # vitest: path translation, wsl decoding, MCP protocol (in-memory transport)
npm run buildLicense
This server cannot be deployed
Maintenance
Related MCP Connectors
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Remote MCP server exposing your Node Command fleet (files, shell, processes, browser) to AI hosts.
- FensoryOAuthcom.fensory
Trading MCP server for AI agents, with live market data, account reads and controlled execution.
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceA MCP server for Windows/Linux that provides 90+ tools enabling AI assistants to systematically manage local systems, including system probing, command execution, file editing, network diagnostics, and more.13MIT
- FlicenseNot gradedqualityFmaintenanceA powerful filesystem MCP server for AI agents with extensive system access, including filesystem operations, shell execution, Windows tools, reverse engineering, code intelligence, and agent orchestration.1-
- FlicenseAqualityCmaintenanceA Model Context Protocol server that lets Windows-side AI agents operate on WSL distributions like a local environment, providing file read/write/edit, command execution, process management, log streaming, and content search via UNC paths and persistent shells.28103-
- AlicenseBqualityBmaintenanceThis MCP server enables AI agents to run a restricted set of Unix commands, manage files within a sandboxed working directory, apply patches, and fetch web content, providing controlled local automation without full shell access.188122MIT