Tencent Cloud Log Service (CLS) MCP Server

Tencent Cloud Log Service (CLS) MCP Server

Enables large language models to directly access Tencent Cloud Log Service for log search, metric queries, and alarm management without code.

Category
Visit Server

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, http (Streamable HTTP), 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 http / 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 Streamable HTTP Mode

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

This server runs Streamable HTTP in stateless mode β€” each request is independent, which makes it suitable for containerized deployments and horizontal scaling.

  1. Create a .env file in the current directory:
TRANSPORT=http
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 server:
npx -y cls-mcp-server@latest
  1. Configure your MCP client:
{
  "mcpServers": {
    "cls-mcp-server": {
      "name": "cls-mcp-server",
      "type": "http",
      "isActive": true,
      "url": "http://localhost:3000/mcp"
    }
  }
}

Option 3: 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 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 4: 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. Streamable HTTP Mode β€” Create a .env file in the project root:
TRANSPORT=http
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 server:

npm run start

Then configure your MCP client:

{
  "mcpServers": {
    "cls-mcp-server": {
      "name": "cls-mcp-server",
      "type": "http",
      "isActive": true,
      "url": "http://localhost:3000/mcp"
    }
  }
}
  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 server:

npm run start

Then configure your MCP client:

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

Option 5: 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 (Streamable HTTP mode, default):

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

To run the SSE transport instead, add -e TRANSPORT=sse and point the client at /sse with "type": "sse".

  1. Configure your MCP client:
{
  "mcpServers": {
    "cls-mcp-server": {
      "name": "cls-mcp-server",
      "type": "http",
      "isActive": true,
      "url": "http://localhost:3000/mcp"
    }
  }
}

License

Apache License 2.0

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured