mcpField
S
Spring Boot AI MCP Server

Spring Boot AI MCP Server

Local
github.com/meursongDeveloper Tools0Updated 79w ago

About Spring Boot AI MCP Server

Spring Boot application demonstrating the Model-Controller-Presenter pattern for AI applications, with Spring AI and OpenAI integration. It provides REST endpoints for generating AI responses.

Key features

  1. 01Spring Boot and Java 17 foundation
  2. 02Spring AI with OpenAI integration
  3. 03Model-Controller-Presenter architecture
  4. 04REST API for AI responses
  5. 05Validation and exception handling
  6. 06Unit tests

Use cases

  1. 01Building an AI application with Spring Boot
  2. 02Generating responses through a REST endpoint

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

Spring Boot AI MCP Server

Overview

This project is a Spring Boot application that implements the Model-Controller-Presenter (MCP) architecture pattern for AI-powered applications. It provides a foundation for building AI-enhanced applications using Spring AI and OpenAI integration.

Features

  • Spring Boot 3.2.3 with Java 17
  • Spring AI integration with OpenAI
  • MCP architecture pattern
  • RESTful API endpoints
  • Exception handling
  • Validation
  • Unit testing

Architecture

The project follows the MCP (Model-Controller-Presenter) architecture pattern:

  • Model: Represents the data and business logic
  • Controller: Handles HTTP requests and responses
  • Presenter: Formats data for presentation

Project Structure

src/
├── main/
│   ├── java/
│   │   └── com/
│   │       └── junie/
│   │           └── mcp/
│   │               ├── ai/
│   │               │   ├── config/
│   │               │   ├── controller/
│   │               │   ├── dto/
│   │               │   └── service/
│   │               └── common/
│   │                   ├── dto/
│   │                   ├── entity/
│   │                   └── exception/
│   └── resources/
│       └── application.properties
└── test/
    └── java/
        └── com/
            └── junie/
                └── mcp/
                    └── ai/
                        └── service/

Getting Started

Prerequisites
  • Java 17 or higher
  • Gradle 8 or higher
  • OpenAI API key
Configuration

Set your OpenAI API key in the application.properties file or as an environment variable:

spring.ai.openai.api-key=${OPENAI_API_KEY}
Building the Project
./gradlew build
Running the Project
./gradlew bootRun

API Endpoints

Generate AI Response
POST /api/v1/ai/generate

Request body:

{
  "prompt": "Your prompt here"
}

Response:

{
  "success": true,
  "message": "Success",
  "data": {
    "content": "AI-generated response"
  },
  "timestamp": "2023-06-01T12:00:00"
}

License

This project is licensed under the MIT License - see the LICENSE file for details.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.