Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Comments

Close side panel

fix: use valid JPMS module name for mcp-core#609

Open
bjorndarri wants to merge 1 commit intomodelcontextprotocol:mainmodelcontextprotocol/java-sdk:mainfrom
bjorndarri:fix/jpms-module-namebjorndarri/java-sdk:fix/jpms-module-nameCopy head branch name to clipboard
Open

fix: use valid JPMS module name for mcp-core#609
bjorndarri wants to merge 1 commit intomodelcontextprotocol:mainmodelcontextprotocol/java-sdk:mainfrom
bjorndarri:fix/jpms-module-namebjorndarri/java-sdk:fix/jpms-module-nameCopy head branch name to clipboard

Conversation

@bjorndarri
Copy link

Summary

Fixes #560

  • Fixed Automatic-Module-Name in mcp-core/pom.xml to use a valid JPMS module name
  • Changed from io.modelcontextprotocol.sdk.mcp-core (invalid - contains dash) to io.modelcontextprotocol.sdk.mcp.core
  • OSGI Bundle-SymbolicName kept as io.modelcontextprotocol.sdk.mcp-core for backward compatibility

Problem

JPMS module names must be valid Java identifiers and cannot contain dashes. The previous automatic module name io.modelcontextprotocol.sdk.mcp-core prevented usage in modular Java applications.

Solution

Hard-coded the Automatic-Module-Name to io.modelcontextprotocol.sdk.mcp.core.

Alternative: Could use BND's substitution macro ${subst;${project.groupId}.${project.artifactId};-;.} if dynamic generation is preferred by maintainers.

Compatibility

OSGI's Bundle-SymbolicName remains unchanged with the dash (mcp-core) as OSGI allows dashes in symbolic names. Having different names for JPMS and OSGI is acceptable and common.

Test plan

  • Built mcp-core module successfully
  • Verified manifest contains Automatic-Module-Name: io.modelcontextprotocol.sdk.mcp.core
  • Verified Bundle-SymbolicName remains io.modelcontextprotocol.sdk.mcp-core

🤖 Generated with Claude Code

Changed Automatic-Module-Name from io.modelcontextprotocol.sdk.mcp-core
to io.modelcontextprotocol.sdk.mcp.core. JPMS module names must be valid
Java identifiers and cannot contain dashes. This was preventing usage in
modular Java applications.

The OSGI Bundle-SymbolicName is kept as io.modelcontextprotocol.sdk.mcp-core
(with dash) for backward compatibility, as OSGI allows dashes in symbolic names.

Note: If preferred, the Automatic-Module-Name could use BND's substitution
macro instead: ${subst;${project.groupId}.${project.artifactId};-;.}

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@vorburger
Copy link
Contributor

Alternative: Could use BND's substitution macro ${subst;${project.groupId}.${project.artifactId};-;.} if dynamic generation is preferred by maintainers.

Oh, nice!! If you would like to change it to that here, personally I actually think that would be much nicer... (But I'm NOT a maintainer here!) Saying this mostly because I have a hunch that this bnd-maven-plugin really belongs into the root pom.xml instead of the mcp-core/pom.xml; but perhaps that's better left for a future follow-up PR.

@bjorndarri
Copy link
Author

I agree. I would personally be fine with this PR being dropped and this automatic module name handling being added to all modules, using substitution, with bnd-maven-plugin in the root, like you suggest. Let's see what happens here.

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.

Invalid Automatic-Module-Name in mcp-core

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.