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

@mcpcn/mcp-open-app-roots-test

v1.0.9

Published

打开app 的 mcp服务,通过roots协议获取应用列表

Readme

启动应用程序 MCP 服务

这是一个基于 MCP (Model Context Protocol) 的应用程序启动服务,支持通过 roots 协议从外部传入应用列表。

功能特性

  • 🚀 通过应用名称搜索并启动应用程序
  • 📋 获取所有可用应用程序列表
  • 🔍 支持应用程序搜索功能
  • 🌐 跨平台支持 (Windows, macOS, Linux)
  • 📡 支持 MCP roots 协议动态配置应用列表

改造说明

与原版本不同,此版本不再自动扫描系统中的应用程序,而是通过 MCP roots 协议从客户端接收应用列表。这样可以:

  • 提高启动速度(无需扫描系统)
  • 支持自定义应用列表
  • 更好的跨平台兼容性
  • 减少系统资源占用

应用配置格式

应用程序通过 MCP roots 协议配置,URI 格式为:

app://应用名称?path=应用路径

示例配置

{
  "roots": [
    {
      "uri": "app://Visual%20Studio%20Code?path=/Applications/Visual Studio Code.app",
      "name": "VS Code"
    },
    {
      "uri": "app://Chrome?path=/Applications/Google Chrome.app", 
      "name": "Google Chrome"
    },
    {
      "uri": "app://Terminal?path=/System/Applications/Utilities/Terminal.app",
      "name": "终端"
    }
  ]
}

可用工具

1. open_app

根据应用名称搜索并打开应用程序

参数:

  • appName (string): 要打开的应用程序名称

示例:

{
  "appName": "VS Code"
}

2. get_all_apps

获取通过 roots 配置的所有应用程序

参数:

3. search_apps

搜索通过 roots 配置的应用程序

参数:

  • query (string, 可选): 搜索关键词,如果为空则返回所有应用

示例:

{
  "query": "code"
}

4. get_platform_info

获取当前操作系统信息

参数:

安装和使用

1. 安装依赖

npm install

2. 构建项目

npm run build

3. 启动服务

npm start

4. 开发模式

npm run dev

平台支持

  • macOS: 使用 open 命令启动应用
  • Windows: 使用 start 启动应用,并在检测到窗口后尝试使用 PowerShell + user32 API 将窗口前置/置顶
  • Linux: 直接执行应用路径

注意事项

  1. 应用路径必须是有效的可执行文件或应用包路径
  2. 在 macOS 上,应用路径通常是 .app 包的完整路径
  3. 在 Windows 上,应用路径通常是 .exe 文件的完整路径
  4. 在 Linux 上,应用路径可以是可执行文件路径或桌面文件路径
  5. Windows 出于“防抢焦点”策略限制,极少数情况下 SetForegroundWindow 可能被系统拒绝;本服务已在置顶前发送一次 Alt 键并尝试还原/显示窗口以提升成功率

错误处理

  • 如果应用未找到,会返回错误信息和可用应用列表
  • 如果应用启动失败,会返回详细的错误信息
  • 支持平台检测,确保使用正确的启动命令

版本历史

  • v1.0.16: 改造为支持 MCP roots 协议的版本
  • 移除了平台特定的应用扫描逻辑
  • 添加了动态应用列表配置支持