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:
- Experiment with the new Spring AI features
- Learn about MCP server implementation
- 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
- Clone the repo:
git clone https://github.com/cagritrk/spring-ai-mcp-server
- Build and run:
mvn clean install
java -jar target/spring-ai-mcp-0.0.1-SNAPSHOT.jar
Demo Screenshots
Create new Person
Get the list of Persons
How many male person records are there?
Available MCP Tools
The server provides these handy tools:
ps_create_person
: Add new person recordsps_get_all_persons
: List all recordsps_filter_by_sex
: Filter by genderps_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!