CS

cagritrk/spring-ai-mcp-server

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

6 stars 4 forks Качество 43 Тренд 14

Sample Spring AI MCP Server project built for fun and experimentation. 🚀 It implements basic CRUD operations using an in-memory data store with dummy Person data. 🤖

Обзор

This is a sample Spring AI MCP Server project built for fun and experimentation. It implements basic CRUD operations using an in-memory data store with dummy Person data. The project demonstrates: - Implementation of a PersonService with CRUD operations - In-memory data storage for Person entities - Spring MCP Tools annotations and required code to create an MCP Server - : Delete a person record by ID from the in-memory store. : id (integer) - : Search for persons by job title in the in-memory store. : jobTitleQuery (string) - : Filter persons by sex (case-insensitive). : sex (string) - : Filter persons by age. : age (integer) - : Update an existing person record by ID in the in-memory store. : id (integer), updatedPersonData (object) - : Create a new person record in the in-memory store. : personData (object)

README

Показан фрагмент оригинального README. Открыть оригинал.

Spring AI MCP Server Example

This is a sample Spring AI MCP Server project built for fun and experimentation. It implements basic CRUD operations using an in-memory data store with dummy Person data.

Project Overview

The project demonstrates:

  • Implementation of a PersonService with CRUD operations
  • In-memory data storage for Person entities
  • Spring MCP Tools annotations and required code to create an MCP Server

Technologies

  • Java 24
  • Spring Boot 3.4.4
  • Spring AI 1.0.0-M6

How to Run

  1. Build the project:
mvn clean install
  1. Start the MCP server:
java -jar target/spring-ai-mcp-0.0.1-SNAPSHOT.jar

MCP Server Configuration

{
  "mcpServers": {
    "cagritrk-inmemory-data-mcp-server": {
      "command": "java",
      "args": [
        "-jar",
        "\\spring-ai-mcp\\target\\spring-ai-mcp-0.0.1-SNAPSHOT.jar"
      ]
    }
  }
}

Tools of cagritrk-inmemory-data-mcp-server

  • ps_delete_person: Delete a person record by ID from the in-memory store.
    Input: id (integer)

  • ps_search_by_job_title: Search for persons by job title in the in-memory store.
    Input: jobTitleQuery (string)

  • ps_filter_by_sex: Filter persons by sex (case-insensitive).
    Input: sex (string)

  • ps_filter_by_age: Filter persons by age.
    Input: age (integer)

  • ps_update_person: Update an existing person record by ID in the in-memory store.
    Input: id (integer), updatedPersonData (object)

  • ps_create_person: Create a new person record in the in-memory store.
    Input: personData (object)

  • ps_get_all_persons: Retrieve all person records from the in-memory store.
    Input: None

  • ps_get_person_by_id: Retrieve a person record by ID from the in-memory store.
    Input: id (integer)

Demo Screenshots

Create new Person

Get the list of Persons

How many male person records are there?

CSV Data

The project uses the following sample CSV data:

Index,User Id,First Name,Last Name,Sex,Email,Phone,Date of birth,Job Title
1,88F7B33d2bcf9f5,Shelby,Terrell,Male,[email protected],001-084-906-7849x73518,1945-10-26,Games developer
2,f90cD3E76f1A9b9,Phillip,Summers,Female,[email protected],214.112.6044x4913,1910-03-24,Phytotherapist
3,DbeAb8CcdfeFC2c,Kristine,Travis,Male,[email protected],277.609.7938,1992-07-02,Homeopath
4,A31Bee3c201ef58,Yesenia,Martinez,Male,[email protected],584.094.6111,2017-08-03,Market researcher
Открыть полный README на GitHub

Установка

This server does not publish a one-line install command.

Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

{ "mcpServers": { "cagritrk-inmemory-data-mcp-server": { "command": "java", "args": [ "-jar", "<YOUR_PATH>\\spring-ai-mcp\\target\\spring-ai-mcp-0.0.1-SNAPSHOT.jar" ] } } }