Commit graph

83 commits

Author SHA1 Message Date
Christian Tzolov
ea6ef6a21b Release version 0.2.0 v0.2.0 2024-12-21 18:09:36 +01:00
Christian Tzolov
890350c634 minor javadoc 2024-12-21 16:35:22 +01:00
Christian Tzolov
12fd8e51f3 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
2024-12-21 16:30:19 +01:00
Christian Tzolov
2ea5527ade feat: Add default logging for MCP notification handlers
- Adds default logging for tools, resources and prompts change notifications.
- Introduces Utils class with collection and string helper methods.
- Ensures notification handlers are always registered with at least a default logging consumer.
2024-12-20 10:39:26 +01:00
Christian Tzolov
975578b64b feat: Add resources and prompts change notification support
- Add resourcesChangeNotificationHandler and promptsChangeNotificationHandler with non-blocking execution
- Add builder methods for resources and prompts change consumers
- Add test coverage for all notification handlers
- Update documentation to cover all three notification types (tools, resources, prompts)
- Consolidate notification documentation under unified Change Notifications section
- Ensure consistent non-blocking behavior using boundedElastic scheduler

All notification handlers follow the same pattern of non-blocking execution and error handling,
providing a consistent approach to change notifications across the system.

Resolves #20
2024-12-19 14:26:40 +01:00
Christian Tzolov
383d6a7eff feat(mcp-client): Add non-blocking tools change notification support
- Add toolsChangeNotificationHandler with non-blocking consumer execution using boundedElastic scheduler
- Add toolsChangeConsumer builder method to McpClient for easy configuration
- Add comprehensive test coverage for tools change notifications
- Update documentation with tools change notification features and examples

The implementation ensures consumers are executed non-blockingly on the boundedElastic scheduler,
preventing performance impact from blocking implementations while maintaining proper error handling and logging.

Part of #20
2024-12-19 13:56:16 +01:00
Christian Tzolov
9adcc5b9c4 fix(sdtio-client) Escape any embedded newlines in the JSON message
Resolves #21
2024-12-19 12:21:24 +01:00
Christian Tzolov
05085b76e6 remove folder duplication 2024-12-19 12:13:58 +01:00
Christian Tzolov
82c64f5ad3 feat(core): add roots list support and improve documentation
- Add roots list capability to allow servers to understand filesystem boundaries
- Move architecture diagram and add detailed documentation for transports and sessions
- Enhance client capabilities with roots and sampling features
- Rename withRequestTimeout to requestTimeout for better API consistency
- Add tests for roots list functionality

Resolves #8
2024-12-19 12:12:51 +01:00
Dariusz Jędrzejczyk
7a98a935af Refactor the mcp-core module
- The core module has been refactored to remove unnecessary abstraction
  between the SSE transport and the STDIO transport.
- Tests have been improved and no longer complain about multiple
  subscriptions to single-subscriber Sink.
- SSE transport layer is now assuming non-blocking execution and no longer
  makes thread hops when not needed.
- Decouple ObjectMapper and error handling from AbstractMcpTransport
  and remove later.

Additional improvements:

- Rename transport classes to better reflect client-side role (*ServerTransport -> *ClientTransport)
- Introduce fluent builder pattern for client configuration
- Simplify DefaultMcpSession by removing ObjectMapper dependency
- Move unmarshal responsibility to transport layer
- Update documentation and diagrams to reflect new architecture
- Clean up test implementations
2024-12-19 09:07:11 +01:00
Dariusz Jędrzejczyk
8b2ce26e8a
Fix tests by restarting the container in each test
The reason is that the server performs shutdown after SSE connection is
closed.
2024-12-17 15:33:41 +01:00
Christian Tzolov
716d1a0e7f Enhance DefaultMcpSession with request/response handling
- Add comprehensive documentation for MCP session components in MCP-SESSION.md
- Add logging and error handling in McpAsyncClient
- Update test configurations and dependencies
- Add reactor-netty-http and spring-context test dependencies

Resolves #6
2024-12-17 13:42:59 +01:00
Christian Tzolov
0ebb38ce0e Fix the docker.io/tzolov/mcp-everything-server:v1 url 2024-12-15 23:32:11 +01:00
Christian Tzolov
bc281dee54 feat: add SSE transport and improve documentation
- Add Server-Sent Events (SSE) transport implementation with test coverage
- Add detailed documentation for both SSE and STDIO transports
- Extract common test logic into abstract base classes
- Add testcontainers support for SSE integration tests
- Replace System.out with SLF4J logging
- Externalize dependency versions to properties
- Implement endpoint event handling per MCP spec
- Add message endpoint sink for reliable message routing
- Improve error handling and graceful shutdown
- Update core module README with expanded features and examples
- Add dependency version properties and logging configuration
- Update architecture and class diagrams

Resolves #4
2024-12-15 22:54:48 +01:00
Christian Tzolov
be31c6119c feat(mcp): add convenience methods without cursor parameter
Add overloaded methods for list operations (tools, resources, templates, prompts)
 that don't require a cursor parameter, simplifying the API for basic use cases
 where pagination is not needed.
2024-12-13 09:15:37 +01:00
Christian Tzolov
c332300651 Delete outdated test 2024-12-13 00:02:35 +01:00
Christian Tzolov
59319e5509 refactor: process output writing 2024-12-12 23:27:46 +01:00
Christian Tzolov
8a0cd4ef06 refactor: improve resource management in StdioServerTransport
- Use try-with-resources for proper reader cleanup
- Remove unnecessary reader/writer instance variables
- Access process streams directly when needed
2024-12-12 23:18:25 +01:00
Dariusz Jędrzejczyk
8397849d6e Properly dispose Schedulers for IO and skip closing BufferedReader as they deadlocked on Ubuntu
Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@gmail.com>
2024-12-12 22:54:28 +01:00
Christian Tzolov
a4950c04a5 test: increase MCP client timeout to 20s and enable tests
- Doubles the default timeout from 10s to 20s in McpAsyncClient
- Updates corresponding timeout values in test classes
- Enables previously disabled async client tests
2024-12-12 21:45:51 +01:00
Christian Tzolov
c41f3fe738 Temp disable the entire McpAsyncClientTests 2024-12-12 21:32:06 +01:00
Christian Tzolov
4a1763d355 Temp disable testMcpAsyncClientState 2024-12-12 21:29:18 +01:00
Christian Tzolov
a55379745f Fix javadoc 2024-12-12 21:13:02 +01:00
Christian Tzolov
e9bafe9f21 feat(client): add convenience methods for listing operations without cursor
Add overloaded methods for list operations (tools, resources, templates, prompts)
 that don't require a cursor parameter. This simplifies the API for cases where
 pagination is not needed.
2024-12-12 14:34:45 +01:00
Dariusz Jędrzejczyk
972519b9ea
Improve examples in README.md (#2)
* Improve AsyncMcpClient example in README.md

* Move McpSyncClient example above the async variant and improve the code
2024-12-12 14:34:03 +01:00
Christian Tzolov
7f25221d42 Improve MpcSchema structure 2024-12-12 14:00:31 +01:00
Dariusz Jędrzejczyk
9081b6345f refactor: improve process handling and graceful shutdown
- Enhance process handling in StdioServerTransport with proper cleanup
- Refactor graceful shutdown across McpSession implementations
- Add proper JSON serialization annotations for Role and LoggingLevel enums
- Fix typo in setInboundMessageHandler method name
- Improve test coverage using StepVerifier
- Add documentation and cleanup code
2024-12-12 13:47:01 +01:00
Christian Tzolov
912e815b17
Update README.md
add examples section to the README
2024-12-12 10:53:51 +01:00
Christian Tzolov
683cf93d7e Udpate the README docs 2024-12-11 13:35:27 +01:00
Christian Tzolov
800f145eb2 Update the mcp-core readme 2024-12-11 07:58:44 +01:00
Mark Pollack
9bbf9d9732 Next development version 2024-12-11 01:45:23 -05:00
Mark Pollack
dce530ed91 Release version 0.1.0 v0.1.0 2024-12-11 01:44:20 -05:00
Mark Pollack
a300886954 Fix profile xml in profile for artifactory-milestone 2024-12-11 01:28:06 -05:00
Mark Pollack
44c8fb0080 Add github action for milestone repo release 2024-12-11 01:20:12 -05:00
Mark Pollack
98eee0111d Add javadoc back to maven central action 2024-12-11 00:50:35 -05:00
Mark Pollack
107c9e9860 Remove upload of javadocs to maven central 2024-12-11 00:48:01 -05:00
Mark Pollack
46e929d465 Add javadoc profile to artifactory staging build 2024-12-11 00:44:46 -05:00
Mark Pollack
ad8bcb5198 Add github actions for artifactory staging and maven central release 2024-12-11 00:26:26 -05:00
Mark Pollack
586f132f46 Update copyright headers and add javaformat plugin 2024-12-10 23:49:24 -05:00
Mark Pollack
7bec6efd37 remove sample app module, bump version to 0.1.0-SNAPSHOT 2024-12-10 23:40:17 -05:00
Mark Pollack
6df87e2170 Enable tests 2024-12-10 19:47:21 -05:00
Mark Pollack
3e55cbc1ff temp disable of running tests 2024-12-10 19:44:31 -05:00
Christian Tzolov
120b5b2242 demo 2024-12-11 01:35:28 +01:00
Mark Pollack
b22ee0a1f7 reduce logging in javadoc generation 2024-12-10 19:21:23 -05:00
Mark Pollack
559e671f8d Add javadoc profile when running javadoc:aggregate 2024-12-10 19:18:35 -05:00
Mark Pollack
d28b8d2839 Remove npm cache in CI action 2024-12-10 19:10:57 -05:00
Mark Pollack
6604f03176 Add node to CI action 2024-12-10 19:08:44 -05:00
Christian Tzolov
949f961c04 fix docs 2024-12-11 00:56:06 +01:00
Mark Pollack
2747182b3b Remove leftover mvnw scripts and suppress javadoc warnings 2024-12-10 18:55:16 -05:00
Christian Tzolov
a922b1aa7a Add doc diagrams 2024-12-11 00:51:24 +01:00