Migrate MCP server registrations to specifications
ProprietaryMCP Java SDK 0.8 replaced McpServerFeatures.SyncToolRegistration and the other tool, resource and prompt registrations with specifications, whose handlers also take the McpSyncServerExchange or McpAsyncServerExchange of the request, and Spring AI 1.0 uses an SDK that no longer has the registrations. This renames the registrations to their specifications, and adds an exchange parameter in front of the parameter of a handler lambda. Handlers that are not lambdas are left for review.
io. moderne. java. spring. ai1. MigrateMcpServerRegistrationsmod run . --recipe= io. moderne. java. spring. ai1. MigrateMcpServerRegistrationsInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.
Recipe list
It runs these recipes, in this order.
- Change type
McpServerFeatures$SyncToolRegistrationtoMcpServerFeatures$SyncToolSpecification - Change type
McpServerFeatures$SyncResourceRegistrationtoMcpServerFeatures$SyncResourceSpecification - Change type
McpServerFeatures$SyncPromptRegistrationtoMcpServerFeatures$SyncPromptSpecification - Change type
McpServerFeatures$AsyncToolRegistrationtoMcpServerFeatures$AsyncToolSpecification - Change type
McpServerFeatures$AsyncResourceRegistrationtoMcpServerFeatures$AsyncResourceSpecification - Change type
McpServerFeatures$AsyncPromptRegistrationtoMcpServerFeatures$AsyncPromptSpecification