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

emp-mcp-test

v1.0.6

Published

这是一个 Model Context Protocol (MCP) 服务器,用于打开 EMP 门户网站。

Readme

EMP MCP Server

这是一个 Model Context Protocol (MCP) 服务器,用于打开 EMP 门户网站。

功能

  • open_emp: 在用户的默认浏览器中打开 EMP 门户
  • smart_analyze_page: EMP 专用智能识别(导航、菜单、标签页、按钮、输入框、表格工具栏、分页)
  • inspect_frame_tree: 查看当前页面 frame 树结构
  • get_page_snapshot: 获取当前页面快照摘要
  • list_console_messages: 查看最近浏览器控制台消息
  • list_network_requests: 查看最近浏览器网络请求摘要
  • apply_business_trip: 进入出差申请并校验表单是否出现
  • fill_business_trip_form: 填写出差申请三字段(出差日期、销差日期、出差事由)
  • submit_business_trip_form: 用户确认无误后提交出差申请

出差申请的信息收集规则:

  • 只需要三项:出差日期销差日期出差事由
  • 应一次性问完,不要分多轮追问
  • 目的地 不是必填项

使用方法

1. 通过 npx 直接运行(推荐)

在 Cursor 的 mcpServers 配置中添加:

{
  "mcpServers": {
    "emp-mcp": {
      "command": "npx",
      "args": ["-y", "emp-mcp-test"]
    }
  }
}

2. 本地调试(查看最新代码效果)

如果你正在本地修改代码,请不要使用 npx -y emp-mcp-test,它会运行 npm 发布版本。
请先执行:

npm run build

然后在 Cursor 的 mcpServers 配置中改为本地入口:

{
  "mcpServers": {
    "emp-mcp": {
      "command": "node",
      "args": ["d:/自己/ai/mcp/emp-mcp/dist/index.js"]
    }
  }
}

修改后重启 Cursor 或重启 MCP 服务。

开发

  1. 克隆仓库
  2. 安装依赖: npm install
  3. 构建: npm run build
  4. 本地测试: node dist/index.js

识别说明

smart_analyze_page 已改为本地 EMP 专用识别引擎,不依赖第三方云 API,可直接离线运行(仅依赖 Playwright 打开的网页上下文)。

诊断工具

为了减少模型在页面里盲试,本项目新增了几类只读诊断工具:

  • inspect_frame_tree
    • 用于确认当前页面的 iframe / frame 结构
  • get_page_snapshot
    • 用于快速读取每个 frame 的标题、按钮、标签、正文摘要
  • list_console_messages
    • 用于查看最近前端报错、警告和运行日志
  • list_network_requests
    • 用于查看最近接口请求、资源请求和状态码

排查问题时,优先使用这些只读诊断工具,而不是直接反复点击页面元素。

动作执行器

项目正在把常用浏览器动作逐步收敛到共享执行器,避免每个业务模块重复实现一套点击和提交判断。

当前已共享的能力包括:

  • 首个可见按钮点击
  • Element Plus el-select 选择
  • 固定 selector + index 的 checkbox 勾选/切换
  • Element Plus 日期输入写值与事件触发
  • 提交后的结果判定
    • 成功
    • 失败
    • 未知
  • 提交后只读检测:
    • 弹窗文本
    • 表单是否仍然可见
    • 提交 按钮是否仍然可见

后续新增业务流程时,优先复用共享动作执行器,而不是在模块里重新各写一套提交逻辑。

iframe 规则

  • MCP 不应擅自把任何 EMP iframe 模块 URL 单独打开
  • 如需分析或操作模块内容,应先通过 EMP 首页、菜单、卡片、tab 或业务入口进入该模块
  • 如果目标模块已经在当前页面的 frame 中打开,应直接复用当前上下文

补签页专用规则

  • “通宵加班”旁边的 checkbox 固定为:
    • document.querySelectorAll('.el-form .el-checkbox input.el-checkbox__original')[0]
  • “签到补签”旁边的 checkbox 固定为:
    • document.querySelectorAll('.el-form .el-checkbox input.el-checkbox__original')[1]
  • “签退补签”旁边的 checkbox 固定为:
    • document.querySelectorAll('.el-form .el-checkbox input.el-checkbox__original')[2]
  • 这个页面的 checkbox 必须优先走上面这条 input.click() 硬逻辑,不要改成点文字、点 wrapper、点 inner 的通用策略
  • 不要让模型在补签页反复用 click_elementsmart_analyze_pageget_page_elements 去瞎找 checkbox