
java spring custom mcp client
使用 Spring Boot 和 Spring AI MCP Client 构建的聊天助手,支持与 LLM 模型交互。
Repository Info
About This Server
使用 Spring Boot 和 Spring AI MCP Client 构建的聊天助手,支持与 LLM 模型交互。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
Chat Assistant with MCP Client
Project Overview
This project implements a Model Context Protocol (MCP) client using Spring Boot and the Spring AI MCP Client starter. The client connects to an MCP server to interact with various LLM models and provides a chat interface for user interactions.
Demo
!img.png
Overview
The MCP client is built using:
- Java 21
- Spring Boot 3.5.0
- Spring AI MCP Client Starter 1.0.0: Documentation
Prerequisites
- Java 21 or higher
- Gradle 8.x or higher
- Access to an MCP Server instance
- Docker (optional, for containerized deployment)
Project Structure
src/
├── main/
│ ├── java/ # Java source files
│ └── resources/ # Configuration files
└── test/ # Test files
Dependencies
- spring-ai-starter-mcp-client: Core MCP client implementation
- stater-web: Web framework for building RESTful APIs
- spring-boot-starter-test: Testing framework
- starter-thymeleaf: Template engine for rendering chat HTML view
Configuration
The client can be configured through application.properties or application.yml files in the src/main/resources directory to connect to the MCP server.
Implementation Steps
1. Create an MCP Client to connect to the any Java SSE MCP Server like our https://github.com/Ntsal/ntsal-ecom-java-mcp-server/tree/sse
2. Add ChatClient with an paid LLM Model like Anthropic Claude, Google Gemini, OpenAI GPT to test its tool calling with MCP
3. Facilitate an Interactive Chat Interface
4. Try with free Ollama models that support tool calling like llama3.2:3b, qwen3:8b,...
Quick Start
Clone the repository
git clone https://github.com/youssefelshiaty/java-spring-custom-mcp-clientInstall dependencies
cd java-spring-custom-mcp-client
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.