# shdhumale/spring-boot-ai-mcp-client architecture

> Architecture diagram of the GitHub repository shdhumale/spring-boot-ai-mcp-client, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shdhumale/spring-boot-ai-mcp-client
- Repository: https://github.com/shdhumale/spring-boot-ai-mcp-client

## Overview

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: [`src/main/java/com/siddhu/config/MCPClientChatClientConfig.java`](https://github.com/shdhumale/spring-boot-ai-mcp-client/blob/main/src/main/java/com/siddhu/config/MCPClientChatClientConfig.java) (Spring AI ChatClient), [`src/main/java/com/siddhu/controller/ChatController.java`](https://github.com/shdhumale/spring-boot-ai-mcp-client/blob/main/src/main/java/com/siddhu/controller/ChatController.java) (Chat endpoint), [`src/main/resources/application.yml`](https://github.com/shdhumale/spring-boot-ai-mcp-client/blob/main/src/main/resources/application.yml) (MCP client connection), [`src/main/java/com/siddhu/SpringBootAiMcpClientApplication.java`](https://github.com/shdhumale/spring-boot-ai-mcp-client/blob/main/src/main/java/com/siddhu/SpringBootAiMcpClientApplication.java) (Application entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_chat_endpoint["Chat endpoint"]
end

subgraph group_runtime["Spring Runtime"]
  node_application["Application entry"]
  node_chat_config["ChatClient config"]
end

subgraph group_ai["AI Integrations"]
  node_chat_client["Spring AI ChatClient"]
  node_model["Configured AI model"]
  node_mcp_client["MCP client connection<br/>[application.yml]"]
end

node_user(("Chat user"))
node_mongo_server["Mongo MCP server"]

node_application -->|"starts runtime"| node_chat_endpoint
node_user -->|"posts prompt"| node_chat_endpoint
node_chat_endpoint -->|"submits prompt"| node_chat_client
node_chat_config -->|"builds with tools"| node_chat_client
node_chat_client -->|"requests response"| node_model
node_chat_client -->|"uses MCP tools"| node_mcp_client
node_mcp_client -->|"launches over stdio"| node_mongo_server

click node_application "https://github.com/shdhumale/spring-boot-ai-mcp-client/blob/main/src/main/java/com/siddhu/SpringBootAiMcpClientApplication.java"
click node_chat_endpoint "https://github.com/shdhumale/spring-boot-ai-mcp-client/blob/main/src/main/java/com/siddhu/controller/ChatController.java"
click node_chat_config "https://github.com/shdhumale/spring-boot-ai-mcp-client/blob/main/src/main/java/com/siddhu/config/MCPClientChatClientConfig.java"
click node_chat_client "https://github.com/shdhumale/spring-boot-ai-mcp-client/blob/main/src/main/java/com/siddhu/config/MCPClientChatClientConfig.java"
click node_mcp_client "https://github.com/shdhumale/spring-boot-ai-mcp-client/blob/main/src/main/resources/application.yml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_chat_endpoint,node_user toneBlue
class node_application,node_chat_config toneAmber
class node_chat_client,node_model,node_mcp_client,node_mongo_server toneMint
```

## Components

### HTTP API

- [Chat endpoint](https://github.com/shdhumale/spring-boot-ai-mcp-client/blob/main/src/main/java/com/siddhu/controller/ChatController.java): `src/main/java/com/siddhu/controller/ChatController.java`

### Spring Runtime

- [Application entry](https://github.com/shdhumale/spring-boot-ai-mcp-client/blob/main/src/main/java/com/siddhu/SpringBootAiMcpClientApplication.java): `src/main/java/com/siddhu/SpringBootAiMcpClientApplication.java`
- [ChatClient config](https://github.com/shdhumale/spring-boot-ai-mcp-client/blob/main/src/main/java/com/siddhu/config/MCPClientChatClientConfig.java): `src/main/java/com/siddhu/config/MCPClientChatClientConfig.java`

### AI Integrations

- [Spring AI ChatClient](https://github.com/shdhumale/spring-boot-ai-mcp-client/blob/main/src/main/java/com/siddhu/config/MCPClientChatClientConfig.java): `src/main/java/com/siddhu/config/MCPClientChatClientConfig.java`
- **Configured AI model**
- [MCP client connection](https://github.com/shdhumale/spring-boot-ai-mcp-client/blob/main/src/main/resources/application.yml): `src/main/resources/application.yml`

### Other components

- **Chat user**
- **Mongo MCP server**

## Connections

- Application entry → Chat endpoint: starts runtime (evidence: `src/main/java/com/siddhu/SpringBootAiMcpClientApplication.java`)
- Chat user → Chat endpoint: posts prompt (evidence: `README.md`)
- Chat endpoint → Spring AI ChatClient: submits prompt (evidence: `src/main/java/com/siddhu/controller/ChatController.java`)
- ChatClient config → Spring AI ChatClient: builds with tools (evidence: `src/main/java/com/siddhu/config/MCPClientChatClientConfig.java`)
- Spring AI ChatClient → Configured AI model: requests response (evidence: `README.md`)
- Spring AI ChatClient → MCP client connection: uses MCP tools (evidence: `README.md`)
- MCP client connection → Mongo MCP server: launches over stdio (evidence: `README.md`)
