Content
This project demonstrates a sample implementation of Model Context Protocol (MCP) using Spring AI.
# Installation
#### Install Ollama
- Please install Ollama by referring to the link below.
```
https://ollama.com/blog/ollama-is-now-available-as-an-official-docker-image
```
#### MCP Server
- git clone this sources
```
git clone https://github.com/mrjishin/spring-ai-mcp-example.git
```
- Create a database in mysql (any other database will do, using JPA)
Refer to spring-ai-mcp-server-example/docs/schema.sql or set it as "spring.jpa.hibernate.ddl-auto: create" in the application.yml file and run it to create the table.
- Build spring-ai-mcp-server-example (The server source uses QueryDSL, so it must be built first.)
```
spring:
jpa:
hibernate:
ddl-auto: create
```
```
cd ./spring-ai-mcp-server-example/
./gradlew build
```
- Insert sample data by referring to the spring-ai-mcp-server-example/docs/data-en.sql file.
- Start MCP server.
```
./gradlew bootRun
```
#### MCP Client
- In application.yml of the spring-ai-mcp-client-example source, change the values of spring.api.openai.api-key to your openai API key.
```
spring:
ai:
openai:
api-key: <YOUR_OPENAI_API_KEY>
```
- Start MCP Client.
```
cd ./spring-ai-mcp-client-example/
./gradlew bootRun
```
- Now you can test it in a web browser.
```
http://localhost:8888/
```
You Might Also Like
Ollama
Ollama enables easy access to large language models on various platforms.

n8n
n8n is a secure workflow automation platform for technical teams with 400+...
OpenWebUI
Open WebUI is an extensible web interface for customizable applications.

Dify
Dify is a platform for AI workflows, enabling file uploads and self-hosting.

Zed
Zed is a high-performance multiplayer code editor from the creators of Atom.
MarkItDown MCP
markitdown-mcp is a lightweight MCP server for converting various URIs to Markdown.