Generate Spring Boot Projects Programmatically
MCP server wrapping the Spring Initializr API so an AI assistant can generate and download configured Spring Boot projects.
Why it matters
Automate the creation of Spring Boot projects with custom configurations. This asset allows AI assistants to programmatically generate and download Spring Boot applications, streamlining the initial setup process for developers.
Outcomes
What it gets done
Generate Spring Boot projects with specified dependencies and configurations.
Download generated Spring Boot project ZIP files.
Support for various project types, languages, and Java versions.
Integrate with AI assistants for automated code generation.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-spring-initializr | bash Capabilities
Tools your agent gets
Generates and downloads a Spring Boot project with specified configuration including dependencies, language, and build tool.
Overview
Spring Initializr MCP Server
Wraps the Spring Initializr API in an MCP tool so Claude can generate and download Spring Boot projects with a chosen build tool, language, Java version, and dependency set, built as a fast-starting GraalVM native binary. Use when scaffolding a new Spring Boot project conversationally with specific dependencies; requires internet access to Spring Initializr's own metadata and generation service.
What it does
Spring Initializr MCP Server wraps the Spring Initializr API so an AI assistant like Claude can generate and download Spring Boot projects programmatically, instead of manually visiting start.spring.io. It exposes a single tool, generate-spring-boot-project, which accepts a set of optional parameters: projectType (project build system - Maven, Gradle, or Gradle with Kotlin), language (Java, Kotlin, or Groovy), javaVersion (17, 21, or 24, defaulting to 17), packaging (jar or war, defaulting to jar), dependencies (a comma-separated list drawn from hundreds of Spring Boot starters), plus project metadata (groupId, artifactId, name, description, packageName, springBootVersion) and download behavior (downloadFolderPath, shouldExtract for automatic ZIP extraction). It returns the absolute path to the downloaded file or extracted directory.
Dependency coverage spans Web (Spring Web, WebFlux, GraphQL, REST repositories), Security (Spring Security, OAuth2, LDAP), Data (JPA, JDBC, MongoDB, Redis, Elasticsearch, R2DBC), Messaging (RabbitMQ, Apache Kafka, WebSocket), Cloud (Spring Cloud Gateway, Config, Eureka, Feign), Ops (Actuator, Micrometer, distributed tracing), AI (Spring AI with various model providers), and Testing (TestContainers, contract testing). This dependency list, along with supported Java versions and defaults, is kept current automatically: a Gradle task fetches the latest metadata from https://start.spring.io/metadata/client and regenerates a Java constants file from it, so the tool tracks new Spring Boot releases without a manual update.
The server is built with GraalVM native compilation for fast startup, with prebuilt native binaries for Linux x64, Windows x64, macOS x64, and macOS ARM64. Integration tests validate that the native executable starts in under one second, alongside full MCP protocol handshake and tool discovery/invocation testing.
When to use - and when NOT to
Use this when scaffolding a new Spring Boot project with a specific combination of build tool, language, Java version, and dependencies through natural-language requests - for example asking for "a Spring Boot web application with Spring Data JPA, PostgreSQL, and Spring Security," "a Kotlin Spring Boot project using Gradle with WebFlux and MongoDB," or "a Maven-based Spring Boot project with Thymeleaf, Validation, and Actuator." It requires internet connectivity to Spring Initializr's own service to fetch metadata and generate the project, so it depends on that upstream availability rather than working fully offline.
Capabilities
Building from source requires Java 24 and GraalVM for native compilation, using ./gradlew build and ./gradlew nativeCompile. The project maintains unit tests (JUnit), MCP protocol integration tests, native-compilation validation tests, and URL-builder tests for correct Spring Initializr request construction, all runnable via Gradle test tasks. CI/CD via GitHub Actions builds and tests on every push, and automates native binary releases across all supported platforms.
How to install
Prebuilt binaries are downloaded from the project's GitHub Releases page for the target platform. Claude Desktop is configured by pointing the command field at the binary's absolute path:
{
"mcpServers": {
"springinitializr": {
"command": "/path/to/springinitializr-mcp-binary"
}
}
}
Common troubleshooting notes: the binary needs execute permissions on Unix systems and shouldn't be blocked by antivirus software; project generation failures usually trace back to connectivity issues reaching Spring Initializr, invalid dependency names, or a non-writable download directory; and Claude Desktop typically needs a restart after configuration changes.
Who it's for
Java/Kotlin/Groovy developers using Claude Desktop who want to scaffold new Spring Boot projects with specific dependencies and configurations conversationally, instead of manually configuring and downloading from the Spring Initializr website.
Source README
Spring Initializr MCP Server
An MCP (Model Context Protocol) server that provides access to Spring Initializr functionality, allowing AI assistants to generate and download Spring Boot projects programmatically.
What is this?
This project implements an MCP server that wraps the Spring Initializr API, enabling AI assistants (like Claude) to create Spring Boot projects with custom configurations. Instead of manually visiting start.spring.io, you can now ask your AI assistant to generate projects with specific dependencies, Java versions, and project structures.
Features
- Generate Spring Boot Projects: Create new Spring Boot projects with custom configurations
- Flexible Configuration: Support for different project types (Maven/Gradle), languages (Java/Kotlin/Groovy), and Java versions
- Dependency Management: Add popular Spring Boot dependencies automatically
- Native Compilation: Fast startup times with GraalVM native compilation
- Cross-Platform: Native binaries available for Linux, Windows, and macOS (x64 and ARM64)
- Automatic Extraction: Optional extraction of downloaded ZIP files
- Dynamic Metadata: Automatically fetches latest Spring Boot versions and dependencies
Supported Parameters
When generating a project, you can specify:
- Project Type:
maven-project,gradle-project,gradle-project-kotlin - Language:
java,kotlin,groovy - Java Version:
17,21,24(defaults to17) - Packaging:
jar,war(defaults tojar) - Dependencies: Hundreds of Spring Boot starters and dependencies
- Project Metadata: Group ID, Artifact ID, name, description, package name
- Download Options: Custom download location and automatic ZIP extraction
Installation
Download Pre-built Binaries
Download the appropriate binary for your platform from the Releases page:
- Linux x64:
springinitializr-mcp-linux-x64 - Windows x64:
springinitializr-mcp-windows-x64.exe - macOS x64:
springinitializr-mcp-macos-x64 - macOS ARM64:
springinitializr-mcp-macos-arm64
Build from Source
Requirements:
- Java 24
- GraalVM (for native compilation)
git clone https://github.com/hpalma/springinitializr-mcp.git
cd springinitializr-mcp
./gradlew build
./gradlew nativeCompile
Usage with Claude Desktop
Add the MCP server to your Claude Desktop configuration:
macOS/Linux
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"springinitializr": {
"command": "/path/to/springinitializr-mcp-binary"
}
}
}
Windows
Edit %APPDATA%/Claude/claude_desktop_config.json:
{
"mcpServers": {
"springinitializr": {
"command": "C:\\path\\to\\springinitializr-mcp-windows-x64.exe"
}
}
}
Example Usage
Once configured, you can ask Claude to generate Spring Boot projects:
"Create a Spring Boot web application with Spring Data JPA, PostgreSQL, and Spring Security dependencies"
"Generate a Kotlin Spring Boot project using Gradle with WebFlux and MongoDB"
"Create a Maven-based Spring Boot project with Thymeleaf, Validation, and Actuator"
The tool will generate and download the project as a ZIP file to your specified location, with optional automatic extraction.
Available Dependencies
The server supports all Spring Initializr dependencies, including:
- Web: Spring Web, WebFlux, GraphQL, REST repositories
- Security: Spring Security, OAuth2, LDAP
- Data: JPA, JDBC, MongoDB, Redis, Elasticsearch, R2DBC
- Messaging: RabbitMQ, Apache Kafka, WebSocket
- Cloud: Spring Cloud Gateway, Config, Eureka, Feign
- Ops: Actuator, Micrometer, Distributed Tracing
- AI: Spring AI with various model providers
- Testing: TestContainers, Contract testing
The dependency list is automatically updated by fetching the latest metadata from Spring Initializr.
Development
Running in Development
# Run with dev profile for more logging
./gradlew bootRun --args='--spring.profiles.active=dev'
# Generate updated constants from Spring Initializr
./gradlew generateToolDescriptions
# Run tests
./gradlew test
# Run native tests
./gradlew nativeTest
Code Generation
The project uses a Gradle task to fetch the latest Spring Initializr metadata and generate constants for supported dependencies and Java versions:
./gradlew generateToolDescriptions
This ensures the tool always supports the latest Spring Boot versions and dependencies by:
- Fetching metadata from
https://start.spring.io/metadata/client - Generating
SpringInitializrConstants.javawith current dependencies - Updating supported Java versions and default values
Testing
The project includes comprehensive tests:
- Unit Tests: Standard JUnit tests for core functionality
- Integration Tests: Tests for the MCP protocol implementation
- Native Tests: Validation that native compilation works correctly
- URL Builder Tests: Validation of Spring Initializr URL construction
# Run all tests
./gradlew test nativeTest nativeIntegrationTest
# Run only unit tests
./gradlew test
# Run only native integration tests
./gradlew nativeIntegrationTest
Native Performance Testing
The integration tests include startup time validation to ensure native compilation provides expected performance benefits:
- Native executable startup under 1 second
- Full MCP protocol handshake validation
- Tool discovery and invocation testing
CI/CD
The project uses GitHub Actions for:
- Continuous Integration: Build and test on every push/PR
- Release Automation: Create native binaries for all platforms
- Multi-platform Support: Linux, Windows, macOS (x64 and ARM64)
- Automated Testing: Unit, integration, and native tests
Release Process
- Create a new release on GitHub or trigger workflow manually
- Native binaries are automatically built for all platforms
- Binaries are attached to the release for download
Configuration
Application Configuration
The server uses Spring Boot configuration with the following key properties:
spring:
application:
name: springinitializr-mcp
ai:
mcp:
server:
name: springinitializr
version: 1.0.0
Environment Profiles
- Default: Minimal logging for production use
- Dev: Enhanced logging for development and debugging
API Reference
Tool: generate-spring-boot-project
Generates and downloads a Spring Boot project with the specified configuration.
Parameters:
downloadFolderPath(optional): Target download directoryshouldExtract(optional): Whether to extract the ZIP fileprojectType(optional): Project build system typelanguage(optional): Programming languagegroupId(optional): Maven/Gradle group identifierartifactId(optional): Project artifact identifierspringBootVersion(optional): Spring Boot version to usename(optional): Project display namedescription(optional): Project descriptionpackageName(optional): Base Java package namepackaging(optional): Packaging type (JAR/WAR)javaVersion(optional): Target Java versiondependencies(optional): Comma-separated dependency list
Returns: Absolute path to the downloaded file or extracted directory
Troubleshooting
Common Issues
Native executable fails to start:
- Ensure you have the correct binary for your platform
- Check that the binary has execute permissions on Unix systems
- Verify no antivirus software is blocking execution
Project generation fails:
- Check internet connectivity to Spring Initializr
- Verify the specified dependencies are valid
- Ensure the download directory exists and is writable
MCP connection issues:
- Verify the Claude Desktop configuration is correct
- Check that the binary path is absolute and valid
- Restart Claude Desktop after configuration changes
Debug Mode
Run with the dev profile for enhanced logging:
./gradlew bootRun --args='--spring.profiles.active=dev'
FAQ
Common questions
Discussion
Questions & comments ยท 0
Sign In Sign in to leave a comment.