Skip to content

feat(mcp): add mcp-annotations module#5567

Merged
tzolov merged 5 commits intospring-projects:mainfrom
tzolov:mcp-annotations-migration-2
Mar 9, 2026
Merged

feat(mcp): add mcp-annotations module#5567
tzolov merged 5 commits intospring-projects:mainfrom
tzolov:mcp-annotations-migration-2

Conversation

@tzolov
Copy link
Contributor

@tzolov tzolov commented Mar 9, 2026

Migrate the framework-agnostic mcp-annotations core from spring-ai-community/mcp-annotations into spring-ai as part of the mcp/mcp-annotations-spring module.

  • Includes annotations (@mcptool, @McpPrompt, @McpResource, etc.), method callbacks, providers (tool, prompt, resource, sampling, progress, completion, elicitation, logging), request context, and adapters — covering both sync/async and stateless variants.
  • Align the ClassUtills and JsonParser with existing spring-ai utils.
  • Registers the module in root pom.xml and spring-ai-bom.
  • Update MCP annotations docs
  • Add migration instructions and open-rewrite receipe

Resolves #5457

@tzolov tzolov added this to the 2.0.0-M3 milestone Mar 9, 2026
@@ -189,4 +194,19 @@ else if (javaType.isEnum()) {
return result;
}

public static Map<String, Object> toMap(Object object) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those additional methods are used by the mcp-annotations.
I guess we can use the more generic toTypedObject but it will enforce some additional unnecessary checks, conversions and castings that might harm the performance.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice if we could avoid introducing those methods to JsonParser and keep something more internal before we replace it by something better.

tzolov added 3 commits March 9, 2026 16:55
Migrate the framework-agnostic mcp-annotations core from
spring-ai-community/mcp-annotations into spring-ai as part
of the mcp/mcp-annotations-spring module.

- Includes annotations (@mcptool, @McpPrompt, @McpResource, etc.),
  method callbacks, providers (tool, prompt, resource, sampling,
  progress, completion, elicitation, logging), request context,
  and adapters — covering both sync/async and stateless variants.
- Align the ClassUtills and JsonParser with existing spring-ai utils.
- Registers the module in root pom.xml and spring-ai-bom.
- Update MCP annotations docs
- Add migration instructions and open-rewrite receipe

Resolves spring-projects#5457

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
@tzolov tzolov force-pushed the mcp-annotations-migration-2 branch from 5adf433 to 3a8b0ed Compare March 9, 2026 16:09
tzolov added 2 commits March 9, 2026 17:57
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
@tzolov tzolov merged commit 585d618 into spring-projects:main Mar 9, 2026
4 checks passed
@tzolov tzolov changed the title feat(mcp): add mcp-annotations module (M3) feat(mcp): add mcp-annotations module Mar 17, 2026
@tzolov tzolov added the MCP label Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate mcp-annotations into Spring AI project

2 participants