spring-ai
Java SDK for the Model Context Protocol (MCP), providing seamless integration between Java and Spring applications and MCP-compliant AI models and tools.
claude mcp add --transport stdio spring-attic-spring-ai-mcp mvn clean install -DskipTests \ --env JAVA_HOME="path/to/java/home" \ --env MAVEN_OPTS="-Xmx2g"
How to use
This MCP server repository historically provided Java and Spring integrations for the Model Context Protocol (MCP). It originated as a set of Java SDKs and Spring-based components that enable Java applications to act as MCP clients or servers, handling tool discovery, resource management, prompt processing, and logging with both synchronous and asynchronous communication patterns. Although this repository has graduated and moved to the MCP Java SDK and Spring AI MCP, you can still explore the concepts here: the MCP model, how servers expose tools, and how clients interact with those tools through the MCP interfaces. The primary capabilities are realized through the Java SDKs and Spring integrations that support standard MCP operations, including stubs for Stdio and SSE transports and Spring-specific auto-configuration points. To work with MCP in Java today, refer to the MCP Java SDK and Spring AI MCP documentation linked in the repository notes for current usage patterns, client/server APIs, and transport options.
How to install
Prerequisites:
- Java Development Kit (JDK 11+ recommended)
- Maven
- Optional: Git
Installation steps:
-
Clone the repository (or navigate to the MCP Java SDK repo if you’re migrating): git clone https://github.com/spring-projects-experimental/spring-ai-mcp cd spring-ai-mcp
-
Build the project using Maven: mvn clean install -DskipTests
-
If you’re migrating to the MCP Java SDK, follow the current MCP Java SDK installation and usage guidance from the MCP Java SDK documentation and the Spring AI MCP reference pages referenced in the repo's notes.
-
Integrate into your project by adding the appropriate Maven dependencies (as guided by the current MCP Java SDK/Spring AI MCP documentation) and configure transports (Stdio, SSE, WebFlux/WebMVC as needed).
-
Run your application with the standard Java execution flow, ensuring any required environment variables (e.g., JAVA_HOME) are set.
Additional notes
Notes:
- This repository has graduated and is archived. The active work and ongoing support live in the MCP Java SDK and Spring AI MCP projects. Use the links in the repository notes to transition to the current destinations for documentation and examples.
- If you encounter transport-related issues, review the available transports (Stdio, SSE) and the optional WebFlux/WebMVC SSE transports described in the active MCP projects.
- Ensure you align your Maven dependencies with the recommended versions from the current MCP Java SDK and Spring AI MCP documentation, since this historical repository may reference older configuration conventions.
- Environment variables such as JAVA_HOME and MAVEN_OPTS can impact build and runtime behavior; adjust them according to your development environment.
- When migrating, prefer the official MCP Java SDK and Spring AI MCP references for up-to-date APIs, transport implementations, and auto-configuration mechanisms.
Related MCP Servers
ai-code-helper
2025 年 AI 编程助手实战项目(作者:程序员鱼皮),基于 Spring Boot 3.5 + Java 21 + LangChain4j + AI 构建智能编程学习与求职辅导机器人,覆盖 AI 大模型接入、LangChain4j 核心特性、流式对话、Prompt 工程、RAG 检索增强、向量数据库、Tool Calling 工具调用、MCP 模型上下文协议、Web 爬虫、安全防护、Vue.js 前端开发、SSE 服务端推送等企业级 AI 应用开发技术。帮助开发者掌握 AI 时代必备技能,熟悉 LangChain 框架,提升编程学习效率和求职竞争力,成为企业需要的 AI 全栈开发人才。
sonarqube
SonarQube MCP Server
PIXRA
Pixelize the real world on-chain
mcp-mianshiya
基于 Spring AI 的面试鸭搜索题目的 MCP Server 服务,快速让 AI 搜索企业面试真题和答案
api2mcp4j
This is a revolutionary AI MCP plugin with excellent pluggable and encapsulated features. With just a few lines of configuration, it can easily integrate into your Spring boot web program and give it MCP capabilities,inheriting the powerful engineering capabilities of the Spring series framework
quarkus-workshop-langchain4j
Quarkus Langchain4J Workshop