# 腾讯云日志服务 CLS

搜索和分析日志、查询监控指标与告警记录。

- 类型：MCP
- 权限：只读查询
- 门槛：需授权账号、需 API Key
- 官方入口：https://cloud.tencent.com/document/product/614/118699
- 官方仓库：https://github.com/Tencent/cls-mcp-server
- 网页详情：https://guanmo-ai.github.io/awesome-agent-mcp/s/tencent-cls/

仅供参考，官方身份核验不代表接入实测；以厂商文档为准，密钥和登录在本地完成。

## 接入前准备

需 Node.js/npx、腾讯云 API 密钥及日志资源权限；日志查询额度和产品费用按账号确认。

## 接入步骤

1. 准备有目标日志权限的 SecretId/SecretKey。 [官方入口](https://github.com/Tencent/cls-mcp-server)
2. 按官方 README 设置 TRANSPORT=stdio 及本地环境变量；时区应与业务查询一致。 [官方入口](https://github.com/Tencent/cls-mcp-server)

## 验证方法

查询已有日志主题或一小段日志，核对地域、主题和时间范围。

指引核对于 2026-11-05，不是本项目实测结果。

## 费用

所查官方接入资料未能确认该工具的具体调用费用和免费额度；实际费用按官方产品规则核实。 [官方来源](https://github.com/Tencent/cls-mcp-server)（核对日期：2026-11-05）

## 安装配置

### JSON

```
{
  "mcpServers": {
    "tencent-cls": {
      "command": "npx",
      "args": [
        "-y",
        "cls-mcp-server@latest"
      ],
      "env": {
        "TRANSPORT": "stdio",
        "TENCENTCLOUD_SECRET_ID": "${TENCENTCLOUD_SECRET_ID}",
        "TENCENTCLOUD_SECRET_KEY": "${TENCENTCLOUD_SECRET_KEY}",
        "TZ": "Asia/Shanghai"
      }
    }
  }
}
```

### Claude Code

```
claude mcp add --env 'TRANSPORT=stdio' --env 'TENCENTCLOUD_SECRET_ID=${TENCENTCLOUD_SECRET_ID}' --env 'TENCENTCLOUD_SECRET_KEY=${TENCENTCLOUD_SECRET_KEY}' --env 'TZ=Asia/Shanghai' --transport stdio 'tencent-cls' -- 'npx' '-y' 'cls-mcp-server@latest'
```

### Codex

```
# ~/.codex/config.toml
[mcp_servers.tencent-cls]
command = "npx"
args = ["-y","cls-mcp-server@latest"]
env_vars = ["TENCENTCLOUD_SECRET_ID","TENCENTCLOUD_SECRET_KEY"]

[mcp_servers.tencent-cls.env]
TRANSPORT = "stdio"
TZ = "Asia/Shanghai"
```

JSON 示例用于 Claude Code 的 .mcp.json；${VAR} 从启动客户端的环境读取。Codex 的环境变量也须在启动进程中可用，不能将变量名替换成密钥值。

命令会进入 shell 历史，请在本地执行，不要分享。保留命令中的 ${VAR} 引用；Codex 不支持在 URL 或命令参数中展开这些引用，此处保留待本地处理的占位符。

## 核验与来源

2026-11-05 核对官方身份：[依据](https://github.com/Tencent/cls-mcp-server)。Tencent 官方仓库反链腾讯云产品文档；工具清单均为日志、指标、告警查询。

官方原文摘录（2026-11-05，来自上述依据）：

```
cls-mcp-server@latest
```

- [厂商官方接入文档](https://github.com/Tencent/cls-mcp-server)
- [厂商官方发布依据](https://cloud.tencent.com/document/product/614/118699)

[使用说明与免责声明](https://guanmo-ai.github.io/awesome-agent-mcp/#disclaimer)
