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.
| 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.) |
| Tool | Description |
|---|---|
QueryMetric | Query real-time values of metric topics (PromQL syntax) |
QueryRangeMetric | Query metric data trends over a time range |
| 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) |
| 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 |
TextToSearchLogQuery, enabling more precise and efficient log retrieval.| 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) |
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"toenv.
Prerequisites: Install Node.js (LTS version recommended) and obtain Tencent Cloud SecretId and SecretKey.
.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
npx -y cls-mcp-server@latest
{
"mcpServers": {
"cls-mcp-server": {
"name": "cls-mcp-server",
"type": "sse",
"isActive": true,
"baseUrl": "http://localhost:3000/sse"
}
}
}
Prerequisites: Install Node.js (LTS version recommended) and obtain Tencent Cloud SecretId and SecretKey.
git clone <repository-url>
cd cls-mcp-server
npm install
npm run build
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"toenv.
.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"
}
}
}
Prerequisites: Install Docker and obtain Tencent Cloud SecretId and SecretKey.
docker build -t cls-mcp-server .
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
{
"mcpServers": {
"cls-mcp-server": {
"name": "cls-mcp-server",
"type": "sse",
"isActive": true,
"baseUrl": "http://localhost:3000/sse"
}
}
}