{"id":18222,"library":"cls-mcp-server","title":"Tencent Cloud Log Service MCP Server","description":"CLS MCP Server (v1.0.3) connects LLMs (e.g., Claude, GPT) to Tencent Cloud Log Service via the Model Context Protocol. Provides 17+ tools for log search (CQL), metric queries (PromQL), alarm management, time conversion, and region lookup. Requires Tencent Cloud API credentials. Active development on GitHub (Tencent), supports stdio and SSE transports, Node.js 18–22. Distinct from generic MCP servers by deep CLS integration, natural language query translation, and built-in alarm workflow tools.","status":"active","version":"1.0.3","language":"javascript","source_language":"en","source_url":"https://github.com/Tencent/cls-mcp-server","tags":["javascript"],"install":[{"cmd":"npm install cls-mcp-server","lang":"bash","label":"npm"},{"cmd":"yarn add cls-mcp-server","lang":"bash","label":"yarn"},{"cmd":"pnpm add cls-mcp-server","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package exports a single main function/class as default. Named exports are not available at the top level.","wrong":"import { server } from 'cls-mcp-server'","symbol":"default export","correct":"import server from 'cls-mcp-server'"},{"note":"The primary class is exported as default. For CommonJS, use 'const CLSMCPServer = require(\"cls-mcp-server\").default'.","wrong":"const { CLSMCPServer } = require('cls-mcp-server')","symbol":"CLSMCPServer","correct":"import CLSMCPServer from 'cls-mcp-server'"},{"note":"The default export is a function that runs the server. The name 'runServer' is user-defined; adjust as needed.","wrong":"","symbol":"runServer","correct":"import runServer from 'cls-mcp-server'"}],"quickstart":{"code":"import runServer from 'cls-mcp-server';\n\nawait runServer({\n  transport: 'stdio',\n  secretId: process.env.TENCENTCLOUD_SECRET_ID ?? '',\n  secretKey: process.env.TENCENTCLOUD_SECRET_KEY ?? '',\n  region: 'ap-guangzhou',\n  maxLength: 10000,\n  timezone: 'Asia/Shanghai'\n});","lang":"typescript","description":"Initializes and runs the CLS MCP server with stdio transport, reading Tencent Cloud credentials from environment variables and setting region, max length, and timezone."},"warnings":[{"fix":"Ensure TRANSPORT is set to 'stdio' or 'sse' in environment, or pass in options if supported.","message":"The transport mode is determined by the TRANSPORT environment variable (default 'stdio'), not by a parameter. Setting it incorrectly will cause the server to not start.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use Node.js 18, 20, or 22.","message":"Node.js versions below 18 are not supported. The engine requirement is '>=18 <=22'.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Rename parameter to 'maxLength'.","message":"The 'maxTokenLength' option (if any) is deprecated; use 'maxLength' instead.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Set TENCENTCLOUD_SECRET_ID and TENCENTCLOUD_SECRET_KEY environment variables.","message":"The 'secretId' and 'secretKey' are required but commonly mistaken as optional. If missing, the server will fail to authenticate with Tencent Cloud API.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use the new prefixed variable names.","message":"Environment variable names changed from old naming (e.g., SECRET_ID) to TENCENTCLOUD_SECRET_ID in v1.0.0.","severity":"breaking","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Set TENCENTCLOUD_SECRET_ID and TENCENTCLOUD_SECRET_KEY in the environment.","cause":"Tencent Cloud API credentials not provided.","error":"Error: Missing required environment variable: TENCENTCLOUD_SECRET_ID"},{"fix":"Use 'const runServer = require('cls-mcp-server').default' for CommonJS.","cause":"Default import used as named import in CommonJS context.","error":"TypeError: (0 , ...) is not a function"},{"fix":"Set TRANSPORT to 'stdio' or 'sse'.","cause":"TRANSPORT environment variable set to an unsupported value.","error":"Error: Invalid transport: http. Must be 'stdio' or 'sse'"},{"fix":"Use the default 'tencentcloudapi.com' when not in Tencent Cloud VPC.","cause":"Network issue or incorrect TENCENTCLOUD_API_BASE_HOST (e.g., using internal host outside VPC).","error":"Error: connect ETIMEDOUT"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}