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

Commit 42b5931

Browse files
committed
Add Bill of Materials (BOM) for dependency management
Introduces a new mcp-bom module to simplify dependency version management across Spring AI MCP projects. The BOM allows users to import a single dependency that manages versions of all MCP components, ensuring version compatibility and reducing maintenance overhead. - Adds mcp-bom module with managed versions for all Spring AI MCP dependencies - Provides centralized version control through a single BOM import - Removes explicit version declarations from documentation examples - Adds dependency management documentation and updates existing docs to reference the new BOM Resolves #59
1 parent dd065dd commit 42b5931

File tree

7 files changed

+179
-12
lines changed

7 files changed

+179
-12
lines changed

mcp-bom/pom.xml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<parent>
8+
<groupId>org.springframework.experimental</groupId>
9+
<artifactId>mcp-parent</artifactId>
10+
<version>0.5.0-SNAPSHOT</version>
11+
<relativePath>../pom.xml</relativePath>
12+
</parent>
13+
14+
<artifactId>mcp-bom</artifactId>
15+
<packaging>pom</packaging>
16+
<name>Spring AI MCP BOM</name>
17+
<description>Spring AI MCP Bill of Materials</description>
18+
19+
<properties>
20+
<main.basedir>${basedir}/..</main.basedir>
21+
</properties>
22+
23+
<dependencyManagement>
24+
<dependencies>
25+
<!-- Core MCP -->
26+
<dependency>
27+
<groupId>org.springframework.experimental</groupId>
28+
<artifactId>mcp</artifactId>
29+
<version>${project.version}</version>
30+
</dependency>
31+
32+
<!-- MCP Test -->
33+
<dependency>
34+
<groupId>org.springframework.experimental</groupId>
35+
<artifactId>mcp-test</artifactId>
36+
<version>${project.version}</version>
37+
</dependency>
38+
39+
<!-- MCP Transport - WebFlux SSE -->
40+
<dependency>
41+
<groupId>org.springframework.experimental</groupId>
42+
<artifactId>mcp-webflux-sse-transport</artifactId>
43+
<version>${project.version}</version>
44+
</dependency>
45+
46+
<!-- MCP Transport - WebMVC SSE -->
47+
<dependency>
48+
<groupId>org.springframework.experimental</groupId>
49+
<artifactId>mcp-webmvc-sse-transport</artifactId>
50+
<version>${project.version}</version>
51+
</dependency>
52+
53+
<!-- Spring AI MCP -->
54+
<dependency>
55+
<groupId>org.springframework.experimental</groupId>
56+
<artifactId>spring-ai-mcp</artifactId>
57+
<version>${project.version}</version>
58+
</dependency>
59+
</dependencies>
60+
</dependencyManagement>
61+
</project>
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
* xref:overview.adoc[Overview]
2+
** xref:dependency-management.adoc[Dependency Management]
23
* xref:mcp.adoc[MCP Java SDK]
34
* xref:spring-mcp.adoc[Spring AI MCP]
4-
// ** xref:concepts.adoc[AI Concepts]
5-
// * xref:getting-started.adoc[Getting Started]
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
[[dependency-management]]
2+
= Dependency Management
3+
4+
[[mcp-bom]]
5+
== Bill of Materials (BOM)
6+
7+
The Bill of Materials (BOM) declares the recommended versions of all the dependencies used by a given release.
8+
Using the BOM from your application’s build script avoids the need for you to specify and maintain the dependency versions yourself.
9+
Instead, the version of the BOM you’re using determines the utilized dependency versions.
10+
It also ensures that you’re using supported and tested versions of the dependencies by default, unless you choose to override them.
11+
12+
Add the BOM to your project:
13+
14+
[tabs]
15+
======
16+
Maven::
17+
+
18+
[source,xml,indent=0,subs="verbatim,quotes"]
19+
----
20+
<dependencyManagement>
21+
<dependencies>
22+
<dependency>
23+
<groupId>org.springframework.experimental</groupId>
24+
<artifactId>mcp-bom</artifactId>
25+
<version>0.5.0-SNAPSHOT</version>
26+
<type>pom</type>
27+
<scope>import</scope>
28+
</dependency>
29+
</dependencies>
30+
</dependencyManagement>
31+
----
32+
33+
Gradle::
34+
+
35+
[source,groovy,indent=0,subs="verbatim,quotes"]
36+
----
37+
dependencies {
38+
implementation platform("org.springframework.experimental:mcp-bom:0.5.0-SNAPSHOT")
39+
// Replace the following with the starter dependencies of specific modules you wish to use
40+
//...
41+
}
42+
----
43+
Gradle users can also use the Spring AI MCP BOM by leveraging Gradle (5.0+) native support for declaring dependency constraints using a Maven BOM.
44+
This is implemented by adding a 'platform' dependency handler method to the dependencies section of your Gradle build script.
45+
As shown in the snippet below this can then be followed by version-less declarations of the Starter Dependencies for the one or more spring-ai modules you wish to use, e.g. spring-ai-openai.
46+
======
47+
48+
[[dependencies]]
49+
== Available Dependencies
50+
51+
The following dependencies are available and managed by the BOM:
52+
53+
=== Core Dependencies
54+
55+
* `org.springframework.experimental:mcp` - Core MCP library providing the base functionality and APIs for Model Context Protocol implementation.
56+
* `org.springframework.experimental:spring-ai-mcp` - Spring AI integration with MCP, providing Spring-specific features and utilities.
57+
58+
=== Transport Dependencies
59+
60+
* `org.springframework.experimental:mcp-webflux-sse-transport` - WebFlux-based Server-Sent Events (SSE) transport implementation for reactive applications.
61+
* `org.springframework.experimental:mcp-webmvc-sse-transport` - WebMVC-based Server-Sent Events (SSE) transport implementation for servlet-based applications.
62+
63+
=== Testing Dependencies
64+
65+
* `org.springframework.experimental:mcp-test` - Testing utilities and support for MCP-based applications.
66+
67+
[[repositories]]
68+
=== Milestone and Snapshot Repositories
69+
70+
To use the Milestone and Snapshot version, you need to add references to the Spring Milestone and/or Snapshot repositories in your build file.
71+
Add the following repository definitions to your Maven or Gradle build file:
72+
73+
[tabs]
74+
======
75+
Maven::
76+
+
77+
[source,xml,indent=0,subs="verbatim,quotes"]
78+
----
79+
<repositories>
80+
<repository>
81+
<id>spring-milestones</id>
82+
<name>Spring Milestones</name>
83+
<url>https://repo.spring.io/milestone</url>
84+
<snapshots>
85+
<enabled>false</enabled>
86+
</snapshots>
87+
</repository>
88+
<repository>
89+
<id>spring-snapshots</id>
90+
<name>Spring Snapshots</name>
91+
<url>https://repo.spring.io/snapshot</url>
92+
<releases>
93+
<enabled>false</enabled>
94+
</releases>
95+
</repository>
96+
</repositories>
97+
----
98+
99+
Gradle::
100+
+
101+
[source,groovy,indent=0,subs="verbatim,quotes"]
102+
----
103+
repositories {
104+
mavenCentral()
105+
maven { url 'https://repo.spring.io/milestone' }
106+
maven { url 'https://repo.spring.io/snapshot' }
107+
}
108+
----
109+
======

