Content
# auto-mcp-client
## Project Introduction
This is a Java project based on **Spring AI 1.0.0-M7**, encapsulating the **mcp-client** service, supporting interaction with the MCP Server via **stdio** and **HTTP SSE (Server-Sent Events)**. The project implements an automated connection management mechanism, including automatic connection initialization, health checks, timeout closure, and connection reuse.
---
### Private Model Configuration Example
```
ai:
openai:
api-key: YWljcF9hcHA6UVd4aFpHUnBianB2Y0dWdUlITmxjMkZ0WlE=
base-url: http://10.0.1.133:30080
chat:
options:
stream: true
model: qwen3-30b-a3b
base-url: http://10.0.1.133:30080
completions-path: /v10/llm/chat/qwen3-30b-a3b/completion
```
## Features
- **Multi-protocol Support**: Supports communication with MCP Server via `stdio` and `HTTP SSE`.
- **Automatic Connection Initialization**: Automatically completes the connection initialization with the MCP Server when the project starts.
- **Automatic Health Check**: Periodically checks the health status of the connection to ensure the connection is always available.
- **Automatic Timeout Closure**: Automatically closes the connection to release resources when the connection has not been used for a specified timeout period.
- **Connection Reuse**: Reuses the same connection within the timeout period to improve performance and resource utilization.
- **Environment Isolation**: Multiple agents with the same mcp server are isolated from each other.
---
## Technology Stack
- **Framework**: Spring AI 1.0.0-M7
- **Language**: Java
- **Dependencies**:
- mcp-client
- Spring Boot 3.3.6
- HTTP client library (e.g., OkHttp or HttpClient)
---
## Quick Start
### 1. Environment Preparation
- **Java Version**: Ensure that JDK 17 or higher is installed.
- **Maven/Gradle**: The project uses Maven/Gradle build tools, please ensure they are configured correctly.
### 2. Project Pre-run Configuration
1. Need to change the nacos configuration center and namespace in bootstrap.yml. Need to import the mcp-client-dev.yml configuration into the nacos configuration center.
2. The default is Alibaba Bailian qwen2.5-72b-instruct large model (openai protocol); supports replacing private openai protocol models; apikey needs to be applied for by yourself.
3. The built-in default default-mcp-registry.json needs to be modified to your own apikey or other mcpserver.
4. Need to modify the node service path in the configuration file. The service startup will first check whether the node service is available. The purpose of the check is to adapt more mcp servers with the stdio protocol.
### 3. Built-in Effect Display (Other tools can be accessed after being configured by yourself)
- **Effect 1**:
1. question: Help me compare the temperature of Beijing weather and Shanghai weather today and generate a bar chart
2. answer:

- **Effect 2**:
1. question: Help me analyze the top 5 GDP of Fujian Province in the database and draw it into a pie chart
2. answer:

- **Effect 3**:
1. question: Help me organize the content on this webpage and summarize it into markdown
2. answer:

Connection Info
You Might Also Like
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
servers
Model Context Protocol Servers
Time
A Model Context Protocol server for time and timezone conversions.
Filesystem
Node.js MCP Server for filesystem operations with dynamic access control.
Sequential Thinking
A structured MCP server for dynamic problem-solving and reflective thinking.
git
A Model Context Protocol server for Git automation and interaction.