How shdhumale/spring-boot-ai-mcp-client works
This Spring Boot MCP client accepts chat text over HTTP, passes it through a configured Spring AI ChatClient, and returns the response content. The ChatClient is built with tool callbacks; the README describes configuration for an OpenAI-compatible model and a stdio-launched Mongo MCP server. The excerpts establish the controller and bean wiring, while the README supplies the external configuration details; application.yml was not excerpted.
Main entry points: MCPClientChatClientConfig.java Spring AI ChatClient · ChatController.java Chat endpoint · application.yml MCP client connection · SpringBootAiMcpClientApplication.java Application entry
Components 8
HTTP API
- Chat endpoint
src/main/java/com/siddhu/controller/ChatController.java
Spring Runtime
- Application entry
src/main/java/com/siddhu/SpringBootAiMcpClientApplication.java - ChatClient config
src/main/java/com/siddhu/config/MCPClientChatClientConfig.java
AI Integrations
- Spring AI ChatClient
src/main/java/com/siddhu/config/MCPClientChatClientConfig.java - Configured AI model
- MCP client connection
src/main/resources/application.yml
Other components
- Chat user
- Mongo MCP server
Connections 7
- Application entry → Chat endpoint: starts runtime
src/main/java/com/siddhu/SpringBootAiMcpClientApplication.java - Chat user → Chat endpoint: posts prompt
README.md - Chat endpoint → Spring AI ChatClient: submits prompt
src/main/java/com/siddhu/controller/ChatController.java - ChatClient config → Spring AI ChatClient: builds with tools
src/main/java/com/siddhu/config/MCPClientChatClientConfig.java - Spring AI ChatClient → Configured AI model: requests response
README.md - Spring AI ChatClient → MCP client connection: uses MCP tools
README.md - MCP client connection → Mongo MCP server: launches over stdio
README.md