Skip to content

Commit e014046

Browse files
authored
Merge branch 'main' into taskHink
2 parents 34c7e97 + fa9dac8 commit e014046

11 files changed

Lines changed: 37 additions & 61 deletions

File tree

mcp-bom/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>io.modelcontextprotocol.sdk</groupId>
99
<artifactId>mcp-parent</artifactId>
10-
<version>0.17.0-SNAPSHOT</version>
10+
<version>0.18.0-SNAPSHOT</version>
1111
</parent>
1212

1313
<artifactId>mcp-bom</artifactId>

mcp-core/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>io.modelcontextprotocol.sdk</groupId>
88
<artifactId>mcp-parent</artifactId>
9-
<version>0.17.0-SNAPSHOT</version>
9+
<version>0.18.0-SNAPSHOT</version>
1010
</parent>
1111
<artifactId>mcp-core</artifactId>
1212
<packaging>jar</packaging>
@@ -68,7 +68,7 @@
6868
<dependency>
6969
<groupId>io.modelcontextprotocol.sdk</groupId>
7070
<artifactId>mcp-json</artifactId>
71-
<version>0.17.0-SNAPSHOT</version>
71+
<version>0.18.0-SNAPSHOT</version>
7272
</dependency>
7373

7474
<dependency>
@@ -101,7 +101,7 @@
101101
<dependency>
102102
<groupId>io.modelcontextprotocol.sdk</groupId>
103103
<artifactId>mcp-json-jackson2</artifactId>
104-
<version>0.17.0-SNAPSHOT</version>
104+
<version>0.18.0-SNAPSHOT</version>
105105
<scope>test</scope>
106106
</dependency>
107107

mcp-json-jackson2/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>io.modelcontextprotocol.sdk</groupId>
88
<artifactId>mcp-parent</artifactId>
9-
<version>0.17.0-SNAPSHOT</version>
9+
<version>0.18.0-SNAPSHOT</version>
1010
</parent>
1111
<artifactId>mcp-json-jackson2</artifactId>
1212
<packaging>jar</packaging>
@@ -37,7 +37,7 @@
3737
<dependency>
3838
<groupId>io.modelcontextprotocol.sdk</groupId>
3939
<artifactId>mcp-json</artifactId>
40-
<version>0.17.0-SNAPSHOT</version>
40+
<version>0.18.0-SNAPSHOT</version>
4141
</dependency>
4242
<dependency>
4343
<groupId>com.fasterxml.jackson.core</groupId>

mcp-json/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>io.modelcontextprotocol.sdk</groupId>
88
<artifactId>mcp-parent</artifactId>
9-
<version>0.17.0-SNAPSHOT</version>
9+
<version>0.18.0-SNAPSHOT</version>
1010
</parent>
1111
<artifactId>mcp-json</artifactId>
1212
<packaging>jar</packaging>

