Skip to main content
Glama

Tencent Cloud COS MCP Server

Official
by Tencent
utils.ts1.37 kB
import crypto from 'crypto'; export const generateOutPutFileId = (objectKey: string) => { const now = new Date(); const formattedDate = [ now.getFullYear(), String(now.getMonth() + 1).padStart(2, '0'), // 月份补零 String(now.getDate()).padStart(2, '0'), // 日期补零 ].join(''); if (objectKey) { const lastDotIndex = objectKey.lastIndexOf('.'); const base = lastDotIndex === -1 ? objectKey : objectKey.substring(0, lastDotIndex); const outPutFileid = `${formattedDate}_${base}_${generateCode()}`; return encodeURIComponent(outPutFileid); } else { const outPutFileid = `${formattedDate}_${generateCode()}`; return encodeURIComponent(outPutFileid); } }; export const generateCode = (length = 6, useSecure = true) => { const chars = 'ABCDEFGHJKLMNPQRSTUVWXYZ' + // 大写字母(排除 I, O) 'abcdefghjkmnpqrstuvwxyz' + // 小写字母(排除 i, l, o) '23456789'; // 数字(排除 0, 1) let code = ''; if (useSecure) { // 使用加密安全的随机数 const randomBytes = crypto.randomBytes(length); for (let i = 0; i < length; i++) { code += chars[randomBytes[i] % chars.length]; } } else { // 使用普通随机数 for (let i = 0; i < length; i++) { code += chars[Math.floor(Math.random() * chars.length)]; } } return code; };

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Tencent/cos-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server