基于MCP协议的桌面文件管理助手,提供文件整理、分类、统计等功能。
- 文件扫描:扫描文件夹并提供详细的文件统计信息
- 文件整理:按类型、日期、大小、名称等多种策略自动整理文件
- 操作历史:记录所有文件操作,支持撤销整理操作
- 资源访问:提供文件系统、历史记录、日志、配置等资源的访问能力
- 多种传输层:支持stdio和HTTP两种传输方式
# 克隆仓库
git clone https://github.com/yourusername/desktopManagementAssistant.git
cd desktopManagementAssistant
# 安装依赖
npm install
# 编译TypeScript
npm run build# 使用stdio传输层启动(默认)
node dist/index.js
# 使用HTTP传输层启动
node dist/index.js --http- 确保已安装Claude桌面客户端
- 在Claude桌面客户端中添加以下配置:
{
"mcpServers": {
"file-organizer-stdio": {
"command": "node",
"args": ["dist/index.js"],
"cwd": "<项目绝对路径>",
"env": {
"NODE_ENV": "production"
},
"description": "文件整理助手 MCP 服务器 (stdio模式)"
},
"file-organizer-http": {
"command": "node",
"args": ["dist/index.js", "--http"],
"url": "http://localhost:3000/mcp",
"description": "文件整理助手 MCP 服务器 (HTTP模式)"
}
}
}- 在Claude桌面客户端中选择"文件整理助手"服务器
# 测试初始化
node test-initialize.js
# 使用HTTP传输层测试初始化
node test-initialize.js --http
# 完整功能测试
node test-mcp.js
# 使用HTTP传输层进行完整功能测试
node test-mcp.js --httpdesktopManagementAssistant/
├── data/ # 数据存储目录
│ ├── database.sqlite # SQLite数据库
│ ├── history/ # 历史记录
│ └── logs/ # 日志文件
├── dist/ # 编译后的JavaScript文件
├── src/ # 源代码
│ ├── core/ # 核心组件
│ │ ├── event-bus.ts # 事件总线
│ │ ├── plugin-manager.ts # 插件管理器
│ │ ├── security-manager.ts # 安全管理器
│ │ ├── server.ts # MCP服务器
│ │ ├── storage-manager.ts # 存储管理器
│ │ └── tool-registry.ts # 工具注册表
│ ├── plugins/ # 插件
│ │ └── file-organizer/ # 文件整理插件
│ │ ├── config/ # 配置
│ │ ├── tools/ # 工具实现
│ │ └── utils/ # 工具函数
│ ├── shared/ # 共享代码
│ │ ├── interfaces/ # 接口定义
│ │ └── utils/ # 工具函数
│ └── index.ts # 入口文件
├── claude_desktop_config.json # Claude桌面客户端配置
├── package.json # 项目配置
├── tsconfig.json # TypeScript配置
└── README.md # 项目文档
scan-folder: 扫描文件夹并返回文件统计信息organize-files: 根据指定的策略整理文件夹中的文件undo-organize: 撤销之前的文件整理操作,将文件恢复到原始位置get-history: 获取文件操作历史记录
history://{type}/{id}: 查看文件操作历史记录file://{filePath*}: 访问本地文件系统logs://{logType}: 查看系统日志config://{configType}: 查看系统配置
organize-files: 帮助用户整理文件夹中的文件analyze-folder: 分析文件夹内容并提供统计信息undo-organize: 撤销之前的文件整理操作
- TypeScript
- Node.js
- Model Context Protocol (MCP)
- SQLite
- Express (HTTP传输层)
MIT # desktopTool