AI Assistant - MCP Server
A Spring Boot-based Model Context Protocol (MCP) Server implementation that enables seamless integration with Claude and other AI clients.
What is MCP?
The Model Context Protocol (MCP) is an open standard that enables AI assistants to securely interact with local and remote resources. This project implements an MCP server using Spring AI, allowing Claude and other AI clients to access tools, prompts, and data through a standardized interface.
Overview
This MCP server is built with Spring Boot 3.5.7 and Spring AI 1.1.0, providing an extensible platform for AI-powered workflows. It exposes MCP-compatible endpoints backed by an H2 database for persistent state management.
Features
- MCP Server Implementation: Full Model Context Protocol server support via Spring AI
- Persistent Storage: H2 database with JPA for data persistence
- Hot Reload: Development mode with automatic reloading
- Extensible Architecture: Modular package structure for easy feature additions
Prerequisites
- Java 21 or higher
- Maven 3.8+ (or use included wrapper)
- Git
Quick Start
Installation```bash
Clone the repository
git clone <repository-url>
cd mcp-ai-assistant
Run the application
./mvnw spring-boot:run
The MCP server will start on the configured port (default: 8080).
### Building```bash
# Build the project
./mvnw clean package
# Run the built JAR
java -jar target/ai-assistant-0.0.1-SNAPSHOT.jar
Configuration
Configuration is managed through src/main/resources/application.properties. Key settings:```properties
Database
spring.datasource.url=${SPRING_DATASOURCE_URL:jdbc:h2:file:./data/assistant}
spring.datasource.username=${SPRING_DATASOURCE_USERNAME:sa}
spring.datasource.password=${SPRING_DATASOURCE_PASSWORD:}
JPA
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=false
H2 Console (development only)
spring.h2.console.enabled=true
### Environment Variables
Use environment variables for sensitive configuration:
- `SPRING_DATASOURCE_URL`: Database connection URL
- `SPRING_DATASOURCE_USERNAME`: Database username
- `SPRING_DATASOURCE_PASSWORD`: Database password
## Project Structure```
src/
├── main/
│ ├── java/org/example/ai_assistant/
│ │ ├── AiAssistantApplication.java # Main entry point
│ │ └── [feature packages]/ # Feature modules
│ └── resources/
│ ├── application.properties # Configuration
│ ├── db/
│ │ ├── schema.sql # Database schema
│ │ └── data.sql # Seed data
│ └── files/ # Helper resources
Database
The application uses H2 database:
- File location:
./data/assistant.mv.db - Console: Available at
http://localhost:8080/h2-console(development) - Migrations: Managed via
src/main/resources/db/schema.sql
Technology Stack
- Java: 21
- Spring Boot: 3.5.7
- Spring AI: 1.1.0 (MCP server support)
- Database: H2 (embedded)
- Build Tool: Maven
Resources
- Model Context Protocol Documentation
- Spring AI MCP Documentation
- Development guidelines: AGENTS.md
