Skip to content

feat(spi): adds implementation-neutral SPI module #178

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Aliaksie
Copy link
Contributor

@Aliaksie Aliaksie commented Apr 21, 2025

This PR introduces the first version of the mcp-spi module to define a transport-agnostic, reactive-compatible interface for the Model Context Protocol Java SDK.

Key changes:

  • New mcp-spi , transport interface + Jackson-free schema types + McpSchemaCodec abstraction
  • New mcp-schema-jackson Jackson-based schema + McpSchemaCodec implementation
  • Renamed mcp to mcp-reactor
  • adapts mcp-reactor to use mcp-spi and mcp-schema-jackson (as default codec implementation)
  • makes it possible to use own codec implementation for mcp-reactor
  • minor changes...

Motivation and Context

The motivation behind this change is to make the SDK modular, implementation-agnostic, and easier to integrate with diverse runtime environments.

How Has This Been Tested?

Breaking Changes

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

Additional context

Possible Future Work:

  • posable extract McpClient/McpServer abstraction into mcp-spi
  • Introduce TCK (Technology Compatibility Kit) for validating McpClientTransport and McpMessageCodec implementations (mcp-spi-tck).
  • Add support for other runtime environments, e.g.(Vert.x-based transport(mcp-vertx), Java 11+ Flow.Publisher HTTP client(mcp-flow),)
  • Provide alternative serialization support (e.g., mcp-schema-gson, mcp-schema-cbor, mcp-schema-protobuf).
  • Allow ServiceLoader-based discovery for default transport and codec implementations.
  • Refactor mcp to optionally log via a pluggable logger interface (McpTransportLogger interface in mcp-spi instead of hard SLF4J dependency).

p.s. if these changes don't make sense no problem just close this pr :-)

@Aliaksie Aliaksie changed the title feat: adds mcp-spi feat(spi): adds implementation-neutral SPI module Apr 25, 2025
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