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

@boallin/mcp-struts2-tag-manager

v1.0.3

Published

企业级MCP服务用于管理Struts2 JSP标签组件库 - 智能检索与组件推荐

Readme

Struts2 JSP标签组件库管理MCP服务 v2.0

这是一个功能强大的企业级MCP(Model Context Protocol)服务,专门用于管理完整的Struts2 JSP标签组件库。支持52个主要标签类型,978个属性定义,覆盖企业应用的各种UI需求。

🚀 核心功能

1. 智能组件检索

  • 多维度搜索:支持按标签名称、描述、类名、分类进行搜索
  • 智能相关性排序:根据匹配度智能排序结果
  • 实时索引:自动解析XML文件构建高效索引

2. 分类浏览系统

  • 10大功能分类:基础UI、表单控件、日期时间、数据字典、业务组件、组织人员、文件上传、高级组件、权限控制、操作按钮
  • 分类导航:快速定位所需组件类型
  • 组件统计:每个分类包含的组件数量和概览

3. 详细属性管理

  • 完整属性信息:名称、描述、是否必填、支持表达式
  • 属性分类:必填属性 vs 可选属性
  • 属性搜索:根据属性名反向查找组件

4. 智能推荐系统

  • 需求匹配:根据描述推荐最适合的组件
  • 场景化推荐:基于常见使用场景推荐组件组合
  • 关键词映射:智能识别需求关键词

5. 使用示例库

  • 代码示例:每个组件都有详细的使用示例
  • 场景示例:完整的业务场景实现示例
  • 最佳实践:推荐的属性配置和用法

6. 组件对比分析

  • 多组件对比:同时对比多个组件的差异
  • 共同属性分析:识别组件间的共同点
  • 独特功能识别:突出每个组件的独特属性

7. 增强自然语言处理

  • 智能意图识别:理解复杂的查询意图
  • 多轮对话支持:支持上下文相关的查询
  • 中文友好:专门优化的中文自然语言处理

🛠️ 可用工具

基础查询工具

  • search_tags - 智能搜索标签组件
  • get_tag_details - 获取标签详细信息
  • list_all_tags - 列出所有标签组件
  • get_required_attributes - 获取必填属性
  • get_optional_attributes - 获取可选属性
  • find_tags_by_attribute - 根据属性查找标签

分类浏览工具

  • get_all_categories - 获取所有组件分类
  • get_tags_by_category - 根据分类获取标签

📦 安装和配置

1. 环境要求

  • Node.js >= 16.0.0
  • 支持ES模块的环境

2. 安装依赖

npm install

3. 启动服务

npm start          # 生产模式
npm run dev        # 开发模式(文件监听)

4. MCP客户端配置

{
  "mcpServers": {
    "struts2-tag-manager": {
      "command": "node",
      "args": ["index.js"],
      "cwd": "d:/workplace/huiyang/ai/mcp-tools"
    }
  }
}

{
  "mcpServers": {
    "struts2-tag-manager": {
      "command": "npx",
      "args": ["-y", "@boallin/[email protected]"]
    }
  }
}

🎯 支持的组件库

基础UI组件 (8个)

  • datagrid - 数据表格
  • column - 表格列
  • card - 数据卡片
  • loading - 加载提示
  • tableform - 表单布局
  • item - 表单项
  • panel - 面板容器
  • splitline - 分割线

表单控件 (11个)

  • textfield - 文本输入框
  • select - 下拉选择框
  • combobox - 组合框
  • checkbox - 复选框
  • radiobox - 单选按钮
  • switchbutton - 开关按钮
  • numberbox - 数字输入框
  • numberspinner - 数字微调器
  • timespinner - 时间微调器
  • colorpicker - 颜色选择器
  • address - 地址选择器

数据字典组件 (3个)

  • dictionaryselect - 数据字典选择框
  • dictionarycheckbox - 数据字典复选框
  • dictionaryradiobox - 数据字典单选框

业务组件 (7个)

  • statusfield - 状态字段
  • statusswitch - 状态开关
  • sexfield - 性别字段
  • sexswitch - 性别开关
  • yesornofield - 是否字段
  • yesornoswitch - 是否开关
  • authcodefield - 验证码字段

组织人员组件 (6个)

  • person - 人员选择器
  • organization - 组织选择器
  • staff - 员工选择器
  • usergroup - 用户组选择器
  • workgroup - 工作组选择器
  • listbox - 列表选择器

