Skip to content

Commit f3e1bb5

Browse files
Restructure javadoc documentation to eliminate duplicate overviews
- Merge Features and Architecture sections from `sdk-overview.md` into `overview.md` - Create `getting-started.md` with Dependency and BOM setup instructions - Delete `sdk-overview.md` (content redistributed) - Update links to point to `getting-started.html` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 68ca849 commit f3e1bb5

File tree

4 files changed

+169
-185
lines changed

4 files changed

+169
-185
lines changed
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Getting Started
2+
3+
Add the following dependencies to your project:
4+
5+
## Maven
6+
7+
The core MCP functionality:
8+
9+
```xml
10+
<dependency>
11+
<groupId>io.modelcontextprotocol.sdk</groupId>
12+
<artifactId>mcp</artifactId>
13+
</dependency>
14+
```
15+
16+
The core `mcp` module already includes default `STDIO`, `SSE` and `Streamable-HTTP` transport implementations and doesn't require external web frameworks.
17+
18+
If you're using the Spring Framework and want to use Spring-specific transport implementations, add one of the following optional dependencies:
19+
20+
```xml
21+
<!-- Optional: Spring WebFlux-based SSE and Streamable-HTTP client and server transports -->
22+
<dependency>
23+
<groupId>io.modelcontextprotocol.sdk</groupId>
24+
<artifactId>mcp-spring-webflux</artifactId>
25+
</dependency>
26+
27+
<!-- Optional: Spring WebMVC-based SSE and Streamable-HTTP server transports -->
28+
<dependency>
29+
<groupId>io.modelcontextprotocol.sdk</groupId>
30+
<artifactId>mcp-spring-webmvc</artifactId>
31+
</dependency>
32+
```
33+
34+
## Gradle
35+
36+
The core MCP functionality:
37+
38+
```groovy
39+
dependencies {
40+
implementation platform("io.modelcontextprotocol.sdk:mcp")
41+
//...
42+
}
43+
```
44+
45+
The core `mcp` module already includes default `STDIO`, `SSE` and `Streamable-HTTP` transport implementations and doesn't require external web frameworks.
46+
47+
If you're using the Spring Framework and want to use Spring-specific transport implementations, add one of the following optional dependencies:
48+
49+
```groovy
50+
// Optional: Spring WebFlux-based SSE and Streamable-HTTP client and server transports
51+
dependencies {
52+
implementation platform("io.modelcontextprotocol.sdk:mcp-spring-webflux")
53+
}
54+
55+
// Optional: Spring WebMVC-based SSE and Streamable-HTTP server transports
56+
dependencies {
57+
implementation platform("io.modelcontextprotocol.sdk:mcp-spring-webmvc")
58+
}
59+
```
60+
61+
---
62+
63+
- `io.modelcontextprotocol.sdk:mcp-spring-webflux` - WebFlux-based Client and Server, `Streamable-HTTP` and `SSE` transport implementations.
64+
The WebFlux implementation can be used in reactive applications while the WebClient-based MCP Client can be used in both reactive and imperative applications.
65+
It is a highly scalable option and suitable and recommended for high-throughput scenarios.
66+
- `io.modelcontextprotocol.sdk:mcp-spring-webmvc` - WebMVC-based Server, `Streamable-HTTP` and `SSE` transport implementation for servlet-based applications.
67+
68+
## Bill of Materials (BOM)
69+
70+
The Bill of Materials (BOM) declares the recommended versions of all the dependencies used by a given release.
71+
Using the BOM from your application's build script avoids the need for you to specify and maintain the dependency versions yourself.
72+
Instead, the version of the BOM you're using determines the utilized dependency versions.
73+
It also ensures that you're using supported and tested versions of the dependencies by default, unless you choose to override them.
74+
75+
Add the BOM to your project:
76+
77+
### Maven
78+
79+
```xml
80+
<dependencyManagement>
81+
<dependencies>
82+
<dependency>
83+
<groupId>io.modelcontextprotocol.sdk</groupId>
84+
<artifactId>mcp-bom</artifactId>
85+
<version>0.12.1</version>
86+
<type>pom</type>
87+
<scope>import</scope>
88+
</dependency>
89+
</dependencies>
90+
</dependencyManagement>
91+
```
92+
93+
### Gradle
94+
95+
```groovy
96+
dependencies {
97+
implementation platform("io.modelcontextprotocol.sdk:mcp-bom:0.12.1")
98+
//...
99+
}
100+
```
101+
102+
Gradle users can also use the MCP BOM by leveraging Gradle (5.0+) native support for declaring dependency constraints using a Maven BOM.
103+
This is implemented by adding a 'platform' dependency handler method to the dependencies section of your Gradle build script.
104+
As shown in the snippet above, this can then be followed by version-less declarations of the MCP SDK modules you wish to use.
105+
106+
---
107+
108+
Replace the version number with the version of the BOM you want to use.
109+
110+
## Additional Dependencies
111+
112+
The following additional dependencies are available and managed by the BOM:
113+
114+
- `io.modelcontextprotocol.sdk:mcp-test` - Testing utilities and support for MCP-based applications.

mcp-core/src/main/javadoc/io/modelcontextprotocol/doc-files/sdk-overview.md

Lines changed: 0 additions & 174 deletions
This file was deleted.

mcp-core/src/main/javadoc/io/modelcontextprotocol/doc-files/server.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ Key features:
110110

111111
### WebFlux Transport
112112

113-
WebFlux-based SSE and Streamable-HTTP server transport. Requires the `mcp-spring-webflux` dependency (see [Dependencies](sdk-overview.html#dependencies)).
113+
WebFlux-based SSE and Streamable-HTTP server transport. Requires the `mcp-spring-webflux` dependency (see [Getting Started](getting-started.html)).
114114

115115
#### Streamable-HTTP (WebFlux)
116116

src/main/javadoc/overview.md

Lines changed: 54 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,65 @@ The source code is available at [github.com/modelcontextprotocol/java-sdk](https
1313
- **mcp-spring-webflux** - Spring WebFlux transport
1414
- **mcp-spring-webmvc** - Spring WebMVC transport
1515

16-
## Getting Started
16+
## Features
1717

18-
Add the MCP SDK to your project:
18+
- MCP Client and MCP Server implementations supporting:
19+
- Protocol [version compatibility negotiation](https://modelcontextprotocol.io/specification/latest/basic/lifecycle#initialization)
20+
- [Tool](https://modelcontextprotocol.io/specification/latest/server/tools/) discovery, execution, list change notifications
21+
- [Resource](https://modelcontextprotocol.io/specification/latest/server/resources/) management with URI templates
22+
- [Prompt](https://modelcontextprotocol.io/specification/latest/server/prompts/) handling and management
23+
- [Completion](https://modelcontextprotocol.io/specification/latest/server/utilities/completion/) argument autocompletion suggestions for prompts and resource URIs
24+
- [Progress](https://modelcontextprotocol.io/specification/latest/basic/utilities/progress/) progress tracking for long-running operations
25+
- [Ping](https://modelcontextprotocol.io/specification/latest/basic/utilities/ping/) lightweight health check mechanism
26+
- [Server Keepalive](https://modelcontextprotocol.io/specification/latest/basic/utilities/ping#implementation-considerations/) to maintain active server connections
27+
- [Logging](https://modelcontextprotocol.io/specification/latest/server/utilities/logging/) for sending structured log messages to clients
28+
- [Roots](https://modelcontextprotocol.io/specification/latest/client/roots/) list management and notifications
29+
- [Sampling](https://modelcontextprotocol.io/specification/latest/client/sampling/) support for AI model interactions
30+
- [Elicitation](https://modelcontextprotocol.io/specification/latest/client/elicitation/) for servers to request additional information from users through the client
31+
- Multiple transport implementations:
32+
- Default transports (included in core `mcp` module, no external web frameworks required):
33+
- Stdio-based transport for process-based communication
34+
- Java HttpClient-based `SSE` and `Streamable-HTTP` client transport
35+
- Servlet-based `SSE` and `Streamable-HTTP` server transport
36+
- Optional Spring-based transports (convenience if using Spring Framework):
37+
- WebFlux `SSE` and `Streamable-HTTP` client and server transports
38+
- WebMVC `SSE` and `Streamable-HTTP` transport for servlet-based HTTP streaming
39+
- Supports Synchronous and Asynchronous programming paradigms
1940

20-
```xml
21-
<dependency>
22-
<groupId>io.modelcontextprotocol.sdk</groupId>
23-
<artifactId>mcp</artifactId>
24-
<version>${mcp.version}</version>
25-
</dependency>
26-
```
41+
> **Tip:** The core `io.modelcontextprotocol.sdk:mcp` module provides default `STDIO`, `SSE` and `Streamable-HTTP` client and server transport implementations without requiring external web frameworks.
42+
>
43+
> Spring-specific transports are available as optional dependencies for convenience when using the [Spring AI](https://docs.spring.io/spring-ai/reference/1.1-SNAPSHOT/api/mcp/mcp-overview.html) Framework.
44+
45+
## Architecture
46+
47+
The SDK follows a layered architecture with clear separation of concerns:
48+
49+
- **Client/Server Layer (McpClient/McpServer)**: Both use McpSession for sync/async operations,
50+
with McpClient handling client-side protocol operations and McpServer managing server-side protocol operations.
51+
- **Session Layer (McpSession)**: Manages communication patterns and state using DefaultMcpSession implementation.
52+
- **Transport Layer (McpTransport)**: Handles JSON-RPC message serialization/deserialization via:
53+
- StdioTransport (stdin/stdout) in the core module
54+
- HTTP `Streamable-HTTP` and `SSE` transports in dedicated transport modules (Java HttpClient, Spring WebFlux, Spring WebMVC)
55+
56+
The [MCP Client](io/modelcontextprotocol/doc-files/client.html) is a key component in the Model Context Protocol (MCP) architecture, responsible for establishing and managing connections with MCP servers.
57+
It implements the client-side of the protocol.
58+
59+
<img src="io/modelcontextprotocol/doc-files/images/java-mcp-client-architecture.jpg" alt="Java MCP Client Architecture" style="max-height: 80vh;">
60+
61+
The [MCP Server](io/modelcontextprotocol/doc-files/server.html) is a foundational component in the Model Context Protocol (MCP) architecture that provides tools, resources, and capabilities to clients.
62+
It implements the server-side of the protocol.
63+
64+
<img src="io/modelcontextprotocol/doc-files/images/java-mcp-server-architecture.jpg" alt="Java MCP Server Architecture" style="max-height: 80vh;">
65+
66+
Key Interactions:
67+
68+
- **Client/Server Initialization**: Transport setup, protocol compatibility check, capability negotiation, and implementation details exchange.
69+
- **Message Flow**: JSON-RPC message handling with validation, type-safe response processing, and error handling.
70+
- **Resource Management**: Resource discovery, URI template-based access, subscription system, and content retrieval.
2771

2872
## SDK Documentation
2973

30-
- [Java SDK Overview](io/modelcontextprotocol/doc-files/sdk-overview.html) - Features, architecture, and dependencies
74+
- [Getting Started](io/modelcontextprotocol/doc-files/getting-started.html) - Dependencies and setup
3175
- [MCP Client](io/modelcontextprotocol/doc-files/client.html) - Client implementation and transport options
3276
- [MCP Server](io/modelcontextprotocol/doc-files/server.html) - Server implementation and transport providers
3377

0 commit comments

Comments
 (0)