Skip to main content
Glama
jar-inspector-mcp

jar-inspector-mcp

jar-inspector-mcp

Claude Code가 Java 아카이브 내부를 읽을 수 있게 해주는 MCP 서버 — 클래스, API, 소스, 리소스, 바이트코드 — 압축을 풀지 않고도 말이죠.

문제

Claude Code가 JVM 프로젝트에서 작업하다가 jar 안에 무엇이 있는지 알아야 할 때, 셸 도구에 의존하게 됩니다:

unzip -l target/lib/jackson-databind-2.16.1.jar     # 780 lines of entry listing
unzip -o app.jar -d /tmp/x && cat /tmp/x/…/Foo.java # a whole file to answer one question
javap -p -c -cp app.jar com.acme.Foo                # 300 KB of bytecode

그 모든 것이 컨텍스트 창에 들어오고, 대부분은 노이즈이며, 일부는 작업 트리에 임시 파일을 씁니다.

Related MCP server: dejared-mcp

해결책

실제 질문 — "이 jar에 뭐가 들어있지", "이 클래스의 API가 뭐지", "이 문자열이 어디서 설정되지" — 에 답하고 그 결과만 반환하는 10개의 집중된 도구입니다.

jackson-databind-2.16.1.jar(클래스 779개, 압축 해제 시 4.1MB)에서 측정:

대신 사용하는 것

jar-inspector

unzip -l <jar>

79,674자

jar_overview

2,632자

97% 감소

javap <class>

36,008자

jar_class_outline

18,061자

50% 감소

javap -p -c <class>

303,105자

jar_class_outline

21,409자

93% 감소

디스크에 기록되는 것은 없으며, JDK도 필요 없습니다 — 클래스 파일 파서는 순수 Python입니다. (jar_disassemble가 유일한 예외로, javap를 셸로 호출합니다.)

설치

uv와 Python 3.10+가 필요합니다.

# from GitHub, nothing to clone
claude mcp add jar-inspector -- uvx --from git+https://github.com/pgatzka/jar-inspector-mcp jar-inspector-mcp

# or from a local clone
git clone https://github.com/pgatzka/jar-inspector-mcp && cd jar-inspector-mcp
claude mcp add jar-inspector -- uv run --directory "$PWD" jar-inspector-mcp

--scope project를 추가하면 .mcp.json을 통해 저장소와 공유하고, --scope user를 추가하면 모든 곳에서 사용할 수 있습니다. 수동으로 연결하려면:

// .mcp.json
{
  "mcpServers": {
    "jar-inspector": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/pgatzka/jar-inspector-mcp", "jar-inspector-mcp"]
    }
  }
}

claude mcp list 또는 Claude Code 내에서 /mcp로 확인하세요.

다른 MCP 클라이언트: 서버는 stdio를 사용하므로 uvx --from … jar-inspector-mcp가 어디서든 명령으로 작동합니다.

도구

도구

답변하는 질문

jar_overview

이 아티팩트는 무엇인가? 매니페스트, 패키지, 클래스 수, 바이트코드 수준, 소스 첨부 여부

jar_list

어떤 항목이 들어 있는가? glob과 종류로 필터링, 페이지 처리됨

jar_find_class

HttpClient는 어디에 있나? 단순 이름, FQCN 또는 glob → 클래스 이름

jar_class_outline

이 클래스의 API는 무엇인가? 선언, 애너테이션, 필드, 메서드 시그니처

jar_read_source

실제로 무엇을 하는가? 첨부된 .java/.kt 소스, 줄 창 단위로

jar_read_entry

이 설정에 무엇이 있나? 텍스트 항목 하나: MANIFEST, META-INF/services/…, XML

jar_search

이 문자열은 어디에 있나? 텍스트 항목과 컴파일된 문자열 상수 전체에서 검색

jar_class_dependencies

이 클래스는 무엇을 참조하나? 내부 vs 외부 참조

jar_disassemble

이 메서드는 무엇으로 컴파일되나? javap를 통한 메서드 하나의 바이트코드

jar_find

jar는 어디에 있나? 빌드 출력, Maven 저장소, Gradle 캐시에서 검색

모든 도구는 읽기 전용이며 다음을 허용하는 jar 인수를 받습니다:

  • 아카이브 — .jar, .war, .ear, .aar, .zip, .jmod

  • 압축 해제된 클래스 디렉터리 — target/classes, build/classes/java/main

  • 중첩된 아카이브 — app.jar!BOOT-INF/lib/dep-1.0.jar (Spring Boot fat jar)

출력 예시

jar_class_outline, 그대로 (테스트가 단언하는 정확한 출력입니다):

com.acme.demo.UserService  [class, Java 21, UserService.java]
// source is attached -- jar_read_source(jar, 'com.acme.demo.UserService') shows it

