本项目是一个基于Node.js实现模型上下文协议(MCP)的服务器,专为Windows Subsystem for Linux (WSL)环境量身打造。它是原始文件系统MCP服务器的分支,在性能和对Linux命令的支持上进行了显著优化。
git clone https://github.com/yourusername/mcp-server-wsl-filesystem.git
cd mcp-server-wsl-filesystem
npm install
npm run build
node --version
npm --version
在运行服务器之前,必须先构建 TypeScript 项目:
npm install
npm run build
然后运行服务器,指定使用的WSL发行版(可选)和要暴露的目录:
node dist/index.js [--distro=distribution_name] [additional_directories...]
node dist/index.js --distro=Ubuntu-20.04 /home/user/documents
node dist/index.js /home/user/documents
git clone https://github.com/yourusername/mcp-server-wsl-filesystem.git
cd mcp-server-wsl-filesystem
npm install
npm run build
node --version
npm --version
访问Ubuntu-20.04发行版:
node dist/index.js --distro=Ubuntu-20.04 /home/user/documents
使用默认发行版:
node dist/index.js /home/user/documents
在claude_desktop_config.json
中添加以下配置:
{
"mcpServers": {
"wsl-filesystem": {
"command": "npx",
"args": [
"-y",
"mcp-server-wsl-filesystem",
"--distro=Ubuntu-20.04",
"/home/user/documents"
]
}
}
}
{
"mcpServers": {
"wsl-filesystem": {
"command": "npx",
"args": [
"-y",
"mcp-server-wsl-filesystem",
"/home/user/documents"
]
}
}
}
在第二种方案中,系统将自动使用默认WSL发行版而无需额外配置。
此分支针对WSL环境进行了以下优化:
该项目是针对WSL优化的分支,主要功能包括:
项目遵循MIT许可证,具体许可内容请参考LICENSE
文件。
欢迎社区贡献!如果发现任何问题或有改进建议,请提交Issues或Pull Request到仓库:
⚠️ 重要提示
原项目支持通过网络路径访问WSL文件,例如:
node dist/index.js '\\.\pipe\windows-to-ubuntu'
并提供了以下示例配置:
{ "mcpServers": { "filesystem": { "command": "node", "args": ["dist/index.js", "\\\\.", "pipe", "windows-to-ubuntu"] } } }