Commit graph java-sdk/pom.xml
Author SHA1 Message Date
Christian Tzolov
b2d3e0098e Next development version
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-05-12 15:04:05 +02:00
Dennis Kawurek
eae3840e7d
fix: Mockito inline mocking for Java 21+ (#207)
Before this fix the execution of the maven surefire
plugin with Java 21 logged warnings that mockito should be added as
a java agent, because the self-attaching won't be supported in future
java releases.
In Java 24 the test just broke.

This problem is solved by modifying the pom.xml of the parent and doing
this changes:

* Adding mockito as a java agent.
* Removing the surefireArgLine from the properties. This can be
added back when it's needed (for example when JaCoCo will be used).

Furthermore, the pom.xml in the mcp-spring-* modules now have
the byte-buddy dependency included, as the test would otherwise break
when trying to mock McpSchema#CreateMessageRequest.

Fixes #187

Co-authored-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
2025-05-08 12:44:51 +02:00
E550448
344f1b8383 feat(mcp): resolve absolute and relative message endpoint URIs (#150)
Improve endpoint URI handling by supporting both relative paths
and properly validated absolute URIs.

- Implement URI resolution in HttpClientSseClientTransport:
- Change baseUri field from String to URI type
- Add Utils.resolveUri method to handle both absolute and relative URIs
- Resolve relative URIs against the base URI
- Validate absolute URIs to ensure they match base URI's scheme, authority, and path
- Add parameterized tests for various URI resolution scenarios
- Add ByteBuddy dependency for HttpClient mocking and update Mockito

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-04-18 14:52:50 +02:00
Christian Tzolov
f348a83e5a Next development version
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-04-10 18:06:46 +02:00
Christian Tzolov
a94163b282 Next development version
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-03-21 18:11:30 +01:00
Christian Tzolov
a72abf6e33
(pom) Enable automatic publishing to Maven Central (#63)
Set autoPublish to true in the Maven configuration to
automatically publish artifacts to the Central repository when the release is performed.

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-03-21 17:05:06 +01:00
Christian Tzolov
1bee8d4744
refactor(mcp): remove redundant type field from Content implementations (#27)
- The type field and associated methods were redundant in Content implementations (TextContent, ImageContent, EmbeddedResource)
  as the type information is already handled by Jackson's polymorphic type handling via @JsonSubTypes annotation.
- Add default implementation that returns the appropriate type string based on the implementing class (text, image, or resource)
- Added comprehensive unit tests for McpSchema to validate serialization/deserialization behavior of all schema components.
- Add deserialization tests for all content types
- Add json-unit-assertj for flexible JSON testing -  ignores array order and extra array items, reducing test brittleness while
maintaining functional validation.

Resolves #26
Resolve https://github.com/spring-projects/spring-ai/issues/2350

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-03-03 13:57:41 +01:00
konczdev
d9c4818607 Generate OSGi metadata 2025-02-26 18:55:46 +01:00
Christian Tzolov
352ec2db09 Next development version 0.8.0-SNAPSHOT
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-02-14 13:39:20 +01:00
Christian Tzolov
d14b10e014 Enable maven-central auto-publish
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-02-14 13:07:57 +01:00
Christian Tzolov
dfe576b461 Update pom and GH actions
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-02-14 12:40:27 +01:00
Christian Tzolov
48e4cf4b13 Minor pom config 2025-02-03 11:37:05 +01:00
Christian Tzolov
8cd3cfdf3f Improve docs 2025-01-29 14:32:43 +01:00
Christian Tzolov
585f30cf33 Module and Package restructoring
- mcp-transport -> mcp-spring
- mcp-webflux-sse-transport -> mcp-spring-webflux
 - pom coordinates changed accordingly
- mpc-webmvc-sse-transport -> mcp-spring-webmvc
 - pom coordinates changed accordingly
- docs contains the mdx version of the documentation
2025-01-29 13:40:53 +01:00
Christian Tzolov
c78c1adcc6 Migrate to central-publishing-maven-plugin 2025-01-28 19:36:27 +01:00
Christian Tzolov
1a506d0563
Update pom.xml
update nexus plugin version to 1.7.0
2025-01-28 17:52:23 +01:00
Christian Tzolov
181e1f25ab Change the top domain from org to io 2025-01-28 17:25:58 +01:00
Christian Tzolov
91a0332009 Update nexus-staging-maven-plugin conf 2025-01-28 17:04:45 +01:00
Christian Tzolov
01592fff45 Disable the mcp-docs as pom module 2025-01-28 14:08:47 +01:00
Christian Tzolov
d391598be7 Extend maven gpg configuration 2025-01-28 13:46:07 +01:00
Christian Tzolov
2d7228d47c Clean the pom 2025-01-28 13:06:05 +01:00
Christian Tzolov
8d946bbdff initial maven central relese configuraitons 2025-01-28 10:50:15 +01:00
Christian Tzolov
413d138d0c Change license from Apache to MIT
Resolves #1

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-01-24 23:05:15 +01:00
Christian Tzolov
3112e5ede7 Refactor package structure and dependencies
- Updated package prefix: `org.springframework.ai.mcp` → `org.modelcontextprotocol`
- Changed POM groupId: `org.springframework.experimental` → `org.modelcontextprotocol.sdk`
- Update all dependecies and BOM
- Updated documentation references accordingly

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-01-24 22:14:44 +01:00
Christian Tzolov
25ad5ed052 Remove the spring-ai-mcp module from the MCP Java SDK
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-01-24 20:25:42 +01:00
Christian Tzolov
dd64cd88c2 Next development version 2025-01-24 18:40:03 +01:00
Christian Tzolov
e7505ba247 Release version 0.6.0
Some checks failed
Deploy Docs / build (push) Has been cancelled
2025-01-24 18:39:38 +01:00
Christian Tzolov
9d90e4875f Next development version 2025-01-13 12:27:18 +01:00
Christian Tzolov
c4e2c79845 Release version 0.5.0
Some checks failed
Deploy Docs / build (push) Has been cancelled
2025-01-13 12:27:03 +01:00
Christian Tzolov
0c8968044c refactor: Add HttpServletSseServerTransport for generic Servlet integration
Introduces a new Server-Sent Events (SSE) Server transport implementation
based on the Servlet API that enables MCP integration with any Java HTTP
server application supporting Servlets.

This implementation complements the existing WebFlux and WebMvc transports
by providing a generic Servlet-based option that works with any Java web
server, not just Spring applications.

Key changes:

- Add HttpServletSseServerTransport with async Servlet 6.0 support
- Add integration tests with embedded Tomcat
- Add servlet dependencies with externalized versions:
  - jakarta.servlet-api 6.1.0 (provided)
  - tomcat-embed-core 11.0.2 (test)
  - tomcat-embed-websocket 11.0.2 (test)

Resolves #61
2025-01-12 19:33:46 +01:00
Christian Tzolov
42b5931dd5 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
2025-01-12 17:32:15 +01:00
Christian Tzolov
de95c00ce8 Move the WebMvc SSE Server + Http SSE Client sample to spring-ai-examples 2025-01-11 17:35:41 +01:00
Christian Tzolov
edbd78465c refactor(transport): Replace SseEmitter with queue-based SSE implementation in WebMvc transport
Replaces Spring's SseEmitter with a custom BlockingQueue-based SSE implementation in
WebMvcSseServerTransport for improved event delivery control and connection management.

The new implementation:
- Uses BlockingQueue for reliable event queuing and delivery
- Adds proper session management with dedicated SSEEvent record
- Improves error handling and timeout management
- Adds comprehensive integration tests

Resolves #57
2025-01-11 15:12:14 +01:00
Christian Tzolov
5058b08406 Make samples self-contained boot projects 2025-01-09 19:50:38 +01:00
Christian Tzolov
6311794bcd Improve the samples code 2025-01-09 16:48:36 +01:00
Christian Tzolov
611f3258d6 refactor: Split transport implementations into modules
Split the  transport implementations into dedicated modules to improve modularity
and reduce core dependencies.

Added shared test module for common test utilities.

Key changes:

- Create mcp-transport/mcp-webflux-sse-transport module
 - Move SseClientTransport → WebFluxSseClientTransport
 - Move SseServerTransport → WebFluxSseServerTransport
 - Move related tests and utilities

- Create mcp-transport/mcp-webmvc-sse-transport module
 - Add new WebMvcSseServerTransport implementation
 - Add corresponding tests and integration tests

- Add framework-independent SSE client implementations to core module
 - Add FlowSseClient using java.net.http
 - Add HttpClientSseClientTransport using java.net.http

- Keep StdioClientTransport/StdioServerTransport in core (no external deps)

- Create mcp-test module for shared test infrastructure
 - Move abstract test base classes
 - Move shared test utilities and mocks
 - Update test dependencies

The modular approach allows users to choose between:

- Framework-specific implementations (WebFlux/WebMVC)
- Pure Java implementations (java.net.http)
- Basic implementations (STDIO)

Add breaking changes readme: 0.5.0-BREAKING-CHANGES.md

Resolves #54
2025-01-09 15:38:34 +01:00
Christian Tzolov
85c4fb8713 Next development version 2025-01-07 10:55:08 +01:00
Christian Tzolov
a47eace440 Release version 0.4.2
Some checks failed
Deploy Docs / build (push) Has been cancelled
2025-01-07 10:54:53 +01:00
Christian Tzolov
8334e2ee96 Next development version 2025-01-04 18:13:19 +01:00
Christian Tzolov
25c9d8cc73 Release version 0.4.1
Some checks failed
Deploy Docs / build (push) Has been cancelled
2025-01-04 18:13:02 +01:00
Thomas Vitale
68ae239552 Remove Logback from production JAR
Move Logback dependency to test scope to make it possible for applications using this library to choose their implementation of the SLF4J API. For example, Spring Boot provides one out of the box already.

Fixes gh-49

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
2025-01-04 18:02:20 +01:00
Christian Tzolov
b2082a0506 Next development version 2025-01-04 08:41:43 +01:00
Christian Tzolov
30c8fc32eb Release version 0.4.0
Some checks failed
Deploy Docs / build (push) Has been cancelled
2025-01-04 08:41:22 +01:00
Christian Tzolov
724a12b697 Add mcp-docs with initial Antora support 2025-01-02 19:27:59 +01:00
Christian Tzolov
d96222dcaf Next development version 2024-12-30 13:25:53 +01:00
Christian Tzolov
8dc9b979a8 Release version 0.3.1 2024-12-30 13:25:35 +01:00
Christian Tzolov
ad3cdd20a9 fix: Improve MCP server stability and test reliability
- Replace bounded elastic schedulers with single thread executors
- Add timeouts to MCP server tests
- Enhance error handling in StdioServerTransport
- Comment out unused PaginatedRequest unmarshalling
- Simplify shutdown logic in StdioServerTransport
2024-12-30 12:57:36 +01:00
Christian Tzolov
e6cb56c4b1 Next development version 2024-12-29 18:17:34 +01:00
Christian Tzolov
f5e121f3c0 Release version 0.3.0 2024-12-29 18:16:15 +01:00
Christian Tzolov
abd0facf4e feat: Add MCP server with Server stdio/sse transport improve MCP client
- Implement MCP server with async/sync support and builder pattern configuration
 - Add Server stdio/SSE transport layers with robust error handling
 - Convert McpClient and McpServer to interfaces for better extensibility
 - Add sampling capabilities for LLM interactions (text/image)
 - Implement dynamic root management and runtime tool management
 - Add comprehensive prompt and resource capabilities
 - Add support for dynamic root management (add/remove roots at runtime)

 Architecture Changes

 - Introduce registration records for tools, resources, and prompts
 - Improve thread safety with concurrent collections
 - Enhance resource template handling
 - Implement builder patterns for Server/Client capabilities
 - Add support for server capabilities and implementation info

Transport Layer:
 - Implement SseServerTransport with SSE endpoints
 - Add StdioServerTransport for process-based communication
 - Reorganize transport packages for better organization
 - Improve transport error handling and shutdown processes

Documentation:

 - Add detailed MCP reference documentation
 - Include architecture diagrams and API documentation
 - Add comprehensive test coverage for all components
 - Include sample projects demonstrating stdio/SSE transports

BREAKING CHANGES:

 Transport Package Reorganization

 - Move StdioClientTransport to o.s.ai.mcp.client.transport
 - Move SseClientTransport to o.s.ai.mcp.client.transport
 - Move ServerParameters to o.s.ai.mcp.client.transport
 - StdioClientTransport.errorHandler changed to private with
   setter method Migration: Use setErrorHandler() method
   instead of direct field access

 API Changes

 - Replace static factory methods with builder pattern
 - Update ServerCapabilities to use builder pattern
 - Make StdioClientTransport.errorHandler private with setter
 - Replace rootsListProvider with direct root management
 - Remove deprecated static factory methods

Resolves #27,#25,#24,#11
Related to #12
2024-12-28 21:03:29 +01:00