{"repo":"duongminhhieu/springboot-ai-mcp-example","free":true,"listed":false,"github":"https://github.com/duongminhhieu/springboot-ai-mcp-example","clone":"git clone https://github.com/duongminhhieu/springboot-ai-mcp-example.git","description":"Example Spring AI Model Context Protocol (MCP)","language":"Java","stars":11,"topics":["mcp","mcp-client","mcp-server","mongodb","postgresql","webmvc","openai-api","spring-ai"],"license":null,"category":"mcp-servers","readme_excerpt":"Spring AI MCP Examples This project demonstrates how to build and integrate a Model-Controller-Prompt (MCP) architecture using Spring Boot and Spring AI . It includes both an MCP Client and an MCP Server , showcasing how AI models can dynamically interact with external tools and data sources ( MongoDB , PostgreSQL ) to fulfill user requests in real time. Full blog: https://blog.nashtechglobal.com/building-an-mcp-server-and-client-using-java-spring-boot-ai/ Features Data Source Integration : Connects to a local MongoDB, PostgreSQL to perform various operations. Callable Tools with Annotation : Tool methods are declared using the annotation, making them discoverable and callable by the AI model at runtime. Tool Registration with : Used to expose and register tools dynamically during initialization, enabling seamless integration with Spring AI. How It Works The MCP workflow in these examples follows these steps: Initial Setup and Discovery 1. Connection Initialization When the host application starts, its Chat Client sends an initialization request to the MCP Client. The MCP Client establishes a connection to the configured MCP Server. 2. Capability Discovery The MCP Client asks the MCP Server: “What capabilities (tools) do you offer?” The MCP Server responds with metadata describing all available tools, such as names, parameters, and descriptions. 4. Registration The MCP Client forwards this tool list to the Chat Client. The Chat Client registers these tools with the AI model (","default_branch":null,"files":null,"tree":[],"storefront":"/r/duongminhhieu","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/duongminhhieu/springboot-ai-mcp-example/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}