Content
# srping-ai-mcp
## 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 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 closures, 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 the MCP Server via `stdio` and `HTTP SSE`.
- **Automatic Connection Initialization**: Automatically initializes the connection with the MCP Server upon project startup.
- **Automatic Health Checks**: Regularly checks the health status of the connection to ensure it is always available.
- **Automatic Timeout Closure**: Automatically closes connections that have not been used beyond a specified timeout to free up resources.
- **Connection Reuse**: Reuses the same connection within the timeout period to improve performance and resource utilization.
- **Environment Isolation**: Multiple agents using the same MCP server are isolated from each other.
---
## Tech Stack
- **Framework**: Spring AI 1.0.0-M7
- **Language**: Java
- **Dependencies**:
- mcp-client
- Spring Boot 3.3.6
- HTTP client libraries (such as 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 as the build tool, please ensure it is configured correctly.
### 2. Configuration Before Running the Project
1. You need to change the nacos configuration center and namespace in bootstrap.yml and import the mcp-client-dev.yml configuration into the nacos configuration center.
2. By default, it connects to the Alibaba Bailian qwen2.5-72b-instruct large model (OpenAI protocol); it supports switching to a private OpenAI protocol model; the 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. You need to modify the node service path in the configuration file. The service startup will first check if the node service is available. The purpose of this check is to adapt to the stdio protocol for more MCP servers.
### 3. Built-in Effect Demonstration (Other tools can be configured to ask questions as well)
- **Effect One**:
1. question: Help me compare the weather in Beijing and Shanghai today, which has a higher temperature? Generate a bar chart.
2. answer:

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

- **Effect Three**:
1. question: Help me organize the content on this webpage and convert it to markdown.
2. answer:

You Might Also Like
Ollama
Ollama enables easy access to large language models on various platforms.

n8n
n8n is a secure workflow automation platform for technical teams with 400+...
OpenWebUI
Open WebUI is an extensible web interface for customizable applications.

Dify
Dify is a platform for AI workflows, enabling file uploads and self-hosting.

Zed
Zed is a high-performance multiplayer code editor from the creators of Atom.
MarkItDown MCP
markitdown-mcp is a lightweight MCP server for converting various URIs to Markdown.