|
| 1 | +# Spring AI MCP |
| 2 | + |
| 3 | +Java SDK for the Model Context Protocol (MCP), providing seamless integration between Java and Spring applications and MCP-compliant AI models and tools. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +Spring AI MCP is an experimental project that provides Java and Spring Framework integration for the [Model Context Protocol](https://modelcontextprotocol.org/docs/concepts/architecture). It enables Spring applications to interact with AI models and tools through a standardized interface, supporting both synchronous and asynchronous communication patterns. |
| 8 | + |
| 9 | +<img src="spring-ai-mcp-architecture.jpg" width="600"> |
| 10 | + |
| 11 | +## Modules |
| 12 | + |
| 13 | +The project consists of two main modules: |
| 14 | + |
| 15 | +### spring-ai-mcp-core |
| 16 | + |
| 17 | +The core module provides a Java implementation of the Model Context Protocol specification. It includes: |
| 18 | +- Synchronous and asynchronous client implementations |
| 19 | +- Standard MCP operations support (tool discovery, resource management, prompt handling) |
| 20 | +- Stdio-based server transport |
| 21 | +- Reactive programming support using Project Reactor |
| 22 | + |
| 23 | +### spring-ai-mcp-spring |
| 24 | + |
| 25 | +The Spring integration module provides Spring-specific functionality: |
| 26 | +- Integration with Spring AI's function calling system |
| 27 | +- Spring-friendly abstractions for MCP clients |
| 28 | +- Automatic conversion between JSON and Java objects for tool arguments |
| 29 | + |
| 30 | +## Requirements |
| 31 | + |
| 32 | +- Java 17 or later |
| 33 | +- Maven 3.6 or later |
| 34 | +- Spring AI 1.0.0-M4 or later |
| 35 | + |
| 36 | +## Installation |
| 37 | + |
| 38 | +Add the following dependencies to your Maven project: |
| 39 | + |
| 40 | +```xml |
| 41 | +<!-- For core MCP functionality --> |
| 42 | +<dependency> |
| 43 | + <groupId>org.springframework.experimental</groupId> |
| 44 | + <artifactId>spring-ai-mcp-core</artifactId> |
| 45 | + <version>0.2.0-SNAPSHOT</version> |
| 46 | +</dependency> |
| 47 | + |
| 48 | +<!-- For Spring integration --> |
| 49 | +<dependency> |
| 50 | + <groupId>org.springframework.experimental</groupId> |
| 51 | + <artifactId>spring-ai-mcp-spring</artifactId> |
| 52 | + <version>0.2.0-SNAPSHOT</version> |
| 53 | +</dependency> |
| 54 | +``` |
| 55 | + |
| 56 | +## Documentation |
| 57 | + |
| 58 | +- [Core Module Documentation](spring-ai-mcp-core/README.md) |
| 59 | +- [Spring Integration Documentation](spring-ai-mcp-spring/README.md) |
| 60 | +- [UML Class Diagrams](spring-ai-mcp-core/docs/spring-ai-mcp-uml-classdiagram.svg) |
| 61 | + |
| 62 | +## Development |
| 63 | + |
| 64 | +### Building from Source |
| 65 | + |
| 66 | +```bash |
| 67 | +mvn clean install |
| 68 | +``` |
| 69 | + |
| 70 | +### Running Tests |
| 71 | + |
| 72 | +```bash |
| 73 | +mvn test |
| 74 | +``` |
| 75 | + |
| 76 | +## Project Information |
| 77 | + |
| 78 | +- **Group ID**: org.springframework.experimental |
| 79 | +- **Version**: 0.2.0-SNAPSHOT |
| 80 | +- **Java Version**: 17 |
| 81 | +- **Spring AI Version**: 1.0.0-M4 |
| 82 | + |
| 83 | +## Contributing |
| 84 | + |
| 85 | +This is an experimental Spring project. Contributions are welcome! Please: |
| 86 | + |
| 87 | +1. Fork the repository |
| 88 | +2. Create a feature branch |
| 89 | +3. Submit a Pull Request |
| 90 | + |
| 91 | +## Team |
| 92 | + |
| 93 | +- Christian Tzolov |
| 94 | +- Dariusz Jędrzejczyk |
| 95 | + |
| 96 | +## Links |
| 97 | + |
| 98 | +- [GitHub Repository](https://github.com/spring-projects-experimental/spring-ai-mcp) |
| 99 | +- [Issue Tracker](https://github.com/spring-projects-experimental/spring-ai-mcp/issues) |
| 100 | +- [CI/CD](https://github.com/spring-projects-experimental/spring-ai-mcp/actions) |
| 101 | + |
| 102 | +## License |
| 103 | + |
| 104 | +This project is licensed under the [Apache License 2.0](LICENSE). |
| 105 | + |
| 106 | +``` |
| 107 | +Copyright 2024-2024 the original author or authors. |
| 108 | +
|
| 109 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 110 | +you may not use this file except in compliance with the License. |
| 111 | +You may obtain a copy of the License at |
| 112 | +
|
| 113 | + https://www.apache.org/licenses/LICENSE-2.0 |
| 114 | +
|
| 115 | +Unless required by applicable law or agreed to in writing, software |
| 116 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 117 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 118 | +See the License for the specific language governing permissions and |
| 119 | +limitations under the License. |
0 commit comments