MCP Server: Dependency Intelligence for JVM Build Tools
Streamline dependency management with MCP server for Maven, Gradle, SBT, and Mill using Maven Central intelligence and Context7 docs integration.
npx -y @arvindand/maven-tools-mcpOverview
MCP (Model Context Protocol) Server is a lightweight HTTP service that provides dependency intelligence to JVM build tools (Maven, Gradle, SBT, Mill). It enriches conventional package metadata with contextual information derived from the Maven Central index and Context7 documentation, making it easier to discover trusted versions, documentation links, change notes, and metadata useful for automated dependency decisions.
By exposing a consistent API for dependency lookup and enrichment, MCP Server lets CI systems, pre-commit checks, and build plugins query authoritative metadata without directly scraping registries. This centralization reduces repeated network calls, normalizes metadata across tools, and enables build-time features such as automated version recommendations, documentation linking, and simple license / compatibility checks.
Features
- Centralized API for dependency metadata (groupId, artifactId, version, POM data)
- Integration with Maven Central index for up-to-date artifact information
- Context7 docs integration: links to contextual documentation pages for artifacts and APIs
- Version recommendations and basic semantic-change hints (major/minor/patch)
- Caching layer to reduce traffic on remote indices and speed lookups
- Simple HTTP API suitable for use by Maven, Gradle, SBT, Mill, or CI scripts
- Docker-ready distribution and JVM jar for standalone hosting
Installation / Configuration
Run from a JAR (Java 11+ recommended)
# Download latest release jar (replace URL with current release)
# Run with default settings
# Override port or config via system properties
Run with Docker
# Pull image (replace image name/tag with published image if available)
# Run, exposing port 8080
Configuration file (application.yml example)
server:
port: 8080
maven:
indexPath: /data/maven-index # local index cache
remoteIndexUrl: https://repo1.maven.org/maven2
context7:
enabled: true
endpoint: https://docs.context7.example/api
cache:
ttlSeconds: 3600
cors:
allowedOrigins:
Environment variables can be used for common overrides, e.g. MCP_SERVER_PORT, MCP_MAVEN_INDEX_PATH, MCP_CONTEXT7_ENDPOINT.
Available Resources
The server exposes a small, RESTful set of endpoints to lookup and enrich dependency information. Typical routes include:
- GET /api/v1/dependency?gav=group:artifact:version — detailed metadata for a GAV
- GET /api/v1/suggest?ga=group:artifact — recommended versions and upgrade hints
- GET /api/v1/docs?gav=group:artifact:version — Context7 documentation links
- GET /api/v1/health — service health/status
Example: query a dependency
|
Example JSON response (typical)
Use Cases
Automated upgrade checks (CI)
- CI jobs call /api/v1/suggest?ga=org.foo:lib to get recommended newer versions and classify them as patch/minor/major. The job can fail builds for vulnerable or EOL versions.
Editor or IDE integrations
- IDE plugins query /api/v1/docs to show contextual docs and quick links for the selected dependency, improving developer discoverability of API docs.
Pre-merge dependency audits
- A pre-commit or pull-request bot queries MCP to validate licenses and check for known license incompatibilities before allowing a dependency addition.
Cross-tool normalization
- Organizations with mixed build tools (Maven/Gradle/SBT/Mill) use MCP as a single source of enrichment so all tools show consistent version suggestions and documentation links.
Dependency resolution augmentation
- Build plugins use MCP metadata to present human-friendly upgrade info in build output, or to auto-generate changelogs for updated dependencies.
Getting Started Examples
Simple shell example to check for newer versions
GA="org.apache.commons:commons-lang3"
|
Integrate into a Gradle init script (conceptual)
// init.gradle (conceptual snippet)
def mcpUrl = 'http://localhost:8080'
gradle.taskGraph.whenReady
Note: integration details will depend on the plugin or script you write; MCP provides HTTP endpoints that are language-agnostic.
Where to find the project
Source code, issues, and releases are on GitHub: https://github.com/arvindand/maven-tools-mcp
For best results, host MCP close to your CI/build agents, populate the local Maven index cache for faster responses, and enable Context7 integration if you rely on contextual documentation links.