- name
SKILL.md
技能檔案保留在發布者的儲存庫中。
在終端機中貼上複製的指令。它會將這個 SKILL.md 安裝到對應的代理中。
npx skills add rrezartprebreza/spring-boot-skills --skill mcp-server -a cursor -y在終端機中貼上複製的指令。它會將這個 SKILL.md 安裝到對應的代理中。
npx skills add rrezartprebreza/spring-boot-skills --skill mcp-server -a claude-code -y在終端機中貼上複製的指令。它會將這個 SKILL.md 安裝到對應的代理中。
npx skills add rrezartprebreza/spring-boot-skills --skill mcp-server -a codex -y在終端機中貼上複製的指令。它會將這個 SKILL.md 安裝到對應的代理中。
npx skills add rrezartprebreza/spring-boot-skills --skill mcp-server -a grok -y在 Grok Bot 聊天中傳送複製的訊息。Bot 會從 GitHub 取得這個 SKILL.md,並加入你所有 Bot 共用的技能中。
Install this skill: https://github.com/rrezartprebreza/spring-boot-skills/tree/HEAD/skills/spring-boot-3/mcp-server來自發布者
Prefer the Spring AI MCP server starters in a Spring Boot application. Let the Spring AI BOM manage its MCP SDK dependency; do not force the standalone SDK version into a starter-based application.
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-starter-mcp-server</artifactId>
</dependency>
For a raw SDK application without Spring AI, use the current MCP Java SDK 2.x release and follow its migration guide. Do not assume raw SDK examples match the version managed by Spring AI 1.x.
<dependency>
<groupId>io.modelcontextprotocol.sdk</groupId>
<artifactId>mcp</artifactId>
<version>2.0.0</version>
</dependency>
Spring AI 1.0.x exposes @Tool methods only through an explicit MethodToolCallbackProvider —
a bare @Component with @Tool methods registers nothing. Spring AI 1.1.x additionally supports
native @McpTool/@McpToolParam with spring.ai.mcp.server.annotation-scanner.enabled=true,
imported from org.springaicommunity.mcp.annotation (Spring AI 2.0 moved them to
org.springframework.ai.mcp.annotation). Pick one registration path per tool.
@Configuration
class McpToolsConfiguration {
@Bean
ToolCallbackProvider orderTools(OrderMcpTools tools) {
return MethodToolCallbackProvider.builder()
.toolObjects(tools)
.build();
}
}
@Component
final class OrderMcpTools {
private final OrderService orderService;
OrderMcpTools(OrderService orderService) {
this.orderService = orderService;
}
@Tool(description = "Get an order by UUID with line items and status history")
OrderResponse getOrder(
@ToolParam(description = "Order UUID") String orderId) {
return OrderResponse.from(orderService.findById(UUID.fromString(orderId)));
}
}
CallToolResult.builder(); old constructors were removed.spring:
main:
banner-mode: "off"
ai:
mcp:
server:
name: order-service-mcp
version: 1.0.0
type: SYNC
stdio: true
Use stdio when a local client launches the jar. Use the matching MVC or WebFlux starter and Streamable HTTP for a remote server when supported by the selected Spring AI 1.x release. Keep stdout clean in stdio mode because it carries JSON-RPC frames.
examples/OrderMcpTools.java, examples/good-order-tools.java, and examples/bad-order-tools.java.org.springframework.ai.mcp.annotation imports into a 1.1 project - 1.1 uses org.springaicommunity.mcp.annotation, and 1.0 has no MCP annotations at all.@Tool methods on a plain @Component to appear as MCP tools in 1.x - register them through a ToolCallbackProvider bean.--spring.ai.mcp.server.transport=stdio - no such property; Boot ignores it silently. Use spring.ai.mcp.server.stdio=true.new CallToolResult(...) constructors in raw SDK code - use builders.>
---name: mcp-serverdescription: >---# skills/spring-boot-3/mcp-server/SKILL.md常見問題
從發布者下載 skills/spring-boot-3/mcp-server/SKILL.md,或複製路徑後開啟儲存庫。PlugMCP 只收錄這項技能,不代管檔案。
發布者將它存放在 https://github.com/rrezartprebreza/spring-boot-skills。
Claude、Cursor、Codex 和 Grok Build 可以讀取你從發布者儲存庫加入的 SKILL.md。在聊天中傳送技能的 GitHub 資料夾連結,Grok Bot 就會安裝它。