npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

aliyun-sls-log-mcp

v1.0.4

Published

阿里云SLS日志查询MCP服务

Readme

阿里云日志服务 (SLS) 的 MCP 查询工具,支持通过 AI 助手直接访问和分析云日志数据。

安装配置

将以下配置添加到你的 MCP 客户端配置文件中:

{
  "mcpServers": {
    "aliyun-sls": {
      "command": "npx",
      "args": [
        "-y",
        "[email protected]"
      ]
    }
  }
}

前置要求

  • Node.js >= 18.0.0
  • 阿里云 RAM 子账号的 AccessKey(需具备 SLS 只读权限)

工具列表

set_credentials

设置阿里云访问凭证,必须在使用其他工具前调用。

| 参数 | 说明 | |------|------| | access_key_id | 阿里云 AccessKey ID | | access_key_secret | 阿里云 AccessKey Secret | | endpoint | SLS 服务端点,默认 cn-hangzhou.log.aliyuncs.com |

常用端点:

  • 华东1(杭州):cn-hangzhou.log.aliyuncs.com
  • 华东2(上海):cn-shanghai.log.aliyuncs.com
  • 华北2(北京):cn-beijing.log.aliyuncs.com
  • 华南1(深圳):cn-shenzhen.log.aliyuncs.com

list_projects

列出当前凭证可访问的所有 SLS 项目。

list_logstores

列出指定项目下的所有日志库。

| 参数 | 说明 | |------|------| | project_name | 项目名称 |

get_logs

查询日志,支持 SLS 查询语法。

| 参数 | 说明 | |------|------| | project_name | 项目名称 | | logstore_name | 日志库名称 | | from_time | 开始时间(Unix 时间戳,秒) | | to_time | 结束时间(Unix 时间戳,秒) | | query | 查询语句,默认 * | | page | 页码,默认 1 | | size | 每页数量,默认 100 |

查询示例:

  • * 全部日志
  • error 包含 error 的日志
  • status:500 status 字段为 500 的日志
  • * | select count(*) SQL 分析

query_context_logs

获取指定日志的上下文,用于追溯完整请求链路。

| 参数 | 说明 | |------|------| | project_name | 项目名称 | | logstore_name | 日志库名称 | | pack_id | 日志元数据中的 tag:pack_id 字段 | | pack_meta | 日志元数据中的 pack_meta 字段 | | back_lines | 向前获取行数,默认 30 | | forward_lines | 向后获取行数,默认 30 |

get_log_histogram

获取日志时间分布直方图,用于识别异常时段和流量峰值。

| 参数 | 说明 | |------|------| | project_name | 项目名称 | | logstore_name | 日志库名称 | | from_time | 开始时间(Unix 时间戳,秒) | | to_time | 结束时间(Unix 时间戳,秒) | | query | 查询语句,默认 * |

使用场景

  • 问题排查:通过自然语言描述问题,AI 自动查询相关错误日志
  • 日志分析:统计日志趋势、识别异常模式
  • 链路追踪:根据单条日志追溯完整请求上下文
  • 运维监控:了解系统日志分布,发现流量峰值或故障时段

许可证

MIT