Content
# auto-mcp-client
## Project Introduction
This is a Java project based on **Spring AI 1.0.0-M7**, which encapsulates the **mcp-client** service and supports interaction with MCP Server through **stdio** and **HTTP SSE (Server-Sent Events)**. The project implements an automated connection management mechanism, including automatic initialization of connections, health checks, timeout closures, and link 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 through `stdio` and `HTTP SSE`.
- **Automatic Initialization of Connection**: The project will automatically complete the connection initialization with MCP Server at startup.
- **Automatic Health Check**: Regularly checks the health status of the connection to ensure it is always available.
- **Automatic Timeout Closure**: Automatically closes the connection if it exceeds the specified timeout period without being used, to release resources.
- **Link Reuse**: Reuses the same connection within the timeout period to improve performance and resource utilization.
- **Environment Isolation**: Multiple intelligent agents with the same MCP Server are mutually isolated.
---
## Technical Stack
- **Framework**: Spring AI 1.0.0-M7
- **Language**: Java
- **Dependency Libraries**:
- mcp-client
- Spring Boot 3.3.6
- HTTP Client Library (such as OkHttp or HttpClient)
---
## Quick Start
### 1. Environment Preparation
- **Java Version**: Ensure JDK 17 or higher is installed.
- **Maven/Gradle**: The project uses Maven/Gradle build tools, please ensure they are correctly configured.
### 2. Configuration Before Running the Project
1. The Nacos configuration center and namespace in `bootstrap.yml` need to be changed. The `mcp-client-dev.yml` configuration needs to be imported into the Nacos configuration center.
2. The default docking is with Alibaba's Qwen2.5-72b-instruct large model (OpenAI protocol); supports replacing with private OpenAI protocol models; API key needs to be applied for by yourself.
3. The built-in default `default-mcp-registry.json` needs to be modified to your own API key or other MCP Server.
4. The node service path in the configuration file needs to be modified. The service startup will prioritize checking if the node service is available, and the check is to adapt to more MCP Servers with stdio protocol.
### 3. Built-in Effect Display (Other tools can be configured and asked, and all can be accessed)
- **Effect 1**:
1. Question: Help me compare the weather in Beijing and Shanghai today, which one has a higher temperature? Generate a bar chart.
2. Answer:

- **Effect 2**:
1. Question: Help me analyze the top 5 GDP in Fujian Province and draw a pie chart.
2. Answer:

- **Effect 3**:
1. Question: Help me organize the content on this webpage and draw a total to markdown.
2. Answer:

Connection Info
You Might Also Like
everything-claude-code
Complete Claude Code configuration collection - agents, skills, hooks,...
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
servers
Model Context Protocol Servers
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.