mcp-workspace
by MarcusJellinghaus·★ 47·综合分 45
安全的 MCP 服务器,为 AI 助手在沙盒项目目录中提供文件系统、Git 和 GitHub 工具。
概述
MCP Workspace Server 是一个基于 Python 的 MCP 服务器,在指定的项目目录中提供安全的文件系统操作。它使 AI 助手能够读取、写入、编辑和删除文件,以及处理 Git 仓库和 GitHub 资源。服务器通过将所有操作限制在配置的项目目录中来实施严格的安全措施,防止未授权的文件访问。它包括结构化日志记录、参考项目(用于对其他代码库进行只读访问)以及使用精确字符串匹配的精确文件编辑功能。
试试问 AI
装完之后,这里有 6 个你可以让 AI 做的事:
什么时候选它
当您需要为 AI 助手在本地开发项目中提供安全的沙盒文件系统访问,并支持多个参考项目时选择此工具。
什么时候不要选它
如果您需要基于云的文件访问、超出项目目录的更广泛系统权限,或与 GitHub 以外的服务集成,则避免使用此工具。
此 server 暴露的工具
从 README 抽取出 10 个工具list_directoryLists files and directories in the project directory
read_fileReads the contents of a file
save_fileCreates or overwrites files atomically
append_fileAdds content to existing files
delete_this_fileRemoves files from the filesystem
edit_fileMakes selective edits using exact string matching
move_fileMoves or renames files and directories
get_reference_projectsLists available reference projects
list_reference_directoryLists files in a reference project
read_reference_fileReads files from reference projects
可对比工具
安装
安装
# 克隆仓库
git clone https://github.com/MarcusJellinghaus/mcp-workspace.git
cd mcp_workspace
# 创建并激活虚拟环境(可选但推荐)
python -m venv venv
source venv/bin/activate # 在 Windows 上: venv\Scripts\activate
# 使用 pip 和 pyproject.toml 安装依赖
pip install -e .运行服务器
mcp-workspace --project-dir /path/to/project [--reference-project NAME=/path/to/reference]... [--log-level LEVEL] [--log-file PATH]Claude Desktop 集成
将以下内容添加到 Claude Desktop 配置文件中:
{
"mcpServers": {
"filesystem": {
"command": "mcp-workspace",
"args": [
"--project-dir",
"C:\\path\\to\\your\\specific\\project",
"--reference-project",
"docs=C:\\path\\to\\documentation"
]
}
}
}FAQ
- 服务器如何确保文件安全性?
- 服务器将所有文件操作限制在指定的项目目录中。尝试访问此目录之外的文件将导致错误。参考项目仅提供只读访问。
- 我可以使用多个参考项目吗?
- 是的,您可以多次使用 --reference-project 参数指定多个参考项目。每个参考项目都是只读的,并且可以有唯一的名称。
- 支持哪些文件操作?
- 服务器支持 list_directory、read_file、save_file、append_file、delete_this_file、edit_file 和 move_file 操作,以及用于处理参考项目的特殊方法。
mcp-workspace 对比
最后更新于 · 由 README + GitHub 公开数据自动生成。