
MCP 文件服务器,使 Claude Cowork 能够在 WSL 中读写 ~/dev
概览
这是一个小型本地MCP服务器,允许Windows上的Claude Desktop的Cowork在WSL中读写你的文件。 它运行在 WSL 里,通过 stdio,Claude Desktop 启动时是wsl.exe。 Windows 上的 Cowork 无法关联存放在 WSL 发行版中的文件夹。所有方法都失败: - \wsl.localhost\ ...子文件夹一开始就被拒绝:“这里不支持网络(UNC)路径。”- \wsl.localhost文件夹本身、映射的驱动器(网络使用)、Subst驱动器或Windows主文件夹中的符号链接:选择器接受它们,但消息失败,提示“某些文件夹无法添加。” 这让 WSL 开发者无法为他们的代码提供 Cowork。Microsoft 自己的建议是让项目保持在 Linux 文件系统上以保证速度(WSL 文档)。 功能请求是anthropics/claude-code#99303。它重新提交了#61003,但被机器人关闭为陈旧且无维护者回复。Claude Desktop 的代码标签确实处理WSL文件夹;Cowork不处理。
概述(AI 翻译)
这是一个小型本地MCP服务器,允许Windows上的Claude Desktop的Cowork在WSL中读写你的文件。
它运行在 WSL 内部通过 stdio,Claude Desktop 以 wsl.exe 启动。
为什么会有这样的存在
Windows 上的 Cowork 无法关联存放在 WSL 发行版中的文件夹。所有方法都失败:
- 一个
\\wsl.localhost\ \...子文件夹在前期被拒绝:“此处不支持网络(UNC)路径。” \\wsl.localhost文件夹本身、映射驱动器(net use)、subst驱动器或 Windows 主文件夹中的符号链接:选择器接受后,提示失败,提示“某些文件夹无法添加”。
这让 WSL 开发者无法为他们的代码提供 Cowork。Microsoft 自己的建议是让项目保持在 Linux 文件系统上以保证速度(WSL 文档)。
功能请求是anthropics/claude-code#99303。它重新提交了#61003,但被机器人关闭为陈旧且无维护者回复。Claude Desktop 的代码标签确实处理WSL文件夹;Cowork不处理。
定时任务也遇到同样的难题:“新定时任务”表单会拒绝WSL文件夹,称其为“受保护位置”。代码标签页的WSL会话本可以绕过这个问题,但截至2026-10-17(桌面2.42304.0)。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
wsl-files
A small local MCP server that lets Claude Desktop’s Cowork, on Windows, read and write your files inside WSL.
It runs inside WSL over stdio, and Claude Desktop starts it with wsl.exe.
Why this exists
Cowork on Windows can’t attach a folder that lives in a WSL distro. Every way in fails:
- A
\\wsl.localhost\\...subfolder is rejected up front: “Network (UNC) paths are not supported here.” - The
\\wsl.localhostfolder itself, a mapped drive (net use), asubstdrive, or a symlink in your Windows home folder: the picker accepts them, then the message fails with “Some folders couldn’t be added.”
That leaves WSL developers without Cowork for any of their code. Microsoft’s own advice is to keep projects on the Linux filesystem for speed (WSL docs).
The feature request is anthropics/claude-code#99303. It re-files #61003, which a bot closed as stale with no maintainer response. Claude Desktop’s Code tab does handle WSL folders; Cowork doesn’t.
Scheduled tasks hit the same wall: the “New scheduled task” form rejects a WSL folder as “a protected location”. The Code tab’s WSL sessions would be the way around that, but as of 2026-10-17 (Desktop 2.42304.0.0) they fail to start with “Couldn’t upload to the remote (server binary) … [ENOENT]” (#101998).
Cowork can still use local MCP servers through Claude Desktop, and an MCP server can run inside WSL. This one does the file work there and hands Cowork the results.
Why not the official filesystem server
@modelcontextprotocol/server-filesystem works, but two things made it a poor fit here:
- No server-side deny list. Anything under an allowed folder is readable,
.envfiles included; itsexcludePatternsis a per-call option for searches, chosen by the client. This server refuses secrets files outright and redacts key-shaped strings. - The client can replace its folders. Per its README, roots sent by the client “completely replace any server-side Allowed directories”. Here the folders are fixed on the server side, whatever the client sends.
This one also accepts the Windows spellings Cowork tends to send (\\wsl.localhost\..., W:\..., C:\Users\\dev\...).
If Anthropic ships WSL folders in Cowork, you won’t need this.
What it can do
| Tool | What it does |
|---|---|
list_roots |
Shows the folders it may use |
read_file |
Reads a text file with line numbers, in pages (offset, limit) |
write_file |
Creates or replaces a file, creating parent folders |
edit_file |
Replaces exact text: one match, or every match with replace_all |
list_dir |
Lists a folder, up to 5 levels deep |
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →