{"id":48150,"date":"2025-07-30T10:57:18","date_gmt":"2025-07-30T02:57:18","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/48150.html"},"modified":"2025-07-30T10:57:18","modified_gmt":"2025-07-30T02:57:18","slug":"%e5%9c%a8-java-%e4%b8%ad%e5%88%9b%e5%bb%ba%e4%bd%a0%e7%9a%84%e7%ac%ac%e4%b8%80%e4%b8%aamodel-context-protocol-mcp-%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/48150.html","title":{"rendered":"\u5728 Java \u4e2d\u521b\u5efa\u4f60\u7684\u7b2c\u4e00\u4e2aModel Context Protocol (MCP) \u670d\u52a1\u5668"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"386\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730025717-68898a0d69c79.png\" width=\"686\" \/><\/p>\n<p>\u4f60\u662f\u5426\u5e0c\u671b\u901a\u8fc7\u8fde\u63a5\u4f60\u81ea\u5df1\u7684\u6570\u636e\u548c\u670d\u52a1&#xff0c;\u6765\u6269\u5c55\u7c7b\u4f3c Deepseek \u8fd9\u6837\u7684 AI \u6a21\u578b\u7684\u80fd\u529b&#xff1f;Model Context Protocol&#xff08;MCP&#xff09;\u63d0\u4f9b\u4e86\u4e00\u79cd\u6807\u51c6\u5316\u65b9\u5f0f\u6765\u5b9e\u73b0\u8fd9\u4e00\u76ee\u6807&#xff0c;\u800c Spring AI \u5219\u8ba9\u5b9e\u73b0\u4f60\u81ea\u5df1\u7684 MCP \u670d\u52a1\u5668\u53d8\u5f97\u5f88\u7b80\u5355\u3002\u5728\u672c\u6559\u7a0b\u4e2d&#xff0c;\u6211\u5c06\u5e26\u4f60\u4ece\u96f6\u5f00\u59cb&#xff0c;\u4f7f\u7528 Spring Boot \u548c Spring AI \u521b\u5efa\u4f60\u7684\u7b2c\u4e00\u4e2a MCP \u670d\u52a1\u5668\u3002<\/p>\n<p>\u4ec0\u4e48\u662f Model Context Protocol&#xff08;MCP&#xff09;&#xff1f;<\/p>\n<p>Model Context Protocol&#xff08;MCP&#xff09;\u662f\u4e00\u79cd\u5f00\u653e\u6807\u51c6&#xff0c;\u7528\u4e8e\u5b9a\u4e49 AI \u6a21\u578b\u5982\u4f55\u4e0e\u5916\u90e8\u5de5\u5177\u548c\u6570\u636e\u6e90\u8fdb\u884c\u901a\u4fe1\u3002\u5b83\u901a\u8fc7\u4e00\u4e2a\u6807\u51c6\u5316\u63a5\u53e3&#xff0c;\u4f7f\u5f97 AI \u6a21\u578b\u53ef\u4ee5\u4e0e\u81ea\u5b9a\u4e49\u670d\u52a1\u8fdb\u884c\u4ea4\u4e92&#xff0c;\u4ece\u800c\u5b9e\u73b0\u4ee5\u4e0b\u529f\u80fd&#xff1a;<\/p>\n<ul>\n<li>\u8bbf\u95ee\u79c1\u6709\u6216\u4e13\u6709\u6570\u636e<\/li>\n<li>\u6267\u884c\u7279\u5b9a\u7684\u8ba1\u7b97\u4efb\u52a1<\/li>\n<li>\u6267\u884c\u81ea\u5b9a\u4e49\u7684\u4e1a\u52a1\u903b\u8f91<\/li>\n<li>\u4e0e\u5916\u90e8\u7cfb\u7edf\u4ea4\u4e92<\/li>\n<\/ul>\n<p>\u4f60\u53ef\u4ee5\u5c06 MCP \u7406\u89e3\u4e3a\u8fde\u63a5 AI \u6a21\u578b\u4e0e\u66f4\u5e7f\u6cdb\u751f\u6001\u7cfb\u7edf\u4e4b\u95f4\u7684\u4e00\u5ea7\u6865\u6881&#xff0c;\u5b83\u4f7f\u5f97\u6a21\u578b\u80fd\u591f\u7a81\u7834\u8bad\u7ec3\u6570\u636e\u7684\u9650\u5236&#xff0c;\u4e0e\u5b9e\u65f6\u4fe1\u606f\u8fdb\u884c\u4e92\u52a8\u3002<\/p>\n<p>\u4e3a\u4ec0\u4e48\u4f7f\u7528 Spring AI \u6784\u5efa MCP \u670d\u52a1\u5668&#xff1f;<\/p>\n<p>\u5982\u679c\u4f60\u662f\u4e00\u540d\u719f\u6089 Spring \u751f\u6001\u7cfb\u7edf\u7684 Java \u5f00\u53d1\u8005&#xff0c;\u4f7f\u7528 Spring AI \u6784\u5efa MCP \u670d\u52a1\u5668\u5c06\u5e26\u6765\u4ee5\u4e0b\u4e0b\u5217\u4f18\u52bf&#xff1a;<\/p>\n<ul>\n<li>\u7b80\u5316\u5f00\u53d1&#xff1a;Spring AI \u5bf9 MCP \u89c4\u8303\u4e2d\u7684\u590d\u6742\u90e8\u5206\u8fdb\u884c\u4e86\u5c01\u88c5&#xff0c;\u5927\u5927\u964d\u4f4e\u4e86\u5b9e\u73b0\u96be\u5ea6<\/li>\n<li>\u719f\u6089\u7684\u5f00\u53d1\u6a21\u578b&#xff1a;\u53ef\u4ee5\u4f7f\u7528\u6807\u51c6\u7684 Spring \u529f\u80fd&#xff0c;\u5982\u4f9d\u8d56\u6ce8\u5165\u548c\u7ec4\u4ef6\u626b\u63cf<\/li>\n<li>\u4e0e Spring Boot \u65e0\u7f1d\u96c6\u6210&#xff1a;\u5145\u5206\u5229\u7528 Spring Boot \u751f\u6001\u7cfb\u7edf\u7684\u5f3a\u5927\u80fd\u529b<\/li>\n<li>\u591a\u79cd\u901a\u4fe1\u65b9\u5f0f\u652f\u6301&#xff1a;\u652f\u6301 STDIO\u3001HTTP\u3001WebSocket \u548c RSocket \u7b49\u591a\u79cd\u4f20\u8f93\u534f\u8bae<\/li>\n<li><\/li>\n<\/ul>\n<p>\u9879\u76ee\u6982\u89c8<\/p>\n<p>\u5728\u672c\u6559\u7a0b\u4e2d&#xff0c;\u6211\u4eec\u5c06\u6784\u5efa\u4e00\u4e2a\u7b80\u5355\u7684 MCP \u670d\u52a1\u5668&#xff0c;\u7528\u4e8e\u63d0\u4f9b\u6709\u5173Course\u7684\u4fe1\u606f\u3002\u6211\u4eec\u7684\u670d\u52a1\u5668\u5c06\u66b4\u9732\u4e24\u4e2a\u5de5\u5177&#xff1a;<\/p>\n<ul>\n<li>\u4e00\u4e2a\u7528\u4e8e\u68c0\u7d22\u6240\u6709\u53ef\u7528Course\u7684\u5de5\u5177<\/li>\n<li>\u4e00\u4e2a\u7528\u4e8e\u6839\u636eCourse\u6807\u9898\u67e5\u627e\u7279\u5b9a\u8bfe\u7a0b\u7684\u5de5\u5177<\/li>\n<\/ul>\n<p>\u8fd9\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\u5c06\u5c55\u793a MCP \u670d\u52a1\u5668\u5f00\u53d1\u7684\u6838\u5fc3\u6982\u5ff5&#xff0c;\u5e76\u4e3a\u4f60\u4eca\u540e\u6839\u636e\u81ea\u8eab\u9700\u6c42\u6269\u5c55\u529f\u80fd\u6253\u4e0b\u57fa\u7840\u3002<\/p>\n<p>\u524d\u7f6e\u6761\u4ef6<\/p>\n<p>\u5728\u5f00\u59cb\u4e4b\u524d&#xff0c;\u8bf7\u786e\u4fdd\u4f60\u5df2\u7ecf\u5177\u5907\u4ee5\u4e0b\u73af\u5883\u548c\u77e5\u8bc6&#xff1a;<\/p>\n<ul>\n<li>Java \u5f00\u53d1\u5de5\u5177\u5305&#xff08;JDK&#xff09;17 \u6216\u66f4\u9ad8\u7248\u672c<\/li>\n<li>Maven \u6216 Gradle \u7528\u4e8e\u4f9d\u8d56\u5305\u7ba1\u7406<\/li>\n<li>\u5bf9 Spring Boot \u6709\u57fa\u672c\u7684\u4e86\u89e3<\/li>\n<li>\u4e00\u4e2a\u7528\u4e8e\u6d4b\u8bd5\u7684 MCP \u5ba2\u6237\u7aef&#xff08;\u672c\u6559\u7a0b\u5c06\u4f7f\u7528 Claude Desktop&#xff09;<\/li>\n<li><\/li>\n<\/ul>\n<p>\u9879\u76ee\u642d\u5efa<\/p>\n<p>\u6211\u4eec\u9996\u5148\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Spring Boot\u9879\u76ee\u3002\u6700\u7b80\u5355\u7684\u65b9\u6cd5\u662f\u4f7f\u7528Spring Initializr\u3002<\/p>\n<p>\u6309\u7167\u4ee5\u4e0b\u914d\u7f6e\u8bbe\u7f6e\u4f60\u7684\u9879\u76ee&#xff1a;<\/p>\n<\/p>\n<ul>\n<li>\u9879\u76ee\u7c7b\u578b&#xff1a;Maven<\/li>\n<li>\u8bed\u8a00&#xff1a;Java<\/li>\n<li>Spring Boot \u7248\u672c&#xff1a;\u6700\u65b0\u7248\u672c<\/li>\n<li>\u4f9d\u8d56\u9879&#xff1a;\u6dfb\u52a0 Spring AI MCP Server \u4f9d\u8d56<\/li>\n<\/ul>\n<p>\u8fd9\u6837\u5c31\u5b8c\u6210\u4e86\u9879\u76ee\u7684\u57fa\u7840\u8bbe\u7f6e&#xff0c;\u63a5\u4e0b\u6765\u6211\u4eec\u5c06\u5f00\u59cb\u7f16\u5199MCP\u670d\u52a1\u5668\u7684\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"500\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730025717-68898a0d87494.png\" width=\"1080\" \/><\/p>\n<p>\u4e00\u65e6\u4f60\u751f\u6210\u5e76\u4e0b\u8f7d\u4e86\u9879\u76ee&#xff0c;\u5c31\u53ef\u4ee5\u5728 IDE \u4e2d\u6253\u5f00\u5b83\u4e86\u3002<\/p>\n<hr \/>\n<h2>\u7406\u89e3\u9879\u76ee\u7ed3\u6784<\/h2>\n<p>\u63a5\u4e0b\u6765\u6211\u4eec\u6765\u4e86\u89e3\u4e00\u4e0b\u9700\u8981\u521b\u5efa\u7684\u5173\u952e\u7ec4\u4ef6&#xff1a;<\/p>\n<ul>\n<li>Course.java&#xff1a;\u4e00\u4e2a\u7528\u4e8e\u8868\u793a\u8bfe\u7a0b\u6570\u636e\u7684\u7b80\u5355 record \u7c7b<\/li>\n<li>CourseService.java&#xff1a;\u4e00\u4e2a\u670d\u52a1\u7c7b&#xff0c;\u901a\u8fc7 MCP \u5de5\u5177\u66b4\u9732\u8bfe\u7a0b\u6570\u636e<\/li>\n<li>CoursesApplication.java&#xff1a;\u4e3b\u5e94\u7528\u7c7b&#xff0c;\u7528\u4e8e\u6ce8\u518c MCP \u5de5\u5177<\/li>\n<li>application.properties&#xff1a;MCP \u670d\u52a1\u5668\u7684\u914d\u7f6e\u6587\u4ef6<\/li>\n<\/ul>\n<p>\u8fd9\u4e9b\u7ec4\u4ef6\u5c06\u6784\u6210\u4e00\u4e2a\u5b8c\u6574\u7684 MCP \u670d\u52a1\u5668\u793a\u4f8b&#xff0c;\u5e2e\u52a9\u6211\u4eec\u6f14\u793a\u5176\u57fa\u672c\u539f\u7406\u4e0e\u7528\u6cd5\u3002<\/p>\n<h2>\u7b2c\u4e00\u6b65&#xff1a;\u521b\u5efa\u6570\u636e\u6a21\u578b<\/h2>\n<p>\u9996\u5148&#xff0c;\u6211\u4eec\u6765\u521b\u5efa\u8868\u793a\u8bfe\u7a0b\u6570\u636e\u7684 Course \u7c7b\u3002\u7531\u4e8e\u6211\u4eec\u4f7f\u7528\u7684\u662f Java 17 \u53ca\u4ee5\u4e0a\u7248\u672c&#xff0c;\u53ef\u4ee5\u4f7f\u7528 record \u6765\u5b9a\u4e49\u4e00\u4e2a\u7b80\u6d01\u4e14\u4e0d\u53ef\u53d8\u7684\u6570\u636e\u7ed3\u6784&#xff1a;<\/p>\n<p>public record Course(String title, String url) {<br \/>\n}<\/p>\n<p>\u8fd9\u6761\u7b80\u5355\u7684\u8bb0\u5f55\u5c06\u5b58\u50a8\u6bcf\u95e8\u8bfe\u7a0b\u7684\u6807\u9898\u548c URL\u3002<\/p>\n<p>\u6b65\u9aa4\u4e8c&#xff1a;\u5b9e\u73b0\u670d\u52a1\u5c42<\/p>\n<p>\u63a5\u4e0b\u6765&#xff0c;\u6211\u4eec\u521b\u5efa CourseService \u7c7b\u3002\u5728\u8fd9\u91cc&#xff0c;\u6211\u4eec\u5c06\u4f7f\u7528 &#064;Tool \u6ce8\u89e3\u6765\u5b9a\u4e49\u6211\u4eec\u7684 MCP \u5de5\u5177\u3002<\/p>\n<p>&#064;Service<br \/>\npublic class CourseService {<br \/>\n    private static final Logger log &#061; LoggerFactory.getLogger(CourseService.class);<br \/>\n    private List&lt;Course&gt; courses &#061; new ArrayList&lt;&gt;();<br \/>\n    &#064;Tool(name &#061; &#034;dv_get_courses&#034;, description &#061; &#034;Get a list of courses from Dan Vega&#034;)<br \/>\n    public List&lt;Course&gt; getCourses() {<br \/>\n        return courses;<br \/>\n    }<br \/>\n    &#064;Tool(name &#061; &#034;dv_get_course&#034;, description &#061; &#034;Get a single course from Dan Vega by title&#034;)<br \/>\n    public Course getCourse(String title) {<br \/>\n        return courses.stream()<br \/>\n            .filter(course -&gt; course.title().equals(title))<br \/>\n            .findFirst()<br \/>\n            .orElse(null);<br \/>\n    }<br \/>\n    &#064;PostConstruct<br \/>\n    public void init() {<br \/>\n        courses.addAll(List.of(<br \/>\n            new Course(&#034;Building Web Applications with Spring Boot (FreeCodeCamp)&#034;,<br \/>\n                      &#034;https:\/\/youtu.be\/31KTdfRH6nY&#034;),<br \/>\n            new Course(&#034;Spring Boot Tutorial for Beginners &#8211; 2023 Crash Course using Spring Boot 3&#034;,<br \/>\n                      &#034;https:\/\/youtu.be\/UgX5lgv4uVM&#034;)<br \/>\n        ));<br \/>\n    }<br \/>\n}<\/p>\n<p>\u8fd9\u4e2a\u670d\u52a1\u7c7b\u7684\u5173\u952e\u70b9\u5305\u62ec&#xff1a;<\/p>\n<ul>\n<li>&#064;Tool \u6ce8\u89e3&#xff1a;\u5c06\u666e\u901a\u65b9\u6cd5\u8f6c\u6362\u4e3a\u4e0e MCP \u517c\u5bb9\u7684\u5de5\u5177<\/li>\n<li>\u5de5\u5177\u5c5e\u6027&#xff1a;\u6bcf\u4e2a\u5de5\u5177\u90fd\u6709\u552f\u4e00\u7684\u540d\u79f0\u548c\u63cf\u8ff0\u6027\u6587\u672c&#xff0c;\u5e2e\u52a9 AI \u6a21\u578b\u7406\u89e3\u5176\u7528\u9014<\/li>\n<li>\u65b9\u6cd5\u53c2\u6570&#xff1a;\u53c2\u6570\u53d8\u6210\u5de5\u5177\u7684\u8f93\u5165\u53c2\u6570&#xff0c;\u53ef\u4ee5\u7531 AI \u6a21\u578b\u4f20\u9012<\/li>\n<li>\u8fd4\u56de\u7c7b\u578b&#xff1a;\u8fd4\u56de\u7684\u6570\u636e\u4f1a\u81ea\u52a8\u5e8f\u5217\u5316\u4e3a AI \u6a21\u578b\u80fd\u591f\u7406\u89e3\u7684\u683c\u5f0f<\/li>\n<\/ul>\n<p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d&#xff0c;\u6211\u4eec\u4f7f\u7528\u4e86\u4e00\u4e2a\u5185\u5b58\u4e2d\u7684\u5217\u8868\u6765\u5b58\u50a8\u8bfe\u7a0b&#xff0c;\u6570\u636e\u5728 &#064;PostConstruct \u65b9\u6cd5\u4e2d\u521d\u59cb\u5316\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d&#xff0c;\u4f60\u53ef\u80fd\u4f1a\u8fde\u63a5\u6570\u636e\u5e93\u6216\u8c03\u7528\u5916\u90e8 API\u3002<\/p>\n<p>\u6b65\u9aa4\u4e09&#xff1a;\u5728 MCP \u4e2d\u6ce8\u518c\u5de5\u5177<\/p>\n<p>\u73b0\u5728&#xff0c;\u8ba9\u6211\u4eec\u8bbe\u7f6e\u4e3b\u5e94\u7528\u7a0b\u5e8f\u7c7b&#xff0c;\u5c06\u5de5\u5177\u6ce8\u518c\u5230 MCP \u6846\u67b6\u4e2d&#xff1a;<\/p>\n<p>&#064;SpringBootApplication<br \/>\npublic class CoursesApplication {<br \/>\n    public static void main(String[] args) {<br \/>\n        SpringApplication.run(CoursesApplication.class, args);<br \/>\n    }<br \/>\n    &#064;Bean<br \/>\n    public List&lt;ToolCallback&gt; danTools(CourseService courseService) {<br \/>\n        return List.of(ToolCallbacks.from(courseService));<br \/>\n    }<br \/>\n}<\/p>\n<p>ToolCallbacks.from() \u65b9\u6cd5\u4f1a\u626b\u63cf\u670d\u52a1\u7c7b\u4e2d\u7684 &#064;Tool \u6ce8\u89e3&#xff0c;\u5e76\u5c06\u5b83\u4eec\u6ce8\u518c\u5230 MCP \u6846\u67b6\u4e2d\u3002\u8fd9\u6b63\u662f Spring \u7ec4\u4ef6\u626b\u63cf\u529f\u80fd\u7684\u4f18\u52bf \u2014\u2014 \u53ea\u9700\u51e0\u884c\u4ee3\u7801&#xff0c;\u6211\u4eec\u5c31\u5b8c\u6210\u4e86\u5de5\u5177\u7684\u6ce8\u518c\u3002<\/p>\n<p>\u6b65\u9aa4\u56db&#xff1a;\u914d\u7f6e MCP \u670d\u52a1\u5668<\/p>\n<p>\u6700\u540e&#xff0c;\u8ba9\u6211\u4eec\u901a\u8fc7 application.properties \u6587\u4ef6\u6765\u914d\u7f6e MCP \u670d\u52a1\u5668&#xff1a;<\/p>\n<p>spring.main.web-application-type&#061;none<br \/>\nspring.ai.mcp.server.name&#061;dan-vega-mcp<br \/>\nspring.ai.mcp.server.version&#061;0.0.1<br \/>\n# NOTE: You must disable the banner and the console logging<br \/>\n# to allow the STDIO transport to work !!!<br \/>\nspring.main.banner-mode&#061;off<br \/>\nlogging.pattern.console&#061;<\/p>\n<p>\u8fd9\u6bb5\u914d\u7f6e\u5b9e\u73b0\u4e86\u51e0\u4e2a\u91cd\u8981\u529f\u80fd&#xff1a;<\/p>\n<ul>\n<li>\u7981\u7528 Web \u5e94\u7528&#xff1a;\u7531\u4e8e\u6211\u4eec\u4f7f\u7528\u7684\u662f MCP \u7684 STDIO \u4f20\u8f93\u65b9\u5f0f&#xff0c;\u56e0\u6b64\u4e0d\u9700\u8981\u542f\u52a8 Web \u670d\u52a1\u5668<\/li>\n<li>\u8bbe\u7f6e\u670d\u52a1\u5668\u540d\u79f0\u548c\u7248\u672c&#xff1a;\u7528\u4e8e\u5411\u5ba2\u6237\u7aef\u6807\u8bc6\u6211\u4eec\u7684 MCP \u670d\u52a1\u5668<\/li>\n<li>\u7981\u7528\u6a2a\u5e45\u548c\u63a7\u5236\u53f0\u65e5\u5fd7&#xff1a;\u786e\u4fdd STDIO \u4f20\u8f93\u80fd\u591f\u6b63\u5e38\u5de5\u4f5c<\/li>\n<\/ul>\n<p>STDIO \u4f20\u8f93\u673a\u5236\u4f7f\u6211\u4eec\u7684 MCP \u670d\u52a1\u5668\u80fd\u591f\u901a\u8fc7\u6807\u51c6\u8f93\u5165\u8f93\u51fa\u6d41\u8fdb\u884c\u901a\u4fe1&#xff0c;\u8fd9\u6b63\u662f Claude Desktop \u5728\u672c\u5730 MCP \u670d\u52a1\u5668\u4e2d\u4f7f\u7528\u7684\u65b9\u5f0f\u3002<\/p>\n<p>\u672a\u5b8c\u5f85\u7eed&#xff0c;\u4e0b\u4e00\u8282\u6211\u4eec\u6765\u8fd0\u884c\u548c\u6d4b\u8bd5\u8fd9\u4e2aMCP\u3002<\/p>\n<p>\u6211\u662f\u4e00\u540d\u6709\u5341\u5e74\u4ee5\u4e0a\u7ecf\u9a8c\u7684Java\u8001\u7801\u519c&#xff0c;\u66fe\u7ecf\u6c89\u8ff7\u4e8e\u4ee3\u7801\u7684\u4e16\u754c&#xff0c;\u4e5f\u66fe\u5728\u4f20\u7edf\u4e1a\u52a1\u7cfb\u7edf\u4e2d\u6478\u722c\u6eda\u6253\u3002\u4f46\u65f6\u4ee3\u5728\u53d8&#xff0c;AI \u6b63\u5728\u91cd\u5851\u6280\u672f\u683c\u5c40\u3002\u6211\u4e0d\u60f3\u88ab\u6d6a\u6f6e\u7529\u5728\u8eab\u540e&#xff0c;\u6240\u4ee5\u9009\u62e9\u91cd\u65b0\u51fa\u53d1&#xff0c;\u8d70\u4e0a\u00a0AI \u5b66\u4e60\u4e0e\u8f6c\u578b\u7684\u65c5\u7a0b\u3002<\/p>\n<p>\u8fd9\u4e2a\u516c\u4f17\u53f7&#xff0c;\u8bb0\u5f55\u7684\u4e0d\u662f\u9e21\u6c64&#xff0c;\u4e5f\u4e0d\u662f\u201c\u5272\u97ed\u83dc\u201d\u7684\u6559\u7a0b&#xff0c;\u800c\u662f\u6211\u4e00\u4e2a\u7a0b\u5e8f\u5458\u771f\u5b9e\u7684\u601d\u8003\u3001\u5b66\u4e60\u3001\u5b9e\u6218\u7ecf\u9a8c&#xff0c;\u4ee5\u53ca\u4ece\u56f0\u60d1\u5230\u7a81\u7834\u7684\u5168\u8fc7\u7a0b\u3002<\/p>\n<p>\u5982\u679c\u4f60\u4e5f\u662f\u5728\u6280\u672f\u74f6\u9888\u4e2d\u601d\u8003\u8f6c\u578b\u3001\u60f3\u4e86\u89e3 AI \u5982\u4f55\u4e0e\u4f20\u7edf\u5f00\u53d1\u7ed3\u5408\u3001\u53c8\u6216\u4ec5\u4ec5\u60f3\u770b\u4e00\u4e2a\u666e\u901a\u5de5\u7a0b\u5e08\u7684\u8fdb\u5316\u4e4b\u8def&#xff0c;\u6b22\u8fce\u5173\u6ce8&#xff0c;\u4e00\u8d77\u63a2\u7d22&#xff0c;\u4e00\u8d77\u6210\u957f\u3002<\/p>\n<p>\u5173\u6ce8\u6211 \u548c\u6211\u4e00\u8d77&#xff0c;\u7d27\u8ddf\u7740AI\u7684\u6b65\u4f10&#xff0c;\u4e0d\u88ab\u65f6\u4ee3\u629b\u5f03\u3002\u2728<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e18\u6b21\uff0c\u6536\u85cf26\u6b21\u3002Model Context Protocol\uff08MCP\uff09\u662f\u4e00\u79cd\u5f00\u653e\u6807\u51c6\uff0c\u7528\u4e8e\u5b9a\u4e49 AI \u6a21\u578b\u5982\u4f55\u4e0e\u5916\u90e8\u5de5\u5177\u548c\u6570\u636e\u6e90\u8fdb\u884c\u901a\u4fe1\u3002_java\u7f16\u5199mcp\u670d\u52a1<\/p>\n","protected":false},"author":2,"featured_media":48148,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[50],"topic":[],"class_list":["post-48150","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-50"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5728 Java \u4e2d\u521b\u5efa\u4f60\u7684\u7b2c\u4e00\u4e2aModel Context Protocol (MCP) \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/48150.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5728 Java \u4e2d\u521b\u5efa\u4f60\u7684\u7b2c\u4e00\u4e2aModel Context Protocol (MCP) \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e18\u6b21\uff0c\u6536\u85cf26\u6b21\u3002Model Context Protocol\uff08MCP\uff09\u662f\u4e00\u79cd\u5f00\u653e\u6807\u51c6\uff0c\u7528\u4e8e\u5b9a\u4e49 AI \u6a21\u578b\u5982\u4f55\u4e0e\u5916\u90e8\u5de5\u5177\u548c\u6570\u636e\u6e90\u8fdb\u884c\u901a\u4fe1\u3002_java\u7f16\u5199mcp\u670d\u52a1\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/48150.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-07-30T02:57:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730025717-68898a0d69c79.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/48150.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/48150.html\",\"name\":\"\u5728 Java \u4e2d\u521b\u5efa\u4f60\u7684\u7b2c\u4e00\u4e2aModel Context Protocol (MCP) \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-07-30T02:57:18+00:00\",\"dateModified\":\"2025-07-30T02:57:18+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/48150.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/48150.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/48150.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5728 Java \u4e2d\u521b\u5efa\u4f60\u7684\u7b2c\u4e00\u4e2aModel Context Protocol (MCP) \u670d\u52a1\u5668\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5728 Java \u4e2d\u521b\u5efa\u4f60\u7684\u7b2c\u4e00\u4e2aModel Context Protocol (MCP) \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/48150.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5728 Java \u4e2d\u521b\u5efa\u4f60\u7684\u7b2c\u4e00\u4e2aModel Context Protocol (MCP) \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e18\u6b21\uff0c\u6536\u85cf26\u6b21\u3002Model Context Protocol\uff08MCP\uff09\u662f\u4e00\u79cd\u5f00\u653e\u6807\u51c6\uff0c\u7528\u4e8e\u5b9a\u4e49 AI \u6a21\u578b\u5982\u4f55\u4e0e\u5916\u90e8\u5de5\u5177\u548c\u6570\u636e\u6e90\u8fdb\u884c\u901a\u4fe1\u3002_java\u7f16\u5199mcp\u670d\u52a1","og_url":"https:\/\/www.wsisp.com\/helps\/48150.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-07-30T02:57:18+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730025717-68898a0d69c79.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/48150.html","url":"https:\/\/www.wsisp.com\/helps\/48150.html","name":"\u5728 Java \u4e2d\u521b\u5efa\u4f60\u7684\u7b2c\u4e00\u4e2aModel Context Protocol (MCP) \u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-07-30T02:57:18+00:00","dateModified":"2025-07-30T02:57:18+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/48150.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/48150.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/48150.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5728 Java \u4e2d\u521b\u5efa\u4f60\u7684\u7b2c\u4e00\u4e2aModel Context Protocol (MCP) \u670d\u52a1\u5668"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/48150","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=48150"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/48150\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/48148"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=48150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=48150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=48150"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=48150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}