getCosConfig
Retrieve Tencent Cloud COS configuration settings for cloud storage operations and media processing capabilities within the XMZ MCP Server.
Instructions
获取COS配置, 腾讯云配置
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {},
"type": "object"
}
Implementation Reference
- src/server.ts:68-82 (handler)Inline handler function for the 'getCosConfig' tool. It masks sensitive secrets in the config and returns the configuration as a JSON string in the response format.server.tool('getCosConfig', '获取COS配置, 腾讯云配置', {}, async () => { if (config.cosConfig) { config.cosConfig.SecretId = maskSecret(config.cosConfig.SecretId); config.cosConfig.SecretKey = maskSecret(config.cosConfig.SecretKey); } return { content: [ { type: 'text', text: JSON.stringify(config, null, 2), }, ], }; });
- src/server.ts:68-82 (registration)Registration of the 'getCosConfig' tool using server.tool(), with an empty schema {} and inline handler.server.tool('getCosConfig', '获取COS配置, 腾讯云配置', {}, async () => { if (config.cosConfig) { config.cosConfig.SecretId = maskSecret(config.cosConfig.SecretId); config.cosConfig.SecretKey = maskSecret(config.cosConfig.SecretKey); } return { content: [ { type: 'text', text: JSON.stringify(config, null, 2), }, ], }; });
- src/server.ts:14-17 (helper)Helper function used by the getCosConfig handler to mask sensitive secrets like SecretId and SecretKey.export function maskSecret(secret: string): string { secret = String(secret); if (secret.length <= 4) return '****'; return `${secret.substring(0, 4)}****${secret.slice(-4)}`;