MCP ExplorerExplorer

Spring Ai Mcp Demo

@GEM0816gon 14 days ago
1 MIT
FreeCommunity
AI Systems
This project is a Spring Boot-based AI MCP (Model Control Protocol) demonstration application, designed to showcase how to interact with various AI models through the MCP protocol. The project incorporates best practices in modern software development, implementing features such as model service configuration, chat control, and custom tools.

Overview

What is Spring Ai Mcp Demo

Spring-AI-MCP-Demo is a demonstration application based on Spring Boot that showcases how to interact with various AI models using the Model Control Protocol (MCP). It incorporates best practices in modern software development, enabling model service configuration, chat control, and custom tools.

Use cases

Use cases include developing chatbots that interact with users, configuring different AI models for specific tasks, and creating custom tools to enhance AI capabilities in applications.

How to use

To use Spring-AI-MCP-Demo, clone the repository, configure the necessary model services in McpServerConfig, and run the application. You can interact with AI models through the ChatController for chat requests and manage MCP client connections via McpClientController.

Key features

Key features include model service configuration through McpServerConfig, chat handling with ChatController, MCP client management via McpClientController, and the ability to implement custom tools in CustomTools to extend AI model functionalities.

Where to use

Spring-AI-MCP-Demo can be used in various fields such as AI development, chatbot applications, and any domain requiring interaction with AI models through a standardized protocol.

Content

Spring AI MCP Demo

项目简介

本项目是一个基于Spring Boot的AI MCP(Model Control Protocol)演示应用,旨在展示如何通过MCP协议与各种AI模型进行交互。该项目结合了现代软件开发的最佳实践,实现了模型服务配置、聊天控制和自定义工具等功能。

技术栈

  • 编程语言: Java
  • 框架/库: Spring Boot, Spring AI
  • 构建工具: Maven
  • 协议: MCP (Model Control Protocol)
  • 模型: Ollama

功能特性

  • 模型服务配置: 通过McpServerConfig类配置不同的AI模型服务。
  • 聊天控制: 使用ChatController处理聊天请求,支持与AI模型的交互。
  • 客户端控制: 通过McpClientController管理MCP客户端连接。
  • 自定义工具: 在CustomTools中实现自定义工具以扩展AI模型的功能。

目录结构

├── src
│   ├── main
│   │   ├── java
│   │   │   └── com
│   │   │       └── example
│   │   │           └── demo
│   │   │               ├── config
│   │   │               │   └── McpServerConfig.java
│   │   │               ├── controller
│   │   │               │   ├── ChatController.java
│   │   │               │   └── McpClientController.java
│   │   │               └── tools
│   │   │                   └── CustomTools.java
│   │   └── resources
│   │       ├── application.yml
│   │       └── mcp-servers-config.json
└── README.md

Tools

No tools

Comments