scalasm/springai-kata-mcp
3.2
If you are the rightful owner of springai-kata-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This document provides a structured summary of a Model Context Protocol (MCP) server using Spring Boot and MCP integration.
Spring-AI kata (MCP Server))
This is my sandbox for experimenting with MCP servers using Spring Boot and MCP integration.
In addition to this Spring AI MCP Server, there are three kata repositories in this series, to keep things a bit separated:
- Spring AI Kata - prompts, RAG with Milvus
- Spring AI Kata with Azure Functions dealing with Azure functions integration: this should be superseded by a MCP implementation
- Spring AI Kata w/ Multimedia content, deals with image generation, and text2speech
Requirements
- JDK 21 or better
- I use Amazon Corretto 21 but anything should be fine
- Apache Maven 3.9.x
- OPENAI API Key - to be obtained by the Open AI Console
- ensure there is an environment variable called
OPENAI_API_KEY
set and your will be ready to go!
- ensure there is an environment variable called
- NINJAS_API_KEY - to be obtained from API Ninjas - the free tier is ok!
- We want to consume the Weather API
How to run
Option 1 - from Visual Studio Code
A launch configuration is provided for Visual Studio Code - just create a .env
file in the workspace root with you OPENAPI_API_KEY
set.
Option 2 - Command line
mvn spring-boot:run
How to test
You have a few options:
- Configure the MCP Server in your VSCode environment See for a ready-to-use example - you configure the URL for your MCP server.
- Use postman - new Postman include support for inspecting your MCP servers
References
- Understand SSE MCP SERVER with Spring Boot and Spring AI | Beginner Tutorial this is a great reference for both building your MCP server ground up or troubleshooting your own!
- Spring AI - Begineer to Guru has been my initial reference