Skip to content

SettingDust/jardiff-mcp-server

Repository files navigation

JarDiff

MCP service that compares two JAR versions and stores structured API diffs for AI-driven retrieval.

Stack

Layer Technology
JAR analysis japicmp — direct library dependency, no CLI subprocess
Storage DuckDB embedded + VSS extension (HNSW vector index) + fts extension
Embeddings LangChain4j all-MiniLM-L6-v2 ONNX (bundled, no download needed)
MCP Server MCP Kotlin SDK 0.11.1 via stdio transport

Requirements

  • JDK 21+
  • Gradle 8+

No external services required — DuckDB is embedded and the embedding model is bundled in the classpath.

Build

./gradlew jar

Run

# Optional: override the DuckDB database path (default: ~/.jardiff/jardiff.db)
export JARDIFF_DB_PATH=/path/to/jardiff.db

java -jar build/libs/jardiff-0.1.0.jar

Or via Gradle:

./gradlew run

MCP Tools

Tool Arguments Description
compare_jars jar_a_path, jar_b_path, name?, access_modifier? Run japicmp, persist diff + embeddings
list_comparisons List all stored comparisons
search_changes query, comparison_key?, limit? BM25 full-text search (FTS extension)
search_semantic query_text, comparison_key?, top_k? Cosine similarity via HNSW index
get_class_changes class_name, comparison_key Full diff for one class
get_summary comparison_key Stats and metadata for a comparison

MCP Resources

URI Content
jar://comparison/list JSON list of all comparisons

Example workflow

# Index spring-core 5.3 → 6.0
compare_jars(jar_a_path="/jars/spring-core-5.3.39.jar", jar_b_path="/jars/spring-core-6.0.22.jar")
# → comparison_key: "spring-core:5.3.39->6.0.22"

# Find breaking changes
search_changes(query="binary incompatible", comparison_key="spring-core:5.3.39->6.0.22")

# Semantic: find changes conceptually related to "security context"  
search_semantic(query_text="security context authentication token", comparison_key="spring-core:5.3.39->6.0.22")

# Drill into a specific class
get_class_changes(class_name="org.springframework.core.annotation.AnnotationUtils", comparison_key="spring-core:5.3.39->6.0.22")

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages