Skip to content
This repository was archived by the owner on Feb 14, 2025. It is now read-only.

Commit 12fd8e5

Browse files
committed
refactor: rename artifacts and restructure modules
- Rename spring-ai-mcp-core to mcp for simpler artifact naming - Rename spring-ai-mcp-spring to spring-ai-mcp for clarity - Rename parent artifact from spring-ai-mcp to mcp-parent - Update artifact references in pom files and documentation - Update directory structure and paths in GitHub workflow Resolves #31 chore: improve module descriptions and update dependencies - Update parent pom description to better reflect overall project scope - Update mcp module description to detail core Java SDK capabilities - Update spring-ai-mcp module description to emphasize Spring integration features - Update dependency versions to stable releases: * JUnit: 5.11.3 -> 5.10.2 * Jackson: 2.18.2 -> 2.17.0
1 parent 2ea5527 commit 12fd8e5

35 files changed

+92
-109
lines changed

.github/workflows/maven-central-release.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ jobs:
1717

1818
- name: Prepare directory structure
1919
run: |
20+
mkdir -p nexus/org/springframework/experimental/mcp-parent/$RELEASE_VERSION
21+
mkdir -p nexus/org/springframework/experimental/mcp/$RELEASE_VERSION
2022
mkdir -p nexus/org/springframework/experimental/spring-ai-mcp/$RELEASE_VERSION
21-
mkdir -p nexus/org/springframework/experimental/spring-ai-mcp-core/$RELEASE_VERSION
22-
mkdir -p nexus/org/springframework/experimental/spring-ai-mcp-spring/$RELEASE_VERSION
2323
2424
- name: Download release files from Artifactory
2525
env:
@@ -33,19 +33,19 @@ jobs:
3333
3434
echo "Downloading core artifacts"
3535
cd ../../../../../..
36-
cd nexus/org/springframework/experimental/spring-ai-mcp-core/$RELEASE_VERSION
37-
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-ai-mcp-core/$RELEASE_VERSION/spring-ai-mcp-core-$RELEASE_VERSION.pom
38-
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-ai-mcp-core/$RELEASE_VERSION/spring-ai-mcp-core-$RELEASE_VERSION.jar
39-
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-ai-mcp-core/$RELEASE_VERSION/spring-ai-mcp-core-$RELEASE_VERSION-javadoc.jar
40-
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-ai-mcp-core/$RELEASE_VERSION/spring-ai-mcp-core-$RELEASE_VERSION-sources.jar
36+
cd nexus/org/springframework/experimental/mcp/$RELEASE_VERSION
37+
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/mcp/$RELEASE_VERSION/mcp-$RELEASE_VERSION.pom
38+
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/mcp/$RELEASE_VERSION/mcp-$RELEASE_VERSION.jar
39+
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/mcp/$RELEASE_VERSION/mcp-$RELEASE_VERSION-javadoc.jar
40+
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/mcp/$RELEASE_VERSION/mcp-$RELEASE_VERSION-sources.jar
4141
4242
echo "Downloading spring artifacts"
4343
cd ../../../../../..
44-
cd nexus/org/springframework/experimental/spring-ai-mcp-spring/$RELEASE_VERSION
45-
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-ai-mcp-spring/$RELEASE_VERSION/spring-ai-mcp-spring-$RELEASE_VERSION.pom
46-
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-ai-mcp-spring/$RELEASE_VERSION/spring-ai-mcp-spring-$RELEASE_VERSION.jar
47-
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-ai-mcp-spring/$RELEASE_VERSION/spring-ai-mcp-spring-$RELEASE_VERSION-javadoc.jar
48-
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-ai-mcp-spring/$RELEASE_VERSION/spring-ai-mcp-spring-$RELEASE_VERSION-sources.jar
44+
cd nexus/org/springframework/experimental/spring-ai-mcp/$RELEASE_VERSION
45+
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-ai-mcp/$RELEASE_VERSION/spring-ai-mcp-$RELEASE_VERSION.pom
46+
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-ai-mcp/$RELEASE_VERSION/spring-ai-mcp-$RELEASE_VERSION.jar
47+
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-ai-mcp/$RELEASE_VERSION/spring-ai-mcp-$RELEASE_VERSION-javadoc.jar
48+
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-ai-mcp/$RELEASE_VERSION/spring-ai-mcp-$RELEASE_VERSION-sources.jar
4949
5050
- name: Sign artifacts and release them to Maven Central
5151
uses: spring-io/nexus-sync-action@main

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
# Spring AI MCP
1+
# Java & Spring MCP
22

