Spring Initializr MCP Server Generate Spring Boot Projects
Generate Spring Boot projects with custom dependencies, Java versions, and structures using the MCP server, ask your AI assistant to create them instantly.
npx -y @hpalma/springinitializr-mcpOverview
This MCP (Model Context Protocol) server wraps Spring Initializr and exposes it as an MCP-compatible service so AI assistants and other automation agents can request Spring Boot projects programmatically. Instead of manually clicking through the Spring Initializr UI, you can ask your assistant to generate projects with custom group/artifact IDs, dependency selections, build tools, Java versions and packaging — and retrieve a ready-to-use archive.
The server is useful when you want reproducible, on-demand project scaffolding from a bot, CI job, or tooling pipeline. It translates high-level project requests into Spring Initializr archive exports and returns metadata and ZIP artifacts that are ready for build and development.
Features
- MCP-compatible API for programmatic project generation
- Create Spring Boot projects with custom:
- Dependencies (Spring starters and community libs)
- Java versions (e.g., 8, 11, 17, 21)
- Build tools (Maven or Gradle)
- Packaging (jar or war)
- Language (Java, Kotlin, Groovy)
- Returns project metadata and downloadable ZIP archives
- Intended for integration with chat assistants and automation flows
- Can be run locally or containerized for deployment
Installation / Configuration
Clone the repository, build and run locally, or use Docker for quick startups.
Clone and build with Maven:
Run with Docker:
# Build the image
# Run the container on port 8080
Configuration
- The server uses Spring Boot configuration (application.yml / application.properties). You can override settings with environment variables (SPRING_*) when running in containers.
- Typical configuration keys you may want to set:
- server.port — network port the HTTP service listens on
- spring.initializr.* — Spring Initializr-specific defaults (Java version, boot version)
- Check the repository’s application.yml for the exact property names used by this project.
Note: API paths and exact configuration keys are available in the repository. Adapt host, port and endpoints to your deployment.
Available Tools / Resources
The MCP server exposes a small set of HTTP endpoints compatible with MCP-style tooling. Typical resources provided:
- Metadata endpoint (provides available dependencies, versions and configuration options)
- Generate endpoint (accepts a project descriptor and returns a ZIP archive or download link)
- Health / info endpoints (standard Spring Boot endpoints may be enabled)
Example request fields (common across Spring Initializr integrations):
| Field | Description |
|---|---|
| groupId | Java package group ID (e.g., com.example) |
| artifactId | Project artifact name |
| name | Project display name |
| description | Short description |
| packageName | Base package name |
| dependencies | Comma-separated list of dependency IDs (e.g., web, data-jpa) |
| javaVersion | Java version (11, 17, etc.) |
| packaging | jar or war |
| buildTool | maven or gradle |
| language | java, kotlin or groovy |
Example curl (generate project ZIP)
Adjust the URL path (/generate) if your deployment uses a different route — see the repository for exact endpoints.
Use Cases
- Assistant-driven project creation
- Ask an AI assistant inside your chat environment to scaffold a service: “Create a Spring Boot microservice using Java 17 with Spring Web, Spring Data JPA and H2.” The assistant formats an MCP request and pulls a ZIP created by this server.
- CI/CD project templates
- Automatically scaffold starter projects in a repository creation pipeline with a predefined set of dependencies and build tooling.
- Training and workshops
- Generate multiple starter projects for students with different stacks (e.g., Spring Web + Thymeleaf vs WebFlux + R2DBC) using scripted MCP requests.
- Multi-module or custom structures
- Use the server to produce base modules (API, service, common) by making consecutive generation requests and assembling them into a multi-module layout in automation scripts.
Getting Help and Contributing
- Source code and issues: https://github.com/hpalma/springinitial