convez.ai
MCP ServerDevOps & InfraestruturaIntermediário
Tencent

Tencent Cloud Log Service MCP Server

Tencent/cls-mcp-server

Acesso ao CLS do Tencent via Claude para logs, métricas e alarmes

Ver no GitHub
InicialPluginScore · de 0 a 100

Servidor MCP que integra o Tencent Cloud Log Service (CLS) ao Claude, permitindo busca de logs, consultas de métricas e gerenciamento de alertas via linguagem natural. Elimina a necessidade de dominar sintaxe complexa de queries, habilitando análise de logs e troubleshooting de infraestrutura diretamente no contexto do modelo.

Instalação

$npx convez-ai Tencent/cls-mcp-server

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
18
Forks
6
Acompanhando
1
Saúde
37%
Último commit
há 3 dias
Versão
v1.3.0
Issues abertas
0
Contribuidores
1

Casos de uso

  • Análise de logs em linguagem natural sem sintaxe CQL
  • Troubleshooting inteligente de sistemas e anomalias
  • Monitoramento de métricas em tempo real e tendências históricas
  • Gestão e análise de políticas de alarme

Veredito

Ferramenta especializada e bem documentada para quem usa Tencent Cloud e precisa integrar observabilidade ao workflow com Claude. Reduz fricção em análise de logs, mas requer credenciais e infraestrutura Tencent Cloud configuradas.

README

A tradução para o português deste README ainda está na fila.

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

ToolDescription
SearchLogSearch logs based on query conditions (CQL syntax)
DescribeLogContextRetrieve the context (preceding and following N entries) of a specific log
TextToSearchLogQueryConvert natural language descriptions into CLS query statements (CQL expert)
DescribeLogHistogramGet log distribution histogram data within a specified time range
DescribeIndexGet index configuration of a log topic (fields, full-text index, etc.)

Metric Query

ToolDescription
QueryMetricQuery real-time values of metric topics (PromQL syntax)
QueryRangeMetricQuery metric data trends over a time range

Alarm Management

ToolDescription
DescribeAlarmsList alarm policies with filtering support
DescribeAlertRecordHistoryQuery alarm trigger/recovery history records
GetAlarmLogQuery alarm execution detail logs
DescribeAlarmNoticesList notification channel groups (email, SMS, WeChat, etc.)
DescribeAlarmShieldsList alarm shield rules for a notification channel group
DescribeNoticeContentsList notification content templates
DescribeWebCallbacksList webhook callback configurations
GetAlarmDetailGet alarm details by parsing alarm notification URL (supports short/long links)

Utilities

ToolDescription
GetTopicInfoByNameSearch log or metric topics by name
GetRegionCodeByNameGet Tencent Cloud region codes by region name
ConvertTimeStringToTimestampConvert time strings to timestamps
ConvertTimestampToTimeStringConvert 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

ParameterRequiredDefaultDescription
TRANSPORTNostdioMCP transport mode: stdio, http (Streamable HTTP), or sse
TENCENTCLOUD_SECRET_IDYes-Tencent Cloud API SecretId
TENCENTCLOUD_SECRET_KEYYes-Tencent Cloud API SecretKey
TENCENTCLOUD_API_BASE_HOSTNotencentcloudapi.comTencent Cloud API base host. Use internal.tencentcloudapi.com in VPC intranet environments
MAX_LENGTHNoUnlimitedMax response length, used to fit model token limits
PORTNo3000Server port for http / sse mode
TZNoSystem timezoneTimezone 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

Ver o original no GitHub

Bom para

Relacionados