1"use strict";(self.webpackChunkspring_ai_alibaba_website=self.webpackChunkspring_ai_alibaba_website||[]).push([[3021],{17328:(e,r,s)=>{s.d(r,{A:()=>t});const t=s.p+"assets/images/java-mcp-client-architecture-673d5ff17799a1d53ef775ddaf681b39.jpg"},24572:(e,r,s)=>{s.d(r,{A:()=>t});const t=s.p+"assets/images/java-mcp-server-architecture-62438a23e530859a1ecbe03c469d61c1.jpg"},28093:(e,r,s)=>{s.r(r),s.d(r,{assets:()=>d,contentTitle:()=>l,default:()=>h,frontMatter:()=>c,metadata:()=>t,toc:()=>o});const t=JSON.parse('{"id":"mcps/mcp-overview","title":"Model Context Protocol (MCP)","description":"\u63d0\u793a\uff1a\u521d\u6b21\u4f7f\u7528 MCP\uff1f \u8bf7\u4ece\u6211\u4eec\u7684 MCP \u5165\u95e8\u6307\u5357 \u5f00\u59cb\uff0c\u5feb\u901f\u4e86\u89e3\u5e76\u67e5\u770b\u5b9e\u8df5\u793a\u4f8b\u3002","source":"@site/integration/mcps/mcp-overview.md","sourceDirName":"mcps","slug":"/mcps/mcp-overview","permalink":"/integration/mcps/mcp-overview","draft":false,"unlisted":false,"editUrl":"https://github.com/spring-ai-alibaba/website/tree/main/integration/mcps/mcp-overview.md","tags":[],"version":"current","lastUpdatedBy":"Ken Liu","lastUpdatedAt":1768271906000,"frontMatter":{},"sidebar":"integrationSidebar","previous":{"title":"Typesense","permalink":"/integration/rag/vectordbs/more/typesense"},"next":{"title":"MCP Utilities","permalink":"/integration/mcps/mcp-helpers"}}');var n=s(74848),i=s(28453);const c={},l="Model Context Protocol (MCP)",d={},o=[{value:"MCP Java SDK \u67b6\u6784",id:"mcp-java-sdk-\u67b6\u6784",level:2},{value:"Client/Server Layer (Top)",id:"clientserver-layer-top",level:3},{value:"Session Layer (Middle)",id:"session-layer-middle",level:3},{value:"Transport Layer (Bottom)",id:"transport-layer-bottom",level:3}
1,{value:"Spring AI MCP \u96c6\u6210",id:"spring-ai-mcp-\u96c6\u6210",level:2},{value:"Client Starters",id:"client-starters",level:3},{value:"Server Starters",id:"server-starters",level:3},{value:"STDIO",id:"stdio",level:4},{value:"WebMVC",id:"webmvc",level:4},{value:"WebMVC (Reactive)",id:"webmvc-reactive",level:4},{value:"Spring AI MCP Annotations",id:"spring-ai-mcp-annotations",level:2},{value:"\u5176\u4ed6\u8d44\u6e90",id:"\u5176\u4ed6\u8d44\u6e90",level:2}];function a(e){const r={a:"a",blockquote:"blockquote",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",img:"img",li:"li",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r.header,{children:(0,n.jsx)(r.h1,{id:"model-context-protocol-mcp",children:"Model Context Protocol (MCP)"})}),"\n",(0,n.jsxs)(r.blockquote,{children:["\n",(0,n.jsxs)(r.p,{children:[(0,n.jsx)(r.strong,{children:"\u63d0\u793a\uff1a\u521d\u6b21\u4f7f\u7528 MCP\uff1f"})," \u8bf7\u4ece\u6211\u4eec\u7684 ",(0,n.jsx)(r.a,{href:"mcp-client-boot-starter-docs",children:"MCP \u5165\u95e8\u6307\u5357"}
1)," \u5f00\u59cb\uff0c\u5feb\u901f\u4e86\u89e3\u5e76\u67e5\u770b\u5b9e\u8df5\u793a\u4f8b\u3002"]}),"\n"]}),"\n",(0,n.jsxs)(r.p,{children:[(0,n.jsx)(r.a,{href:"https://modelcontextprotocol.org/docs/concepts/architecture",children:"Model Context Protocol"})," (MCP) \u662f\u4e00\u4e2a\u6807\u51c6\u5316\u534f\u8bae\uff0c\u4f7f AI \u6a21\u578b\u80fd\u591f\u4ee5\u7ed3\u6784\u5316\u7684\u65b9\u5f0f\u4e0e\u5916\u90e8\u5de5\u5177\u548c\u8d44\u6e90\u4ea4\u4e92\u3002\n\u53ef\u4ee5\u5c06\u5176\u89c6\u4e3a AI \u6a21\u578b\u4e0e\u73b0\u5b9e\u4e16\u754c\u4e4b\u95f4\u7684\u6865\u6881\u2014\u2014\u5141\u8bb8\u5b83\u4eec\u901a\u8fc7\u4e00\u81f4\u7684\u63a5\u53e3\u8bbf\u95ee\u6570\u636e\u5e93\u3001API\u3001\u6587\u4ef6\u7cfb\u7edf\u548c\u5176\u4ed6\u5916\u90e8\u670d\u52a1\u3002\n\u5b83\u652f\u6301\u591a\u79cd\u4f20\u8f93\u673a\u5236\uff0c\u4ee5\u5728\u4e0d\u540c\u73af\u5883\u4e2d\u63d0\u4f9b\u7075\u6d3b\u6027\u3002"]}),"\n",(0,n.jsxs)(r.p,{children:[(0,n.jsx)(r.a,{href:"https://modelcontextprotocol.io/sdk/java/mcp-overview",children:"MCP Java SDK"})," \u63d0\u4f9b\u4e86 Model Context Protocol \u7684 Java \u5b9e\u73b0\uff0c\u901a\u8fc7\u540c\u6b65\u548c\u5f02\u6b65\u901a\u4fe1\u6a21\u5f0f\u5b9e\u73b0\u4e0e AI \u6a21\u578b\u548c\u5de5\u5177\u7684\u6807\u51c6\u5316\u4ea4\u4e92\u3002"]}),"\n",(0,n.jsxs)(r.p,{children:["Spring AI \u901a\u8fc7\u4e13\u7528\u7684 Boot Starters \u548c MCP Java Annotations \u5168\u9762\u652f\u6301 MCP\uff0c\u4f7f\u6784\u5efa\u80fd\u591f\u65e0\u7f1d\u8fde\u63a5\u5230\u5916\u90e8\u7cfb\u7edf\u7684\u590d\u6742 AI \u9a71\u52a8\u5e94\u7528\u7a0b\u5e8f\u53d8\u5f97\u524d\u6240\u672a\u6709\u7684\u7b80\u5355\u3002\n\u8fd9\u610f\u5473\u7740 Spring \u5f00\u53d1\u8005\u53ef\u4ee5\u53c2\u4e0e MCP \u751f\u6001\u7cfb\u7edf\u7684\u4e24\u4e2a\u65b9\u9762\u2014\u2014\u6784\u5efa\u6d88\u8d39 MCP \u670d\u52a1\u5668\u7684 AI \u5e94\u7528\u7a0b\u5e8f\uff0c\u4ee5\u53ca\u521b\u5efa\u5c06\u57fa\u4e8e Spring \u7684\u670d\u52a1\u66b4\u9732\u7ed9\u66f4\u5e7f\u6cdb AI \u793e\u533a\u7684 MCP \u670d\u52a1\u5668\u3002\n\u4f7f\u7528 ",(0,n.jsx)(r.a,{href:"https://start.spring.io",children:"Spring Initializer"})," \u5f15\u5bfc\u652f\u6301 MCP \u7684 AI \u5e94\u7528\u7a0b\u5e8f\u3002"]}),"\n",(0,n.jsx)(r.h2,{id:"mcp-java-sdk-\u67b6\u6784",children:"MCP Java SDK \u67b6\u6784"}),"\n",(0,n.jsxs)(r.blockquote,{children:["\n",(0,n.jsxs)(r.p,{children:[(0,n.jsx)(r.strong,{children:"\u63d0\u793a\uff1a"})," \u672c\u8282\u6982\u8ff0\u4e86 ",(0,n.jsx)(r.a,{href:"https://modelcontextprotocol.io/sdk/java/mcp-overview",children:"MCP Java SDK \u67b6\u6784"}
1),"\u3002\n\u6709\u5173 Spring AI MCP \u96c6\u6210\uff0c\u8bf7\u53c2\u8003 ",(0,n.jsx)(r.a,{href:"#spring-ai-mcp-%E9%9B%86%E6%88%90",children:"Spring AI MCP Boot Starters"})," \u6587\u6863\u3002"]}),"\n"]}),"\n",(0,n.jsx)(r.p,{children:"Java MCP \u5b9e\u73b0\u9075\u5faa\u4e09\u5c42\u67b6\u6784\uff0c\u5c06\u5173\u6ce8\u70b9\u5206\u79bb\u4ee5\u63d0\u9ad8\u53ef\u7ef4\u62a4\u6027\u548c\u7075\u6d3b\u6027\uff1a"}),"\n",(0,n.jsxs)(r.p,{children:[".MCP Stack Architecture\n",(0,n.jsx)(r.img,{alt:"MCP Stack Architecture",src:s(31247).A+"",width:"344",height:"195"})]}),"\n",(0,n.jsx)(r.h3,{id:"clientserver-layer-top",children:"Client/Server Layer (Top)"}),"\n",(0,n.jsx)(r.p,{children:"\u9876\u5c42\u5904\u7406\u4e3b\u8981\u5e94\u7528\u7a0b\u5e8f\u903b\u8f91\u548c\u534f\u8bae\u64cd\u4f5c\uff1a"}),"\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsxs)(r.li,{children:[(0,n.jsx)(r.em,{children:"McpClient"})," - \u7ba1\u7406\u5ba2\u6237\u7aef\u64cd\u4f5c\u548c\u670d\u52a1\u5668\u8fde\u63a5"]}),"\n",(0,n.jsxs)(r.li,{children:[(0,n.jsx)(r.em,{children:"McpServer"})," - \u5904\u7406\u670d\u52a1\u5668\u7aef\u534f\u8bae\u64cd\u4f5c\u548c\u5ba2\u6237\u7aef\u8bf7\u6c42"]}),"\n",(0,n.jsx)(r.li,{children:"\u4e24\u4e2a\u7ec4\u4ef6\u90fd\u5229\u7528\u4e0b\u9762\u7684\u4f1a\u8bdd\u5c42\u8fdb\u884c\u901a\u4fe1\u7ba1\u7406"}),"\n"]}),"\n",(0,n.jsx)(r.h3,{id:"session-layer-middle",children:"Session Layer (Middle)"}),"\n",(0,n.jsx)(r.p,{children:"\u4e2d\u95f4\u5c42\u7ba1\u7406\u901a\u4fe1\u6a21\u5f0f\u5e76\u7ef4\u62a4\u8fde\u63a5\u72b6\u6001\uff1a"}),"\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsxs)(r.li,{children:[(0,n.jsx)(r.em,{children:"McpSession"})," - \u6838\u5fc3\u4f1a\u8bdd\u7ba1\u7406\u63a5\u53e3"]}),"\n",(0,n.jsxs)(r.li,{children:[(0,n.jsx)(r.em,{children:"McpClientSession"})," - \u5ba2\u6237\u7aef\u7279\u5b9a\u7684\u4f1a\u8bdd\u5b9e\u73b0"]}),"\n",(0,n.jsxs)(r.li,{children:[(0,n.jsx)(r.em,{children:"McpServerSession"})," - \u670d\u52a1\u5668\u7aef\u7279\u5b9a\u7684\u4f1a\u8bdd\u5b9e\u73b0"]}),"\n"]}),"\n",(0,n.jsx)(r.h3,{id:"transport-layer-bottom",children:"Transport Layer (Bottom)"}),"\n",(0,n.jsx)(r.p,{children:"\u5e95\u5c42\u5904\u7406\u5b9e\u9645\u7684\u6d88\u606f\u4f20\u8f93\u548c\u5e8f\u5217\u5316\uff1a"}),"\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsxs)(r.li,{children:[(0,n.jsx)(r.em,{children:"McpTransport"})," - \u7ba1\u7406 JSON-RPC \u6d88\u606f\u5e8f\u5217\u5316\u548c\u53cd\u5e8f\u5217\u5316"]}),"\n",(0,n.jsx)(r.li,{children:"\u652f\u6301\u591a\u79cd\u4f20\u8f93\u5b9e\u73b0\uff08STDIO\u3001HTTP/SSE\u3001Streamable-HTTP \u7b49\uff09"}),"\n",(0,n.jsx)(r.li,{children:"\u4e3a\u6240\u6709\u66f4\u9ad8\u7ea7\u522b\u7684\u901a\u4fe1\u63d0\u4f9b\u57fa\u7840"}),"\n"]}),"\n",(0,n.jsxs)(r.table,{children:[(0,n.jsx)(r.thead,{children:(0,n.jsx)(r.tr,{children:(0,n.jsx)(r.th,{children:(0,n.jsx)(r.a,{href:"https://modelcontextprotocol.io/sdk/java/mcp-client",children:"MCP Client"})})})}),(0,n.jsx)(r.tbody,{children:(0,n.jsx)(r.tr,{children:(0,n.jsxs)(r.td,{children:["MCP Client \u662f Model Context Protocol (MCP) \u67b6\u6784\u4e2d\u7684\u5173\u952e\u7ec4\u4ef6\uff0c\u8d1f\u8d23\u5efa\u7acb\u548c\u7ba1\u7406\u4e0e MCP \u670d\u52a1\u5668\u7684\u8fde\u63a5\u3002\u5b83\u5b9e\u73b0\u534f\u8bae\u7684\u5ba2\u6237\u7aef\uff0c\u5904\u7406\uff1a",(0,n.jsx)("br",{}),(0,n.jsx)("br",{}),"* \u534f\u8bae\u7248\u672c\u534f\u5546\u4ee5\u786e\u4fdd\u4e0e\u670d\u52a1\u5668\u7684\u517c\u5bb9\u6027",(0,n.jsx)("br",{}),"* \u80fd\u529b\u534f\u5546\u4ee5\u786e\u5b9a\u53ef\u7528\u529f\u80fd",(0,n.jsx)("br",{}),"* \u6d88\u606f\u4f20\u8f93\u548c JSON-RPC \u901a\u4fe1",(0,n.jsx)("br",{}),"* \u5de5\u5177\u53d1\u73b0\u548c\u6267\u884c",(0,n.jsx)("br",{}),"* \u8d44\u6e90\u8bbf\u95ee\u548c\u7ba1\u7406",(0,n.jsx)("br",{}),"* Prompt \u7cfb\u7edf\u4ea4\u4e92",(0,n.jsx)("br",{}),"* \u53ef\u9009\u529f\u80fd\uff1a",(0,n.jsx)("br",{}),"** Roots \u7ba1\u7406",(0,n.jsx)("br",{}),"** Sampling \u652f\u6301",(0,n.jsx)("br",{}),"* \u540c\u6b65\u548c\u5f02\u6b65\u64cd\u4f5c",(0,n.jsx)("br",{}),"* \u4f20\u8f93\u9009\u9879\uff1a",(0,n.jsx)("br",{}),"** \u57fa\u4e8e Stdio \u7684\u4f20\u8f93\uff0c\u7528\u4e8e\u57fa\u4e8e\u8fdb\u7a0b\u7684\u901a\u4fe1",(0,n.jsx)("br",{}),"** \u57fa\u4e8e Java HttpClient \u7684 SSE \u5ba2\u6237\u7aef\u4f20\u8f93",(0,n.jsx)("br",{}),"** WebFlux SSE \u5ba2\u6237\u7aef\u4f20\u8f93\uff0c\u7528\u4e8e\u54cd\u5e94\u5f0f HTTP \u6d41\u5f0f\u4f20\u8f93",(0,n.jsx)("br",{}),(0,n.jsx)("br",{}),(0,n.jsx)(r.img,{alt:"Java MCP Client Architecture",src:s(17328).A+"",width:"4047",height:"3953"})]})})})]}),"\n",(0,n.jsxs)(r.table,{children:[(0,n.jsx)(r.thead,{children:(0,n.jsx)(r.tr,{children:(0,n.jsx)(r.th,{children:(0,n.jsx)(r.a,{href:"https://modelcontextprotocol.io/sdk/java/mcp-server",children:"MCP Server"})})})}),(0,n.jsx)(r.tbody,{children:(0,n.jsx)(r.tr,{children:(0,n.jsxs)(r.td,{children:["MCP Server \u662f Model Context Protocol (MCP) \u67b6\u6784\u4e2d\u7684\u57fa\u7840\u7ec4\u4ef6\uff0c\u5411\u5ba2\u6237\u7aef\u63d0\u4f9b\u5de5\u5177\u3001\u8d44\u
16e90\u548c\u80fd\u529b\u3002\u5b83\u5b9e\u73b0\u534f\u8bae\u7684\u670d\u52a1\u5668\u7aef\uff0c\u8d1f\u8d23\uff1a",(0,n.jsx)("br",{}),(0,n.jsx)("br",{}),"* \u670d\u52a1\u5668\u7aef\u534f\u8bae\u64cd\u4f5c\u5b9e\u73b0",(0,n.jsx)("br",{}),"** \u5de5\u5177\u66b4\u9732\u548c\u53d1\u73b0",(0,n.jsx)("br",{}),"** \u57fa\u4e8e URI \u7684\u8d44\u6e90\u7ba1\u7406",(0,n.jsx)("br",{}),"** Prompt \u6a21\u677f\u63d0\u4f9b\u548c\u5904\u7406",(0,n.jsx)("br",{}),"** \u4e0e\u5ba2\u6237\u7aef\u7684\u80fd\u529b\u534f\u5546",(0,n.jsx)("br",{}),"** \u7ed3\u6784\u5316\u65e5\u5fd7\u8bb0\u5f55\u548c\u901a\u77e5",(0,n.jsx)("br",{}),"* \u5e76\u53d1\u5ba2\u6237\u7aef\u8fde\u63a5\u7ba1\u7406",(0,n.jsx)("br",{}),"* \u540c\u6b65\u548c\u5f02\u6b65 API \u652f\u6301",(0,n.jsx)("br",{}),"* \u4f20\u8f93\u5b9e\u73b0\uff1a",(0,n.jsx)("br",{}),"** Stdio\u3001Streamable-HTTP\u3001Stateless Streamable-HTTP\u3001SSE",(0,n.jsx)("br",{}),(0,n.jsx)("br",{}),(0,n.jsx)(r.img,{alt:"Java MCP Server Architecture",src:s(24572).A+"",width:"4659",height:"3433"})]})})})]}),"\n",(0,n.jsxs)(r.p,{children:["\u6709\u5173\u4f7f\u7528\u4f4e\u7ea7 MCP Client/Server API \u7684\u8be6\u7ec6\u5b9e\u73b0\u6307\u5bfc\uff0c\u8bf7\u53c2\u8003 ",(0,n.jsx)(r.a,{href:"https://modelcontextprotocol.io/sdk/java/mcp-overview",children:"MCP Java SDK \u6587\u6863"}),"\u3002\n\u8981\u4f7f\u7528 Spring Boot \u8fdb\u884c\u7b80\u5316\u8bbe\u7f6e\uff0c\u8bf7\u4f7f\u7528\u4e0b\u9762\u63cf\u8ff0\u7684 MCP Boot Starters\u3002"]}),"\n",(0,n.jsx)(r.h2,{id:"spring-ai-mcp-\u96c6\u6210",children:"Spring AI MCP \u96c6\u62
110"}),"\n",(0,n.jsx)(r.p,{children:"Spring AI \u901a\u8fc7\u4ee5\u4e0b Spring Boot starters \u63d0\u4f9b MCP \u96c6\u6210\uff1a"}),"\n",(0,n.jsx)(r.h3,{id:"client-starters",children:(0,n.jsx)(r.a,{href:"mcp-client-boot-starter-docs",children:"Client Starters"})}),"\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsxs)(r.li,{children:[(0,n.jsx)(r.code,{children:"spring-ai-starter-mcp-client"})," - \u6838\u5fc3 starter\uff0c\u63d0\u4f9b ",(0,n.jsx)(r.code,{children:"STDIO"}),"\u3001\u57fa\u4e8e Servlet \u7684 ",(0,n.jsx)(r.code,{children:"Streamable-HTTP"}),"\u3001",(0,n.jsx)(r.code,{children:"Stateless Streamable-HTTP"})," \u548c ",(0,n.jsx)(r.code,{children:"SSE"})," \u652f\u6301"]}),"\n",(0,n.jsxs)(r.li,{children:[(0,n.jsx)(r.code,{children:"spring-ai-starter-mcp-client-webflux"})," - \u57fa\u4e8e WebFlux \u7684 ",(0,n.jsx)(r.code,{children:"Streamable-HTTP"}),"\u3001",(0,n.jsx)(r.code,{children:"Stateless Streamable-HTTP"})," \u548c ",(0,n.jsx)(r.code,{children:"SSE"})," \u4f20\u8f93\u5b9e\u73b0"]}),"\n"]}),"\n",(0,n.jsx)(r.h3,{id:"server-starters",children:(0,n.jsx)(r.a,{href:"mcp-server-boot-starter-docs",children:"Server Starters"})}),"\n",(0,n.jsx)(r.h4,{id:"stdio",children:"STDIO"}),"\n",(0,n.jsxs)(r.table,{children:[(0,n.jsx)(r.thead,{children:(0,n.jsxs)(r.tr,{children:[(0,n.jsx)(r.th,{children:"Server Type"}),(0,n.jsx)(r.th,{children:"Dependency"}),(0,n.jsx)(r.th,{children:"Property"})]})}),(0,n.jsx)(r.tbody,{children:(0,n.jsxs)(r.tr,{children:[(0,n.jsx)(r.td,{children:(0,n.jsx)(r.a,{href:"mcp-stdio-sse-server-boot-starter-docs",children:"Standard Input/Output (STDIO)"})}),(0,n.jsx)(r.td,{children:(0,n.jsx)(r.code,{children:"spring-ai-starter-mcp-server"})}),(0,n.jsx)(r.td,{children:(0,n.jsx)(r.code,{children:"spring.ai.mcp.server.stdio=true"})})]})})]}),"\n",(0,n.jsx)(r.h4,{id:"webmvc",children:"WebMVC"}),"\n",(0,n.jsxs)(r.table,{children:[(0,n.jsx)(r.thead,{children:(0,n.jsxs)(r.tr,{children:[(0,n.jsx)(r.th,{children:"Server Type"}),(0,n.jsx)(r.th,{children:"Dependency"}),(0,n.jsx)(r.th,{children:"Property"})]})}),(0,n.jsxs)(r.tbody,{children:[(0,n.jsxs)(r.tr,{children:[(0,n.jsx)(r.td,{children:(0,n.jsx)(r.a,{href:"mcp-stdio-sse-server-boot-starter-docs#_sse_webmvc_serve",children:"SSE WebMVC"})}),(0,n.jsx)(r.td,{children:(0,n.jsx)(r.code,{children:"spring-ai-starter-mcp-server-webmvc"})}),(0,n.jsxs)(r.td,{children:[(0,n.jsx)(r.code,{children:"spring.ai.mcp.server.protocol=SSE"})," or empty"]})]}),(0,n.jsxs)(r.tr,{children:[(0,n.jsx)(r.td,{children:(0,n.jsx)(r.a,{href:"mcp-streamable-http-server-boot-starter-docs#_streamable_http_webmvc_server",children:"Streamable-HTTP WebMVC"})}),(0,n.jsx)(r.td,{children:(0,n.jsx)(r.code,{children:"spring-ai-starter-mcp-server-webmvc"})}),(0,n.jsx)(r.td,{children:(0,n.jsx)(r.code,{children:"spring.ai.mcp.server.protocol=STREAMABLE"})})]}),(0,n.jsxs)(r.tr,{children:[(0,n.jsx)(r.td,{children:(0,n.jsx)(r.a,{href:"mcp-stateless-server-boot-starter-docs#_stateless_webmvc_server",children:"Stateless Streamable-HTTP WebMVC"})}),(0,n.jsx)(r.td,{children:(0,n.jsx)(r.code,{children:"spring-ai-starter-mcp-server-webmvc"})}),(0,n.jsx)(r.td,{children:(0,n.jsx)(r.code,{children:"spring.ai.mcp.server.protocol=STATELESS"})})]})]})]}),"\n",(0,n.jsx)(r.h4,{id:"webmvc-reactive",children:"WebMVC (Reactive)"}),"\n",(0,n.jsxs)(r.table,{children:[(0,n.jsx)(r.thead,{children:(0,n.jsxs)(r.tr,{children:[(0,n.jsx)(r.th,{children:"Server Type"}),(0,n.jsx)(r.th,{children:"Dependency"}),(0,n.jsx)(r.th,{children:"Property"})]})}),(0,n.jsxs)(r.tbody,{children:[(0,n.jsxs)(r.tr,{children:[(0,n.jsx)(r.td,{children:(0,n.jsx)(r.a,{href:"mcp-stdio-sse-server-boot-starter-docs#_sse_webflux_serve",children:"SSE WebFlux"})}),(0,n.jsx)(r.td,{children:(0,n.jsx)(r.code,{children:"spring-ai-starter-mcp-server-webflux"})}),(0,n.jsxs)(r.td,{children:[(0,n.jsx)(r.code,{children:"spring.ai.mcp.server.protocol=SSE"})," or empty"]})]}),(0,n.jsxs)(r.tr,{children:[(0,n.jsx)(r.td,{children:(0,n.jsx)(r.a,{href:"mcp-streamable-http-server-boot-starter-docs#_streamable_http_webflux_server",children:"Streamable-HTTP WebFlux"})}),(0,n.jsx)(r.td,{children:(0,n.jsx)(r.code,{children:"spring-ai-starter-mcp-server-webflux"})}),(0,n.jsx)(r.td,{children:(0,n.jsx)(r.code,{children:"spring.ai.mcp.server.protocol=STREAMABLE"})})]}),(0,n.jsxs)(r.tr,{children:[(0,n.jsx)(r.td,{children:(0,n.jsx)(r.a,{href:"mcp-stateless-server-boot-starter-docs#_stateless_webflux_server",children:"Stateless Streamable-HTTP WebFlux"})}),(0,n.jsx)(r.td,{children:(0,n.jsx)(r.code,{children:"spring-ai-starter-mcp-server-webflux"})}),(0,n.jsx)(r.td,{children:(0,n.jsx)(r.code,{children:"spring.ai.mcp.server.protocol=STATELESS"})})]})]})]}),"\n",(0,n.jsx)(r.h2,{id:"spring-ai-mcp-annotations",children:(0,n.jsx)(r.a,{href:"annotations/mcp-annotations-overview",children:"Spring AI MCP Annotations"})}),"\n",(0,n.jsxs)(r.p,{children:["\u9664\u4e86\u7a0b\u5e8f\u5316\u7684 MCP \u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u914d\u7f6e\u5916\uff0cSpring AI \u8fd8\u901a\u8fc7 ",(0,n.jsx)(r.a,{href:"annotations/mcp-annotations-overview",children:"MCP Annotations"})," \u6a21\u5757\u4e3a MCP \u670d\u52a1\u5668\u548c\u5ba2\u6237\u7aef\u63d0\u4f9b\u57fa\u4e8e\u6ce8\u89e3\u7684\u65b9\u6cd5\u5904\u7406\u3002\n\u8fd9\u79cd\u65b9\u6cd5\u4f7f\u7528\u7b80\u6d01\u7684\u58f0\u660e\u5f0f\u7f16\u7a0b\u6a21\u578b\u548c Java \u6ce8\u89e3\u7b80\u5316\u4e86 MCP \u64cd\u4f5c\u7684\u521b\u5efa\u548c\u6ce8\u518c\u3002"]}),"\n",(0,n.jsx)(r.p,{children:"MCP Annotations \u6a21\u5757\u4f7f\u5f00\u53d1\u8005\u80fd\u591f\uff1a"}),"\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsx)(r.li,{children:"\u4f7f\u7528\u7b80\u5355\u7684\u6ce8\u89e3\u521b\u5efa MCP \u5de5\u5177\u3001\u8d44\u
16e90\u548c prompts"}),"\n",(0,n.jsx)(r.li,{children:"\u4ee5\u58f0\u660e\u65b9\u5f0f\u5904\u7406\u5ba2\u6237\u7aef\u901a\u77e5\u548c\u8bf7\u6c42"}),"\n",(0,n.jsx)(r.li,{children:"\u51cf\u5c11\u6837\u677f\u4ee3\u7801\u5e76\u63d0\u9ad8\u53ef\u7ef4\u62a4\u6027"}),"\n",(0,n.jsx)(r.li,{children:"\u81ea\u52a8\u4e3a\u5de5\u5177\u53c2\u6570\u751f\u6210 JSON schemas"}),"\n",(0,n.jsx)(r.li,{children:"\u8bbf\u95ee\u7279\u6b8a\u53c2\u6570\u548c\u4e0a\u4e0b\u6587\u4fe1\u606f"}),"\n"]}),"\n",(0,n.jsx)(r.p,{children:"\u4e3b\u8981\u529f\u80fd\u5305\u62ec\uff1a"}),"\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsxs)(r.li,{children:[(0,n.jsx)(r.a,{href:"annotations/mcp-annotations-server",children:"Server Annotations"}),": ",(0,n.jsx)(r.code,{children:"@McpTool"}),"\u3001",(0,n.jsx)(r.code,{children:"@McpResource"}),"\u3001",(0,n.jsx)(r.code,{children:"@McpPrompt"}),"\u3001",(0,n.jsx)(r.code,{children:"@McpComplete"})]}),"\n",(0,n.jsxs)(r.li,{children:[(0,n.jsx)(r.a,{href:"annotations/mcp-annotations-client",children:"Client Annotations"}),": ",(0,n.jsx)(r.code,{children:"@McpLogging"}),"\u3001",(0,n.jsx)(r.code,{children:"@McpSampling"}),"\u3001",(0,n.jsx)(r.code,{children:"@McpElicitation"}),"\u3001",(0,n.jsx)(r.code,{children:"@McpProgress"})]}),"\n",(0,n.jsxs)(r.li,{children:[(0,n.jsx)(r.a,{href:"annotations/mcp-annotations-special-params",children:"Special Parameters"}),": ",(0,n.jsx)(r.code,{children:"McpSyncServerExchange"}),"\u3001",(0,n.jsx)(r.code,{children:"McpAsyncServerExchange"}),"\u3001",(0,n.jsx)(r.code,{children:"McpTransportContext"}),"\u3001",(0,n.jsx)(r.code,{children:"McpMeta"})]}),"\n",(0,n.jsxs)(r.li,{children:[(0,n.jsx)(r.em,{children:"Automatic Discovery"}),": \u5177\u6709\u53ef\u914d\u7f6e\u5305\u5305\u542b/\u6392\u9664\u7684\u6ce8\u89e3\u626b\u63cf"]}),"\n",(0,n.jsxs)(r.li,{children:[(0,n.jsx)(r.em,{children:"Spring Boot Integration"}),": \u4e0e MCP Boot Starters \u65e0\u7f1d\u96c6\u6210"]}),"\n"]}),"\n",(0,n.jsx)(r.h2,{id:"\u5176\u4ed6\u8d44\u6e90",children:"\u5176\u4ed6\u8d44\u6e90"}),"\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsx)(r.li,{children:(0,n.jsx)(r.a,{href:"annotations/mcp-annotations-overview",children:"MCP Annotations \u6587\u6863"})}),"\n",(0,n.jsx)(r.li,{children:(0,n.jsx)(r.a,{href:"mcp-client-boot-starter-docs",children:"MCP Client Boot Starters \u6587\u6863"})}),"\n",(0,n.jsx)(r.li,{children:(0,n.jsx)(r.a,{href:"mcp-server-boot-starter-docs",children:"MCP Server Boot Starters \u6587\u6863"})}),"\n",(0,n.jsx)(r.li,{children:(0,n.jsx)(r.a,{href:"mcp-helpers",children:"MCP Utilities \u6587\u6863"})}),"\n",(0,n.jsx)(r.li,{children:(0,n.jsx)(r.a,{href:"https://modelcontextprotocol.github.io/specification/",children:"Model Context Protocol \u89c4\u8303"})}),"\n"]})]})}function h(e={}){const{wrapper:r}={...(0,i.R)(),...e.components};return r?(0,n.jsx)(r,{...e,children:(0,n.jsx)(a,{...e})}):a(e)}},28453:(e,r,s)=>{s.d(r,{R:()=>c,x:()=>l});var t=s(96540);const n={},i=t.createContext(n);function c(e){const r=t.useContext(i);return t.useMemo(function(){return"function"==typeof e?e(r):{...r,...e}},[r,e])}function l(e){let r;return r=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:c(e.components),t.createElement(i.Provider,{value:r},e.children)}},31247:(e,r,s)=>{s.d(r,{A:()=>t});const t=s.p+"assets/images/mcp-stack-eb3e28445f73760dfcddb24484f4ab1d.svg"}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.