Spring AI 2.0.0-M3 introduces MCP Apps, a way to embed rich HTML/JavaScript UIs directly inside AI chat interfaces. Using @McpResource and @McpTool annotations on a Spring Boot MCP server, developers can serve interactive UI components (like a dice roller) that communicate bidirectionally with the AI assistant host via JSON-RPC. The ext-apps.ts module enables the UI to update the model context, send messages, and call server tools. The tutorial walks through project setup, defining the HTML UI, implementing the MCP server, configuring Streamable HTTP transport, and testing with clients like Claude Desktop or MCP Jam.

11m read timeFrom spring.io
Post cover image
Table of contents
MCP Apps in a NutshellInitializing the ProjectDefine the User InterfaceCreate the MCP ServerRunning the MCP AppConclusionResources

Sort: