MCP Workspace Server
MCP Workspace Server
一个轻量级的 Python MCP 服务器,让 AI 代理能够安全、结构化地访问受控本地工作区内的文件。
概览
AI 代理通常需要访问存储在本地文件中的项目上下文。如果给代理无限制的文件系统访问权限,就会带来不必要的安全风险。
本项目使用 Model Context Protocol (MCP) 来暴露一组受控的工作区工具,同时将访问限制在配置的目录内。
Related MCP server: file-reader-mcp
MCP 工具
该服务器提供三种工具:
list_workspace_files
列出工作区内可用的文件。
read_text_file
以可配置的文件大小限制读取 UTF-8 文本文件。
search_text
搜索工作区文档,并返回匹配的文件名、行号和文本。
安全性
服务器会相对于定义的工作区根目录来解析请求的路径,并防止路径遍历绕过到该目录之外。
其他安全保护包括:
受限的工作区访问
输入验证
文件大小限制
UTF-8 处理
路径遍历防护
自动化安全测试
项目结构
mcp-workspace-server/
├── src/
│ └── mcp_workspace_server/
│ ├── __init__.py
│ └── server.py
├── tests/
│ └── test_paths.py
├── workspace/
│ └── example.txt
├── pyproject.toml
└── README.mdThis server cannot be deployed
Maintenance
Related MCP Connectors
Securely search and manage workspace context files for AI agents and teams.
Safe folder access for ChatGPT and Claude: read, write and search files, risky tools opt-in.
Manage files and folders directly from your workspace. Read and write files, list directories, cre…
Artifact store for AI agents — read, write, and search files by path; share by rendered URL.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables Large Language Models to safely browse and interact with local file systems through secure directory listing, file reading, and content search capabilities. Built with comprehensive security controls and high-performance handling of large directories and files.1MIT
- FlicenseNot gradedqualityDmaintenanceEnables LLM agents to securely explore, read, search, and analyze text-based files within a sandboxed environment.-
- FlicenseNot gradedqualityBmaintenanceEnables AI agents to safely read and write files in a sandboxed workspace via natural language, with on-demand connection, CVE-hardened path confinement, injection resistance, and full audit logging.-
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to safely read, write, and search files within a whitelisted sandbox directory, rejecting any attempts to escape the sandbox.MIT