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 🙏

© 2025 – Pkg Stats / Ryan Hefner

universal-cli-history-mcp

v1.0.0

Published

Universal MCP server for managing CLI command history across multiple tools

Readme

Universal CLI History MCP Server

一个通用的 MCP 服务器,用于管理和搜索所有 CLI 命令行工具的历史记录。

🚀 支持的工具

Shell 工具

  • bash - .bash_history
  • zsh - .zsh_history
  • fish - fish_history
  • PowerShell - ConsoleHost_history.txt

开发工具

  • git - git commit 历史
  • Node.js - .node_repl_history
  • Python - .python_history
  • npm/yarn - package manager 命令

系统工具

  • docker - docker 相关命令
  • apt/brew - 包管理器
  • curl/wget - 网络工具
  • ssh/scp - 远程连接
  • rsync - 文件同步

通用命令

  • ls, cd, pwd, cat, grep, find
  • mkdir, rm, cp, mv
  • 所有其他系统命令

🔧 功能特性

list_history - 列出历史命令

  • 查看所有 CLI 工具的历史命令
  • 按工具过滤:git, docker, npm, node, python, shell
  • 限制返回数量

search_history - 搜索历史命令

  • 在所有历史命令中搜索关键词
  • 按工具过滤搜索范围

get_tool_stats - 使用统计

  • 查看各工具的使用频率
  • 统计总命令数
  • 识别最常用工具

execute_command - 执行命令

  • 执行 CLI 命令并自动记录到历史
  • 自动识别工具类型

📊 可用资源

cli-history://all

获取所有 CLI 历史命令的 JSON 格式数据。

cli-history://stats

获取各工具使用统计的 JSON 数据。

🛠️ 安装配置

1. 安装依赖

cd universal-cli-history-mcp
npm install
npm run build

2. 配置 Claude Desktop

{
  "mcpServers": {
    "universal-cli-history": {
      "command": "node",
      "args": ["/absolute/path/to/universal-cli-history-mcp/dist/index.js"]
    }
  }
}

3. 配置 Claude Code

{
  "mcpServers": {
    "universal-cli-history": {
      "command": "node",
      "args": ["/absolute/path/to/universal-cli-history-mcp/dist/index.js"]
    }
  }
}

🔍 使用示例

查看最近命令

list_history { "limit": 20 }

搜索 Git 命令

search_history { "query": "commit", "tool": "git" }

查看统计

get_tool_stats {}

执行命令

execute_command { "command": "git status" }

📁 项目结构

universal-cli-history-mcp/
├── src/
│   └── index.ts          # 主服务器文件
├── dist/                 # 编译输出
├── package.json
├── tsconfig.json
└── README.md

🔄 自动检测

服务器会自动检测和加载:

  • 各种 shell 的历史文件
  • Git 仓库的提交历史
  • Node.js/Python REPL 历史
  • 系统命令历史
  • Docker 相关命令

开发

运行开发版本

npm run dev

构建生产版本

npm run build

启动生产版本

npm start

📝 许可证

MIT