Skip to content

Commit 6e1bbc4

Browse files
authored
feat(java): Update the Java SDK to 0.8.0 (modelcontextprotocol#190)
* feat(java): Update the Java SDK to 0.8.0 - Update Java SDK version from 0.7.0 to 0.8.0 - Refactor transport layer to use transportProvider pattern - Rename registrations to specifications in server API - Add exchange parameter to callback functions - Add breaking changes note - Enhance MCP Java SDK documentation with sampling * Add documentation for sampling capabilities in MCP Server * Expand documentation for Tool, Resource, and Prompt specifications * Add Spring AI integration to the client/server docs Signed-off-by: Christian Tzolov <[email protected]> * refactor(java-sdk): improve API usage example - Replace Content builder pattern with direct TextContent constructor - Replace ModelHint builder pattern with static factory method Signed-off-by: Christian Tzolov <[email protected]> --------- Signed-off-by: Christian Tzolov <[email protected]>
1 parent b81c31f commit 6e1bbc4

File tree

4 files changed

+226
-48
lines changed

4 files changed

+226
-48
lines changed

sdk/java/.DS_Store

6 KB
Binary file not shown.

sdk/java/mcp-client.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ The MCP Client is a key component in the Model Context Protocol (MCP) architectu
1515
- Prompt system interactions
1616
- Optional features like roots management and sampling support
1717

18+
<Tip>
19+
The [Spring-AI MCP Client](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-client-boot-starter-docs.html) integration extends the MCP Java SDK to
20+
provide auto-configuration for MCP client functionality in Spring Boot applications and integrating with Spring AI’s [tool execution framework](https://docs.spring.io/spring-ai/reference/api/tools.html).
21+
</Tip>
22+
1823
The client provides both synchronous and asynchronous APIs for flexibility in different application contexts.
1924

2025
<Tabs>
@@ -182,7 +187,6 @@ The roots capability allows servers to:
182187
- Receive notifications when the roots list changes
183188
- Understand which directories and files they have access to
184189

185-
186190
### Sampling Support
187191

188192
Sampling enables servers to request LLM interactions ("completions" or "generations") through the client:
@@ -209,7 +213,6 @@ This capability allows:
209213
- Support for both text and image-based interactions
210214
- Optional inclusion of MCP server context in prompts
211215

212-
213216
## Using MCP Clients
214217

215218
### Tool Execution
@@ -320,3 +323,4 @@ client.executePrompt("echo", Map.of(
320323
```
321324
</Tab>
322325
</Tabs>
326+

sdk/java/mcp-overview.mdx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ description: Introduction to the Model Context Protocol (MCP) Java SDK
66
Java SDK for the [Model Context Protocol](https://modelcontextprotocol.org/docs/concepts/architecture)
77
enables standardized integration between AI models and tools.
88

9+
<Note>
10+
### Breaking Changes in 0.8.0 ⚠️
11+
**Note:** Version 0.8.0 introduces several breaking changes including a new session-based architecture.
12+
If you're upgrading from 0.7.0, please refer to the [Migration Guide](https://github.com/modelcontextprotocol/java-sdk/blob/main/migration-0.8.0.md) for detailed instructions.
13+
</Note>
14+
915
## Features
1016

1117
- MCP Client and MCP Server implementations supporting:
@@ -25,6 +31,10 @@ enables standardized integration between AI models and tools.
2531
- WebMVC SSE transport for servlet-based HTTP streaming
2632
- Supports Synchronous and Asynchronous programming paradigms
2733

34+
<Tip>[Spring AI MCP](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-overview.html) extends the MCP Java SDK with Spring Boot integration,
35+
providing both [Client](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-client-boot-starter-docs.html) and [Server](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-server-boot-starter-docs.html) Boot Starters.
36+
You can bootstrap your AI Spring applications using the [Spring Initializer](https://start.spring.io/).</Tip>
37+
2838
## Architecture
2939

3040
The SDK follows a layered architecture with clear separation of concerns:
@@ -129,7 +139,7 @@ Add the BOM to your project:
129139
<dependency>
130140
<groupId>io.modelcontextprotocol.sdk</groupId>
131141
<artifactId>mcp-bom</artifactId>
132-
<version>0.7.0</version>
142+
<version>0.8.0</version>
133143
<type>pom</type>
134144
<scope>import</scope>
135145
</dependency>
@@ -141,7 +151,7 @@ Add the BOM to your project:
141151
<Tab title="Gradle">
142152
```groovy
143153
dependencies {
144-
implementation platform("io.modelcontextprotocol.sdk:mcp-bom:0.7.0")
154+
implementation platform("io.modelcontextprotocol.sdk:mcp-bom:0.8.0")
145155
//...
146156
}
147157
```

0 commit comments

Comments
 (0)