@Deprecated
@Marker(enabled=true, code='z', tags={"alpha", "beta"})
public class UserService implements Repository<String, Integer>

  // fields (2)
  public static final String CACHE_KEY = "user.cache"
  protected volatile boolean dirty

  // constructors (1)
  public UserService(Map<Integer, String> users)

  // methods (5)
  public long count()
  public List<String> findAll()
  public Optional<String> findById(Integer id) throws IllegalStateException
  public <R extends Comparable<R>> List<R> mapAll(Function<String, R> fn)
  public void rename(int id, String newName, String... aliases)

  // nested (1)
  UserService.Builder

  // 4 more member(s) hidden (visibility below 'protected', synthetic or bridge)

제네릭 시그니처, 매개변수 이름(-g로 컴파일된 경우), 가변 인자, 선언된 예외, 상수 값, 레코드, 열거형 및 default 메서드가 모두 유지됩니다. 메서드 본문, 브리지 메서드 및 상수 풀은 유지되지 않습니다.

구성

환경 변수

효과

JAR_INSPECTOR_ALLOW

서버가 읽을 수 있는 경로 구분 루트. 설정하지 않으면 제한 없음

JAR_INSPECTOR_SEARCH_PATH

jar_find가 먼저 검색하는 추가 디렉터리

MAVEN_REPO_LOCAL

Maven 저장소 위치, ~/.m2/repository가 아닌 경우

jar_find는 다음 순서로 검색합니다: ./target, ./build/libs, ./libs, ./lib, Maven 저장소, Gradle 모듈 캐시, Ivy 캐시, Coursier 캐시.

서버를 하나의 트리로 제한하려면:

claude mcp add jar-inspector --env JAR_INSPECTOR_ALLOW="$HOME/work:$HOME/.m2" \
  -- uvx --from git+https://github.com/pgatzka/jar-inspector-mcp jar-inspector-mcp

Claude가 사용하도록 유도하기

서버는 MCP instructions를 제공하여 클라이언트에게 이 도구들이 unzip, jar xf, javap를 대체한다고 알립니다. 여전히 Claude가 셸을 사용하는 모습이 보이면, 프로젝트의 CLAUDE.md에 한 줄을 추가하세요:

To inspect jars, use the jar-inspector MCP tools instead of unzip/jar/javap.

작동 방식

  • 클래스 파싱은 클래스 파일 형식에 대한 의존성 없는 리더입니다: 상수 풀, 접근 플래그, Signature, MethodParameters, LocalVariableTable, Exceptions, Record, InnerClasses 및 런타임 애너테이션 속성. 메서드 본문은 jar_disassemble이 요청하지 않는 한 건너뜁니다.

  • 아카이브는 메모리에서 zipfile을 통해 읽습니다. 중첩된 jar는 외부 항목의 바이트에서 열리므로 Spring Boot fat jar는 압축을 풀 필요가 없습니다.

  • 소스는 아카이브 자체에서, 그 다음 Maven 레이아웃의 형제 -sources.jar에서, 그 다음 Gradle 캐시가 사용하는 이웃 해시 디렉터리에서 확인됩니다.

  • 출력은 항상 제한되며, 잘렸을 때와 페이지를 넘기는 방법을 항상 알려줍니다.

개발

uv sync
uv run pytest          # 49 tests

테스트는 tests/java의 Java를 javac로 컴파일하고 실제 바이트코드에 대해 단언하므로 제네릭, 브리지 메서드, 레코드가 실제로 검증됩니다. JDK가 없으면 건너뜁니다. 파서는 추가로 Maven과 Gradle과 함께 제공되는 모든 jar의 모든 클래스 — 65,573개 클래스 — 에 대해 검사되며 실패가 없습니다.

라이선스

MIT

Available Tools

10 tools
jar_class_dependenciesA
Read-only

List the classes a compiled class references, split into internal and external.

Useful for tracing what a class actually touches, and for spotting which dependency supplies a type, without decompiling anything.

Args: jar: Archive path, classes directory, or outer.jar!nested.jar. class_name: FQCN, simple name or glob. include_jdk: Include java.*/javax.*/jdk.* references. limit: Maximum references to list.

Inputs: jar (required), class_name (required), limit, include_jdk. Returns: result

jar_class_outlineA
Read-only

Show a class's API: declaration, annotations, fields and method signatures.

This is the cheap alternative to decompiling or reading source. Signatures keep generics, parameter names (when compiled with -g), thrown exceptions and constant values; method bodies are not included.

Args: jar: Archive path, classes directory, or outer.jar!nested.jar. class_name: FQCN, simple name or glob (resolved like jar_find_class). visibility: Lowest visibility to include: public, protected, package, private. include_synthetic: Include compiler-generated bridge/synthetic members. fully_qualified_types: Print java.util.List instead of List.

Inputs: jar (required), class_name (required), visibility, include_synthetic, +1 more. Returns: result

jar_disassembleA
Read-only

Disassemble one method's bytecode with javap (needs a JDK on PATH).

Reach for this only when the API outline and the source are not enough -- for example when checking what a method compiles to, or reading a class that has no sources attached. Always pass method to keep it small.

