基于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服务器。
一旦启用了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"
系统使用了:
以下功能计划在未来版本中添加:
欢迎贡献!请随意提交Pull Request。
本项目采用MIT许可证——详情见LICENSE文件。