mcp-docs/src/main/antora/modules/ROOT/pages/mcp.adoc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ The core MCP functionality:
3535
<dependency>
3636
<groupId>org.springframework.experimental</groupId>
3737
<artifactId>mcp</artifactId>
38-
<version>0.5.0-SNAPSHOT</version>
3938
</dependency>
4039
----
4140
+
@@ -48,14 +47,12 @@ For HTTP SSE transport implementations, add one of the following dependencies
4847
<dependency>
4948
<groupId>org.springframework.experimental</groupId>
5049
<artifactId>mcp-webflux-sse-transport</artifactId>
51-
<version>0.5.0-SNAPSHOT</version>
5250
</dependency>
5351
5452
<!-- Spring WebMVC-based SSE server transport -->
5553
<dependency>
5654
<groupId>org.springframework.experimental</groupId>
5755
<artifactId>mcp-webmvc-sse-transport</artifactId>
58-
<version>0.5.0-SNAPSHOT</version>
5956
</dependency>
6057
----
6158
@@ -83,6 +80,7 @@ implementation 'org.springframework.experimental:mcp-webmvc-sse-transport'
8380
----
8481
======
8582

83+
Reffer to the xref:dependency-management.adoc[Dependency Management] page for more information.
8684

8785
== Architecture
8886

mcp-docs/src/main/antora/modules/ROOT/pages/overview.adoc

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Spring integration features:
3737
* Spring-friendly MCP client abstractions
3838
* Auto-configurations (WIP)
3939

40-
== Installation
40+
== Getting Started
4141

4242
[tabs]
4343
======
@@ -48,29 +48,25 @@ Maven::
4848
<!-- Core MCP -->
4949
<dependency>
5050
<groupId>org.springframework.experimental</groupId>
51-
<artifactId>mcp</artifactId>
52-
<version>0.5.0-SNAPSHOT</version>
51+
<artifactId>mcp</artifactId>
5352
</dependency>
5453
5554
<!-- Optional: WebFlux SSE transport -->
5655
<dependency>
5756
<groupId>org.springframework.experimental</groupId>
5857
<artifactId>mcp-webflux-sse-transport</artifactId>
59-
<version>0.5.0-SNAPSHOT</version>
6058
</dependency>
6159
6260
<!-- Optional: WebMVC SSE transport -->
6361
<dependency>
6462
<groupId>org.springframework.experimental</groupId>
6563
<artifactId>mcp-webmvc-sse-transport</artifactId>
66-
<version>0.5.0-SNAPSHOT</version>
6764
</dependency>
6865
6966
<!-- Optional: Spring AI integration -->
7067
<dependency>
7168
<groupId>org.springframework.experimental</groupId>
7269
<artifactId>spring-ai-mcp</artifactId>
73-
<version>0.5.0-SNAPSHOT</version>
7470
</dependency>
7571
----
7672
+
@@ -107,6 +103,8 @@ repositories {
107103
----
108104
======
109105

106+
Reffer to the xref:dependency-management.adoc[Dependency Management] page for more information.
107+
110108
== Examples
111109

112110
* link:https://github.com/spring-projects/spring-ai-examples/tree/main/model-context-protocol/sqlite/simple[SQLite Simple] - Basic LLM-database integration

mcp-docs/src/main/antora/modules/ROOT/pages/spring-mcp.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,11 @@ To use this module, add the following dependency to your Maven project:
118118
<dependency>
119119
<groupId>org.springframework.experimental</groupId>
120120
<artifactId>spring-ai-mcp</artifactId>
121-
<version>0.5.0-SNAPSHOT</version>
122121
</dependency>
123122
----
124123

124+
Reffer to the xref:dependency-management.adoc[Dependency Management] page for more information.
125+
125126
=== Example: Creating an MCP Tool Server with Spring AI Functions
126127

127128
[source,java]

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
</properties>
101101

102102
<modules>
103+
<module>mcp-bom</module>
103104
<module>mcp</module>
104105
<module>mcp-transport/mcp-webflux-sse-transport</module>
105106
<module>mcp-transport/mcp-webmvc-sse-transport</module>

0 commit comments

Comments
 (0)