33
Java SDK for the Model Context Protocol (MCP), providing seamless integration between Java and Spring applications and MCP-compliant AI resources and tools.
44

55
## Overview
66

7-
Spring AI MCP is an experimental project that provides Java and Spring Framework integration for the [Model Context Protocol](https://modelcontextprotocol.org/docs/concepts/architecture). It enables Java applications to interact with AI models and tools through a standardized interface, supporting both synchronous and asynchronous communication patterns.
7+
Experimental project that provides Java and Spring Framework integration for the [Model Context Protocol](https://modelcontextprotocol.org/docs/concepts/architecture). It enables Java applications to interact with AI models and tools through a standardized interface, supporting both synchronous and asynchronous communication patterns.
88

99
<img src="docs/spring-ai-mcp-architecture.jpg" width="600">
1010

1111
## Modules
1212

1313
The project consists of two main modules:
1414

15-
### [mcp-core](./spring-ai-mcp-core/README.md)
15+
### [mcp](./mcp/README.md)
1616

1717
The core module provides a Java implementation of the Model Context Protocol specification. It includes:
1818
- Synchronous and asynchronous client implementations
1919
- Standard MCP operations support (tool discovery, resource management, prompt handling). Support for request and notificaiotn handling.
2020
- [Stdio](https://spec.modelcontextprotocol.io/specification/basic/transports/#stdio) and [SSE](https://spec.modelcontextprotocol.io/specification/basic/transports/#http-with-sse) transport implementations.
21-
- [Find more](./spring-ai-mcp-core/README.md).
21+
- [Find more](./mcp/README.md).
2222

23-
### [mcp-spring](./spring-ai-mcp-spring/README.md)
23+
### [spring-ai-mcp](./spring-ai-mcp/README.md)
2424

2525
The Spring integration module provides Spring-specific functionality:
2626
- Integration with Spring AI's function calling system
@@ -41,14 +41,14 @@ Add the following dependencies to your Maven project:
4141
<!-- For core MCP functionality -->
4242
<dependency>
4343
<groupId>org.springframework.experimental</groupId>
44-
<artifactId>spring-ai-mcp-core</artifactId>
44+
<artifactId>mcp</artifactId>
4545
<version>0.2.0-SNAPSHOT</version>
4646
</dependency>
4747

48-
<!-- For Spring integration -->
48+
<!-- For Spring AI integration -->
4949
<dependency>
5050
<groupId>org.springframework.experimental</groupId>
51-
<artifactId>spring-ai-mcp-spring</artifactId>
51+
<artifactId>spring-ai-mcp</artifactId>
5252
<version>0.2.0-SNAPSHOT</version>
5353
</dependency>
5454
```
@@ -64,9 +64,9 @@ Explore these MCP examples in the [spring-ai-examples/model-context-protocol](ht
6464

6565
## Documentation
6666

67-
- [Core Module Documentation](spring-ai-mcp-core/README.md)
68-
- [Spring Integration Documentation](spring-ai-mcp-spring/README.md)
69-
- [UML Class Diagrams](spring-ai-mcp-core/docs/spring-ai-mcp-uml-classdiagram.svg)
67+
- [Core Module Documentation](mcp/README.md)
68+
- [Spring Integration Documentation](spring-ai-mcp/README.md)
69+
- [UML Class Diagrams](spring-ai-mcp/docs/spring-ai-mcp-uml-classdiagram.svg)
7070

7171
## Development
7272

spring-ai-mcp-core/README.md renamed to mcp/README.md

Lines changed: 49 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ This SDK implements the Model Context Protocol, enabling seamless integration wi
88

99
## Features
1010

11-
- Synchronous and Asynchronous client implementations
11+
- Synchronous and Asynchronous MCP Client implementations
12+
- Synchronous and Asynchronous MCP Server implementations (WIP: comming with 0.3.0)
1213
- Standard MCP operations support:
1314
- Protocol version compatibility negotiation
1415
- Client-server capability exchange
@@ -32,7 +33,7 @@ Add the following dependency to your Maven project:
3233
```xml
3334
<dependency>
3435
<groupId>org.springframework.experimental</groupId>
35-
<artifactId>spring-ai-mcp-core</artifactId>
36+
<artifactId>mcp</artifactId>
3637
<version>0.2.0-SNAPSHOT</version>
3738
</dependency>
3839
```
@@ -60,10 +61,6 @@ Server-Sent Events (SSE) based transport following the MCP HTTP with SSE transpo
6061
WebClient.Builder webClientBuilder = WebClient.builder()
6162
.baseUrl("http://your-mcp-server");
6263
McpTransport transport = new SseClientTransport(webClientBuilder);
63-
64-
// Or with custom ObjectMapper
65-
ObjectMapper mapper = new ObjectMapper();
66-
McpTransport transport = new SseClientTransport(webClientBuilder, mapper);
6764
```
6865

6966
The SSE transport provides:
@@ -74,52 +71,14 @@ The SSE transport provides:
7471
- Graceful shutdown handling
7572
- Configurable JSON serialization
7673

77-
### Roots List Support
78-
79-
The SDK supports the MCP roots list capability, which allows servers to understand which directories and files they have access to. Clients can provide a list of root directories/files and notify servers when this list changes.
80-
81-
#### Features
82-
- Define root providers that supply filesystem access boundaries
83-
- Support for roots list changed notifications
84-
- Automatic roots list request handling
85-
86-
#### Example with Roots List Configuration
87-
88-
```java
89-
// Create root providers
90-
List<Supplier<List<Root>>> rootProviders = List.of(
91-
() -> List.of(new Root("file:///workspace/project", "Project Root")),
92-
() -> List.of(new Root("file:///workspace/docs", "Documentation"))
93-
);
94-
95-
// Create async client with roots list support
96-
McpAsyncClient client = new McpAsyncClient(
97-
new StdioClientTransport(params),
98-
Duration.ofSeconds(30),
99-
rootProviders, // Configure root providers
100-
true // Enable roots list changed notifications
101-
);
102-
103-
// Initialize connection
104-
client.initialize()
105-
.doOnSuccess(result -> {
106-
// Connection initialized with roots list capability
107-
108-
// Notify server when roots list changes
109-
return client.sendRootsListChanged();
110-
})
111-
.subscribe();
112-
```
11374

114-
### Sync Client Example
75+
### Sync MCP Client Example
11576

11677
```java
11778
// Create and initialize sync client
118-
ServerParameters params = ServerParameters.builder("npx")
119-
.args("-y", "@modelcontextprotocol/server-everything", "dir")
120-
.build();
79+
McpTransport mcpTransport = ...
12180

122-
try (McpSyncClient client = McpClient.sync(new StdioClientTransport(params))) {
81+
try (McpSyncClient client = McpClient.using(mcpTransport).sync()) {
12382
// Initialize connection with protocol version and capabilities
12483
McpSchema.InitializeResult initResult = client.initialize();
12584

@@ -145,20 +104,15 @@ try (McpSyncClient client = McpClient.sync(new StdioClientTransport(params))) {
145104
}
146105
```
147106

148-
### Async Client Example with Custom Configuration
107+
### Async MCP Client Example with Custom Configuration
149108

150109
```java
151-
// Create server parameters
152-
ServerParameters params = ServerParameters.builder("npx")
153-
.args("-y", "@modelcontextprotocol/server-everything", "dir")
154-
.build();
110+
McpTransport mcpTransport = ...
155111

156112
// Initialize async client with custom timeout and object mapper
157-
McpAsyncClient client = McpClient.async(
158-
new StdioClientTransport(params),
159-
Duration.ofSeconds(30),
160-
new ObjectMapper()
161-
);
113+
McpAsyncClient client = McpClient.using(mcpTransport)
114+
.requestTimeout(Duration.ofSeconds(30))
115+
.async();
162116

163117
// Initialize connection and chain operations
164118
var result = client.initialize()
@@ -261,7 +215,44 @@ The SDK follows a layered architecture with clear separation of concerns:
261215
- Execution handling with timeout support
262216
- Result processing with error handling
263217

264-
### Change Notifications
218+
### Roots List Support
219+
220+
The SDK supports the MCP roots list capability, which allows servers to understand which directories and files they have access to. Clients can provide a list of root directories/files and notify servers when this list changes.
221+
222+
#### Features
223+
- Define root providers that supply filesystem access boundaries
224+
- Support for roots list changed notifications
225+
- Automatic roots list request handling
226+
227+
#### Example with Roots List Configuration
228+
229+
```java
230+
// Create root providers
231+
List<Supplier<List<Root>>> rootProviders = List.of(
232+
() -> List.of(new Root("file:///workspace/project", "Project Root")),
233+
() -> List.of(new Root("file:///workspace/docs", "Documentation"))
234+
);
235+
236+
// Create async client with roots list support
237+
McpAsyncClient client = new McpAsyncClient(
238+
new StdioClientTransport(params),
239+
Duration.ofSeconds(30),
240+
rootProviders, // Configure root providers
241+
true // Enable roots list changed notifications
242+
);
243+
244+
// Initialize connection
245+
client.initialize()
246+
.doOnSuccess(result -> {
247+
// Connection initialized with roots list capability
248+
249+
// Notify server when roots list changes
250+
return client.sendRootsListChanged();
251+
})
252+
.subscribe();
253+
```
254+
255+
### Change Notifications Support
265256

266257
The SDK supports automatic handling of changes through a non-blocking notification system for tools, resources, and prompts:
267258

spring-ai-mcp-core/pom.xml renamed to mcp/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
<modelVersion>4.0.0</modelVersion>
66
<parent>
77
<groupId>org.springframework.experimental</groupId>
8-
<artifactId>spring-ai-mcp</artifactId>
8+
<artifactId>mcp-parent</artifactId>
99
<version>0.2.0-SNAPSHOT</version>
1010
</parent>
11-
<artifactId>spring-ai-mcp-core</artifactId>
11+
<artifactId>mcp</artifactId>
1212
<packaging>jar</packaging>
13-
<name>Spring AI MCP Core</name>
14-
<description>Demo project for Spring Boot</description>
13+
<name>Java MCP SDK</name>
14+
<description>Core Java implementation of the Model Context Protocol (MCP) specification, providing synchronous and asynchronous clients, server implementations (coming in 0.3.0), with support for tool discovery, resource management, and multiple transport implementations</description>
1515
<url>https://github.com/spring-projects-experimental/spring-ai-mcp</url>
1616

1717
<scm>
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@
4040
* </ul>
4141
*
4242
* <p>
43-
* Each client type can be instantiated with default settings or with custom configuration
44-
* including request timeout and JSON object mapping.
45-
*
46-
* <p>
4743
* Use the builder pattern for flexible client configuration:
4844
*
4945
* <pre>{@code

0 commit comments

Comments
 (0)