# Smart-AI **Repository Path**: kylewka/smart-ai ## Basic Information - **Project Name**: Smart-AI - **Description**: Smart-AI 是一个基于 Spring Boot 的 AI 工具包,提供了 MCP (Machine Callable Protocol) 服务端点的快速集成能力。该工具包允许开发者轻松创建和发布可被 AI 调用的接口服务,实现人工智能与应用系统的无缝对接。 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 27 - **Forks**: 9 - **Created**: 2025-04-28 - **Last Updated**: 2025-09-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Smart-AI ## 介绍 Smart-AI 是一个基于 Spring Boot 的 AI 工具包,提供了 MCP (Machine Callable Protocol) 服务端点的快速集成能力。该工具包允许开发者轻松创建和发布可被 AI 调用的接口服务,实现人工智能与应用系统的无缝对接。 ## 软件架构 Smart-AI 采用模块化设计,主要包含以下组件: 1. **smart-ai-mcp-spring-boot-starter**:核心启动器模块,提供 MCP 服务端点的自动配置和注册功能 2. **smart-ai-demo**:示例应用模块,展示如何使用 Smart-AI 创建 MCP 服务 整体架构基于 Spring Boot 框架,通过注解驱动的方式简化 MCP 服务的开发和部署。 ## 安装教程 1. 确保您的开发环境已安装 JDK 8 或更高版本以及 Maven 2. 克隆本仓库到本地:`git clone [仓库地址]` 3. 进入项目根目录,执行 Maven 构建命令:`mvn clean install` ## 使用说明 ### 1. 添加依赖 在您的 Spring Boot 项目的 `pom.xml` 文件中添加以下依赖: 该依赖暂未发布到 Maven 仓库,需要手动安装至本地仓库: ```xml com.github.kylewka smart-ai-mcp-spring-boot-starter 1.0.0 ``` ### 2. 创建 MCP 服务端点 使用 @McpServerEndpoint 注解标注您的服务类,并使用 @McpFunction 注解标注服务方法: ```java @McpServerEndpoint(value = "/mcp", version = "1.0.0", name = "测试MCP服务") public class McpServerTool { @McpFunction(name = "getWeather", description = "获取天气信息") public String getWeather(@McpParam(name = "city", description = "城市名称", required = true) String city) { return String.format("%s: 晴天,温度25℃", city); } @McpFunction(name = "getSpeciality", description = "获取城市特产") public String getSpeciality(@McpParam(name = "city", description = "城市名称", required = true) String city) { return String.format("%s特产是小笼包", city); } } ``` ### 3. 启动应用 直接启动 Spring Boot 启动 MCP 服务 ### 4. 注意事项 1. MCP服务受项目本身的鉴权系统影响,请根据实际情况进行配置 ## 客户端使用 使用新版MCP协议的客户端软件 [Cherry Studio](https://cherry-ai.com/),建议使用 Cherry Studio >= 1.2.0 建议选择支持工具调用的大模型 ![img.png](doc/imgs/img.png) ![img_1.png](doc/imgs/img_1.png) ![img_2.png](doc/imgs/img_2.png) ![img_3.png](doc/imgs/img_4.png)