Args: jar: Archive path or classes directory (nested ! specs are not supported). class_name: FQCN, simple name or glob. method: Method name to keep; empty returns every method (often large). limit: Maximum lines of disassembly to return.

Inputs: jar (required), class_name (required), limit, method. Returns: result

jar_findA
Read-only

Find jar files on this machine by name: build output, Maven repo, Gradle cache.

Use it to turn "the Jackson databind jar" into a path you can pass to the other tools.

Args: query: Part of the file name, or a glob such as jackson-databind-*.jar. search_path: Extra directories to scan first, separated by the path separator. include_classifiers: Also list -sources, -javadoc and -tests jars. limit: Maximum jars to return.

Inputs: query (required), limit, search_path, include_classifiers. Returns: result

jar_find_classA
Read-only

Find classes in an archive by simple name, fully-qualified name or glob.

Use this to turn "where does HttpClient live" into a concrete class name you can pass to jar_class_outline or jar_read_source.

Args: jar: Archive path, classes directory, or outer.jar!nested.jar. name: HttpClient, com.acme.HttpClient, or a glob like com.acme.*Repo. limit: Maximum matches to return.

Inputs: jar (required), name (required), limit. Returns: result

jar_listA
Read-only

List entries in an archive, filtered by glob and kind.

Prefer this over unzip -l. Use kind='text' to find configuration, kind='archive' to find jars bundled inside a fat jar.

Args: jar: Archive path, classes directory, or outer.jar!nested.jar. pattern: Comma-separated globs matched against the entry path, e.g. META-INF/* or *.properties. Empty matches everything. kind: One of all, class, source, text, binary, archive. limit: Maximum entries to return. offset: Entries to skip, for paging.

Inputs: jar (required), kind, limit, offset, +1 more. Returns: result

jar_overviewA
Read-only

Summarize a Java archive: manifest, size, packages, class count, and whether sources are attached.

Start here when you meet an unfamiliar jar, instead of unzipping it or listing every entry.

Args: jar: Path to a .jar/.war/.aar/.zip, an exploded classes directory, or a nested archive such as app.jar!BOOT-INF/lib/dep-1.0.jar.

Inputs: jar (required). Returns: result

jar_read_entryA
Read-only

Read one text entry from an archive: MANIFEST, service files, XML, config.

Prefer this over unzip -p. Binary entries are described, not dumped.

Args: jar: Archive path, classes directory, or outer.jar!nested.jar. entry: Exact entry path, e.g. META-INF/spring.factories. start_line: 1-based first line to show. line_count: How many lines to show.

Inputs: jar (required), entry (required), line_count, start_line. Returns: result

jar_read_sourceA
Read-only

Read attached Java/Kotlin source for a class, one line window at a time.

Looks inside the archive itself, then the matching -sources.jar next to it (Maven layout) or beside it in the Gradle cache. If no source is available, say so and fall back to jar_class_outline.

Args: jar: Archive path, classes directory, or outer.jar!nested.jar. target: FQCN (com.acme.Foo) or an entry path (com/acme/Foo.java). start_line: 1-based first line to show. line_count: How many lines to show; use a window rather than whole files. sources_jar: Explicit sources archive, when auto-detection misses it.

Inputs: jar (required), target (required), line_count, start_line, +1 more. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 10 tools

    Disambiguation5/5

    Each tool targets a distinct inspection task: overview, listing, class lookup, API outline, source reading, entry reading, search, dependency analysis, disassembly, and jar discovery. There is no meaningful overlap that would make an agent likely to pick the wrong tool.

    Naming Consistency3/5

    All tools share the jar_ prefix, which helps, but the grammatical pattern is mixed: jar_list and jar_search are bare verbs, jar_find_class and jar_read_source are verb_noun, while jar_overview and jar_class_outline are noun phrases. The names are readable but not consistently verb_noun.

    Tool Count5/5

    Ten tools is well within the ideal range and each tool covers a distinct facet of archive inspection. The count feels neither bloated nor thin for the stated purpose.

    Completeness5/5

    The read-only jar inspection domain is covered thoroughly: overview, listing, class lookup, API outline, source reading, arbitrary text entries, grep-like search, class dependency analysis, bytecode disassembly, and locating jars on disk. An agent can move from finding a jar to reading its source or bytecode without obvious dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      An MCP server for intelligently reading Java source code, supporting extraction from Maven dependencies and local projects with dual decompilers.
      2
      154
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      A Model Context Protocol (MCP) server for exploring, analyzing, and decompiling Java JAR files.
      281 npm
      11
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      MCP server that indexes your codebase's public API at startup and serves it via compact tool responses, saving tokens vs reading source files.
      5
      69 PyPI
      21
      MIT
    • A
      license
      B
      quality
      C
      maintenance
      MCP server for searching, browsing, and analyzing decompiled Minecraft source code locally. Supports symbol lookup, text search, reference lookup, and lightweight RAG.
      11
      Apache 2.0