New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

tencent-cos-mcp

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

tencent-cos-mcp

腾讯云COS MCP服务器 - 基于Node.js的Model Context Protocol服务器,提供腾讯云对象存储服务功能

latest
Source
npmnpm
Version
1.0.7
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

腾讯云 COS MCP 服务器

一个基于 Node.js 的 Model Context Protocol (MCP)服务器,为 Claude Desktop、Cursor 和 Windsurf 等 IDE 提供腾讯云对象存储(COS)功能。

功能特性

  • 🚀 文件上传 - 支持单文件和批量文件上传到腾讯云 COS
  • 🔗 临时 URL - 生成带签名的临时访问链接,支持自定义过期时间
  • 📋 文件管理 - 列出存储桶中的对象,支持前缀过滤
  • 🗑️ 文件删除 - 安全删除 COS 中的指定对象
  • 🔧 MCP 兼容 - 完全兼容 Model Context Protocol 规范

快速开始

方式 1:NPX 直接使用(推荐)

# 直接运行,无需安装
npx tencent-cos-mcp

方式 2:全局安装

# 全局安装
npm install -g tencent-cos-mcp

# 运行服务器
tencent-cos-mcp

方式 3:本地开发

# 克隆项目
git clone https://github.com/156554395/tencent-cos-mcp.git
cd tencent-cos-mcp

# 安装依赖
npm install

# 启动服务器
npm start

环境配置

服务器通过环境变量读取腾讯云 COS 配置:

作为 MCP 服务器使用(推荐)

在 MCP 兼容编辑器中配置:

{
  "command": "npx",
  "args": ["-y","tencent-cos-mcp"],
  "env": {
    "COS_SECRET_ID": "your-secret-id",
    "COS_SECRET_KEY": "your-secret-key",
    "COS_REGION": "ap-chengdu",
    "COS_BUCKET": "your-bucket",
    "COS_DOMAIN": "your-custom-domain.com"
  }
}

直接启动使用

# 通过环境变量启动
COS_SECRET_ID=your-id \
COS_SECRET_KEY=your-key \
COS_REGION=ap-chengdu \
COS_BUCKET=your-bucket \
npx -y tencent-cos-mcp

环境变量说明

变量名必需说明示例
COS_SECRET_ID腾讯云 Secret IDAKIDxxx...
COS_SECRET_KEY腾讯云 Secret Keyxxx...
COS_REGIONCOS 地域ap-beijing, ap-shanghai
COS_BUCKET存储桶名称my-bucket-1234567890
COS_DOMAIN自定义域名cdn.example.com

MCP 工具列表

1. upload_file - 单文件上传

{
  "file_path": "/path/to/local/file.jpg",    // 必需:本地文件路径
  "object_key": "images/file.jpg",           // 可选:COS中的对象键
  "custom_domain": "cdn.example.com"        // 可选:自定义域名
}

2. upload_multiple - 批量文件上传

{
  "files": [
    {
      "file_path": "/path/to/file1.jpg",
      "object_key": "images/file1.jpg"       // 可选
    },
    {
      "file_path": "/path/to/file2.png"      // 使用文件名作为对象键
    }
  ]
}

3. get_signed_url - 获取临时访问 URL

{
  "object_key": "images/file.jpg",          // 必需:COS对象键
  "expire_time": 3600                       // 可选:过期时间(秒),默认1小时
}

4. list_objects - 列出存储桶对象

{
  "prefix": "images/"                       // 可选:对象键前缀过滤
}

5. delete_object - 删除对象

{
  "object_key": "images/file.jpg"           // 必需:要删除的对象键
}

IDE 集成配置

Claude Desktop

~/Library/Application Support/Claude/claude_desktop_config.json中添加:

{
  "mcpServers": {
    "tencent-cos-mcp": {
      "command": "npx",
      "args": ["y","tencent-cos-mcp"],
      "env": {
        "COS_SECRET_ID": "your-secret-id",
        "COS_SECRET_KEY": "your-secret-key",
        "COS_REGION": "ap-chengdu",
        "COS_BUCKET": "your-bucket",
        "COS_DOMAIN": "your-custom-domain.com"
      }
    }
  }
}

Cursor IDE

在设置中添加 MCP 服务器配置,使用相同的 JSON 格式。

Windsurf IDE

参考官方文档配置 MCP 服务器,使用上述配置参数。

常用命令

# 查看版本
npx tencent-cos-mcp --version

# 测试配置
COS_SECRET_ID=xxx COS_SECRET_KEY=xxx COS_REGION=ap-chengdu COS_BUCKET=test npx tencent-cos-mcp

# 开发模式
npm run dev

# 发布到npm (维护者)
npm run publish

开发指南

项目结构

tencent-cos-mcp/
├── index.js              # MCP服务器主入口
├── src/
│   ├── cosService.js     # COS SDK封装服务
│   └── config.js         # 配置管理
├── config-examples/      # 配置示例
├── package.json          # 项目配置
└── README.md            # 项目文档

核心依赖

  • @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文件了解详情。

支持与反馈

更新日志

v1.0.5 (2024-09-09)

  • 🎉 支持 npx 直接运行,无需本地安装
  • 🔧 优化配置流程和错误处理
  • 📝 完善文档和使用示例

v1.0.4

  • 🐛 修复 npx 路径和警告问题
  • ⚡ 优化服务器启动性能

Keywords

mcp

FAQs

Package last updated on 09 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts