Commit graph

216 commits

Author SHA1 Message Date
Christian Tzolov
109aab20e8
feat(client): Improve initialization state handling in McpAsyncClient (#39)
- Add proper initialization state tracking using AtomicBoolean and Sinks
- Implement timeout handling for requests requiring initialization
- Ensure all client methods verify initialization state before proceeding
- Fix rootsListChangedNotification to check initialization state
- Improve error messages for uninitialized client operations
- improve JavaDoc
- Add tests to verify proper error handling for uninitialized clients
  - Replace hardcoded timeout constants with configurable getTimeoutDuration() method
  - Remove automatic initialization in setUp methods to allow explicit testing

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-03-13 15:13:50 +01:00
Christian Tzolov
4eff00c8da
feat(mcp): relax MCP Schema JSON deserialization constraints (#37)
* feat(mcp):  relax MCP Schema JSON deserialization constraints

- Add @JsonIgnoreProperties(ignoreUnknown = true) annotation to all record
classes in McpSchema to make JSON deserialization more robust by ignoring
unknown properties.
- Make the JsonSchema record public

Resolves #36

This improves compatibility with third-party implementations like Cursor that are not MCP Schema compliant.

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-03-10 12:36:54 +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
Christian Tzolov
b2c62d50cb
Update README with Maven wrapper commands and test prerequisites (#23)
Resolves #20

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-02-27 10:13:25 +01:00
Christian Tzolov
718042644a
refactor(client): improve validation and remove server methods (#14)
Add client initialization and capability validation checks

- New isInitialized() method to check client state
- Validate server capabilities before tool/resource operations
- Add clear error messages for common failure cases
- Remove server-side notification methods from client: sendResourcesListChanged(), promptListChangedNotification()
- Improve protocol version handling
- Testing improvements and new initialization tests
- Redesign MockMcpTransport internals and adapt tests
- Correct McpError messages
- clean unused imports

Resolves #13

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
Co-authored-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
2025-02-27 10:00:04 +01:00
konczdev
d9c4818607 Generate OSGi metadata 2025-02-26 18:55:46 +01:00
Mariano Gonzalez
2c500b9cdc
Resources and prompts cannot be added after server start (#18)
* Resources and prompts cannot be added after server start #17
2025-02-26 11:49:30 +01:00
JermaineHua
7165fea5ec Fix some typos
Signed-off-by: JermaineHua <crazyhzm@apache.org>
2025-02-25 12:33:25 +01:00
Dennis Kawurek
bb6514e808 Remove closed sessions from list in WebMvcSseServerTransport 2025-02-25 10:56:51 +01:00
zeko.zhang
dac5c545b0 Fix issue, SSE connection will terminate after 30 seconds (DEFAULT). 2025-02-25 10:33:04 +01:00
Christian Tzolov
c69cc18eb6 docs: add Spring AI MCP documentation and improve README clarity
- Add Spring AI MCP documentation section with links to client/server starters
- Fix license link text

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-02-17 13:44:06 +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
01aa720862 clean the Readme
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-02-13 20:44:34 +01:00
Christian Tzolov
871add4e45 refactor: reduce log verbosity by adjusting log levels
- Change most INFO logs to DEBUG level for operational messages
- Keep stderr messages at INFO level
- Rename errorHandler to stdErrorHandler in StdioClientTransport
- Add debug logging for JSON message deserialization

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-02-11 16:45:11 +01:00
Christian Tzolov
5d27a13a4d Migrate the docs to the io.mcp 2025-02-05 18:14:46 +01:00
Christian Tzolov
df35c78aeb Improve docs 2025-02-03 14:14:01 +01:00
Christian Tzolov
48e4cf4b13 Minor pom config 2025-02-03 11:37:05 +01:00
Christian Tzolov
196596670e Another round of cleaning the readme 2025-01-29 15:14:45 +01:00
Christian Tzolov
0dc93e134d Improve README.md 2025-01-29 15:11:23 +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
Mark Pollack
7e73152ada Convert asciidoc/antor docs to mintlify 2025-01-29 11:54:10 +01:00
Christian Tzolov
a439e4ae6a Re-enable the CI tests 2025-01-28 19:45:56 +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
Dariusz Jędrzejczyk
c8766098f6 Reorder StdioServerTransport shutdown procedure to avoid errors
Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
2025-01-28 15:59:52 +01:00
Christian Tzolov
76495078be further CI wf improvements 2025-01-28 14:43:08 +01:00
Christian Tzolov
2e0b60dc3b Fix the MAVEN_GPG_PASSPHRASE in GH CI workflow 2025-01-28 14:39:40 +01:00
Christian Tzolov
6296a88331 Update license text and GH actions 2025-01-28 14:36:31 +01:00
Christian Tzolov
2f5fcdbcbe Add CI GH action workflow 2025-01-28 14:31:05 +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
1aaf2d369a Fix the GH action secret names 2025-01-28 13:23:25 +01:00
Christian Tzolov
5b10f70021 Add manual relese trigger 2025-01-28 13:12:08 +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
0f62a508ce reomove old GH actions 2025-01-27 23:19:11 +01:00
Christian Tzolov
f91fe15ec6 Remove redundand code
Resolves #4

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-01-24 23:26:21 +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
v0.6.0
2025-01-24 18:39:38 +01:00
Christian Tzolov
d75adb68c7 feat(sse): expand accepted HTTP status codes for SSE stream connection
Accept HTTP status codes 200, 201, 202, and 206 as valid responses
for SSE stream connection. Improves error message to include actual
status code. Removes unused main method.

Resolves #68
2025-01-24 18:25:40 +01:00
Christian Tzolov
a424b36653 feat: Add protocol version negotiation
Implement protocol version negotiation between MCP client and server to ensure
compatibility and graceful version handling.
The server will now suggest the latest supported version when an
unsupported version is requested, while the client will verify
version compatibility during initialization.

- Support multiple protocol versions in both client and server
- Negotiate compatible version during initialization
- Fall back to latest version when unsupported version requested
- Add comprehensive test coverage for version negotiation

Resolves #71

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-01-24 18:17:30 +01:00
Christian Tzolov
48ab97bf23 fix(transport): Add cleanup logic for inbound processing in StdioServerTransport
Resolves #72

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-01-24 13:10:52 +01:00