Skip to content

Add missing Export-Package to mcp-json-jackson2 and mcp-json-jackson3#911

Open
joaodinissf wants to merge 1 commit intomodelcontextprotocol:mainfrom
joaodinissf:fix/osgi-export-jackson-modules
Open

Add missing Export-Package to mcp-json-jackson2 and mcp-json-jackson3#911
joaodinissf wants to merge 1 commit intomodelcontextprotocol:mainfrom
joaodinissf:fix/osgi-export-jackson-modules

Conversation

@joaodinissf
Copy link
Copy Markdown

Add explicit Export-Package directives to the jackson modules so OSGi consumers can access classes directly.

Motivation and Context

PR #779 added bnd configuration to the jackson modules but omitted Export-Package (which mcp-core has). Without it, all packages are bundle-private, which prevents direct instantiation of JacksonMcpJsonMapperSupplier or DefaultJsonSchemaValidator from other bundles — the recommended workaround per #562 since ServiceLoader.load() does not work across OSGi bundle boundaries.

This particularly affects Eclipse PDE and Tycho-based projects, which get compile-time "Access restriction" errors and runtime ClassNotFoundException when referencing classes from these modules.

How Has This Been Tested?

Verified the generated META-INF/MANIFEST.MF after mvn process-classes contains the correct Export-Package header with only the module's own packages. Also tested in an Eclipse PDE project — the patched modules compile and resolve without issues.

Breaking Changes

No.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

🤖 Generated with Claude Code

Use explicit package names instead of a wildcard glob to avoid
embedding mcp-core classes into the jackson module JARs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant