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

jar-viewer-mcp

v0.1.0

Published

MCP server that lets LLMs browse and decompile Java JARs with optional source attachment.

Readme

Java Jar Viewer MCP

MCP server that lets an LLM browse JAR contents, attach *-sources.jar source, and decompile .class files with CFR. It also runs Maven/Gradle dependency resolution to surface absolute paths for local artifacts.

Prerequisites

  • Node.js 18+
  • Java 8+ (JDK with javap) on PATH (for CFR and describe_class)
  • Maven on PATH when using scan_project_dependencies for Maven projects
  • Gradle Wrapper (./gradlew) or Gradle on PATH when using scan_project_dependencies for Gradle projects

Install & Run

npm install
npm run build
node dist/index.js   # or add to your MCP registry

Tools

  • list_jar_entries(jarPath, innerPath?): Lists up to 100 items from the JAR, folding by directory level for quick navigation.
  • read_jar_entry(jarPath, entryPath): Reads the requested entry. For .class, it first looks for a sibling *-sources.jar and otherwise decompiles with CFR; falls back to javap signatures if needed.
  • describe_class(jarPath, className?, entryPath?, memberVisibility?, methodQuery?, limit?): Returns method signatures for a class using javap (no decompilation). Use memberVisibility="public" (default) or "all" for all members.
  • resolve_class(projectPath, className, dependencyQuery?, includeMembers?, memberVisibility?, methodQuery?, limit?): Locates the class inside project dependency jars. If includeMembers=true, also returns method signatures (same filters as describe_class).
  • scan_project_dependencies(projectPath, excludeTransitive?, configurations?, includeLogTail?, query?): Detects Maven/Gradle projects (by pom.xml or build.gradle(.kts)/settings.gradle(.kts)), then resolves absolute artifact paths. Uses mvn dependency:list for Maven, and an injected Gradle init script (mcpListDeps) for Gradle. Results are cached per project root. query does a case-insensitive substring match on groupId:artifactId and the artifact path.
    • excludeTransitive: set to true to return only first-level dependencies.
    • configurations: Gradle-only list of configuration names to include (e.g. ["runtimeClasspath"]).
    • includeLogTail: set to true to include the last lines of build output for debugging.

lib/cfr-0.152.jar is bundled and copied into dist/lib during npm run build; paths are resolved at runtime via import.meta.url to avoid hard-coding.