Tencent Cloud Log Service (CLS) MCP Server
OfficialClick on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Tencent Cloud Log Service (CLS) MCP Serversearch for error logs in the last hour"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Tencent Cloud Log Service (CLS) MCP Server
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.
Features
Log Search
Tool | Description |
| Search logs based on query conditions (CQL syntax) |
| Retrieve the context (preceding and following N entries) of a specific log |
| Convert natural language descriptions into CLS query statements (CQL expert) |
| Get log distribution histogram data within a specified time range |
| Get index configuration of a log topic (fields, full-text index, etc.) |
Metric Query
Tool | Description |
| Query real-time values of metric topics (PromQL syntax) |
| Query metric data trends over a time range |
Alarm Management
Tool | Description |
| List alarm policies with filtering support |
| Query alarm trigger/recovery history records |
| Query alarm execution detail logs |
| List notification channel groups (email, SMS, WeChat, etc.) |
| List alarm shield rules for a notification channel group |
| List notification content templates |
| List webhook callback configurations |
| Get alarm details by parsing alarm notification URL (supports short/long links) |
Utilities
Tool | Description |
| Search log or metric topics by name |
| Get Tencent Cloud region codes by region name |
| Convert time strings to timestamps |
| 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 |
| No |
| MCP transport mode: |
| Yes | - | Tencent Cloud API SecretId |
| Yes | - | Tencent Cloud API SecretKey |
| No |
| Tencent Cloud API base host. Use |
| No | Unlimited | Max response length, used to fit model token limits |
| No |
| Server port for |
| No | System timezone | Timezone setting, e.g. |
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"toenv.
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.
Create a
.envfile 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/ShanghaiStart the server:
npx -y cls-mcp-server@latestConfigure 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.
Create a
.envfile 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/ShanghaiStart the server:
npx -y cls-mcp-server@latestConfigure 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.
Clone the repository and build:
git clone <repository-url>
cd cls-mcp-server
npm install
npm run buildStdio Mode β Add the following to your MCP client's
mcpServersconfiguration:
{
"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.
Streamable HTTP Mode β Create a
.envfile 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/ShanghaiStart the server:
npm run startThen configure your MCP client:
{
"mcpServers": {
"cls-mcp-server": {
"name": "cls-mcp-server",
"type": "http",
"isActive": true,
"url": "http://localhost:3000/mcp"
}
}
}SSE Mode β Create a
.envfile 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/ShanghaiStart the server:
npm run startThen 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.
Build the Docker image:
docker build -t cls-mcp-server .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-serverTo run the SSE transport instead, add
-e TRANSPORT=sseand point the client at/ssewith"type": "sse".
Configure your MCP client:
{
"mcpServers": {
"cls-mcp-server": {
"name": "cls-mcp-server",
"type": "http",
"isActive": true,
"url": "http://localhost:3000/mcp"
}
}
}License
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Tencent/cls-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server