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

java-to-html-mcp

v1.0.7

Published

MCP: convert Java API interfaces/DTOs to HTML documentation (gen-doc core)

Readme

java-to-html-mcp

通用 stdio MCP 服务:把 Java API 接口 / DTO 转成 HTML 文档,并支持字段定位、增删改与变更说明生成。

| | | | --- | --- | | npm | java-to-html-mcp | | CLI / bin | java-to-html-mcp | | MCP server 名 | java-to-html | | 当前版本 | 见 package.json(要求 Cursor 侧 ≥ 1.0.3) |

本包只做本地文件与文本处理,不绑定任何业务系统、文档库或代码托管平台。落库、发 MR、业务 profile 等由调用方自行编排。

能力

  • 解析 Java → HTML + metaData
  • 在给定目录下定位、增删改 DTO 字段(默认 不写 @ApiModelProperty)
  • 生成通用变更说明(change_summary / change_json)
  • 对 before/after Java 文本做字段级 diff
  • package_info 返回运行中版本,便于排查 npx 缓存旧包

MCP Tools

| Tool | 作用 | | --- | --- | | package_info | 运行中包名/版本门禁 | | regenerate_html | entryFiles + 可选 path 入参/出参 / merge → HTML + meta | | locate_field | 在 searchRoots 下按 className / fieldName 定位 | | apply_field_change | add / update / remove 字段;支持 dryRun | | build_changelog | 通用变更说明;最终预览 versionNo 须用沙盒返回值;对外文案传 includePreview=false + fieldLabelStyle="path" | | diff_java_fields | before/after Java 文本 → FieldChange[] |

build_changelog 对外文案约定

面向外部读者(如渠道方)的 change_summary 不应暴露内部类名与不可访问的预览链接:

| 参数 | 用途 | |------|------| | includePreview | false 时不渲染「- 预览:…」行;此时 previewBaseUrl 可省略 | | fieldLabelStyle | path:用 changes[].fieldPath(缺省退化为 fieldName)+ 语义类型(List<FooDto> → 对象数组,FooDto → 对象),不输出类名 | | changes[].fieldPath / displayType | 逐条覆盖参数路径与类型文案 |

change_json 仍保留 className 等结构化信息,供调用方内部使用。

regenerate_html 大文档约定

| 参数 | 用途 | |------|------| | existingMetaDataPath | 从文件读旧 meta,避免把 40KB+ JSON 塞进工具入参 | | outputDir | 写出 documentHtml.html / metaData.json,默认响应不回传全文 | | mergeExistingApis | 默认 true:保留 entry 未解析到的既有 API path |

公共 npm(必须 pin 版本)

{
  "mcpServers": {
    "java-to-html": {
      "command": "npx",
      "args": ["-y", "[email protected]"]
    }
  }
}

Windows 若找不到 npx,将 command 改为 npx.cmd。

本地开发

npm install
npm run build
npm test
npm run mcp

构建使用 esbuild。相对路径基于进程 cwd;无必须环境变量。

发布

npm install
npm run build
npm test
npm publish

发布后通知调用方:更新 pin 版本并重载 MCP。

gen-doc-core

包内 src/gen-doc-core 基于独立的 Java→HTML 生成逻辑(parser / documentGen / types),不依赖 IDE 插件运行时。

目录结构

├── package.json
├── README.md
├── scripts/
│   └── build.mjs
└── src/
    ├── index.ts              # MCP 入口
    ├── javaFieldEditor.ts
    ├── changelogBuilder.ts
    ├── docRegenerator.ts
    ├── types.ts
    ├── gen-doc-core/
    └── test/