Directory Browser MCP Server
一个用于浏览目录和文件的MCP (Model Context Protocol) 服务器。
功能特性
- 📁 目录浏览 - 列出指定目录的内容
- 📄 文件信息 - 获取文件/目录的详细信息
- 🔍 权限检查 - 检查路径的访问权限
- 🛡️ 安全控制 - 基于白名单的目录访问控制
安装
cd directory_browser_mcp
pip install -e .
配置
编辑 config.json 文件来配置允许访问的目录:
{
"allowed_directories": [
"/Users/用户名/Documents",
"/Users/用户名/Desktop",
"/项目根目录"
],
"show_hidden_files": false,
"max_entries": 1000
}
使用方法
作为MCP服务器运行
python -m directory_browser_mcp
可用工具
-
list_directory - 列出目录内容
path: 目录路径show_hidden: 是否显示隐藏文件 (可选)
-
get_file_info - 获取文件详细信息
path: 文件或目录路径
-
check_path_access - 检查路径访问权限
path: 要检查的路径
安全特性
- ✅ 白名单目录访问控制
- ✅ 路径穿越攻击防护
- ✅ 文件系统权限检查
- ✅ 安全错误处理
示例
# 列出目录
{
"tool": "list_directory",
"arguments": {
"path": "/Users/username/Documents",
"show_hidden": false
}
}
# 获取文件信息
{
"tool": "get_file_info",
"arguments": {
"path": "/Users/username/Documents/file.txt"
}
}
# 检查访问权限
{
"tool": "check_path_access",
"arguments": {
"path": "/Users/username/Documents"
}
}
Metadata
Release files for directory-browser-mcp 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| directory_browser_mcp-0.1.5.tar.gz | 11.9 kB | Without provenance | Details for directory_browser_mcp-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| directory_browser_mcp-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for directory_browser_mcp-0.1.5-py3-none-any.whl |
Total release size: 24.4 kB
Release files / directory_browser_mcp-0.1.5.tar.gz
| Download URL | directory_browser_mcp-0.1.5.tar.gz |
|---|---|
| Size | 11.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
921bc7e6201b4b98418a16c315216ea7e3ab35f5b6e6e0a75e1eeb945f20200d
|
|
BLAKE2b-256 checksum How to use checksums |
e933936618203533a701f97c884366033f2aa571200c7a575657d6c1c9fa1220
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / directory_browser_mcp-0.1.5-py3-none-any.whl
| Download URL | directory_browser_mcp-0.1.5-py3-none-any.whl |
|---|---|
| Size | 12.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
109a48f250837711a648c94b6721ce5dccaae69bde44bc868d34da426e559580
|
|
BLAKE2b-256 checksum How to use checksums |
2c3d38108847add267ab5fa41a48002575388640cd155ca23a8d0cdf823fb1e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Security for directory-browser-mcp 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.