SuperAPIAI Directory

spring-ai-mcp

github.com · AI developer platforms

spring-ai-mcp is a Java SDK and Spring framework integration project for the Model Context Protocol (MCP), used to enable Java and Spring applications to interact with MCP-compliant AI models and tools through standardized interfaces. The project provides synchronous and asynchronous MCP client and server implementations, supports tool discovery, resource management, prompt handling, structured logging, and request and notification handling, and includes multiple transports such as Stdio and SSE. This repository has been archived; the project has graduated and migrated to MCP Java SDK and Spring AI MCP.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsAPI

About this tool

Purpose: spring-ai-mcp provides a Java SDK and Spring Framework integration for the Model Context Protocol (MCP), enabling Java applications to interact with AI models and tools through standardized interfaces, with support for synchronous and asynchronous communication modes.

Main capabilities: includes a Java implementation of the MCP specification, providing synchronous and asynchronous MCP Client and MCP Server implementations; supports standard MCP operations, including tool discovery, resource management, prompt handling, and structured logging, and supports request and notification handling.

Transports: provides Stdio and SSE transport implementations. Stdio is based on process communication and includes StdioClientTransport and StdioServerTransport; the SSE client is based on Java HttpClient, namely HttpClientSseClientTransport, for HTTP streaming; the Servlet server side is HttpServletSseServerTransport, which uses the traditional Servlet API to provide HTTP SSE server-side streaming; WebFlux SSE Transport provides reactive HTTP streaming based on Spring WebFlux, including client and server; WebMvc SSE Transport provides HTTP SSE transport based on Spring MVC, server side only, and clients can use the core HttpClientSseClientTransport.

Spring integration module: provides Spring-specific features, including integration with the Spring AI function calling system, Spring-friendly abstractions for MCP clients, and auto-configuration (WIP).

Usage: add the dependency in a Maven project. The materials state that this is a milestone version, is not on Maven Central, requires adding the corresponding repository in the POM, and refers to the Dependency Management page for more information.

Examples: the materials list MCP examples in the spring-ai-examples/model-context-protocol repository, including SQLite Simple (demonstrates LLM and database integration), SQLite Chatbot (a chatbot that interacts with a SQLite database), Filesystem (lets the LLM interact with local filesystem folders and files), Brave (internet search through natural language interaction with Brave Search), Theme Park API Example (creates an MCP server and client with Spring AI and exposes Theme Park API tools), Http SSE Client + WebMvc SSE Server, WebFlux SSE Client + WebFlux SSE Server, HttpClient SSE Client + Servlet SSE Server, and other examples of different transport combinations.

Applicable scenarios: suitable for development scenarios that need to connect MCP-compatible AI models and tools in Java or Spring applications, build MCP clients or servers, and choose Stdio or SSE transports.

Limitations and status: this repository has been archived; the project has graduated and migrated to MCP Java SDK and Spring AI MCP. The materials describe it as an experimental Spring project, welcome contributions, with the process being to fork the repository, create a feature branch, and submit a Pull Request. The project uses the Apache License 2.0 license.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools