Package org.springframework.ai.mcp.modern


@NullMarked package org.springframework.ai.mcp.modern
Support for MCP servers implementing the 2026-07-28 ("modern") specification revision, built on the io.modelcontextprotocol.modern server API of the MCP Java SDK.

The modern SDK serves each primitive from a repository that lists definitions and finds a definition with its handler (McpSyncTool, McpSyncPrompt, McpSyncResource, or their McpAsync* twins). The InMemorySync*Repository and InMemoryAsync*Repository classes are map-backed repositories with runtime add and remove, change broadcasts and key-cursor paging. SyncResourceRegistration and SyncResourceTemplateRegistration pair a resource or template definition with its handler, which the SDK's McpSyncResource does not carry, and the Async*Registration records are their asynchronous twins. Completions travel with their prompt or template, through the SDK's withCompletionHandler. McpModernAsyncUtils runs blocking code inside asynchronous handlers. McpSchemaConverter converts between the legacy and modern schema types, which lets handlers written against the legacy types be exposed on a modern server, and McpTransportContexts reads the request headers that the Spring transports put into the transport context.