npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

cls-mcp-server

v1.0.3

Published

[![npm version](https://img.shields.io/npm/v/cls-mcp-server)](https://www.npmjs.com/package/cls-mcp-server) [![license](https://img.shields.io/npm/l/cls-mcp-server)](https://github.com/Tencent/cls-mcp-server/blob/v1.0.3/LICENSE)

Readme

Tencent Cloud Log Service (CLS) MCP Server

npm version license

English | 中文

Tencent Cloud Log Service (CLS) MCP Server, built on the Model Context Protocol. It enables large language models to directly access CLS capabilities such as log search, metric queries, and alarm management — no code required.

📖 Tencent Cloud Official Documentation

Features

Log Search

| Tool | Description | | --- | --- | | SearchLog | Search logs based on query conditions (CQL syntax) | | DescribeLogContext | Retrieve the context (preceding and following N entries) of a specific log | | TextToSearchLogQuery | Convert natural language descriptions into CLS query statements (CQL expert) | | DescribeLogHistogram | Get log distribution histogram data within a specified time range | | DescribeIndex | Get index configuration of a log topic (fields, full-text index, etc.) |

Metric Query

| Tool | Description | | --- | --- | | QueryMetric | Query real-time values of metric topics (PromQL syntax) | | QueryRangeMetric | Query metric data trends over a time range |

Alarm Management

| Tool | Description | | --- | --- | | DescribeAlarms | List alarm policies with filtering support | | DescribeAlertRecordHistory | Query alarm trigger/recovery history records | | GetAlarmLog | Query alarm execution detail logs | | DescribeAlarmNotices | List notification channel groups (email, SMS, WeChat, etc.) | | DescribeAlarmShields | List alarm shield rules for a notification channel group | | DescribeNoticeContents | List notification content templates | | DescribeWebCallbacks | List webhook callback configurations | | GetAlarmDetail | Get alarm details by parsing alarm notification URL (supports short/long links) |

Utilities

| Tool | Description | | --- | --- | | GetTopicInfoByName | Search log or metric topics by name | | GetRegionCodeByName | Get Tencent Cloud region codes by region name | | ConvertTimeStringToTimestamp | Convert time strings to timestamps | | ConvertTimestampToTimeString | Convert timestamps to time strings |

Use Cases

  • Natural Language Log Query — Search logs using natural language without mastering complex query syntax, significantly reducing the barrier to log analysis.
  • Intelligent O&M Troubleshooting — Integrate into O&M workflows to intelligently analyze system anomalies and quickly locate root causes.
  • Automated Query Generation — Automatically generate CLS query statements from natural language via TextToSearchLogQuery, enabling more precise and efficient log retrieval.
  • Business Metric Monitoring — Query and monitor real-time metric values and historical trends to keep track of system health.
  • Alarm Management & Analysis — View alarm policies, query alarm trigger/recovery history, and analyze alarm execution details to quickly understand alerting status.

Configuration

| Parameter | Required | Default | Description | | --- | --- | --- | --- | | TRANSPORT | No | stdio | MCP transport mode: stdio or sse | | TENCENTCLOUD_SECRET_ID | Yes | - | Tencent Cloud API SecretId | | TENCENTCLOUD_SECRET_KEY | Yes | - | Tencent Cloud API SecretKey | | TENCENTCLOUD_API_BASE_HOST | No | tencentcloudapi.com | Tencent Cloud API base host. Use internal.tencentcloudapi.com in VPC intranet environments | | MAX_LENGTH | No | Unlimited | Max response length, used to fit model token limits | | PORT | No | 3000 | Server port for SSE mode | | TZ | No | System timezone | Timezone setting, e.g. Asia/Shanghai. Used by time conversion tools (ConvertTimeStringToTimestamp, ConvertTimestampToTimeString) |

Getting Started

Option 1: NPX (Recommended for Local Deployment)

Add the following to your MCP client's mcpServers configuration:

Prerequisites: Install Node.js (LTS version recommended) and obtain Tencent Cloud SecretId and SecretKey.

{
  "mcpServers": {
    "cls-mcp-server": {
      "isActive": true,
      "name": "cls-mcp-server",
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "cls-mcp-server@latest"
      ],
      "env": {
        "TRANSPORT": "stdio",
        "TENCENTCLOUD_SECRET_ID": "<YOUR_SECRET_ID>",
        "TENCENTCLOUD_SECRET_KEY": "<YOUR_SECRET_KEY>",
        "TZ": "Asia/Shanghai"
      }
    }
  }
}

To deploy within a Tencent Cloud VPC, add "TENCENTCLOUD_API_BASE_HOST": "internal.tencentcloudapi.com" to env.

Option 2: Self-hosted SSE Mode

Prerequisites: Install Node.js (LTS version recommended) and obtain Tencent Cloud SecretId and SecretKey.

  1. Create a .env file in the current directory:
TRANSPORT=sse
TENCENTCLOUD_SECRET_ID=<YOUR_SECRET_ID>
TENCENTCLOUD_SECRET_KEY=<YOUR_SECRET_KEY>
# Uncomment the following line if deploying within a Tencent Cloud VPC
# TENCENTCLOUD_API_BASE_HOST=internal.tencentcloudapi.com
PORT=3000
TZ=Asia/Shanghai
  1. Start the SSE server:
npx -y cls-mcp-server@latest
  1. Configure your MCP client:
{
  "mcpServers": {
    "cls-mcp-server": {
      "name": "cls-mcp-server",
      "type": "sse",
      "isActive": true,
      "baseUrl": "http://localhost:3000/sse"
    }
  }
}

Option 3: Install from Source

Prerequisites: Install Node.js (LTS version recommended) and obtain Tencent Cloud SecretId and SecretKey.

  1. Clone the repository and build:
git clone <repository-url>
cd cls-mcp-server
npm install
npm run build
  1. Stdio Mode — Add the following to your MCP client's mcpServers configuration:
{
  "mcpServers": {
    "cls-mcp-server": {
      "isActive": true,
      "name": "cls-mcp-server",
      "type": "stdio",
      "command": "node",
      "args": [
        "/ABSOLUTE/PATH/TO/cls-mcp-server/dist/index.js"
      ],
      "env": {
        "TRANSPORT": "stdio",
        "TENCENTCLOUD_SECRET_ID": "<YOUR_SECRET_ID>",
        "TENCENTCLOUD_SECRET_KEY": "<YOUR_SECRET_KEY>",
        "TZ": "Asia/Shanghai"
      }
    }
  }
}

To deploy within a Tencent Cloud VPC, add "TENCENTCLOUD_API_BASE_HOST": "internal.tencentcloudapi.com" to env.

  1. SSE Mode — Create a .env file in the project root:
TRANSPORT=sse
TENCENTCLOUD_SECRET_ID=<YOUR_SECRET_ID>
TENCENTCLOUD_SECRET_KEY=<YOUR_SECRET_KEY>
# Uncomment the following line if deploying within a Tencent Cloud VPC
# TENCENTCLOUD_API_BASE_HOST=internal.tencentcloudapi.com
PORT=3000
TZ=Asia/Shanghai

Start the SSE server:

npm run start:sse

Then configure your MCP client:

{
  "mcpServers": {
    "cls-mcp-server": {
      "name": "cls-mcp-server",
      "type": "sse",
      "isActive": true,
      "baseUrl": "http://localhost:3000/sse"
    }
  }
}

Option 4: Docker Deployment

Prerequisites: Install Docker and obtain Tencent Cloud SecretId and SecretKey.

  1. Build the Docker image:
docker build -t cls-mcp-server .
  1. Run the container (SSE mode):

To deploy within a Tencent Cloud VPC, add -e TENCENTCLOUD_API_BASE_HOST=internal.tencentcloudapi.com.

docker run -d -p 3000:3000 \
  -e TENCENTCLOUD_SECRET_ID=<YOUR_SECRET_ID> \
  -e TENCENTCLOUD_SECRET_KEY=<YOUR_SECRET_KEY> \
  -e TZ=Asia/Shanghai \
  --name cls-mcp-server \
  cls-mcp-server
  1. Configure your MCP client:
{
  "mcpServers": {
    "cls-mcp-server": {
      "name": "cls-mcp-server",
      "type": "sse",
      "isActive": true,
      "baseUrl": "http://localhost:3000/sse"
    }
  }
}

License

Apache License 2.0