MCP Spring Boot Toolkit
Provides tools for generating JPA entity classes and repositories, and prompts for optimizing Hibernate queries, including resolving N+1 problems, using projections, indexing, and caching.
Supports generating application configuration files (application.yml) for PostgreSQL databases, including connection settings and profile-specific configurations for development and production environments.
Provides tools and prompts for developing Spring Boot applications within the Spring ecosystem, including code generation for entities, controllers, services, and repositories, as well as security auditing and query optimization.
Generates code for Spring Boot projects, including entity classes, REST controllers, service layers, DTOs, repositories, application configuration files, and global exception handlers.
Includes a prompt for security auditing of Spring Security configurations, covering JWT, OAuth2, CORS, CSRF, rate limiting, and input validation.
Supports generating application configuration that includes Swagger/OpenAPI documentation settings for API documentation.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Spring Boot Toolkit Generate a JPA entity for Product with fields name and price"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Spring Boot Toolkit
MCP (Model Context Protocol) server cung cấp tools, resources và prompts hỗ trợ phát triển dự án Java Spring Boot.
Tính năng
Tools (8 tools)
Tool | Mô tả |
| Tạo JPA Entity class với Lombok annotations, audit fields ( |
| Tạo REST Controller với CRUD endpoints, pagination, validation |
| Tạo Service interface + implementation với |
| Tạo Request/Response DTOs với validation annotations + MapStruct mapper |
| Tạo Spring Data JPA Repository với custom query methods, Specification support |
| Tạo |
| Tạo |
| Phân tích |
Prompts (6 prompts)
Prompt | Mô tả |
| Review REST API controller theo best practices (HTTP conventions, validation, security, performance) |
| Phân tích stack trace và đề xuất cách fix |
| Tối ưu JPA/Hibernate query (N+1, projection, indexing, caching) |
| Audit bảo mật Spring Security config (JWT, CORS, CSRF, input validation) |
| Lên kế hoạch upgrade Spring Boot version (breaking changes, namespace migration) |
| Thiết kế kiến trúc microservice (package structure, API contracts, communication patterns) |
Resources (4 guides)
Resource | URI | Nội dung |
Project Structure |
| Cấu trúc package chuẩn cho ứng dụng Spring Boot |
Security |
| Checklist bảo mật: JWT, OAuth2, CORS, rate limiting |
Layered Architecture |
| Kiến trúc phân lớp Controller → Service → Repository |
API Design |
| Thiết kế RESTful API: versioning, pagination, error handling |
Related MCP server: DBJavaGenix
Cài đặt
# Clone hoặc copy project
cd mcp-spring-boot-toolkit
# Cài dependencies
npm install
# Build
npm run buildCách sử dụng
Cấu hình MCP Server
Thêm vào file cấu hình MCP của IDE (ví dụ .kiro/settings/mcp.json, claude_desktop_config.json, hoặc tương đương):
Production (dùng bản build):
{
"mcpServers": {
"spring-boot-toolkit": {
"command": "node",
"args": ["/đường-dẫn-tới/mcp-spring-boot-toolkit/dist/index.js"]
}
}
}Development (dùng tsx, không cần build):
{
"mcpServers": {
"spring-boot-toolkit": {
"command": "npx",
"args": ["tsx", "/đường-dẫn-tới/mcp-spring-boot-toolkit/src/index.ts"]
}
}
}Ví dụ sử dụng tools
Tạo Entity:
Tạo entity Product với fields: name (String, not null), price (BigDecimal), description (String), stock (Integer)Tạo Controller + Service + Repository cho entity:
Tạo full CRUD cho entity Order bao gồm controller, service, repository, DTOsPhân tích pom.xml:
Phân tích file pom.xml của tôi xem có vấn đề gì về dependency khôngTạo config:
Tạo application.yml cho project dùng PostgreSQL, có security, actuator, swagger, với 2 profiles dev và prodVí dụ sử dụng prompts
Review API:
Review controller UserController.java theo best practicesDebug lỗi:
Debug exception này: LazyInitializationException - could not initialize proxy...Tối ưu query:
Tối ưu query trong OrderRepository, đang bị N+1 khi load OrderItemsScripts
Script | Mô tả |
| Compile TypeScript → JavaScript (output vào |
| Chạy trực tiếp từ source bằng tsx |
| Chạy bản đã build |
Tech Stack
Runtime: Node.js
Language: TypeScript
MCP SDK:
@modelcontextprotocol/sdkValidation: Zod
Transport: stdio
Cấu trúc project
mcp-spring-boot-toolkit/
├── src/
│ ├── index.ts # Entry point - khởi tạo MCP server
│ ├── tools.ts # Đăng ký 8 tools code generation
│ ├── prompts.ts # Đăng ký 6 prompts
│ ├── resources.ts # Đăng ký 4 resources
│ └── resources/ # Markdown guides
│ ├── project-structure.md
│ ├── security-checklist.md
│ ├── layered-architecture.md
│ └── api-design.md
├── dist/ # Build output
├── package.json
├── tsconfig.json
└── README.mdLicense
MIT
Available Tools
8 toolsanalyze_pomA
Analyze pom.xml for dependency issues, version conflicts, and suggest improvements
Inputs: pomContent (required).
generate_application_propertiesB
Generate application.yml configuration for Spring Boot with common settings
Inputs: database, features, profiles.
generate_controllerB
Generate a Spring Boot REST Controller with CRUD endpoints and proper exception handling
Inputs: entityName (required), basePath, endpoints, packageName, +2 more.
generate_dtoB
Generate Request/Response DTOs with validation annotations and MapStruct mapper
Inputs: fields (required), entityName (required), withMapper, packageName.
generate_entityA
Generate a JPA Entity class with Lombok annotations, audit fields, and proper mappings
Inputs: fields (required), className (required), tableName, withAudit, +2 more.
generate_exception_handlerB
Generate global exception handler with @ControllerAdvice and custom exceptions
Inputs: exceptions, packageName.
generate_repositoryB
Generate a Spring Data JPA Repository with custom query methods
Inputs: entityName (required), idType, packageName, customQueries, +1 more.
generate_serviceA
Generate a Spring Boot Service with interface and implementation following best practices
Inputs: entityName (required), methods, packageName, withCaching, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool targets a distinct artifact in the Spring Boot architecture: entity, controller, service, DTO, repository, exception handler, and application properties. The analyze_pom tool is clearly separate for dependency analysis. No two tools appear to generate the same type of output.
Seven tools follow the consistent verb_noun pattern 'generate_<artifact>', and analyze_pom also follows the same verb_noun pattern with a different verb. The naming is predictable and clearly indicates the action and target.
With 8 tools, the server is well-scoped for a Spring Boot code generation toolkit. It covers the essential layers and configuration without excessive granularity, making it easy for an agent to select the right tool.
The set covers core generation needs (entity, controller, service, repository, DTO, exception handler, application properties) and includes pom analysis. Missing are tools for project scaffolding, security configuration, or tests, but these are minor gaps that can be worked around or generated manually.
Maintenance
Related MCP Connectors
Build Spring Boot applications, ready for coding agents, including best practices.
Coding guidelines and best-practice guides for 130+ languages, frameworks, and tools.
Generate SBOMs, scan vulnerabilities, and analyze dependencies from local projects or Git repos.
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides tools for accessing coding style guidelines and best practices for various technologies including Java, Python, and React.317MIT
- AlicenseBqualityBmaintenanceEnables reverse engineering of database tables into Spring Boot projects with AI-enhanced naming and code generation, providing interactive visualizations and workflow orchestration.2922 npm36MIT
- AlicenseBqualityBmaintenanceEnables users to access and search Spring ecosystem documentation, guides, tutorials, and best practices through 12 tools, including Spring AI support and intelligent caching.1777 npm23MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to understand and analyze Spring Boot codebases through static analysis, allowing natural language queries about endpoints, classes, dependencies, and architecture without running the application.13MIT