Commit graph

215 commits

Author SHA1 Message Date
Dariusz Jędrzejczyk
a83f41381a
Align abstract tests in mcp-test with mcp-core (#70)
Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
2025-01-23 14:57:25 +01:00
Christian Tzolov
7359750cdb
Update 0.6.0-MIGRATION-GUIDE.md
remove unrelated sections
2025-01-23 14:05:32 +01:00
Dariusz Jędrzejczyk
919433437c Polish
Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
2025-01-23 14:02:13 +01:00
Dariusz Jędrzejczyk
6839d3b740 Refactor McpClient for async and sync interactions
Introduce new builder patterns and enhance type safety

- Add new builder patterns for McpClient and McpServer with sync/async variants
- Introduce dedicated McpClientFeatures and McpServerFeatures classes
- Enhance type safety and reactive support with proper Mono integration
- Add migration guide for 0.6.0 release
- Mark old builder methods as deprecated
- Update documentation to reflect new APIs

BREAKING CHANGE: The old builder patterns using McpClient.using() and McpServer.using()
are now deprecated in favor of new sync() and async() builders that provide
better type safety and clearer sync/async separation. Follow the migration guide.

Resolves #48

Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
Co-authored-by: Christian Tzolov <ctzolov@vmware.com>
2025-01-23 12:27:06 +01:00
Christian Tzolov
e1bdc98813 Add a ref docs link in the README 2025-01-17 07:11:04 +01:00
Christian Tzolov
f333265c5f Minor doc link fixes 2025-01-17 06:59:34 +01:00
Alexandros Pappas
c2ece20cc2 feat: Make SSE endpoint configurable in server transports
This commit updates the WebFluxSseServerTransport, WebMvcSseServerTransport, and HttpServletSseServerTransport classes to accept the SSE endpoint path as a constructor argument.

This change provides more flexibility in configuring the SSE endpoint, allowing it to be customized instead of being hardcoded to "/sse".
It also aligns the Java SDK's behavior with the Python SDK's SseServerTransport, which already supports this customization.

A default SSE endpoint of "/sse" is maintained for backward compatibility.

Also, addressed minor code quality issues identified by SonarLint and reordered modifiers for static final fields to conform with the Java Language Specification.

Signed-off-by: Alexandros Pappas <alexandros.pappas@yiluhub.com>
2025-01-16 19:05:57 +01:00
“JermaineHua”
f3e3a65ca6 Set method scope properly
Signed-off-by: “JermaineHua” <crazyhzm@apache.org>
2025-01-15 09:49:49 +01:00
Christian Tzolov
26460e640b feat(mcp): add JsonIgnoreProperties to schema records for resilient deserialization 2025-01-14 14:43:59 +01:00
Christian Tzolov
2199e34cf8 Fix the MCP Server Architecture diagram 2025-01-13 13:27:07 +01:00
Christian Tzolov
7a5793d0f3 docs: Update dependency management version 2025-01-13 12:36:45 +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
v0.5.0
2025-01-13 12:27:03 +01:00
Christian Tzolov
ae737357e6 build: configure BOM for Maven Central deployment
- Add required Maven Central metadata (URL, SCM information)
- Configure flatten-maven-plugin for proper POM flattening
- Remove unnecessary local build configurations
2025-01-13 12:03:40 +01:00
Christian Tzolov
d617d05772 README cleanup 2025-01-13 11:38:41 +01:00
Christian Tzolov
ea49afccf5 docs: Minor documentation improvements 2025-01-13 11:34:16 +01:00
Christian Tzolov
18951d5f84 Minor docs improvements 2025-01-13 11:21:15 +01:00
Christian Tzolov
9aba371660 feat: Add SSE transport tests for MCP client and server
- Add tests for HttpServletSseServerTransport implementation
- Add tests for HttpClientSseClientTransport implementation
- Rename STDIO transport test classes for clarity
2025-01-13 11:13:06 +01:00
Christian Tzolov
5a73a304a8 Update arch diagrams 2025-01-13 09:06:56 +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
dd065dd6fc Add CI/CD build status badge 2025-01-12 10:01:46 +01:00
Christian Tzolov
3725c3f7c9 Update main README 2025-01-12 09:46:40 +01:00
Christian Tzolov
830fc1b5cf Fix broken README link 2025-01-12 09:42:00 +01:00
Christian Tzolov
fbcd51b332 docs: improve documentation clarity and add WebFlux SSE transport example
- Streamline overview documentation structure and content
- Consolidate installation instructions
- Simplify examples section descriptions
- Add WebFlux SSE transport dependency and configuration example
2025-01-12 09:34:12 +01:00
Christian Tzolov
299eee944a docs: improve transport layer documentation and code cleanup
- Add comprehensive Javadoc for SSE transport implementations
- Document key features and implementation details for WebFlux/WebMVC transports
- Refactor FlowSseClient to use records for better immutability
- Fix typo in prompt property name
- Remove unused code and improve readability
2025-01-12 08:46:43 +01:00
Christian Tzolov
2a612360b3 Minor documentation links corrections 2025-01-11 19:08:39 +01:00
Christian Tzolov
bfd07b4cda refactor(transport): Simplify WebMvc SSE transport with native Spring SseBuilder
Replaces custom BlockingQueue-based SSE implementation with Spring's native
SseBuilder for simpler and more reliable event handling.

This change:
- Removes custom SSEEvent and queue implementation
- Uses Spring's SseBuilder directly for SSE event management
- Improves error handling with direct error reporting
- Reduces complexity in session management
2025-01-11 18:25:19 +01:00
Christian Tzolov
fa278726ae update doc diagrams 2025-01-11 18:05:51 +01:00
Christian Tzolov
59992d10c8 Move samples to the spring-ai-examples project
- All samples moved to the the https://github.com/spring-projects/spring-ai-examples/tree/main/model-context-protocol
- Documentation references are updated.
2025-01-11 17:53:06 +01:00
Christian Tzolov
69e934e31e Update overview docs 2025-01-11 17:37:00 +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
05b572b855 Update tomcat test version 2025-01-09 19:32:28 +01:00
Christian Tzolov
37029523cb imporve test logging configuraitons 2025-01-09 18:30:34 +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
v0.4.2
2025-01-07 10:54:53 +01:00
Christian Tzolov
aa26cfa848 feat: Improve Tool schema handling
- Make McpSchema final and add private constructor
- Add JsonSchema record for structured schema representation
- Change Tool.inputSchema type from Map<String, Object> to JsonSchema.
- Use the String JSON Schema constructor when creating the Tool programaticaly.
- Enhance StdioClientTransport error logging with more context
- Add ToolHelper utility class for:
  - Converting Spring AI FunctionCallbacks to MCP tools
  - Generating JSON schemas for tool input validation
  - Facilitating integration between Spring AI functions and MCP tools
- Update tests and samples to use the new Tool schema format

Resolves #52
2025-01-07 10:39:21 +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
v0.4.1
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
580f95526f feat(McpAsyncServer): Add non-blocking execution for tools and resources
- Execute tool calls, resource reads and prompt handling in a non-blocking
  manner using Schedulers.boundedElastic(). This prevents blocking operations
  from impacting server responsiveness.
- Added integration tests to verify non-blocking behavior with tools that
  make HTTP calls to external services.

Related to #48
This is  a temp patch until #48 is resolved properly.
2025-01-04 17:56:48 +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
v0.4.0
2025-01-04 08:41:22 +01:00
Christian Tzolov
94f172a44e Enhance roots functionality and improve error handling
- Replace Utils.isEmpty check with null check for roots map
- Add specialized error messages for method not found errors
- Extend McpError to include JSONRPCError information
- Add comprehensive tests for roots functionality including:
  - Empty roots list handling
  - Missing capability scenarios
  - Multiple consumers
  - Server closure with active subscriptions
2025-01-04 08:16:02 +01:00
Christian Tzolov
1e2a176c09 fix doc image link 2025-01-04 01:19:42 +01:00
Christian Tzolov
2748260cda feat: Enhance MCP roots implementation and test coverage
- Add proper ListRootsResult wrapping in async client
- Implement paginated listRoots methods in server components
- Fix roots notification handling in async server
- Add roots integration tests
- Update architecture diagram and documentation layout

The changes improve the roots feature implementation with proper result
types,  and robust notification handling. Adds thorough
test coverage for roots functionality including async notifications and
root addition/removal scenarios.

Resolves #46
2025-01-04 01:11:38 +01:00