Spring AI MCP Server - A Fun Demo Project

April 2, 2025Programming

A fun demo project experimenting with Spring AI and MCP Server implementation

Hey everyone! I wanted to share this fun little demo project I built to experiment with Spring AI and the Model Context Protocol (MCP). It's a simple in-memory data server that implements basic CRUD operations for Person entities.

What's This Project About?

This Spring Boot application demonstrates how to create an MCP server that can be connected to various tools and systems. The main features include:

  • Full CRUD operations for Person records
  • Various filtering capabilities (by age, sex, job title)
  • Simple in-memory data storage
  • Ready-to-use MCP server configuration

Why I Built This

I wanted to:

  1. Experiment with the new Spring AI features
  2. Learn about MCP server implementation
  3. Create something simple but functional that others could use as a reference

How It Works

The project uses Java 24 with:

  • Spring Boot 3.4.4
  • Spring AI 1.0.0-M6

Getting Started

  1. Clone the repo:
git clone https://github.com/cagritrk/spring-ai-mcp-server
  1. Build and run:
mvn clean install
java -jar target/spring-ai-mcp-0.0.1-SNAPSHOT.jar

Demo Screenshots

Create new Person

Creating a new person Screenshot

Get the list of Persons

Viewing all persons Screenshot

How many male person records are there?

Filtering by sex Screenshot

Available MCP Tools

The server provides these handy tools:

  • ps_create_person: Add new person records
  • ps_get_all_persons: List all records
  • ps_filter_by_sex: Filter by gender
  • ps_search_by_job_title: Search by profession
  • And more!

Check It Out!

Feel free to fork and play with the code: GitHub Repository

This was a fun weekend project that helped me understand MCP servers better. Let me know if you have any questions or suggestions!

Would you like to stay updated with my latest posts?


No spam, No third-party sharing. Just between us

Recent

A fun demo project experimenting with Spring AI and MCP Server implementation
Spring AI MCP Server - A Fun Demo Project
A fun demo project experimenting with Spring AI and MCP Server implementation
Discover my journey with the Eclipson Model A RC Controlled Airplane, from 3D printing to its maiden flight.
3D Printing Eclipson Model A RC Controlled Airplane
Discover my journey with the Eclipson Model A RC Controlled Airplane, from 3D printing to its maiden flight.
How Portainer transformed my home server management with its intuitive Docker container interface and powerful features
Discovering Portainer - A Game Changer for My Home Server
How Portainer transformed my home server management with its intuitive Docker container interface and powerful features