Skip to content

Add Maven and Gradle protocol support for Java MCP servers #1456

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JAORMX
Copy link
Collaborator

@JAORMX JAORMX commented Aug 16, 2025

This PR introduces support for packaging and running Java-based MCP servers using Maven and Gradle build systems, extending ToolHive's capabilities beyond Python (uvx), Node.js (npx), and Go packages.

Changes

  • New maven.tmpl and gradle.tmpl container templates for Java containers
  • Maven and Gradle transport types in templates.go
  • Protocol handling for maven:// and gradle:// schemes
  • GetSupportedSchemes() function for dynamic scheme listing
  • Comprehensive test coverage for new functionality
  • Updated CLI documentation for thv run and thv build commands

Testing

  • All unit tests pass for the new templates
  • Protocol scheme recognition tests pass
  • Successfully built a Maven-based container (wildfly-mcp-server-sse)
  • Linting passes with no issues

The implementation follows the existing pattern used for other protocol schemes, ensuring consistency across the codebase.

This change introduces support for packaging and running Java-based MCP
servers using Maven and Gradle build systems, extending ToolHive's
capabilities beyond Python (uvx), Node.js (npx), and Go packages.

Changes include:
- New maven.tmpl and gradle.tmpl container templates for Java containers
- Maven and Gradle transport types in templates.go
- Protocol handling for maven:// and gradle:// schemes
- GetSupportedSchemes() function for dynamic scheme listing
- Comprehensive test coverage for new functionality
- Updated CLI documentation for thv run and thv build commands

The implementation follows the existing pattern used for other protocol
schemes, ensuring consistency across the codebase.

Signed-off-by: Juan Antonio Osorio <[email protected]>
@JAORMX JAORMX force-pushed the feat/maven-gradle-protocols branch from 5233d6d to dcad29c Compare August 16, 2025 17:18
@ChrisJBurns
Copy link
Collaborator

LGTM. Always makes me happy seeing Java related things. Although not sure how many MCP servers are being written in Java atm (sad face)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants