refactor: Split transport implementations into modules
Split the transport implementations into dedicated modules to improve modularity and reduce core dependencies. Added shared test module for common test utilities. Key changes: - Create mcp-transport/mcp-webflux-sse-transport module - Move SseClientTransport → WebFluxSseClientTransport - Move SseServerTransport → WebFluxSseServerTransport - Move related tests and utilities - Create mcp-transport/mcp-webmvc-sse-transport module - Add new WebMvcSseServerTransport implementation - Add corresponding tests and integration tests - Add framework-independent SSE client implementations to core module - Add FlowSseClient using java.net.http - Add HttpClientSseClientTransport using java.net.http - Keep StdioClientTransport/StdioServerTransport in core (no external deps) - Create mcp-test module for shared test infrastructure - Move abstract test base classes - Move shared test utilities and mocks - Update test dependencies The modular approach allows users to choose between: - Framework-specific implementations (WebFlux/WebMVC) - Pure Java implementations (java.net.http) - Basic implementations (STDIO) Add breaking changes readme: 0.5.0-BREAKING-CHANGES.md Resolves #54
This commit is contained in:
parent
85c4fb8713
commit
611f3258d6
1 changed files with 5002 additions and 1588 deletions
105
0.5.0-BREAKING-CHANGES.md
Normal file
105
0.5.0-BREAKING-CHANGES.md
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
# Breaking Changes for Spring AI MCP 0.5.0-SNAPSHOT
|
||||
|
||||
## Major Changes
|
||||
|
||||
1. Transport Implementation Modularization
|
||||
- SSE transport implementations have been moved to dedicated modules:
|
||||
- `mcp-webflux-sse-transport`: WebFlux-based SSE transport
|
||||
- `mcp-webmvc-sse-transport`: WebMVC-based SSE transport
|
||||
- Base MCP module no longer includes transport implementations
|
||||
|
||||
2. Class Renames
|
||||
- `SseClientTransport` → `WebFluxSseClientTransport`
|
||||
- `SseServerTransport` → `WebFluxSseServerTransport`
|
||||
|
||||
3. Project Structure
|
||||
- Test utilities moved to new `mcp-test` module
|
||||
- Sample application moved to `samples/` directory
|
||||
|
||||
## Migration Guide
|
||||
|
||||
### 1. Update Dependencies
|
||||
|
||||
If using SSE transport, add the appropriate transport module to your pom.xml:
|
||||
|
||||
For WebFlux SSE transport:
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>org.springframework.experimental</groupId>
|
||||
<artifactId>mcp-webflux-sse-transport</artifactId>
|
||||
<version>0.5.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
For WebMVC SSE transport:
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>org.springframework.experimental</groupId>
|
||||
<artifactId>mcp-webmvc-sse-transport</artifactId>
|
||||
<version>0.5.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
### 2. Update Transport Class References
|
||||
|
||||
Replace:
|
||||
```java
|
||||
import org.springframework.ai.mcp.client.transport.SseClientTransport;
|
||||
import org.springframework.ai.mcp.server.transport.SseServerTransport;
|
||||
```
|
||||
|
||||
With:
|
||||
```java
|
||||
// For WebFlux
|
||||
import org.springframework.ai.mcp.client.transport.WebFluxSseClientTransport;
|
||||
import org.springframework.ai.mcp.server.transport.WebFluxSseServerTransport;
|
||||
|
||||
// Or for WebMVC
|
||||
import org.springframework.ai.mcp.server.transport.WebMvcSseServerTransport;
|
||||
```
|
||||
|
||||
### 3. Update Transport Instantiation
|
||||
|
||||
Replace:
|
||||
```java
|
||||
var transport = new SseClientTransport(webClientBuilder);
|
||||
```
|
||||
|
||||
With:
|
||||
```java
|
||||
var transport = new WebFluxSseClientTransport(webClientBuilder);
|
||||
```
|
||||
|
||||
Replace:
|
||||
```java
|
||||
var serverTransport = new SseServerTransport(objectMapper, messageEndpoint);
|
||||
```
|
||||
|
||||
With:
|
||||
```java
|
||||
// For WebFlux
|
||||
var serverTransport = new WebFluxSseServerTransport(objectMapper, messageEndpoint);
|
||||
|
||||
// Or for WebMVC
|
||||
var serverTransport = new WebMvcSseServerTransport(objectMapper, messageEndpoint);
|
||||
```
|
||||
|
||||
### 4. Test Dependencies
|
||||
|
||||
If you're using MCP test utilities, add the test module dependency:
|
||||
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>org.springframework.experimental</groupId>
|
||||
<artifactId>mcp-test</artifactId>
|
||||
<version>0.5.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
## Other Changes
|
||||
|
||||
- Spring AI dependency updated to 1.0.0-M5
|
||||
- Improved dependency management and reduced transitive dependencies
|
||||
- Sample application restructured under samples/ directory
|
||||
- New test utilities and base test classes in mcp-test module
|
||||
Loading…
Reference in a new issue