Skip to content

Commit 1499df2

Browse files
authored
extract mcp-core (#557)
* extract mcp-core - This change extracts classes previously in `mcp` to `mcp-core`; a new module which does not depend on `mcp-json-jackon2`. - `mcp` module is now an umbrella module that brings `mcp-json-jackon2` and `mcp-core` * add mcp-core to bom BREAKING CHANGE: All source code in the previously `mcp` module is moved to the `mcp-core`. the `mcp` now is just an aggregation for `mcp-core` + `mcp-json-jackson2` for backward compatibility. This change won't affect the end users, but will cause conflicts for the existing PRs.
1 parent 80d0ad8 commit 1499df2

File tree

139 files changed

+246
-151
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+246
-151
lines changed

mcp-bom/pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@
2727
<dependencyManagement>
2828
<dependencies>
2929
<!-- Core MCP -->
30+
<dependency>
31+
<groupId>io.modelcontextprotocol.sdk</groupId>
32+
<artifactId>mcp-core</artifactId>
33+
<version>${project.version}</version>
34+
</dependency>
35+
36+
<!-- MCP -->
3037
<dependency>
3138
<groupId>io.modelcontextprotocol.sdk</groupId>
3239
<artifactId>mcp</artifactId>

mcp-core/pom.xml

Lines changed: 235 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
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+
<parent>
7+
<groupId>io.modelcontextprotocol.sdk</groupId>
8+
<artifactId>mcp-parent</artifactId>
9+
<version>0.13.0-SNAPSHOT</version>
10+
</parent>
11+
<artifactId>mcp-core</artifactId>
12+
<packaging>jar</packaging>
13+
<name>Java MCP SDK Core</name>
14+
<description>Core classes of the Java SDK implementation of the Model Context Protocol, enabling seamless integration with language models and AI tools</description>
15+
<url>https://github.com/modelcontextprotocol/java-sdk</url>
16+
17+
<scm>
18+
<url>https://github.com/modelcontextprotocol/java-sdk</url>
19+
<connection>git://github.com/modelcontextprotocol/java-sdk.git</connection>
20+
<developerConnection>git@github.com/modelcontextprotocol/java-sdk.git</developerConnection>
21+
</scm>
22+
23+
<build>
24+
<plugins>
25+
<plugin>
26+
<groupId>biz.aQute.bnd</groupId>
27+
<artifactId>bnd-maven-plugin</artifactId>
28+
<version>${bnd-maven-plugin.version}</version>
29+
<executions>
30+
<execution>
31+
<id>bnd-process</id>
32+
<goals>
33+
<goal>bnd-process</goal>
34+
</goals>
35+
<configuration>
36+
<bnd><![CDATA[
37+
Bundle-Name: Bundle ${project.groupId} : ${project.artifactId}
38+
version: ${versionmask;===;${version_cleanup;${project.version}}}
39+
Bundle-SymbolicName: ${project.groupId}.${project.artifactId}
40+
Bundle-Version: ${version}
41+
Automatic-Module-Name: ${project.groupId}.${project.artifactId}
42+
Import-Package: jakarta.*;resolution:=optional, \
43+
*;
44+
Export-Package: io.modelcontextprotocol.*;version="${version}";-noimport:=true
45+
-noimportjava: true;
46+
-nouses: true;
47+
-removeheaders: Private-Package
48+
]]>
49+
</bnd>
50+
</configuration>
51+
</execution>
52+
</executions>
53+
</plugin>
54+
55+
<plugin>
56+
<groupId>org.apache.maven.plugins</groupId>
57+
<artifactId>maven-jar-plugin</artifactId>
58+
<configuration>
59+
<archive>
60+
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
61+
</archive>
62+
</configuration>
63+
</plugin>
64+
</plugins>
65+
</build>
66+
67+
<dependencies>
68+
<dependency>
69+
<groupId>io.modelcontextprotocol.sdk</groupId>
70+
<artifactId>mcp-json</artifactId>
71+
<version>0.13.0-SNAPSHOT</version>
72+
</dependency>
73+
74+
<dependency>
75+
<groupId>org.slf4j</groupId>
76+
<artifactId>slf4j-api</artifactId>
77+
<version>${slf4j-api.version}</version>
78+
</dependency>
79+
80+
<dependency>
81+
<groupId>com.fasterxml.jackson.core</groupId>
82+
<artifactId>jackson-annotations</artifactId>
83+
<version>${jackson.version}</version>
84+
</dependency>
85+
86+
<dependency>
87+
<groupId>io.projectreactor</groupId>
88+
<artifactId>reactor-core</artifactId>
89+
</dependency>
90+
91+
92+
<!-- Used by the HttpServletSseServerTransport -->
93+
<dependency>
94+
<groupId>jakarta.servlet</groupId>
95+
<artifactId>jakarta.servlet-api</artifactId>
96+
<version>${jakarta.servlet.version}</version>
97+
<scope>provided</scope>
98+
</dependency>
99+
100+
<!-- Test dependencies -->
101+
<dependency>
102+
<groupId>io.modelcontextprotocol.sdk</groupId>
103+
<artifactId>mcp-json-jackson2</artifactId>
104+
<version>0.13.0-SNAPSHOT</version>
105+
<scope>test</scope>
106+
</dependency>
107+
108+
<dependency>
109+
<groupId>org.springframework</groupId>
110+
<artifactId>spring-webmvc</artifactId>
111+
<version>${springframework.version}</version>
112+
<scope>test</scope>
113+
</dependency>
114+
115+
116+
<dependency>
117+
<groupId>io.projectreactor.netty</groupId>
118+
<artifactId>reactor-netty-http</artifactId>
119+
<scope>test</scope>
120+
</dependency>
121+
122+
<!-- The Spring Context is required due to the reactor-netty connector being dependent on
123+
the Spring Lifecycle, as discussed here:
124+
https://github.com/spring-projects/spring-framework/issues/31180 -->
125+
<dependency>
126+
<groupId>org.springframework</groupId>
127+
<artifactId>spring-context</artifactId>
128+
<version>${springframework.version}</version>
129+
<scope>test</scope>
130+
</dependency>
131+
132+
<dependency>
133+
<groupId>org.springframework</groupId>
134+
<artifactId>spring-test</artifactId>
135+
<version>${springframework.version}</version>
136+
<scope>test</scope>
137+
</dependency>
138+
139+
<dependency>
140+
<groupId>org.assertj</groupId>
141+
<artifactId>assertj-core</artifactId>
142+
<version>${assert4j.version}</version>
143+
<scope>test</scope>
144+
</dependency>
145+
<dependency>
146+
<groupId>org.junit.jupiter</groupId>
147+
<artifactId>junit-jupiter-api</artifactId>
148+
<version>${junit.version}</version>
149+
<scope>test</scope>
150+
</dependency>
151+
<dependency>
152+
<groupId>org.junit.jupiter</groupId>
153+
<artifactId>junit-jupiter-params</artifactId>
154+
<version>${junit.version}</version>
155+
<scope>test</scope>
156+
</dependency>
157+
<dependency>
158+
<groupId>org.mockito</groupId>
159+
<artifactId>mockito-core</artifactId>
160+
<version>${mockito.version}</version>
161+
<scope>test</scope>
162+
</dependency>
163+
164+
<!-- Mockito cannot mock this class: class java.net.http.HttpClient. the bytebuddy helps. -->
165+
<dependency>
166+
<groupId>net.bytebuddy</groupId>
167+
<artifactId>byte-buddy</artifactId>
168+
<version>${byte-buddy.version}</version>
169+
<scope>test</scope>
170+
</dependency>
171+
<dependency>
172+
<groupId>io.projectreactor</groupId>
173+
<artifactId>reactor-test</artifactId>
174+
<scope>test</scope>
175+
</dependency>
176+
<dependency>
177+
<groupId>org.testcontainers</groupId>
178+
<artifactId>junit-jupiter</artifactId>
179+
<version>${testcontainers.version}</version>
180+
<scope>test</scope>
181+
</dependency>
182+
183+
<dependency>
184+
<groupId>org.awaitility</groupId>
185+
<artifactId>awaitility</artifactId>
186+
<version>${awaitility.version}</version>
187+
<scope>test</scope>
188+
</dependency>
189+
190+
<dependency>
191+
<groupId>ch.qos.logback</groupId>
192+
<artifactId>logback-classic</artifactId>
193+
<version>${logback.version}</version>
194+
<scope>test</scope>
195+
</dependency>
196+
197+
<dependency>
198+
<groupId>net.javacrumbs.json-unit</groupId>
199+
<artifactId>json-unit-assertj</artifactId>
200+
<version>${json-unit-assertj.version}</version>
201+
<scope>test</scope>
202+
</dependency>
203+
204+
<!-- Tomcat dependencies for testing -->
205+
<dependency>
206+
<groupId>org.apache.tomcat.embed</groupId>
207+
<artifactId>tomcat-embed-core</artifactId>
208+
<version>${tomcat.version}</version>
209+
<scope>test</scope>
210+
</dependency>
211+
<dependency>
212+
<groupId>org.apache.tomcat.embed</groupId>
213+
<artifactId>tomcat-embed-websocket</artifactId>
214+
<version>${tomcat.version}</version>
215+
<scope>test</scope>
216+
</dependency>
217+
218+
<dependency>
219+
<groupId>org.testcontainers</groupId>
220+
<artifactId>toxiproxy</artifactId>
221+
<version>${toxiproxy.version}</version>
222+
<scope>test</scope>
223+
</dependency>
224+
225+
<!-- Test-only JSON library for the Gson-based McpJsonMapper example -->
226+
<dependency>
227+
<groupId>com.google.code.gson</groupId>
228+
<artifactId>gson</artifactId>
229+
<version>2.10.1</version>
230+
<scope>test</scope>
231+
</dependency>
232+
</dependencies>
233+
234+
235+
</project>

0 commit comments

Comments
 (0)