{"id":41318,"date":"2025-06-01T12:55:55","date_gmt":"2025-06-01T04:55:55","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/41318.html"},"modified":"2025-06-01T12:55:55","modified_gmt":"2025-06-01T04:55:55","slug":"%e6%89%8b%e6%92%95java%e7%a1%85%e5%9f%ba%e6%b5%81%e5%8a%a8%e5%ae%9e%e7%8e%b0mcp%e6%9c%8d%e5%8a%a1%e5%99%a8%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/41318.html","title":{"rendered":"\u624b\u6495Java+\u7845\u57fa\u6d41\u52a8\u5b9e\u73b0MCP\u670d\u52a1\u5668\u6559\u7a0b"},"content":{"rendered":"<h2>\u624b\u6495Java&#043;\u7845\u57fa\u6d41\u52a8\u5b9e\u73b0MCP\u670d\u52a1\u5668\u6559\u7a0b<\/h2>\n<h2>\u4e00\u3001MCP\u534f\u8bae\u6838\u5fc3\u6982\u5ff5<\/h2>\n<h3>MCP\u662f\u4ec0\u4e48<\/h3>\n<p>MCP \u662f Anthropic (Claude) \u4e3b\u5bfc\u53d1\u5e03\u7684\u4e00\u4e2a\u5f00\u653e\u7684\u3001\u901a\u7528\u7684\u3001\u6709\u5171\u8bc6\u7684\u534f\u8bae\u6807\u51c6\u3002<\/p>\n<p>\u25cf MCP \u662f\u4e00\u4e2a\u6807\u51c6\u534f\u8bae&#xff0c;\u5c31\u50cf\u7ed9 AI \u5927\u6a21\u578b\u88c5\u4e86\u4e00\u4e2a \u201c\u4e07\u80fd\u63a5\u53e3\u201d&#xff0c;\u8ba9 AI \u6a21\u578b\u80fd\u591f\u4e0e\u4e0d\u540c\u7684\u6570\u636e\u6e90\u548c\u5de5\u5177\u8fdb\u884c\u65e0\u7f1d\u4ea4\u4e92\u3002\u5b83\u5c31\u50cf USB-C \u63a5\u53e3\u4e00\u6837&#xff0c;\u63d0\u4f9b\u4e86\u4e00\u79cd\u6807\u51c6\u5316\u7684\u65b9\u6cd5&#xff0c;\u5c06 AI \u6a21\u578b\u8fde\u63a5\u5230\u5404\u79cd\u6570\u636e\u6e90\u548c\u5de5\u5177\u3002 \u25cf MCP \u65e8\u5728\u66ff\u6362\u788e\u7247\u5316\u7684 Agent \u4ee3\u7801\u96c6\u6210&#xff0c;\u4ece\u800c\u4f7f AI \u7cfb\u7edf\u66f4\u53ef\u9760&#xff0c;\u66f4\u6709\u6548\u3002\u901a\u8fc7\u5efa\u7acb\u901a\u7528\u6807\u51c6&#xff0c;\u670d\u52a1\u5546\u53ef\u4ee5\u57fa\u4e8e\u534f\u8bae\u6765\u63a8\u51fa\u5b83\u4eec\u81ea\u5df1\u670d\u52a1\u7684 AI \u80fd\u529b&#xff0c;\u4ece\u800c\u652f\u6301\u5f00\u53d1\u8005\u66f4\u5feb\u7684\u6784\u5efa\u66f4\u5f3a\u5927\u7684 AI \u5e94\u7528\u3002\u5f00\u53d1\u8005\u4e5f\u4e0d\u9700\u8981\u91cd\u590d\u9020\u8f6e\u5b50&#xff0c;\u901a\u8fc7\u5f00\u6e90\u9879\u76ee\u53ef\u4ee5\u5efa\u7acb\u5f3a\u5927\u7684 AI Agent \u751f\u6001\u3002 \u25cf MCP \u53ef\u4ee5\u5728\u4e0d\u540c\u7684\u5e94\u7528 \/ \u670d\u52a1\u4e4b\u95f4\u4fdd\u6301\u4e0a\u4e0b\u6587&#xff0c;\u589e\u5f3a\u6574\u4f53\u81ea\u4e3b\u6267\u884c\u4efb\u52a1\u7684\u80fd\u529b\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250601045553-683bdd59636ff.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h3>MCP\u67b6\u6784<\/h3>\n<p>MCP\u9075\u5faa\u5ba2\u6237\u7aef &#8211; \u670d\u52a1\u5668\u67b6\u6784&#xff0c;\u5305\u542b\u4ee5\u4e0b\u51e0\u4e2a\u6838\u5fc3\u90e8\u5206&#xff1a; \u25cf MCP \u4e3b\u673a&#xff08;MCP Hosts&#xff09;&#xff1a;\u53d1\u8d77\u8bf7\u6c42\u7684 AI \u5e94\u7528\u7a0b\u5e8f&#xff0c;\u6bd4\u5982\u804a\u5929\u673a\u5668\u4eba\u3001AI \u9a71\u52a8\u7684 IDE \u7b49\u3002 \u25cf MCP \u5ba2\u6237\u7aef&#xff08;MCP Clients&#xff09;&#xff1a;\u5728\u4e3b\u673a\u7a0b\u5e8f\u5185\u90e8&#xff0c;\u4e0e MCP \u670d\u52a1\u5668\u4fdd\u6301 1:1 \u7684\u8fde\u63a5\u3002 \u25cf MCP \u670d\u52a1\u5668&#xff08;MCP Servers&#xff09;&#xff1a;\u4e3a MCP \u5ba2\u6237\u7aef\u63d0\u4f9b\u4e0a\u4e0b\u6587\u3001\u5de5\u5177\u548c\u63d0\u793a\u4fe1\u606f\u3002 \u25cf \u672c\u5730\u8d44\u6e90&#xff08;Local Resources&#xff09;&#xff1a;\u672c\u5730\u8ba1\u7b97\u673a\u4e2d\u53ef\u4f9b MCP \u670d\u52a1\u5668\u5b89\u5168\u8bbf\u95ee\u7684\u8d44\u6e90&#xff0c;\u5982\u6587\u4ef6\u3001\u6570\u636e\u5e93\u3002 \u25cf \u8fdc\u7a0b\u8d44\u6e90&#xff08;Remote Resources&#xff09;&#xff1a;MCP \u670d\u52a1\u5668\u53ef\u4ee5\u8fde\u63a5\u5230\u7684\u8fdc\u7a0b\u8d44\u6e90&#xff0c;\u5982\u901a\u8fc7 API \u63d0\u4f9b\u7684\u6570\u636e\u3002<\/p>\n<h2>\u4e8c\u3001Java\u5b9e\u73b0MCP\u670d\u52a1\u5668\u7684\u6b65\u9aa4<\/h2>\n<h3>1. \u73af\u5883\u51c6\u5907<\/h3>\n<p>\u5f00\u53d1\u5de5\u5177&#xff1a;IntelliJ IDEA \/ Eclipse \u4f9d\u8d56\u7ba1\u7406&#xff1a;Maven\u6216Gradle \u7845\u57fa\u6d41\u52a8API&#xff1a; \u7845\u57fa\u6d41\u52a8\u5b98\u7f51 \u6ce8\u518c\u8d26\u53f7\u5e76\u751f\u6210API\u5bc6\u94a5,&#xff0c;\u6ce8\u518c\u5373\u8d60\u900114\u5143\u989d\u5ea6&#xff0c;\u7ea62000\u4e07\u514d\u8d39Token&#xff0c;\u65b9\u4fbf\u6d4b\u8bd5\u3002<\/p>\n<h3>2. \u521b\u5efaMCP\u670d\u52a1\u5668\u57fa\u7840\u6846\u67b6<\/h3>\n<p><span class=\"token keyword\">import<\/span> <span class=\"token import\"><span class=\"token namespace\">java<span class=\"token punctuation\">.<\/span>io<span class=\"token punctuation\">.<\/span><\/span><span class=\"token operator\">*<\/span><\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">import<\/span> <span class=\"token import\"><span class=\"token namespace\">java<span class=\"token punctuation\">.<\/span>util<span class=\"token punctuation\">.<\/span><\/span><span class=\"token class-name\">Scanner<\/span><\/span><span class=\"token punctuation\">;<\/span> <\/p>\n<p><span class=\"token keyword\">public<\/span> <span class=\"token keyword\">class<\/span> <span class=\"token class-name\">McpServer<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">public<\/span> <span class=\"token keyword\">static<\/span> <span class=\"token keyword\">void<\/span> <span class=\"token function\">main<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">String<\/span><span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span> args<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token keyword\">try<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token class-name\">BufferedReader<\/span> reader <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">BufferedReader<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">new<\/span> <span class=\"token class-name\">InputStreamReader<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">System<\/span><span class=\"token punctuation\">.<\/span>in<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n             <span class=\"token class-name\">PrintWriter<\/span> writer <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">PrintWriter<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">System<\/span><span class=\"token punctuation\">.<\/span>out<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>  <span class=\"token punctuation\">{<\/span><\/p>\n<p>            <span class=\"token class-name\">String<\/span> line<span class=\"token punctuation\">;<\/span><br \/>\n            <span class=\"token keyword\">while<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">(<\/span>line <span class=\"token operator\">&#061;<\/span> reader<span class=\"token punctuation\">.<\/span><span class=\"token function\">readLine<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>  <span class=\"token operator\">!&#061;<\/span> <span class=\"token keyword\">null<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n                <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>line<span class=\"token punctuation\">.<\/span><span class=\"token function\">startsWith<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;Content-Length:&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>  <span class=\"token punctuation\">{<\/span><br \/>\n                    <span class=\"token keyword\">int<\/span> length <span class=\"token operator\">&#061;<\/span> <span class=\"token class-name\">Integer<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">parseInt<\/span><span class=\"token punctuation\">(<\/span>line<span class=\"token punctuation\">.<\/span><span class=\"token function\">split<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;:&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">[<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">trim<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n                    <span class=\"token class-name\">String<\/span> payload <span class=\"token operator\">&#061;<\/span> reader<span class=\"token punctuation\">.<\/span><span class=\"token function\">readLine<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n                    <span class=\"token comment\">\/\/ \u5904\u7406MCP\u8bf7\u6c42<\/span><br \/>\n                    <span class=\"token function\">processRequest<\/span><span class=\"token punctuation\">(<\/span>payload<span class=\"token punctuation\">,<\/span> writer<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n                <span class=\"token punctuation\">}<\/span><br \/>\n            <span class=\"token punctuation\">}<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">catch<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token class-name\">IOException<\/span> e<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            e<span class=\"token punctuation\">.<\/span><span class=\"token function\">printStackTrace<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><\/p>\n<p>    <span class=\"token keyword\">private<\/span> <span class=\"token keyword\">static<\/span> <span class=\"token keyword\">void<\/span> <span class=\"token function\">processRequest<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">String<\/span> payload<span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">PrintWriter<\/span> writer<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token comment\">\/\/ \u89e3\u6790JSON\u8bf7\u6c42\u5e76\u8c03\u7528\u5bf9\u5e94\u5de5\u5177<\/span><br \/>\n        <span class=\"token comment\">\/\/ \u793a\u4f8b&#xff1a;\u8c03\u7528\u7845\u57fa\u6d41\u52a8API<\/span><br \/>\n        <span class=\"token class-name\">String<\/span> response <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">callSiliconFlowAPI<\/span><span class=\"token punctuation\">(<\/span>payload<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        writer<span class=\"token punctuation\">.<\/span><span class=\"token function\">println<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;Content-Length:  &#034;<\/span> <span class=\"token operator\">&#043;<\/span> response<span class=\"token punctuation\">.<\/span><span class=\"token function\">length<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        writer<span class=\"token punctuation\">.<\/span><span class=\"token function\">println<\/span><span class=\"token punctuation\">(<\/span>response<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        writer<span class=\"token punctuation\">.<\/span><span class=\"token function\">flush<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<h3>3. \u96c6\u6210\u7845\u57fa\u6d41\u52a8API<\/h3>\n<p>\u751f\u6210API\u5bc6\u94a5&#xff1a;\u5728 \u7845\u57fa\u6d41\u52a8 \u63a7\u5236\u53f0\u521b\u5efaAPI\u5bc6\u94a5\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250601045553-683bdd59cade9.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u8c03\u7528DeepSeek\u6a21\u578b&#xff1a;<\/p>\n<p><span class=\"token keyword\">private<\/span> <span class=\"token keyword\">static<\/span> <span class=\"token class-name\">String<\/span> <span class=\"token function\">callSiliconFlowAPI<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">String<\/span> query<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token class-name\">String<\/span> apiKey <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;YOUR_SILICONFLOW_API_KEY&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token class-name\">String<\/span> endpoint <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;https:\/\/api.siliconflow.cn\/v1\/chat\/completions&#034;<\/span><span class=\"token punctuation\">;<\/span> <\/p>\n<p>    <span class=\"token comment\">\/\/ \u6784\u5efa\u8bf7\u6c42\u4f53<\/span><br \/>\n    <span class=\"token class-name\">String<\/span> jsonBody <span class=\"token operator\">&#061;<\/span> <span class=\"token class-name\">String<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">format<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;{\\\\n&#034;<\/span><br \/>\n            <span class=\"token operator\">&#043;<\/span> <span class=\"token string\">&#034;  \\\\&#034;model\\\\&#034;: \\\\&#034;deepseek-ai\/DeepSeek-R1\\\\&#034;,\\\\n&#034;<\/span><br \/>\n            <span class=\"token operator\">&#043;<\/span> <span class=\"token string\">&#034;  \\\\&#034;messages\\\\&#034;: [{\\\\&#034;role\\\\&#034;: \\\\&#034;user\\\\&#034;, \\\\&#034;content\\\\&#034;: \\\\&#034;%s\\\\&#034;}]\\\\n&#034;<\/span><br \/>\n            <span class=\"token operator\">&#043;<\/span> <span class=\"token string\">&#034;}&#034;<\/span><span class=\"token punctuation\">,<\/span> query<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token comment\">\/\/ \u4f7f\u7528HttpClient\u53d1\u9001POST\u8bf7\u6c42<\/span><br \/>\n    <span class=\"token comment\">\/\/ &#xff08;\u9700\u6dfb\u52a0Java 11&#043;\u7684HttpClient\u4f9d\u8d56\u6216\u4f7f\u7528Apache HttpClient&#xff09;<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> <span class=\"token string\">&#034;AI\u54cd\u5e94\u5185\u5bb9&#034;<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token comment\">\/\/ \u5b9e\u9645\u5e94\u89e3\u6790API\u8fd4\u56de\u7ed3\u679c<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<h3>4. \u914d\u7f6eMCP\u5de5\u5177<\/h3>\n<p>\u5728\u9879\u76ee\u6839\u76ee\u5f55\u521b\u5efa.cursor\/mcp.json &#xff1a;<\/p>\n<p><span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token string-property property\">&#034;mcpServers&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token string-property property\">&#034;silicon-flow-server&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n      <span class=\"token string-property property\">&#034;command&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;java&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n      <span class=\"token string-property property\">&#034;args&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;-cp&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;target\/classes&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;McpServer&#034;<\/span><span class=\"token punctuation\">]<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<h2>\u4e09\u3001\u5173\u952e\u4ee3\u7801\u793a\u4f8b&#xff08;\u5de5\u5177\u66b4\u9732&#xff09;<\/h2>\n<p><span class=\"token comment\">\/\/ \u793a\u4f8b\u5de5\u5177&#xff1a;\u8c03\u7528\u7845\u57fa\u6d41\u52a8\u8fdb\u884c\u6587\u672c\u751f\u6210<\/span><br \/>\n<span class=\"token keyword\">public<\/span> <span class=\"token keyword\">class<\/span> <span class=\"token class-name\">SiliconFlowTool<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token annotation punctuation\">&#064;McpTool<\/span><span class=\"token punctuation\">(<\/span>name <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;text_generation&#034;<\/span><span class=\"token punctuation\">,<\/span> description <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;\u8c03\u7528DeepSeek\u6a21\u578b\u751f\u6210\u6587\u672c&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">public<\/span> <span class=\"token class-name\">String<\/span> <span class=\"token function\">generateText<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">String<\/span> prompt<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token comment\">\/\/ \u8c03\u7528callSiliconFlowAPI\u65b9\u6cd5<\/span><br \/>\n        <span class=\"token keyword\">return<\/span> <span class=\"token string\">&#034;\u751f\u6210\u7684\u6587\u672c\u5185\u5bb9&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<h2>\u56db\u3001\u6d4b\u8bd5\u4e0e\u9a8c\u8bc1<\/h2>\n<li>\u542f\u52a8\u670d\u52a1\u5668&#xff1a;<span class=\"token function\">java<\/span> <span class=\"token parameter variable\">-cp<\/span> target\/classes McpServer\n <\/li>\n<li>\u5728Cursor\u4e2d\u6d4b\u8bd5&#xff1a;agent<span class=\"token punctuation\">.<\/span>run<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034; \u8bf7\u8c03\u7528text_generation\u5de5\u5177\u751f\u6210\u4e00\u6bb5\u5173\u4e8eAI\u7684\u63cf\u8ff0&#034;<\/span><span class=\"token punctuation\">)<\/span>\n <\/li>\n<h2>\u4e94\u3001\u4f18\u5316\u5efa\u8bae<\/h2>\n<li>\u591a\u7ebf\u7a0b\u5904\u7406&#xff1a;\u4f7f\u7528ExecutorService\u63d0\u5347\u5e76\u53d1\u6027\u80fd\u3002<\/li>\n<li>\u9519\u8bef\u5904\u7406&#xff1a;\u6dfb\u52a0\u91cd\u8bd5\u673a\u5236\u548c\u8d85\u65f6\u63a7\u5236\u3002<\/li>\n<li>\u5b89\u5168\u589e\u5f3a&#xff1a;\u5b9e\u73b0JWT\u8eab\u4efd\u9a8c\u8bc1\u3002<\/li>\n<p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4&#xff0c;\u53ef\u5b9e\u73b0\u4e00\u4e2a\u57fa\u4e8eJava\u7684MCP\u670d\u52a1\u5668&#xff0c;\u96c6\u6210\u7845\u57fa\u6d41\u52a8API\u63d0\u4f9bAI\u80fd\u529b.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb751\u6b21\uff0c\u70b9\u8d5e13\u6b21\uff0c\u6536\u85cf14\u6b21\u3002MCP \u662f Anthropic (Claude) \u4e3b\u5bfc\u53d1\u5e03\u7684\u4e00\u4e2a\u5f00\u653e\u7684\u3001\u901a\u7528\u7684\u3001\u6709\u5171\u8bc6\u7684\u534f\u8bae\u6807\u51c6\u3002\u25cf MCP \u662f\u4e00\u4e2a\u6807\u51c6\u534f\u8bae\uff0c\u5c31\u50cf\u7ed9 AI \u5927\u6a21\u578b\u88c5\u4e86\u4e00\u4e2a \u201c\u4e07\u80fd\u63a5\u53e3\u201d\uff0c\u8ba9 AI \u6a21\u578b\u80fd\u591f\u4e0e\u4e0d\u540c\u7684\u6570\u636e\u6e90\u548c\u5de5\u5177\u8fdb\u884c\u65e0\u7f1d\u4ea4\u4e92\u3002\u5b83\u5c31\u50cf USB-C \u63a5\u53e3\u4e00\u6837\uff0c\u63d0\u4f9b\u4e86\u4e00\u79cd\u6807\u51c6\u5316\u7684\u65b9\u6cd5\uff0c\u5c06 AI \u6a21\u578b\u8fde\u63a5\u5230\u5404\u79cd\u6570\u636e\u6e90\u548c\u5de5\u5177\u3002\u25cf MCP \u65e8\u5728\u66ff\u6362\u788e\u7247\u5316\u7684 Agent \u4ee3\u7801\u96c6\u6210\uff0c\u4ece\u800c\u4f7f AI \u7cfb\u7edf\u66f4\u53ef\u9760\uff0c\u66f4\u6709\u6548\u3002<\/p>\n","protected":false},"author":2,"featured_media":41316,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[544,68,73,929],"topic":[],"class_list":["post-41318","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-ai","tag-deepseek","tag-mcp","tag-929"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u624b\u6495Java+\u7845\u57fa\u6d41\u52a8\u5b9e\u73b0MCP\u670d\u52a1\u5668\u6559\u7a0b - \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\/41318.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u624b\u6495Java+\u7845\u57fa\u6d41\u52a8\u5b9e\u73b0MCP\u670d\u52a1\u5668\u6559\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb751\u6b21\uff0c\u70b9\u8d5e13\u6b21\uff0c\u6536\u85cf14\u6b21\u3002MCP \u662f Anthropic (Claude) \u4e3b\u5bfc\u53d1\u5e03\u7684\u4e00\u4e2a\u5f00\u653e\u7684\u3001\u901a\u7528\u7684\u3001\u6709\u5171\u8bc6\u7684\u534f\u8bae\u6807\u51c6\u3002\u25cf MCP \u662f\u4e00\u4e2a\u6807\u51c6\u534f\u8bae\uff0c\u5c31\u50cf\u7ed9 AI \u5927\u6a21\u578b\u88c5\u4e86\u4e00\u4e2a \u201c\u4e07\u80fd\u63a5\u53e3\u201d\uff0c\u8ba9 AI \u6a21\u578b\u80fd\u591f\u4e0e\u4e0d\u540c\u7684\u6570\u636e\u6e90\u548c\u5de5\u5177\u8fdb\u884c\u65e0\u7f1d\u4ea4\u4e92\u3002\u5b83\u5c31\u50cf USB-C \u63a5\u53e3\u4e00\u6837\uff0c\u63d0\u4f9b\u4e86\u4e00\u79cd\u6807\u51c6\u5316\u7684\u65b9\u6cd5\uff0c\u5c06 AI \u6a21\u578b\u8fde\u63a5\u5230\u5404\u79cd\u6570\u636e\u6e90\u548c\u5de5\u5177\u3002\u25cf MCP \u65e8\u5728\u66ff\u6362\u788e\u7247\u5316\u7684 Agent \u4ee3\u7801\u96c6\u6210\uff0c\u4ece\u800c\u4f7f AI \u7cfb\u7edf\u66f4\u53ef\u9760\uff0c\u66f4\u6709\u6548\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/41318.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-06-01T04:55:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250601045553-683bdd59636ff.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=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/41318.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/41318.html\",\"name\":\"\u624b\u6495Java+\u7845\u57fa\u6d41\u52a8\u5b9e\u73b0MCP\u670d\u52a1\u5668\u6559\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-06-01T04:55:55+00:00\",\"dateModified\":\"2025-06-01T04:55:55+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/41318.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/41318.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/41318.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u624b\u6495Java+\u7845\u57fa\u6d41\u52a8\u5b9e\u73b0MCP\u670d\u52a1\u5668\u6559\u7a0b\"}]},{\"@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":"\u624b\u6495Java+\u7845\u57fa\u6d41\u52a8\u5b9e\u73b0MCP\u670d\u52a1\u5668\u6559\u7a0b - \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\/41318.html","og_locale":"zh_CN","og_type":"article","og_title":"\u624b\u6495Java+\u7845\u57fa\u6d41\u52a8\u5b9e\u73b0MCP\u670d\u52a1\u5668\u6559\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb751\u6b21\uff0c\u70b9\u8d5e13\u6b21\uff0c\u6536\u85cf14\u6b21\u3002MCP \u662f Anthropic (Claude) \u4e3b\u5bfc\u53d1\u5e03\u7684\u4e00\u4e2a\u5f00\u653e\u7684\u3001\u901a\u7528\u7684\u3001\u6709\u5171\u8bc6\u7684\u534f\u8bae\u6807\u51c6\u3002\u25cf MCP \u662f\u4e00\u4e2a\u6807\u51c6\u534f\u8bae\uff0c\u5c31\u50cf\u7ed9 AI \u5927\u6a21\u578b\u88c5\u4e86\u4e00\u4e2a \u201c\u4e07\u80fd\u63a5\u53e3\u201d\uff0c\u8ba9 AI \u6a21\u578b\u80fd\u591f\u4e0e\u4e0d\u540c\u7684\u6570\u636e\u6e90\u548c\u5de5\u5177\u8fdb\u884c\u65e0\u7f1d\u4ea4\u4e92\u3002\u5b83\u5c31\u50cf USB-C \u63a5\u53e3\u4e00\u6837\uff0c\u63d0\u4f9b\u4e86\u4e00\u79cd\u6807\u51c6\u5316\u7684\u65b9\u6cd5\uff0c\u5c06 AI \u6a21\u578b\u8fde\u63a5\u5230\u5404\u79cd\u6570\u636e\u6e90\u548c\u5de5\u5177\u3002\u25cf MCP \u65e8\u5728\u66ff\u6362\u788e\u7247\u5316\u7684 Agent \u4ee3\u7801\u96c6\u6210\uff0c\u4ece\u800c\u4f7f AI \u7cfb\u7edf\u66f4\u53ef\u9760\uff0c\u66f4\u6709\u6548\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/41318.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-06-01T04:55:55+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250601045553-683bdd59636ff.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/41318.html","url":"https:\/\/www.wsisp.com\/helps\/41318.html","name":"\u624b\u6495Java+\u7845\u57fa\u6d41\u52a8\u5b9e\u73b0MCP\u670d\u52a1\u5668\u6559\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-06-01T04:55:55+00:00","dateModified":"2025-06-01T04:55:55+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/41318.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/41318.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/41318.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u624b\u6495Java+\u7845\u57fa\u6d41\u52a8\u5b9e\u73b0MCP\u670d\u52a1\u5668\u6559\u7a0b"}]},{"@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\/41318","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=41318"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/41318\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/41316"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=41318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=41318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=41318"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=41318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}