This server provides Tencent Cloud Object Storage (COS) functionality through a Model Context Protocol (MCP) interface, enabling seamless integration with MCP-compatible IDEs like Claude Desktop, Cursor, and Windsurf.
Key capabilities:
Upload files: Single file upload (
upload_file
) or batch upload (upload_multiple
) with customizable object keys and optional custom domainsGenerate temporary URLs: Create time-limited signed URLs (
get_signed_url
) for secure access to COS objects with customizable expiration (default 3600 seconds)List objects: Browse bucket contents (
list_objects
) with optional prefix filtering for organizationDelete objects: Remove files (
delete_object
) from COS storage using object keys
All operations are fully compatible with the Model Context Protocol for easy integration into supported development environments.
Provides tools for managing files in Tencent Cloud Object Storage (COS), including uploading single or multiple files, generating signed temporary URLs, listing objects with prefix filtering, and deleting objects
腾讯云 COS MCP 服务器
一个基于 Node.js 的 Model Context Protocol (MCP)服务器,为 Claude Desktop、Cursor 和 Windsurf 等 IDE 提供腾讯云对象存储(COS)功能。
功能特性
- 🚀 文件上传 - 支持单文件和批量文件上传到腾讯云 COS
- 📦 大文件上传 - 自动分片上传,支持断点续传和进度监控
- 🔄 并发控制 - 智能重试机制和可配置并发限制
- 🧹 资源清理 - 自动清理临时文件,防止磁盘空间泄漏
- 📁 文件管理 - 复制、移动、重命名文件操作
- 🗂️ 文件夹操作 - 创建、删除文件夹,支持递归操作
- 🔗 临时 URL - 生成带签名的临时访问链接,支持自定义过期时间
- 📋 对象管理 - 列出存储桶中的对象,支持前缀过滤和文件夹视图
- 🗑️ 批量删除 - 支持单个和批量删除 COS 中的对象
- 📊 统计分析 - 文件夹统计信息,包括大小、数量、类型分布
- 🔧 MCP 兼容 - 完全兼容 Model Context Protocol 规范
快速开始
📖 快速上手: 查看 快速参考指南 了解所有工具的基本用法
📚 详细文档: 查看 工具使用说明 获取完整的API文档和示例
本地调试
环境配置
服务器通过环境变量读取腾讯云 COS 配置:
作为 MCP 服务器使用(推荐)
在 MCP 兼容编辑器中配置:
环境变量说明
变量名 | 必需 | 说明 | 示例 |
---|---|---|---|
COS_SECRET_ID | ✅ | 腾讯云 Secret ID | AKIDxxx... |
COS_SECRET_KEY | ✅ | 腾讯云 Secret Key | xxx... |
COS_REGION | ✅ | COS 地域 | ap-beijing , ap-shanghai |
COS_BUCKET | ✅ | 存储桶名称 | my-bucket-1234567890 |
COS_DOMAIN | ❌ | 自定义域名 | cdn.example.com |
MCP 工具列表
1. upload_file - 单文件上传
2. upload_multiple - 批量文件上传
3. get_signed_url - 获取临时访问 URL
4. list_objects - 列出存储桶对象
5. delete_object - 删除对象
6. copy_object - 复制对象
7. move_object - 移动对象
8. rename_object - 重命名对象
9. delete_multiple - 批量删除对象
10. create_folder - 创建文件夹
11. delete_folder - 删除文件夹
12. list_folders - 列出文件夹和文件
13. get_folder_stats - 获取文件夹统计
14. upload_large_file - 大文件分片上传
15. get_upload_progress - 获取上传进度
16. clear_upload_progress - 清理上传进度
17. manage_temp_files - 管理临时文件
IDE 集成配置
使用本地运行集成
已发布到 npm 集成
Claude code 中集成
在配置中添加 MCP 服务器配置,使用相同的 JSON 格式。
Cursor IDE
在设置中添加 MCP 服务器配置,使用相同的 JSON 格式。
Windsurf IDE
参考官方文档配置 MCP 服务器,使用上述配置参数。
常用命令
测试
项目包含完整的测试套件,确保功能的可靠性:
测试文件
test/test.js
- 基础功能测试test/test-mcp.js
- MCP协议合规性测试test/test-temp.js
- 临时目录管理测试test/test-cleanup.js
- 临时文件清理测试test/test-path-validation.js
- 文件路径验证测试
运行测试
测试覆盖
- ✅ COS服务基础功能验证
- ✅ MCP协议标准输出合规性
- ✅ 临时目录结构和管理
- ✅ 上传完成后资源清理
- ✅ 断点续传进度管理
- ✅ 异常情况资源回收
- ✅ 文件路径清理和中文支持
开发指南
项目结构
核心依赖
@modelcontextprotocol/sdk
- MCP 协议实现cos-nodejs-sdk-v5
- 腾讯云 COS 官方 SDK
贡献指南
- Fork 项目
- 创建功能分支 (
git checkout -b feature/new-feature
) - 提交更改 (
git commit -am 'Add new feature'
) - 推送分支 (
git push origin feature/new-feature
) - 创建 Pull Request
许可证
MIT License - 查看LICENSE文件了解详情。
支持与反馈
- 🐛 问题反馈: GitHub Issues
- 💡 功能建议: GitHub Discussions
- 📧 联系作者: 156554395@qq.com
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Enables interaction with Tencent Cloud Object Storage (COS) through MCP protocol. Supports file upload, download, deletion, listing objects, and generating temporary signed URLs for cloud storage management.
- 功能特性
- 快速开始
- 环境配置
- MCP 工具列表
- 1. upload_file - 单文件上传
- 2. upload_multiple - 批量文件上传
- 3. get_signed_url - 获取临时访问 URL
- 4. list_objects - 列出存储桶对象
- 5. delete_object - 删除对象
- 6. copy_object - 复制对象
- 7. move_object - 移动对象
- 8. rename_object - 重命名对象
- 9. delete_multiple - 批量删除对象
- 10. create_folder - 创建文件夹
- 11. delete_folder - 删除文件夹
- 12. list_folders - 列出文件夹和文件
- 13. get_folder_stats - 获取文件夹统计
- 14. upload_large_file - 大文件分片上传
- 15. get_upload_progress - 获取上传进度
- 16. clear_upload_progress - 清理上传进度
- 17. manage_temp_files - 管理临时文件
- IDE 集成配置
- 常用命令
- 测试
- 开发指南
- 许可证
- 支持与反馈