Tencent/cls-mcp-server
Tencent Cloud Log Service (CLS) MCP Server
5ea952a9d2e0cls-mcp-server1.3.0 in package.jsonPaths from tool input into commands, SQL, files and URLs
How much power the tools give an agent over the machine
Hidden instructions and poisoning in text for the model
Known vulnerabilities in the packages the server uses
How the server reads credentials and where they can go
Whether the tools do only what their descriptions say
Top risks in plain words
- INFONo published risk: no tool declared to run commands, files, addresses or queries of the caller's choice, no known vulnerability in a production package, no advisory. Code findings appear here only after a person has verified them.
How to use it safely
Practical steps from what we found in this server. They lower the risk; they do not replace a review of the code.
- Give it a narrowly scoped token
Its code reads credentials or environment variables. Use a key limited to what this server needs, not your main one.
- Keep confirmations on
Leave your MCP client's confirmation prompt on for tools that change files, run commands or send data.
What its tools can do on your machine
The server offers 20 tools. When an AI agent calls them, this is what their code can do on the machine where the server runs, as traced in the source. Tools that call code the scanner could not follow may do more.
GetAlarmDetail, GetRegionCodeByNameDescribeAlarmNotices, DescribeAlarmShields, DescribeAlarms, DescribeAlertRecordHistory, DescribeIndex, DescribeLogContext and 12 moreConvertTimeStringToTimestamp, ConvertTimestampToTimeString, DescribeAlarmNotices, DescribeAlarmShields, DescribeAlarms, DescribeAlertRecordHistory and 14 moreDescribeAlarmNotices, DescribeAlarmShields, DescribeAlarms, DescribeAlertRecordHistory, DescribeIndex, DescribeLogContext and 12 moreNo tool was seen to: start other programs on the machine; read or write files.
Where its requests and secrets go
Read from the names along each tool's calls, not from a run: what the code says, not every address it may reach at run time.
The literal addresses the tools' requests name.
- None: no request names a fixed host.
Constants or settings that start an address; the value comes from configuration.
- None seen.
Credential-like environment variables. Give the server a key with the least access it needs.
TENCENTCLOUD_SECRET_ID· GetAlarmDetail, GetRegionCodeByNameTENCENTCLOUD_SECRET_KEY· GetAlarmDetail, GetRegionCodeByName
1 request address could not be settled from the code (built at run time).
Text it brings in from outside
Text that reaches the model from outside: an instruction hidden in it can steer the agent (prompt injection). Treat what these tools return as data, not as orders.
- web or API responses1 tool · GetAlarmDetail
Tool annotations
No tool declares MCP annotations (readOnlyHint, destructiveHint and the rest). Clients use them to decide what to confirm; directories such as Anthropic's and OpenAI's ask for them.
Tools, prompts and resources (20: 20 tools)
Open a row for its full description. Chips show what its code can reach, and which risky capability its own description declares.
ConvertTimeStringToTimestamptool 将时间字符串转换为毫秒或秒级时间戳。常用于为 SearchLog、DescribeLogHistogram 等工具的 From/To 参数准备时间戳。Env vars
将时间字符串转换为毫秒或秒级时间戳。常用于为 SearchLog、DescribeLogHistogram 等工具的 From/To 参数准备时间戳。
ConvertTimestampToTimeStringtool 将时间戳转换为时间字符串。不传 timestamp 参数时返回当前时间,常用于获取当前时间后计算 SearchLog 等工具所需的时间范围。Env vars
将时间戳转换为时间字符串。不传 timestamp 参数时返回当前时间,常用于获取当前时间后计算 SearchLog 等工具所需的时间范围。
DescribeAlarmNoticestool 获取 CLS 通知渠道组列表。查询指定地域下的通知渠道组列表,通知渠道组用于配置告警通知的接收方式和接收人,包括邮件、短信、电话、企业微信等。CredentialsEnv varsSensitive paths
获取 CLS 通知渠道组列表。查询指定地域下的通知渠道组列表,通知渠道组用于配置告警通知的接收方式和接收人,包括邮件、短信、电话、企业微信等。 支持的过滤条件(Filters 参数): - name: 按通知渠道组名称过滤 - alarmNoticeId: 按通知渠道组 ID 过滤 返回信息包含:AlarmNoticeId、Name、NoticeReceivers、WebCallbacks、CreateTime、UpdateTime 等。
DescribeAlarmShieldstool 获取 CLS 告警屏蔽规则列表。查询指定通知渠道组下的告警屏蔽规则,屏蔽规则用于在特定时间段内屏蔽告警通知,避免维护期间产生大量告警噪音。CredentialsEnv varsSensitive paths
获取 CLS 告警屏蔽规则列表。查询指定通知渠道组下的告警屏蔽规则,屏蔽规则用于在特定时间段内屏蔽告警通知,避免维护期间产生大量告警噪音。
应用场景:
1. 查看某个通知渠道组下配置的所有屏蔽规则
2. 查询当前生效的屏蔽规则(按状态过滤)
3. 审计和管理告警屏蔽配置
支持的过滤条件(Filters 参数):
- shieldId: 按屏蔽规则 ID 过滤,如 [{Key: 'shieldId', Values: ['shield-xxx']}]
- name: 按屏蔽规则名称过滤,如 [{Key: 'name', Values: ['维护屏蔽']}]
- status: 按状态过滤(enabled=启用,disabled=禁用),如 [{Key: 'status', Values: ['enabled']}]DescribeAlarmstool 获取 CLS 告警策略列表。查询指定地域的告警策略列表,支持按告警策略启用状态等条件过滤和分页。CredentialsEnv varsSensitive paths
获取 CLS 告警策略列表。查询指定地域的告警策略列表,支持按告警策略启用状态等条件过滤和分页。
支持的过滤条件(Filters 参数):
- name: 按告警策略名称过滤
- alarmId: 按告警策略 ID 过滤
- topicId: 按监控对象的日志主题 ID 过滤
- enable: 按启用状态过滤(1=启用,0=禁用),如 [{Key: 'enable', Values: ['1']}]DescribeAlertRecordHistorytool 获取 CLS 告警历史记录。查询指定时间范围内的告警历史记录,包含告警触发、恢复等事件的详细信息,用于分析告警趋势和排查告警问题。CredentialsEnv varsSensitive paths
获取 CLS 告警历史记录。查询指定时间范围内的告警历史记录,包含告警触发、恢复等事件的详细信息,用于分析告警趋势和排查告警问题。 支持的过滤条件(Filters 参数): - alarmId: 按告警策略 ID 过滤 - alarmName: 按告警策略名称过滤 - topicId: 按日志主题 ID 过滤 - status: 按告警状态过滤(0-未恢复,1-已恢复) 返回信息包含:TotalCount(总数)、Records 列表(每条记录含 RecordId、AlarmId、AlarmName、TopicId、TopicName、Region、Trigger、TriggerCount、AlarmLevel、Status、CreateTime、Duration、NotifyStatus)。
DescribeIndextool 获取 CLS 日志主题索引配置。查询指定日志主题的索引配置信息,包括键值索引、元数据索引(TAG)和全文索引的详细配置。CredentialsEnv varsSensitive paths
获取 CLS 日志主题索引配置。查询指定日志主题的索引配置信息,包括键值索引、元数据索引(TAG)和全文索引的详细配置。 索引配置决定了日志哪些字段可以被搜索和分析,是日志检索和分析的基础配置。 使用场景:生成检索语句时,推荐优先使用 TextToSearchLogQuery 工具(自动适配索引配置)。仅在需要手写 CQL 查询时,才使用本工具了解日志主题有哪些可检索字段及其类型。 返回字段包含:字段名及其 type(类型)、sql_flag(是否支持 SQL 分析)、description(字段描述);__TAG__(元数据索引);__FULLTEXT__(全文索引)。
DescribeLogContexttool 获取指定日志的上下文内容(前后 N 条日志)。用于在定位到某条异常日志后,查看其前后的日志以分析问题根因。CredentialsEnv varsSensitive paths
获取指定日志的上下文内容(前后 N 条日志)。用于在定位到某条异常日志后,查看其前后的日志以分析问题根因。 前置条件:需先使用 SearchLog 工具检索到目标日志,从返回结果的 Results 中获取 Time、PkgId、PkgLogId 三个必填参数。
DescribeLogHistogramtool 获取 CLS 日志直方图数据。查询指定日志主题在指定时间范围内的日志分布直方图,统计各时间段内匹配查询条件的日志数量。CredentialsEnv varsSensitive paths
获取 CLS 日志直方图数据。查询指定日志主题在指定时间范围内的日志分布直方图,统计各时间段内匹配查询条件的日志数量。 重要:本工具仅返回时间(BTime)和计数(Count)两个维度,无法做多字段聚合分析。 - 如果日志主题支持 SQL 分析(标准存储),应优先使用 SearchLog 工具通过管道符 | 进行时间分组统计,功能更强大 - 本工具适用于不支持 SQL 分析的日志主题(如低频存储主题),或只需快速查看日志量时间趋势的场景 Query 参数使用 CQL 语法,建议先使用 TextToSearchLogQuery 生成。 返回信息包含:Interval(时间间隔)、TotalCount(总日志条数)、HistogramInfos(各时间段的 BTime 起始时间和 Count 日志计数)。
DescribeLogsetstool 获取 CLS 日志集列表。查询指定地域下的日志集,支持按日志集名称、日志集 ID 过滤。CredentialsEnv varsSensitive paths
获取 CLS 日志集列表。查询指定地域下的日志集,支持按日志集名称、日志集 ID 过滤。 日志集是日志主题的容器,用于区分不同项目。当多个项目存在同名日志主题时,可通过日志集区分。 支持的过滤条件: - LogsetName:按日志集名称过滤(模糊匹配) - LogsetId:按日志集 ID 过滤(精确匹配) 返回信息包含:LogsetId(日志集 ID)、LogsetName(日志集名称)、Region(地域)、CreateTime(创建时间)、TopicCount(日志主题数目)、MetricTopicCount(指标主题数目)。
DescribeNoticeContentstool 获取 CLS 通知内容模板列表。查询指定地域下的通知内容模板,模板定义告警触发和恢复时的消息内容,支持邮件、短信、企业微信、Webhook 等渠道。CredentialsEnv varsSensitive paths
获取 CLS 通知内容模板列表。查询指定地域下的通知内容模板,模板定义告警触发和恢复时的消息内容,支持邮件、短信、企业微信、Webhook 等渠道。 支持的过滤条件(Filters 参数): - name: 按模板名称过滤 - noticeContentId: 按模板 ID 过滤 返回信息包含:NoticeContentId、Name、Type、NoticeContents(各渠道内容配置)、CreateTime、UpdateTime 等。
DescribeTopicstool 按名称搜索日志主题或指标主题信息,返回主题 ID、名称、保留周期等信息。CredentialsEnv varsSensitive paths
按名称搜索日志主题或指标主题信息,返回主题 ID、名称、保留周期等信息。 支持的过滤条件: - TopicId:按主题 ID 过滤(精确匹配) - TopicName:按主题名称过滤(默认模糊匹配) - LogsetId:按日志集 ID 过滤(精确匹配) - LogsetName:按日志集名称过滤(默认模糊匹配) PreciseSearch 控制模糊/精确匹配:0=两者均模糊(默认),1=TopicName 精确,2=LogsetName 精确,3=两者均精确。 返回信息包含:TopicId、TopicName、LogsetId、LogsetName、Region、StorageType(hot/cold)、Period。
DescribeWebCallbackstool 获取 CLS 告警回调配置列表。查询指定地域下的 Webhook 回调配置,用于在告警触发或恢复时向指定 URL 发送 HTTP 通知,常用于与第三方监控系统或自动化运维系统集成。CredentialsEnv varsSensitive paths
获取 CLS 告警回调配置列表。查询指定地域下的 Webhook 回调配置,用于在告警触发或恢复时向指定 URL 发送 HTTP 通知,常用于与第三方监控系统或自动化运维系统集成。 支持的过滤条件(Filters 参数): - name: 按回调配置名称过滤 - callbackId: 按回调配置 ID 过滤 返回信息包含:CallbackId、Name、Url、Method、Headers、Body、CreateTime、UpdateTime 等。
GetAlarmDetailtool 通过告警详情 URL 获取 CLS 告警的详细信息。从告警通知中的 URL 提取并解析告警信息,支持短链接和长链接格式。NetworkCredentialsEnv varsSensitive pathsoutside text
通过告警详情 URL 获取 CLS 告警的详细信息。从告警通知中的 URL 提取并解析告警信息,支持短链接和长链接格式。 支持的 URL 格式: 1. 短链接:https://alarm.cls.tencentcs.com/WeNZ5sSP 2. 短链接:https://mc.tencent.com/xxx 3. 长链接:https://ap-guangzhou-monitor.cls.tencentcs.com/cls_no_login?action=GetAlertDetailPage#/alert?RecordId=xxx 返回 Markdown 格式的告警详细信息,包含: - 告警基本信息(名称、ID、地域) - 告警详细数据(监控对象、触发时间、持续时间、触发条件) - 触发语句(CQL 查询) - 多维分析结果(字段分布、查询结果表格) 应用场景:直接粘贴告警通知中的 URL 即可获取完整告警信息,用于快速排查和分析。
GetAlarmLogtool 获取 CLS 告警执行详情日志。查询指定时间范围内的告警策略执行详情,使用方式类似 SearchLog,通过 Query 参数传入检索分析语句。CredentialsEnv varsSensitive paths
获取 CLS 告警执行详情日志。查询指定时间范围内的告警策略执行详情,使用方式类似 SearchLog,通过 Query 参数传入检索分析语句。 常用查询语句(直接作为 Query 参数传入): 1. 查询执行详情列表(最常用): NOT condition_evaluate_result:"Skip" AND condition_evaluate_result:[* TO *] | SELECT __TIMESTAMP__ as timestamp, alert_id, alert_name, monitored_object, topic_type, trigger, condition_evaluate_result, notification_send_result, notify_type, silent, record_id, record_group_id, summary_cn ORDER BY timestamp DESC LIMIT 1000 2. 按告警策略过滤执行详情: alert_id:"alarm-xxxx" AND NOT condition_evaluate_result:"Skip" AND condition_evaluate_result:[* TO *] | SELECT __TIMESTAMP__ as timestamp, alert_id, alert_name, monitored_object, trigger, condition_evaluate_result, notification_send_result, notify_type, silent, summary_cn ORDER BY timestamp DESC LIMIT 1000 3. 按监控对象过滤执行详情: monitored_object:"topic-id-xxxx" AND NOT condition_evaluate_result:"Skip" AND condition_evaluate_result:[* TO *] | SELECT __TIMESTAMP__ as timestamp, alert_id, alert_name, monitored_object, trigger, condition_evaluate_result, notification_send_result, notify_type, silent, summary_cn ORDER BY timestamp DESC LIMIT 1000 4. 查询执行失败的记录: condition_evaluate_result:"ProcessError" | SELECT __TIMESTAMP__ as timestamp, alert_id, alert_name, monitored_object, trigger, condition_evaluate_result, summary_cn ORDER BY timestamp DESC LIMIT 1000 5. 查询通知失败的记录: (notification_send_result:"SendFail" OR notification_send_result:"SendPartFail") | SELECT __TIMESTAMP__ as timestamp, alert_id, alert_name, monitored_object, notification_send_result, summary_cn ORDER BY timestamp DESC LIMIT 1000 6. 统计各告警策略执行次数 Top 50: NOT condition_evaluate_result:"Skip" AND condition_evaluate_result:[* TO *] | SELECT alert_id, alert_name, count(*) AS total, count_if(condition_evaluate_result='ProcessError') AS failure_count, count_if(notification_send_result!='NotSend') AS notify_total, count_if(notification_send_result='SendFail' OR notification_send_result='SendPartFail') AS notify_failure_count GROUP BY alert_id, alert_name ORDER BY total DESC LIMIT 50 常用过滤字段及枚举值: - alert_id: 告警策略ID - monitored_object: 监控对象(日志主题ID) - condition_evaluate_result: QueryResultMatch(满足) / QueryResultUnmatch(不满足) / ProcessError(执行失败) / Skip(跳过) - notification_send_result: SendSuccess(成功) / SendFail(失败) / SendPartFail(部分失败) / NotSend(未发送) 分页说明:首次不传 Context;若返回 ListOver 为 false,用返回的 Context 获取后续数据。Context 有效期 1 小时,翻页时请勿修改其他参数,总计最多获取 1 万条。SQL 分析结果的分页请使用 LIMIT/OFFSET。 返回信息:SQL 分析时返回 AnalysisRecords;非 SQL 查询时返回 Results 列表(每条含 Time、LogJson)、Context(分页标识)、ListOver(是否查询完毕)。
GetRegionCodeByNametool 按地域名称搜索腾讯云地域参数代码(如"广州"→"ap-guangzhou"),支持中文和英文名称模糊匹配。NetworkCredentialsEnv varsSensitive paths
按地域名称搜索腾讯云地域参数代码(如"广州"→"ap-guangzhou"),支持中文和英文名称模糊匹配。
QueryMetrictool 针对指标主题,查询指定时刻指标的最新值(瞬时查询)。使用 PromQL 语法对指标主题中的数据进行查询。注意:若该时刻向前推5分钟内均无指标数据,则无相应查询结果。CredentialsEnv varsSensitive paths
针对指标主题,查询指定时刻指标的最新值(瞬时查询)。使用 PromQL 语法对指标主题中的数据进行查询。注意:若该时刻向前推5分钟内均无指标数据,则无相应查询结果。 PromQL 语法示例: - 简单查询:ETLProcessingTraffic - 速率计算:rate(http_requests_total[5m]) - 聚合查询:sum(cpu_usage) by (instance) - 参考文档:https://cloud.tencent.com/document/product/614/90334
QueryRangeMetrictool 针对指标主题,查询指定时间范围内指标的变化趋势(范围查询)。使用 PromQL 语法对指标主题中的数据进行时序查询,返回区间内的时序数据。CredentialsEnv varsSensitive paths
针对指标主题,查询指定时间范围内指标的变化趋势(范围查询)。使用 PromQL 语法对指标主题中的数据进行时序查询,返回区间内的时序数据。 step 参数建议:根据查询时间范围合理设置数据点密度 - 1 小时内:step=60(每分钟) - 1 天内:step=300(每 5 分钟) - 1 周内:step=3600(每小时) - 1 月内:step=86400(每天)
SearchLogtool 搜索CLS日志内容。在指定日志主题和时间范围内搜索日志,支持复杂查询语法和统计分析。CredentialsEnv varsSensitive paths
搜索CLS日志内容。在指定日志主题和时间范围内搜索日志,支持复杂查询语法和统计分析。 重要:务必先使用 TextToSearchLogQuery 工具生成 CQL 查询语句! TextToSearchLogQuery 能自动适配日志主题索引配置,确保字段名称准确、语法正确。 警告:如果不使用 TextToSearchLogQuery 生成 CQL,直接手写很可能出现字段名称错误、语法不规范等问题导致查询失败。 与 DescribeLogHistogram 的分工: - SearchLog 支持 SQL 分析(管道符 |),可实现按时间分组统计、多维聚合等复杂分析,功能更强大,优先使用 - DescribeLogHistogram 仅返回时间和计数两个维度,适用于不支持 SQL 分析的日志主题(如低频存储主题) 后续操作: - 查看某条日志的上下文:使用返回结果中的 PkgId、PkgLogId、Time 调用 DescribeLogContext 工具 CQL(Cloud Query Language)语法说明: 1. 全文检索:直接输入关键词,如 error;多关键词空格分隔默认 OR 关系 2. 键值检索:key:value 格式,如 level:ERROR、status:404 3. 短语检索:双引号包裹,如 name:"john Smith" 4. 模糊检索:* 匹配多字符,? 匹配单字符,如 host:www.test*.com 5. 数值比较:支持 >、>=、<、<=、=,如 status:>400 6. 范围检索:使用比较运算符组合,如 status:>=400 AND status:<500 7. 逻辑运算符:AND、OR、NOT,支持括号组合,如 (level:ERROR OR level:WARNING) AND pid:1234 8. SQL 分析(管道符 |): - 聚合统计:* | SELECT count(*) AS total - 分组统计:* | SELECT count(*) AS cnt, level GROUP BY level - 排序限制:* | SELECT count(*) AS cnt, host GROUP BY host ORDER BY cnt DESC LIMIT 10 - 条件过滤:* | SELECT * WHERE response_time > 1000
TextToSearchLogQuerytool 【CQL专家】AI 智能生成 CLS CQL 查询语句。将自然语言描述转换为可直接用于 SearchLog 或 DescribeLogHistogram 的 CQL 语句。CredentialsEnv varsSensitive paths
【CQL专家】AI 智能生成 CLS CQL 查询语句。将自然语言描述转换为可直接用于 SearchLog 或 DescribeLogHistogram 的 CQL 语句。 核心优势: 1. 自动适配日志主题索引配置,字段名称 100% 准确 2. 严格遵循 CQL 语法规范,生成的语句保证可执行 3. 查询性能经过优化,执行效率高 4. 支持从简单过滤到复杂聚合的所有查询场景 5. 自动进行语法校验,确保语句正确性 警告:如果不使用本工具生成 CQL,直接手写一定会出现以下问题: - 字段名称错误,导致查询无结果 - 语法不符合 CQL 规范,导致查询失败 - 统计逻辑错误,导致结果不符合预期 典型应用场景: - 简单过滤:"查询 ERROR 级别日志" → level:'error' - 字段统计:"查看 IP 分布" → * | SELECT IP, count(*) AS cnt GROUP BY IP ORDER BY cnt DESC - 复杂聚合:"按小时统计各状态码数量" → * | SELECT histogram(__TIMESTAMP__, INTERVAL 1 HOUR) AS hour, status_code, count(*) GROUP BY hour, status_code - 多维分析:"按地域和业务分组,统计错误数>100的" → level:ERROR | SELECT region, service, count(*) AS error_count GROUP BY region, service HAVING error_count > 100 响应格式说明: 返回文本第一行为 "SessionId: xxx",是本次调用的会话标识,后续连续调用本工具时请作为 SessionId 参数传入 第二行以 "Content: " 开头,其后为本工具返回的正文,从中提取生成的 CQL 语句
Text the model reads (20)
Every tool, prompt and resource description as written in the code: the model sees all of it, the user usually does not.
DescribeAlarms tool
获取 CLS 告警策略列表。查询指定地域的告警策略列表,支持按告警策略启用状态等条件过滤和分页。
支持的过滤条件(Filters 参数):
- name: 按告警策略名称过滤
- alarmId: 按告警策略 ID 过滤
- topicId: 按监控对象的日志主题 ID 过滤
- enable: 按启用状态过滤(1=启用,0=禁用),如 [{Key: 'enable', Values: ['1']}]DescribeAlertRecordHistory tool
获取 CLS 告警历史记录。查询指定时间范围内的告警历史记录,包含告警触发、恢复等事件的详细信息,用于分析告警趋势和排查告警问题。 支持的过滤条件(Filters 参数): - alarmId: 按告警策略 ID 过滤 - alarmName: 按告警策略名称过滤 - topicId: 按日志主题 ID 过滤 - status: 按告警状态过滤(0-未恢复,1-已恢复) 返回信息包含:TotalCount(总数)、Records 列表(每条记录含 RecordId、AlarmId、AlarmName、TopicId、TopicName、Region、Trigger、TriggerCount、AlarmLevel、Status、CreateTime、Duration、NotifyStatus)。
GetAlarmLog tool
获取 CLS 告警执行详情日志。查询指定时间范围内的告警策略执行详情,使用方式类似 SearchLog,通过 Query 参数传入检索分析语句。 常用查询语句(直接作为 Query 参数传入): 1. 查询执行详情列表(最常用): NOT condition_evaluate_result:"Skip" AND condition_evaluate_result:[* TO *] | SELECT __TIMESTAMP__ as timestamp, alert_id, alert_name, monitored_object, topic_type, trigger, condition_evaluate_result, notification_send_result, notify_type, silent, record_id, record_group_id, summary_cn ORDER BY timestamp DESC LIMIT 1000 2. 按告警策略过滤执行详情: alert_id:"alarm-xxxx" AND NOT condition_evaluate_result:"Skip" AND condition_evaluate_result:[* TO *] | SELECT __TIMESTAMP__ as timestamp, alert_id, alert_name, monitored_object, trigger, condition_evaluate_result, notification_send_result, notify_type, silent, summary_cn ORDER BY timestamp DESC LIMIT 1000 3. 按监控对象过滤执行详情: monitored_object:"topic-id-xxxx" AND NOT condition_evaluate_result:"Skip" AND condition_evaluate_result:[* TO *] | SELECT __TIMESTAMP__ as timestamp, alert_id, alert_name, monitored_object, trigger, condition_evaluate_result, notification_send_result, notify_type, silent, summary_cn ORDER BY timestamp DESC LIMIT 1000 4. 查询执行失败的记录: condition_evaluate_result:"ProcessError" | SELECT __TIMESTAMP__ as timestamp, alert_id, alert_name, monitored_object, trigger, condition_evaluate_result, summary_cn ORDER BY timestamp DESC LIMIT 1000 5. 查询通知失败的记录: (notification_send_result:"SendFail" OR notification_send_result:"SendPartFail") | SELECT __TIMESTAMP__ as timestamp, alert_id, alert_name, monitored_object, notification_send_result, summary_cn ORDER BY timestamp DESC LIMIT 1000 6. 统计各告警策略执行次数 Top 50: NOT condition_evaluate_result:"Skip" AND condition_evaluate_result:[* TO *] | SELECT alert_id, alert_name, count(*) AS total, count_if(condition_evaluate_result='ProcessError') AS failure_count, count_if(notification_send_result!='NotSend') AS notify_total, count_if(notification_send_result='SendFail' OR notification_send_result='SendPartFail') AS notify_failure_count GROUP BY alert_id, alert_name ORDER BY total DESC LIMIT 50 常用过滤字段及枚举值: - alert_id: 告警策略ID - monitored_object: 监控对象(日志主题ID) - condition_evaluate_result: QueryResultMatch(满足) / QueryResultUnmatch(不满足) / ProcessError(执行失败) / Skip(跳过) - notification_send_result: SendSuccess(成功) / SendFail(失败) / SendPartFail(部分失败) / NotSend(未发送) 分页说明:首次不传 Context;若返回 ListOver 为 false,用返回的 Context 获取后续数据。Context 有效期 1 小时,翻页时请勿修改其他参数,总计最多获取 1 万条。SQL 分析结果的分页请使用 LIMIT/OFFSET。 返回信息:SQL 分析时返回 AnalysisRecords;非 SQL 查询时返回 Results 列表(每条含 Time、LogJson)、Context(分页标识)、ListOver(是否查询完毕)。
DescribeAlarmNotices tool
获取 CLS 通知渠道组列表。查询指定地域下的通知渠道组列表,通知渠道组用于配置告警通知的接收方式和接收人,包括邮件、短信、电话、企业微信等。 支持的过滤条件(Filters 参数): - name: 按通知渠道组名称过滤 - alarmNoticeId: 按通知渠道组 ID 过滤 返回信息包含:AlarmNoticeId、Name、NoticeReceivers、WebCallbacks、CreateTime、UpdateTime 等。
DescribeAlarmShields tool
获取 CLS 告警屏蔽规则列表。查询指定通知渠道组下的告警屏蔽规则,屏蔽规则用于在特定时间段内屏蔽告警通知,避免维护期间产生大量告警噪音。
应用场景:
1. 查看某个通知渠道组下配置的所有屏蔽规则
2. 查询当前生效的屏蔽规则(按状态过滤)
3. 审计和管理告警屏蔽配置
支持的过滤条件(Filters 参数):
- shieldId: 按屏蔽规则 ID 过滤,如 [{Key: 'shieldId', Values: ['shield-xxx']}]
- name: 按屏蔽规则名称过滤,如 [{Key: 'name', Values: ['维护屏蔽']}]
- status: 按状态过滤(enabled=启用,disabled=禁用),如 [{Key: 'status', Values: ['enabled']}]DescribeNoticeContents tool
获取 CLS 通知内容模板列表。查询指定地域下的通知内容模板,模板定义告警触发和恢复时的消息内容,支持邮件、短信、企业微信、Webhook 等渠道。 支持的过滤条件(Filters 参数): - name: 按模板名称过滤 - noticeContentId: 按模板 ID 过滤 返回信息包含:NoticeContentId、Name、Type、NoticeContents(各渠道内容配置)、CreateTime、UpdateTime 等。
DescribeWebCallbacks tool
获取 CLS 告警回调配置列表。查询指定地域下的 Webhook 回调配置,用于在告警触发或恢复时向指定 URL 发送 HTTP 通知,常用于与第三方监控系统或自动化运维系统集成。 支持的过滤条件(Filters 参数): - name: 按回调配置名称过滤 - callbackId: 按回调配置 ID 过滤 返回信息包含:CallbackId、Name、Url、Method、Headers、Body、CreateTime、UpdateTime 等。
GetAlarmDetail tool
通过告警详情 URL 获取 CLS 告警的详细信息。从告警通知中的 URL 提取并解析告警信息,支持短链接和长链接格式。 支持的 URL 格式: 1. 短链接:https://alarm.cls.tencentcs.com/WeNZ5sSP 2. 短链接:https://mc.tencent.com/xxx 3. 长链接:https://ap-guangzhou-monitor.cls.tencentcs.com/cls_no_login?action=GetAlertDetailPage#/alert?RecordId=xxx 返回 Markdown 格式的告警详细信息,包含: - 告警基本信息(名称、ID、地域) - 告警详细数据(监控对象、触发时间、持续时间、触发条件) - 触发语句(CQL 查询) - 多维分析结果(字段分布、查询结果表格) 应用场景:直接粘贴告警通知中的 URL 即可获取完整告警信息,用于快速排查和分析。
SearchLog tool
搜索CLS日志内容。在指定日志主题和时间范围内搜索日志,支持复杂查询语法和统计分析。 重要:务必先使用 TextToSearchLogQuery 工具生成 CQL 查询语句! TextToSearchLogQuery 能自动适配日志主题索引配置,确保字段名称准确、语法正确。 警告:如果不使用 TextToSearchLogQuery 生成 CQL,直接手写很可能出现字段名称错误、语法不规范等问题导致查询失败。 与 DescribeLogHistogram 的分工: - SearchLog 支持 SQL 分析(管道符 |),可实现按时间分组统计、多维聚合等复杂分析,功能更强大,优先使用 - DescribeLogHistogram 仅返回时间和计数两个维度,适用于不支持 SQL 分析的日志主题(如低频存储主题) 后续操作: - 查看某条日志的上下文:使用返回结果中的 PkgId、PkgLogId、Time 调用 DescribeLogContext 工具 CQL(Cloud Query Language)语法说明: 1. 全文检索:直接输入关键词,如 error;多关键词空格分隔默认 OR 关系 2. 键值检索:key:value 格式,如 level:ERROR、status:404 3. 短语检索:双引号包裹,如 name:"john Smith" 4. 模糊检索:* 匹配多字符,? 匹配单字符,如 host:www.test*.com 5. 数值比较:支持 >、>=、<、<=、=,如 status:>400 6. 范围检索:使用比较运算符组合,如 status:>=400 AND status:<500 7. 逻辑运算符:AND、OR、NOT,支持括号组合,如 (level:ERROR OR level:WARNING) AND pid:1234 8. SQL 分析(管道符 |): - 聚合统计:* | SELECT count(*) AS total - 分组统计:* | SELECT count(*) AS cnt, level GROUP BY level - 排序限制:* | SELECT count(*) AS cnt, host GROUP BY host ORDER BY cnt DESC LIMIT 10 - 条件过滤:* | SELECT * WHERE response_time > 1000
DescribeLogContext tool
获取指定日志的上下文内容(前后 N 条日志)。用于在定位到某条异常日志后,查看其前后的日志以分析问题根因。 前置条件:需先使用 SearchLog 工具检索到目标日志,从返回结果的 Results 中获取 Time、PkgId、PkgLogId 三个必填参数。
TextToSearchLogQuery tool
【CQL专家】AI 智能生成 CLS CQL 查询语句。将自然语言描述转换为可直接用于 SearchLog 或 DescribeLogHistogram 的 CQL 语句。 核心优势: 1. 自动适配日志主题索引配置,字段名称 100% 准确 2. 严格遵循 CQL 语法规范,生成的语句保证可执行 3. 查询性能经过优化,执行效率高 4. 支持从简单过滤到复杂聚合的所有查询场景 5. 自动进行语法校验,确保语句正确性 警告:如果不使用本工具生成 CQL,直接手写一定会出现以下问题: - 字段名称错误,导致查询无结果 - 语法不符合 CQL 规范,导致查询失败 - 统计逻辑错误,导致结果不符合预期 典型应用场景: - 简单过滤:"查询 ERROR 级别日志" → level:'error' - 字段统计:"查看 IP 分布" → * | SELECT IP, count(*) AS cnt GROUP BY IP ORDER BY cnt DESC - 复杂聚合:"按小时统计各状态码数量" → * | SELECT histogram(__TIMESTAMP__, INTERVAL 1 HOUR) AS hour, status_code, count(*) GROUP BY hour, status_code - 多维分析:"按地域和业务分组,统计错误数>100的" → level:ERROR | SELECT region, service, count(*) AS error_count GROUP BY region, service HAVING error_count > 100 响应格式说明: 返回文本第一行为 "SessionId: xxx",是本次调用的会话标识,后续连续调用本工具时请作为 SessionId 参数传入 第二行以 "Content: " 开头,其后为本工具返回的正文,从中提取生成的 CQL 语句
DescribeIndex tool
获取 CLS 日志主题索引配置。查询指定日志主题的索引配置信息,包括键值索引、元数据索引(TAG)和全文索引的详细配置。 索引配置决定了日志哪些字段可以被搜索和分析,是日志检索和分析的基础配置。 使用场景:生成检索语句时,推荐优先使用 TextToSearchLogQuery 工具(自动适配索引配置)。仅在需要手写 CQL 查询时,才使用本工具了解日志主题有哪些可检索字段及其类型。 返回字段包含:字段名及其 type(类型)、sql_flag(是否支持 SQL 分析)、description(字段描述);__TAG__(元数据索引);__FULLTEXT__(全文索引)。
DescribeLogHistogram tool
获取 CLS 日志直方图数据。查询指定日志主题在指定时间范围内的日志分布直方图,统计各时间段内匹配查询条件的日志数量。 重要:本工具仅返回时间(BTime)和计数(Count)两个维度,无法做多字段聚合分析。 - 如果日志主题支持 SQL 分析(标准存储),应优先使用 SearchLog 工具通过管道符 | 进行时间分组统计,功能更强大 - 本工具适用于不支持 SQL 分析的日志主题(如低频存储主题),或只需快速查看日志量时间趋势的场景 Query 参数使用 CQL 语法,建议先使用 TextToSearchLogQuery 生成。 返回信息包含:Interval(时间间隔)、TotalCount(总日志条数)、HistogramInfos(各时间段的 BTime 起始时间和 Count 日志计数)。
QueryMetric tool
针对指标主题,查询指定时刻指标的最新值(瞬时查询)。使用 PromQL 语法对指标主题中的数据进行查询。注意:若该时刻向前推5分钟内均无指标数据,则无相应查询结果。 PromQL 语法示例: - 简单查询:ETLProcessingTraffic - 速率计算:rate(http_requests_total[5m]) - 聚合查询:sum(cpu_usage) by (instance) - 参考文档:https://cloud.tencent.com/document/product/614/90334
QueryRangeMetric tool
针对指标主题,查询指定时间范围内指标的变化趋势(范围查询)。使用 PromQL 语法对指标主题中的数据进行时序查询,返回区间内的时序数据。 step 参数建议:根据查询时间范围合理设置数据点密度 - 1 小时内:step=60(每分钟) - 1 天内:step=300(每 5 分钟) - 1 周内:step=3600(每小时) - 1 月内:step=86400(每天)
DescribeTopics tool
按名称搜索日志主题或指标主题信息,返回主题 ID、名称、保留周期等信息。 支持的过滤条件: - TopicId:按主题 ID 过滤(精确匹配) - TopicName:按主题名称过滤(默认模糊匹配) - LogsetId:按日志集 ID 过滤(精确匹配) - LogsetName:按日志集名称过滤(默认模糊匹配) PreciseSearch 控制模糊/精确匹配:0=两者均模糊(默认),1=TopicName 精确,2=LogsetName 精确,3=两者均精确。 返回信息包含:TopicId、TopicName、LogsetId、LogsetName、Region、StorageType(hot/cold)、Period。
DescribeLogsets tool
获取 CLS 日志集列表。查询指定地域下的日志集,支持按日志集名称、日志集 ID 过滤。 日志集是日志主题的容器,用于区分不同项目。当多个项目存在同名日志主题时,可通过日志集区分。 支持的过滤条件: - LogsetName:按日志集名称过滤(模糊匹配) - LogsetId:按日志集 ID 过滤(精确匹配) 返回信息包含:LogsetId(日志集 ID)、LogsetName(日志集名称)、Region(地域)、CreateTime(创建时间)、TopicCount(日志主题数目)、MetricTopicCount(指标主题数目)。
GetRegionCodeByName tool
按地域名称搜索腾讯云地域参数代码(如"广州"→"ap-guangzhou"),支持中文和英文名称模糊匹配。
ConvertTimeStringToTimestamp tool
将时间字符串转换为毫秒或秒级时间戳。常用于为 SearchLog、DescribeLogHistogram 等工具的 From/To 参数准备时间戳。
ConvertTimestampToTimeString tool
将时间戳转换为时间字符串。不传 timestamp 参数时返回当前时间,常用于获取当前时间后计算 SearchLog 等工具所需的时间范围。
What we checked
The same checks run on every server. Each line below has one of these marks:
- 8 checks: command injection, argument injection, path traversal, server-side request forgery, SQL injection, code execution, unsafe deserialization, template injectionChecked on every scan. Results in this category are published only after a person has verified them.
- Runs programs the caller choosesNo tool runs a command or program the caller supplies — 20 tool handlers traced
- Executes caller-supplied codeNo tool evaluates code the caller supplies — 20 tool handlers traced
- Reads or writes any file pathNo tool works on a file path the caller supplies without a root check — 20 tool handlers traced
- Requests any addressNo tool sends a request to an address the caller supplies — 20 tool handlers traced
- Runs caller-supplied SQLNo tool executes a query the caller supplies — 20 tool handlers traced
- Tools that start processesNot seen in the traced code of 20 capabilities; 20 more call code the scanner could not follow, where it may happen
- Tools that touch filesNot seen in the traced code of 20 capabilities; 20 more call code the scanner could not follow, where it may happen
- Tools that call the network2 of 20 capabilities call the network; 18 more call code the scanner could not follow, where it may happen
Where the code is: 20 handlers in 4 files at commit 5ea952a9d2e0
src/tools/alarm.tsDescribeAlarms, DescribeAlertRecordHistory, GetAlarmLog, DescribeAlarmNotices, DescribeAlarmShields, DescribeNoticeContents, DescribeWebCallbacks, GetAlarmDetailsrc/tools/log-search.tsSearchLog, DescribeLogContext, TextToSearchLogQuery, DescribeIndex, DescribeLogHistogramsrc/tools/metric.tsQueryMetric, QueryRangeMetricsrc/tools/utility.tsDescribeTopics, DescribeLogsets, GetRegionCodeByName, ConvertTimeStringToTimestamp, ConvertTimestampToTimeString
- 5 checks: tool poisoning, instruction override, hidden content, exfiltration requests, metadata integrityChecked on every scan. Results in this category are published only after a person has verified them.
- Dependency manifests1 manifest: package.json
- Lockfiles checked against OSV1 file resolved and checked against the OSV database
- Known vulnerabilities in production dependenciesNo production dependency with a known advisory
- Known vulnerabilities in other dependenciesNo package used only for development, tests or examples has a known advisory
- MCP SDK version@modelcontextprotocol/sdk ^1.32.2
- 3 checks: credential harvesting, undeclared credential access, credentials sent over the networkChecked on every scan. Results in this category are published only after a person has verified them.
- Tools that read credentials18 of 20 capabilities read credentials; 2 more call code the scanner could not follow, where it may happen
- Environment variables20 capabilities read environment variables (often API keys)
- Authentication declaredNot checked: needs the live server's tools/list (a remote server declares how clients authenticate)
- 3 checks: undeclared network access, undeclared file access, undeclared process executionChecked on every scan. Results in this category are published only after a person has verified them.
- Tool descriptions presentEvery tool has a description the model and the user can read
- Statically known namesEvery tool's name could be read from the code
- Input schemasNot checked: needs the live server's tools/list (every tool declares an input schema)
- Destructive tools annotatedNot checked: needs the live server's tools/list (tools that write, delete or run commands carry destructivehint)
Dependencies with known vulnerabilities (0 in production)
No known vulnerabilities in the production dependencies that could be checked.
Past security advisories
Vulnerabilities published for this server itself, from the GitHub Advisory Database.
No security advisories have been published for this server in the GitHub Advisory Database.
How it runs
| Where it runs | On your machine, started by your MCP client from this repository or its package |
|---|---|
| Transport | Streamable HTTP, SSE, stdio |
| Sign-in | not checked needs the live server |
| MCP SDK | @modelcontextprotocol/sdk ^1.32.2 |
| Servers in the code | 1 (cls-mcp-server) |
The project's own security
| Security policy | none no SECURITY.md in the repository: report issues privately through GitHub if it is enabled |
|---|---|
| Past advisories | none in the GitHub Advisory Database |
| Last push | 2026-11-13 |
| Signed releases | not checked yet |
Install it
For the server's own npm package cls-mcp-server. Pin a version ([email protected]) so an update cannot change the tools without you noticing.
Claude Desktop claude_desktop_config.json
{
"mcpServers": {
"cls-mcp-server": {
"command": "npx",
"args": [
"-y",
"cls-mcp-server"
],
"env": {
"TENCENTCLOUD_SECRET_ID": "<your tencentcloud_secret_id>",
"TENCENTCLOUD_SECRET_KEY": "<your tencentcloud_secret_key>"
}
}
}
}Cursor ~/.cursor/mcp.json
{
"mcpServers": {
"cls-mcp-server": {
"command": "npx",
"args": [
"-y",
"cls-mcp-server"
],
"env": {
"TENCENTCLOUD_SECRET_ID": "<your tencentcloud_secret_id>",
"TENCENTCLOUD_SECRET_KEY": "<your tencentcloud_secret_key>"
}
}
}
}VS Code .vscode/mcp.json
{
"servers": {
"cls-mcp-server": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"cls-mcp-server"
],
"env": {
"TENCENTCLOUD_SECRET_ID": "<your tencentcloud_secret_id>",
"TENCENTCLOUD_SECRET_KEY": "<your tencentcloud_secret_key>"
}
}
}
}Claude Code terminal
claude mcp add cls-mcp-server -e TENCENTCLOUD_SECRET_ID=... -e TENCENTCLOUD_SECRET_KEY=... -- npx -y cls-mcp-serverWhere it is published
| npm package | cls-mcp-server |
|---|---|
| Downloads | 4 253 a month on npm |
| Listed in | 4 catalogs (github_search, glama, mcp_toplist, npm) |
| License | NOASSERTION |
| Created | 2026-04-13 |
Attack map
How the server is built and where its risky tools lead: servers, their tools, what the tools' code can do, and the traced route from a declared risky tool's argument to the operation it reaches. Click a node for details.