mcp-server
Skill293 starsChanged 4 months agoMITView on GitHub
Use when exposing Spring Boot 4 application capabilities through Model Context Protocol tools, resources, or prompts. Covers Spring AI 2.0 MCP annotations, transport selection, schemas, errors, security, and the standalone MCP Java SDK 2.x.
8 other projects use a version of this.
Adopted by
Most recently taken up by
- timsonner/agent-skillstheir own version, first seen Aug 30, 2026
- saschb2b/skillstheir own version, first seen Aug 8, 2026
- Happy-Technologies-LLC/happy-platform-skillstheir own version, first seen Jul 28, 2026
- nimadorostkar/Claude-Skills-collectiontheir own version, first seen Jul 14, 2026
- ivanshamaev/de-agent-skillstheir own version, first seen May 17, 2026
- prizmad/agent-skillstheir own version, first seen Apr 30, 2026
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- Happy-Technologies-LLC/happy-platform-skills★ 40same name
- nimadorostkar/Claude-Skills-collection★ 28same name
- ivanshamaev/de-agent-skills★ 21same name
- saschb2b/skills★ 19same name
- DaleStudy/skills★ 4same name
- prizmad/agent-skills★ 2same name
- timsonner/agent-skills★ 2same name
- michaelsvanbeek/personal-agent-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository65 other files it gives its agents.
- ai-observabilitySkill
- api-versioningSkill
- configuration-propertiesSkill
- container-native-deploymentSkill
- domain-driven-designSkill
- event-driven-messagingSkill
- flyway-migrationsSkill
- hateoasSkill
- hexagonal-architectureSkill
- http-interface-clientsSkill
- idempotency-patternsSkill
- layered-architectureSkill
- mcp-serverSkill
- multi-module-mavenSkill
- multi-tenancySkill
- null-safetySkill
- oauth2-resource-serverSkill
- openapi-firstSkill
- problem-details-rfc9457Skill
- production-observabilitySkill
- resilience-retrySkill
- rest-api-conventionsSkill
- spring-ai-integrationSkill
- spring-batchSkill
- spring-boot-migrationSkill
- spring-cloud-gatewaySkill
- spring-data-jpaSkill
- spring-data-redisSkill
- spring-modulithSkill
- spring-security-jwtSkill
- testing-pyramidSkill
- transactional-patternsSkill
- webflux-reactive-patternsSkill
- ai-observabilitySkill
- api-versioningSkill
- configuration-propertiesSkill
- container-native-deploymentSkill
- domain-driven-designSkill
- event-driven-messagingSkill
- flyway-migrationsSkill
- hateoasSkill
- hexagonal-architectureSkill
- http-interface-clientsSkill
- idempotency-patternsSkill
- layered-architectureSkill
- multi-module-mavenSkill
- multi-tenancySkill
- null-safetySkill
- oauth2-resource-serverSkill
- openapi-firstSkill
- problem-details-rfc9457Skill
- production-observabilitySkill
- resilience-retrySkill
- rest-api-conventionsSkill
- spring-ai-integrationSkill
- spring-batchSkill
- spring-boot-migrationSkill
- spring-cloud-gatewaySkill
- spring-data-jpaSkill
- spring-data-redisSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Prefer Spring AI's MCP server starters and native annotations in Spring Boot applications.
- Very specific: line 43
Use @McpTool and @McpToolParam for server capabilities.
- Distinctive: line 72
Use stable, specific descriptions because the model uses them to select tools.
- Very specific: line 75
Use MCP SDK builders such as CallToolResult.builder().
- Distinctive: line 103
Keep destructive tools narrow and require explicit business preconditions.
- Distinctive: line 106
Test initialization, discovery, invalid arguments, authorization, cancellation, and shutdown with a real MCP client.
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
MCP Server - Spring AI 2.0 and Java SDK 2.x
Prefer Spring AI's MCP server starters and native annotations in Spring Boot applications. Use the standalone SDK only when Spring integration is intentionally not required.
Dependencies
Let the Spring AI BOM manage every Spring AI and MCP transitive dependency. Do not override its MCP SDK version independently.
<!-- Pick exactly one transport starter. -->
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-starter-mcp-server</artifactId>
</dependency>
<!-- Remote MVC: spring-ai-starter-mcp-server-webmvc -->
<!-- Remote reactive: spring-ai-starter-mcp-server-webflux -->For an application that uses the raw SDK without Spring AI, use the current 2.x release and follow its 2.0 migration guide. MCP Java SDK 2.0 tracks the 2025-11-25 protocol and prefers Streamable HTTP; SSE transports are deprecated.
<dependency>
<groupId>io.modelcontextprotocol.sdk</groupId>
<artifactId>mcp</artifactId>
<version>2.0.0</version>
</dependency>Native Spring AI MCP tools
Use @McpTool and @McpToolParam for server capabilities. @Tool is Spring AI's model
tool-calling API; it is not the native MCP server annotation.
@Component
final class OrderMcpTools {
private final OrderService orderService;
OrderMcpTools(OrderService orderService) {
this.orderService = orderService;
}
@McpTool(
name = "get_order",
description = "Get an order by UUID with line items and status history",
generateOutputSchema = true,
annotations = @McpTool.McpAnnotations(
readOnlyHint = true,
destructiveHint = false,
idempotentHint = true))
OrderResponse getOrder(
@McpToolParam(description = "Order UUID", required = true) String orderId) {
return OrderResponse.from(orderService.findById(UUID.fromString(orderId)));
}
}- Return DTOs or records, not persistence entities.
- Set tool hints accurately; clients must still treat them as untrusted metadata.
- Use stable, specific descriptions because the model uses them to select tools.
- Align return types with server mode: synchronous methods for
SYNC, reactive types forASYNC. - For expected failures, return a stable structured result. Do not expose stack traces or secrets.
- Use MCP SDK builders such as
CallToolResult.builder(); legacy result constructors were removed.
Transport configuration
spring:
main:
banner-mode: "off"
ai:
mcp:
server:
name: order-service-mcp
version: 1.0.0
type: SYNC
stdio: true
annotation-scanner:
enabled: trueFor a remote server, select the MVC or WebFlux starter and set
spring.ai.mcp.server.protocol=STREAMABLE or STATELESS. Use SSE only for compatibility with an
older client. A stdio server must keep stdout free of banners, logs, and System.out output because
stdout carries JSON-RPC frames.
Security and operations
- Authenticate and authorize remote MCP endpoints like any other privileged application API.
- Validate tool arguments and apply domain authorization inside every capability.
- Keep destructive tools narrow and require explicit business preconditions.
- Bound execution time, result size, pagination, and downstream fan-out.
- Log tool name, outcome, duration, and authenticated actor without recording secrets or full data.
- Test initialization, discovery, invalid arguments, authorization, cancellation, and shutdown with a real MCP client.
Examples
- See
examples/OrderMcpTools.java,examples/good-order-tools.java, andexamples/bad-order-tools.java.
Official sources
- Spring AI MCP overview: https://docs.spring.io/spring-ai/reference/api/mcp/mcp-overview.html
- Spring AI server annotations: https://docs.spring.io/spring-ai/reference/api/mcp/mcp-annotations-server.html
- MCP Java SDK releases: https://github.com/modelcontextprotocol/java-sdk/releases
- MCP Java SDK 2.0 migration: https://github.com/modelcontextprotocol/java-sdk/blob/main/MIGRATION-2.0.md
Gotchas
- Agent uses
@Toolfor native server registration - use@McpTooland@McpToolParam. - Agent overrides the MCP SDK under a Spring AI starter - let the Spring AI BOM manage it.
- Agent uses removed
new CallToolResult(...)constructors - useCallToolResult.builder(). - Agent configures SSE for a new remote server - prefer Streamable HTTP.
- Agent logs to stdout in stdio mode - route logs to stderr or a file and disable the banner.
- Agent mixes synchronous methods with an asynchronous server - the annotation scanner filters mismatched methods.
- Agent exposes entities or unbounded collections - return bounded DTO contracts.
- Agent trusts tool hints as authorization - enforce authorization in application code.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