文件上传组件 (7个)

  • filelist - 文件列表
  • uploadlist - 上传列表
  • uploadbutton - 上传按钮
  • image - 图片上传
  • webuploadbutton - Web上传按钮
  • webuploadlist - Web上传列表
  • webfilelist - Web文件列表

高级组件 (3个)

  • tree - 树形结构
  • htmleditor - HTML编辑器
  • watermark - 水印组件

权限控制和操作按钮

  • permission - 权限控制
  • linkbutton - 链接按钮

💡 使用示例

基础查询

// 搜索组件
{
  "tool": "search_tags",
  "arguments": {
    "query": "表格"
  }
}

// 获取组件详情
{
  "tool": "get_tag_details",
  "arguments": {
    "tag_name": "datagrid"
  }
}

分类浏览

// 获取所有分类
{
  "tool": "get_all_categories"
}

// 获取特定分类的组件
{
  "tool": "get_tags_by_category",
  "arguments": {
    "category_name": "表单控件"
  }
}

🎯 支持的组件库

基础UI组件 (8个)

  • datagrid - 数据表格
  • column - 表格列
  • card - 数据卡片
  • loading - 加载提示
  • tableform - 表单布局
  • item - 表单项
  • panel - 面板容器
  • splitline - 分割线

表单控件 (11个)

  • textfield - 文本输入框
  • select - 下拉选择框
  • combobox - 组合框
  • checkbox - 复选框
  • radiobox - 单选按钮
  • switchbutton - 开关按钮
  • numberbox - 数字输入框
  • numberspinner - 数字微调器
  • timespinner - 时间微调器
  • colorpicker - 颜色选择器
  • address - 地址选择器

数据字典组件 (3个)

  • dictionaryselect - 数据字典选择框
  • dictionarycheckbox - 数据字典复选框
  • dictionaryradiobox - 数据字典单选框

业务组件 (7个)

  • statusfield - 状态字段
  • statusswitch - 状态开关
  • sexfield - 性别字段
  • sexswitch - 性别开关
  • yesornofield - 是否字段
  • yesornoswitch - 是否开关
  • authcodefield - 验证码字段

组织人员组件 (6个)

  • person - 人员选择器
  • organization - 组织选择器
  • staff - 员工选择器
  • usergroup - 用户组选择器
  • workgroup - 工作组选择器
  • listbox - 列表选择器

文件上传组件 (7个)

  • filelist - 文件列表
  • uploadlist - 上传列表
  • uploadbutton - 上传按钮
  • image - 图片上传
  • webuploadbutton - Web上传按钮
  • webuploadlist - Web上传列表
  • webfilelist - Web文件列表

高级组件 (3个)

  • tree - 树形结构
  • htmleditor - HTML编辑器
  • watermark - 水印组件

权限控制和操作按钮

  • permission - 权限控制
  • linkbutton - 链接按钮

💡 使用示例

基础查询

// 搜索组件
{
  "tool": "search_tags",
  "arguments": {
    "query": "表格"
  }
}

// 获取组件详情
{
  "tool": "get_tag_details",
  "arguments": {
    "tag_name": "datagrid"
  }
}

分类浏览

// 获取所有分类
{
  "tool": "get_all_categories"
}

// 获取特定分类的组件
{
  "tool": "get_tags_by_category",
  "arguments": {
    "category_name": "表单控件"
  }
}

🔧 技术架构

  • 运行时: Node.js + ES模块
  • 协议: MCP (Model Context Protocol)
  • 解析: xml2js - 高效XML解析
  • 数据源: hy-base.xml (5936行,52个标签类型)
  • 配置: component-categories.json + usage-examples.json

📈 性能特性

  • 内存优化: 智能缓存和索引机制
  • 快速检索: 毫秒级搜索响应
  • 并发支持: 支持多个并发查询
  • 热更新: 支持配置文件热更新

🚀 更新日志

v2.0.0 (当前版本)

  • ✅ 支持52个标签类型(从6个扩展到52个)
  • ✅ 新增10大功能分类
  • ✅ 完善的属性管理系统

v1.0.0

  • ✅ 基础标签管理
  • ✅ 属性查询
  • ✅ 简单搜索

📝 开发指南

服务会自动解析以下文件:

  • hy-base.xml - 主要组件库定义
  • component-categories.json - 组件分类配置
  • usage-examples.json - 使用示例库

修改这些文件后重启服务即可生效。