ZeroDrive MCP服务器
A. 模型上下文协议(MCP) 用于ZeroDrive文件管理的服务器。该服务器使像Claude这样的人工智能助手能够通过标准化的界面与ZeroDrive云存储进行交互。
特性
- 28个MCP工具 分为4类:
- 文件操作 (8个工具):列出、获取、上传、下载、移动、共享文件 - 文件夹操作 (7个工具):创建、列出、更新、删除、移动、共享文件夹 - 工作区操作 (10个工具):使用文件和文件夹管理协作工作区 - 垃圾处理操作 (3个工具):列出、还原和清空垃圾桶
- 生产准备就绪:
- 对所有输入进行Zod验证 - 使用pino进行结构化日志记录 - 全面的错误处理 - 具有严格模式的TypeScript
需求
- Node.js 22.0.0或更高版本
- ZeroDrive API密钥
安装
通过npm(推荐)
npx @futurixai-labs/zerodrive-mcp-server来源
# Clone the repository
git clone https://github.com/futurixai/zerodrive-mcp-server.git
cd zerodrive-mcp-server
# Install dependencies
npm install
# Build
npm run build配置
设置所需的环境变量:
export ZERODRIVE_API_KEY="your-api-key-here"可选环境变量:
| 变量 | 默认值 | 描述 |
|---|---|---|
ZERODRIVE_BASE_URL | https://drive.futurixai.com | API基本URL |
LOG_LEVEL | info | 日志级别(跟踪、调试、信息、警告、错误、致命、静默) |
NODE_ENV | production | 环境模式 |
使用Claude Desktop
添加到您的Claude Desktop配置(claude_desktop_config.json):
{
"mcpServers": {
"zerodrive": {
"command": "npx",
"args": ["@futurixai-labs/zerodrive-mcp-server"],
"env": {
"ZERODRIVE_API_KEY": "your-api-key-here"
}
}
}
}可用工具
文件工具
| 工具 | 说明 |
|---|---|
list_files | 列出具有过滤、分页和排序功能的文件 |
get_file | 获取详细的文件元数据 |
upload_file | 从本地路径上传文件 |
download_file | 为文件生成下载URL |
generate_signed_url | 生成有时间限制的签名URL |
fetch_file_content | 获取文件的文本内容 |
move_file | 将文件移动到其他文件夹 |
share_file | 与其他用户共享文件 |
文件夹工具
| 工具 | 说明 |
|---|---|
list_folders | 列出具有过滤和分页功能的文件夹 |
create_folder | 创建新文件夹 |
get_folder | 获取文件夹详细信息 |
update_folder | 更新文件夹属性 |
delete_folder | 删除文件夹(到垃圾箱或永久文件夹) |
move_folder | 将文件夹移动到其他父文件夹 |
share_folder | 与其他用户共享文件夹 |
工作区工具
| 工具 | 说明 |
|---|---|
list_workspaces | 列出所有可访问的工作区 |
create_workspace | 创建新工作区 |
get_workspace | 获取工作区详细信息 |
upload_workspace_file | 将文件上传到工作区 |
list_workspace_files | 列出工作区中的文件 |
list_workspace_folders | 列出工作区中的文件夹 |
create_workspace_folder | 在工作区中创建文件夹 |
get_workspace_folder | 获取工作区文件夹详细信息 |
update_workspace_folder | 更新工作区文件夹 |
delete_workspace_folder | 删除工作区文件夹 |
垃圾桶工具
| 工具 | 说明 |
|---|---|
list_trash | 列出被丢弃的物品 |
restore_from_trash | 从回收站还原项目 |
empty_trash | 永久删除所有被丢弃的项目 |
发展
# Install dependencies
npm install
# Run type checking
npm run typecheck
# Build
npm run build
# Run linting
npm run lint
# Run tests
npm test
# Format code
npm run format项目结构
src/
├── index.ts # Entry point
├── api/ # HTTP client layer
│ ├── client.ts # API client with auth
│ └── endpoints.ts # API endpoint constants
├── config/ # Configuration
│ ├── env.ts # Environment validation
│ └── constants.ts # Application constants
├── errors/ # Error handling
│ └── base.ts # Error classes
├── logging/ # Structured logging
│ └── logger.ts # Pino logger setup
├── schemas/ # Zod validation schemas
│ ├── common.ts # Shared schemas
│ ├── files.ts # File tool schemas
│ ├── folders.ts # Folder tool schemas
│ ├── workspaces.ts # Workspace tool schemas
│ └── trash.ts # Trash tool schemas
├── server/ # MCP server setup
│ ├── server.ts # Server creation
│ └── handlers.ts # Request handlers
├── tools/ # Tool implementations
│ ├── files/ # File tools
│ ├── folders/ # Folder tools
│ ├── workspaces/ # Workspace tools
│ ├── trash/ # Trash tools
│ └── registry.ts # Tool dispatcher
├── types/ # TypeScript types
│ ├── entities.ts # Domain types
│ └── api.ts # API types
└── utils/ # Utilities
├── query-builder.ts # URL query builder
├── request-builder.ts # Request body builder
├── upload-handler.ts # File upload logic
└── response-formatter.ts # Response formatting贡献
看 贡献.md 关于贡献指南。
许可证
MIT许可证-请参阅 许可证 了解详情。
