这是一个基于 Python 的文件组织系统,借助模型上下文协议(MCP),能安全地在不同目录间管理和组织文件,有效提升文件管理效率。
本项目实现了一个运用 MCP 框架的文件组织系统,具备以下能力:
# 克隆仓库
git clone https://github.com/diganto-deb/local_file_organizer.git
cd local_file_organizer
# 安装依赖项
pip install -r requirements.txt
创建或修改项目目录中的 .cursor/mcp.json 文件:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/path/to/organize/dir1",
"/path/to/organize/dir2"
]
}
}
}
将路径替换为您要允许 MCP 服务器访问的目录。
在配置 .cursor/mcp.json 文件后:
MCP。filesystem 服务器,服务器应显示名称为 "filesystem"。一旦启用了 MCP 服务器,您就可以直接在 Cursor 的代理中使用文件组织命令:
# 列出所有可用类别
list_categories
# 分析目录而不进行更改
analyze_directory /path/to/directory
# 在目标目录创建分类文件夹
create_category_directories /path/to/target
# 按类型整理文件
organize_files /path/to/directory
# 搜索文件
search_files /path/to/directory "*.jpg"
该系统使用了以下技术:
未来版本将添加以下功能:
如需贡献,请访问项目仓库:https://github.com/diganto-deb/local_file_organizer
该软件受 MIT 许可证的保护。请参阅 LICENSE 以了解详细信息。