Content
## Getting Started
**Algorithmic Learning Graybeard - Empowering Intelligent Querying with RAG + MCP Dual-Engine Architecture.**
*Built upon the foundation of Large Language Models (LLM), leveraging MCP Server's capabilities in data fusion and semantic indexing for databases, this project constructs a dual-engine architecture that synergizes RAG and MCP. It achieves precise conversion from natural language to structured queries through intelligent syntax parsing and query mapping, forming a complete technical loop. This can be used to assist enterprises/teams in technical research and development, product design, and other supporting tasks.*
> **🌟 If this project is helpful to you, please give it a star 🌟**
## System Composition and Documentation
[English](README_en.md)
<br>
> 👉 Code Address: [github](https://github.com/chenlinyang/alg-mcp) or [gitee](https://gitee.com/chenlinyang/alg-mcp)
If you have thousands of data directories and billions of data facts, and you need to perform data retrieval or analysis, you can extend and optimize this project.
Architecture Reference:
- [Claude MCP Protocol](https://www.claudemcp.com/specification)
- [MCP SDK Introduction](https://modelcontextprotocol.io/introduction)
- Overall Architecture<br>
<img src="./images/GeneralArchitecture.png" width = "800" alt="Overall Architecture" />
- Life Cycle<br>
<img src="./images/LifeCycle.png" width = "600" alt="Life Cycle" />
- Operation Steps<br>
<img src="./images/Operation.png" width = "600" alt="Operation Steps" />
## Features
* MCP Server
* MCP Client
* Chat Demo Address: <br>
http://localhost:4000/
- Weather Query
> External interface free docking

- Database Operation
> One sentence to complete grouping, ranking, sampling and other SQL operations

## Supported Models
* Zhipu-AI
* Also supports access to other models: <br>
Supports DeepSeek, ChatGPT 3.5, Tongyi Qianwen, Wenxin Yiyan, Ollama, etc.
## Technology Stack
This repository is for backend services
Technology Stack:
* jdk 17
* springboot 3.4.4
* [langchain4j 1.0.0-beta3](https://github.com/langchain4j/langchain4j)
* **mcp-server** utilizes custom annotations to implement the MCP protocol. Completed interfaces include: <br>
initialize, tools/call, tools/list, notifications/initialized, prompts/list, prompts/get, etc.
* **mcp-client** uses RAG custom QueryTransformer to read MCP server and implement NPL2SQL functionality
## How to Run
### mcp-server Configuration
**a. Configure Database Connection**
* Database (MySQL)
```yaml
spring:
datasource:
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:mysql://<ip>:<port>/<database_name>?characterEncoding=utf8&serverTimezone=GMT%2B8&useSSL=false
driver-class-name: com.mysql.cj.jdbc.Driver
username: <username>
password: <password>
```
* Supports PostgreSQL, Oracle, SQLServer, H2 and other relational databases<br>
Configuration reference: [spring-boot-data-jdbc](https://docs.spring.io/spring-boot/docs/current/reference/html/data.html#data.sql.jdbc)
**b. Configure Third-Party Weather API**
* Apply for QWeather API-KEY and API-HOST<br>
[Application Address](https://id.qweather.com/#/login)
```yaml
weather:
api:
host: <api-host>
api-key: <api-key>
```
### mcp-client Configuration
**a. Configure mcp-server Connection**
* SSE Endpoint
```yaml
mcp:
server:
sse-url: http://localhost:3002/sse
```
**b. Configure Large Model**
* Large model api-key and model configuration
```yaml
zhipu-ai:
api-key: <api-key>
model: <model>
```
Connection Info
You Might Also Like
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
markitdown
Python tool for converting files and office documents to Markdown.
OmniRoute
Never stop coding. The free AI gateway — one endpoint, 160+ providers, zero...
Filesystem
Node.js MCP Server for filesystem operations with dynamic access control.
TrendRadar
TrendRadar: Your hotspot assistant for real news in just 30 seconds.
mempalace
The highest-scoring AI memory system ever benchmarked. And it's free.