mcp-json/src/main/java/io/modelcontextprotocol/json/TypeRef.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
/**
1111
* Captures generic type information at runtime for parameterized JSON (de)serialization.
12-
* Usage: TypeRef<List<Foo>> ref = new TypeRef<>(){};
12+
* Usage: TypeRef&lt;List&lt;Foo&gt;&gt; ref = new TypeRef&lt;&gt;(){};
1313
*/
1414
public abstract class TypeRef<T> {
1515

mcp-spring/mcp-spring-webflux/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>io.modelcontextprotocol.sdk</groupId>
88
<artifactId>mcp-parent</artifactId>
9-
<version>0.17.0-SNAPSHOT</version>
9+
<version>0.18.0-SNAPSHOT</version>
1010
<relativePath>../../pom.xml</relativePath>
1111
</parent>
1212
<artifactId>mcp-spring-webflux</artifactId>
@@ -25,19 +25,19 @@
2525
<dependency>
2626
<groupId>io.modelcontextprotocol.sdk</groupId>
2727
<artifactId>mcp-json-jackson2</artifactId>
28-
<version>0.17.0-SNAPSHOT</version>
28+
<version>0.18.0-SNAPSHOT</version>
2929
</dependency>
3030

3131
<dependency>
3232
<groupId>io.modelcontextprotocol.sdk</groupId>
3333
<artifactId>mcp</artifactId>
34-
<version>0.17.0-SNAPSHOT</version>
34+
<version>0.18.0-SNAPSHOT</version>
3535
</dependency>
3636

3737
<dependency>
3838
<groupId>io.modelcontextprotocol.sdk</groupId>
3939
<artifactId>mcp-test</artifactId>
40-
<version>0.17.0-SNAPSHOT</version>
40+
<version>0.18.0-SNAPSHOT</version>
4141
<scope>test</scope>
4242
</dependency>
4343

mcp-spring/mcp-spring-webflux/src/main/java/io/modelcontextprotocol/client/transport/WebClientStreamableHttpTransport.java

Lines changed: 12 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ public Mono<Void> sendMessage(McpSchema.JSONRPCMessage message) {
313313

314314
// The spec mentions only ACCEPTED, but the existing SDKs can return
315315
// 200 OK for notifications
316-
if (is2xx(response)) {
316+
if (response.statusCode().is2xxSuccessful()) {
317317
Optional<MediaType> contentType = response.headers().contentType();
318318
long contentLength = response.headers().contentLength().orElse(-1);
319319
// Existing SDKs consume notifications with no response body nor
@@ -397,15 +397,14 @@ private Flux<McpSchema.JSONRPCMessage> extractError(ClientResponse response, Str
397397
}
398398
catch (IOException ex) {
399399
toPropagate = new McpTransportException("Sending request failed, " + e.getMessage(), e);
400-
logger.debug("Received content together with {} HTTP code response: {}", response.rawStatusCode(),
401-
body);
400+
logger.debug("Received content together with {} HTTP code response: {}", response.statusCode(), body);
402401
}
403402

404403
// Some implementations can return 400 when presented with a
405404
// session id that it doesn't know about, so we will
406405
// invalidate the session
407406
// https://github.com/modelcontextprotocol/typescript-sdk/issues/389
408-
if (isBadRequest(responseException)) {
407+
if (responseException.getStatusCode().isSameCodeAs(HttpStatus.BAD_REQUEST)) {
409408
if (!sessionRepresentation.equals(MISSING_SESSION_ID)) {
410409
return Mono.error(new McpTransportSessionNotFoundException(sessionRepresentation, toPropagate));
411410
}
@@ -425,8 +424,16 @@ private Flux<McpSchema.JSONRPCMessage> eventStream(McpTransportStream<Disposable
425424
return Flux.from(sessionStream.consumeSseStream(idWithMessages));
426425
}
427426

427+
private static boolean isNotFound(ClientResponse response) {
428+
return response.statusCode().isSameCodeAs(HttpStatus.NOT_FOUND);
429+
}
430+
431+
private static boolean isNotAllowed(ClientResponse response) {
432+
return response.statusCode().isSameCodeAs(HttpStatus.METHOD_NOT_ALLOWED);
433+
}
434+
428435
private static boolean isEventStream(ClientResponse response) {
429-
return is2xx(response) && response.headers().contentType().isPresent()
436+
return response.statusCode().is2xxSuccessful() && response.headers().contentType().isPresent()
430437
&& response.headers().contentType().get().isCompatibleWith(MediaType.TEXT_EVENT_STREAM);
431438
}
432439

@@ -605,36 +612,4 @@ public WebClientStreamableHttpTransport build() {
605612

606613
}
607614

608-
/**
609-
* Needed for Spring 5 compatibility
610-
*/
611-
@SuppressWarnings("deprecation")
612-
private static boolean isBadRequest(final WebClientResponseException responseException) {
613-
return responseException.getRawStatusCode() == HttpStatus.BAD_REQUEST.value();
614-
}
615-
616-
/**
617-
* Needed for Spring 5 compatibility
618-
*/
619-
@SuppressWarnings("deprecation")
620-
private static boolean isNotFound(ClientResponse response) {
621-
return response.rawStatusCode() == HttpStatus.NOT_FOUND.value();
622-
}
623-
624-
/**
625-
* Needed for Spring 5 compatibility
626-
*/
627-
@SuppressWarnings("deprecation")
628-
private static boolean isNotAllowed(ClientResponse response) {
629-
return response.rawStatusCode() == HttpStatus.METHOD_NOT_ALLOWED.value();
630-
}
631-
632-
/**
633-
* Needed for Spring 5 compatibility
634-
*/
635-
@SuppressWarnings("deprecation")
636-
private static boolean is2xx(final ClientResponse response) {
637-
return response.rawStatusCode() >= 200 && response.rawStatusCode() < 300;
638-
}
639-
640615
}

mcp-spring/mcp-spring-webmvc/pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>io.modelcontextprotocol.sdk</groupId>
88
<artifactId>mcp-parent</artifactId>
9-
<version>0.17.0-SNAPSHOT</version>
9+
<version>0.18.0-SNAPSHOT</version>
1010
<relativePath>../../pom.xml</relativePath>
1111
</parent>
1212
<artifactId>mcp-spring-webmvc</artifactId>
@@ -25,13 +25,13 @@
2525
<dependency>
2626
<groupId>io.modelcontextprotocol.sdk</groupId>
2727
<artifactId>mcp-json-jackson2</artifactId>
28-
<version>0.17.0-SNAPSHOT</version>
28+
<version>0.18.0-SNAPSHOT</version>
2929
</dependency>
3030

3131
<dependency>
3232
<groupId>io.modelcontextprotocol.sdk</groupId>
3333
<artifactId>mcp</artifactId>
34-
<version>0.17.0-SNAPSHOT</version>
34+
<version>0.18.0-SNAPSHOT</version>
3535
</dependency>
3636

3737
<dependency>
@@ -43,14 +43,14 @@
4343
<dependency>
4444
<groupId>io.modelcontextprotocol.sdk</groupId>
4545
<artifactId>mcp-test</artifactId>
46-
<version>0.17.0-SNAPSHOT</version>
46+
<version>0.18.0-SNAPSHOT</version>
4747
<scope>test</scope>
4848
</dependency>
4949

5050
<dependency>
5151
<groupId>io.modelcontextprotocol.sdk</groupId>
5252
<artifactId>mcp-spring-webflux</artifactId>
53-
<version>0.17.0-SNAPSHOT</version>
53+
<version>0.18.0-SNAPSHOT</version>
5454
<scope>test</scope>
5555
</dependency>
5656

mcp-test/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>io.modelcontextprotocol.sdk</groupId>
88
<artifactId>mcp-parent</artifactId>
9-
<version>0.17.0-SNAPSHOT</version>
9+
<version>0.18.0-SNAPSHOT</version>
1010
</parent>
1111
<artifactId>mcp-test</artifactId>
1212
<packaging>jar</packaging>
@@ -24,7 +24,7 @@
2424
<dependency>
2525
<groupId>io.modelcontextprotocol.sdk</groupId>
2626
<artifactId>mcp</artifactId>
27-
<version>0.17.0-SNAPSHOT</version>
27+
<version>0.18.0-SNAPSHOT</version>
2828
</dependency>
2929

3030
<dependency>

mcp/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>io.modelcontextprotocol.sdk</groupId>
88
<artifactId>mcp-parent</artifactId>
9-
<version>0.17.0-SNAPSHOT</version>
9+
<version>0.18.0-SNAPSHOT</version>
1010
</parent>
1111
<artifactId>mcp</artifactId>
1212
<packaging>jar</packaging>
@@ -25,13 +25,13 @@
2525
<dependency>
2626
<groupId>io.modelcontextprotocol.sdk</groupId>
2727
<artifactId>mcp-json-jackson2</artifactId>
28-
<version>0.17.0-SNAPSHOT</version>
28+
<version>0.18.0-SNAPSHOT</version>
2929
</dependency>
3030

3131
<dependency>
3232
<groupId>io.modelcontextprotocol.sdk</groupId>
3333
<artifactId>mcp-core</artifactId>
34-
<version>0.17.0-SNAPSHOT</version>
34+
<version>0.18.0-SNAPSHOT</version>
3535
</dependency>
3636
</dependencies>
3737

0 commit comments

Comments
 (0)