{"id":82949,"date":"2026-07-25T14:50:50","date_gmt":"2026-07-25T06:50:50","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/82949.html"},"modified":"2026-07-25T14:50:50","modified_gmt":"2026-07-25T06:50:50","slug":"ai-agent-10-mcp%e5%9f%ba%e7%a1%80%ef%bc%9a%e5%bf%ab%e9%80%9f%e7%bc%96%e5%86%99%e4%bd%a0%e8%87%aa%e5%b7%b1%e7%9a%84mcp%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%88server%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/82949.html","title":{"rendered":"[Ai Agent] 10 MCP\u57fa\u7840\uff1a\u5feb\u901f\u7f16\u5199\u4f60\u81ea\u5df1\u7684MCP\u670d\u52a1\u5668\uff08Server\uff09"},"content":{"rendered":"<p>\u00a0\u535a\u5ba2\u914d\u5957\u4ee3\u7801\u53d1\u5e03\u4e8egithub&#xff1a;10 MCP \u57fa\u7840<\/p>\n<p>\u76f8\u5173Agent\u4e13\u680f&#xff1a;Ai Agent\u6559\u5b66<\/p>\n<p>\u672c\u7cfb\u5217\u6240\u6709\u535a\u5ba2\u5747\u914d\u5957Gihub\u5f00\u6e90\u4ee3\u7801&#xff0c;\u5f00\u7bb1\u5373\u7528&#xff0c;\u4ec5\u9700\u914d\u7f6eAPI_KEY\u3002<\/p>\n<p>\u5982\u679c\u8be5Agent\u6559\u5b66\u7cfb\u5217\u5e2e\u5230\u4e86\u4f60&#xff0c;\u6b22\u8fce\u7ed9\u6211\u4e2aStar\u2b50&#xff01;<\/p>\n<p>\u77e5\u8bc6\u70b9&#xff1a;Stdio\u4f20\u8f93 | Streamable HTTP | FastMCP\u6846\u67b6 | Transport\u901a\u4fe1<\/p>\n<hr \/>\n<h3>\u5e8f\u7ae0&#xff1a;\u4ece\u201c\u9020\u8f6e\u5b50\u201d\u5230\u201c\u63d2 USB\u201d<\/h3>\n<p>\u5728\u7b2c 07 \u7bc7\u4e2d&#xff0c;\u4e3a\u4e86\u8ba9 Agent \u80fd\u67e5\u8be2\u5929\u6c14&#xff0c;\u6211\u4eec\u624b\u5199\u4e86\u4e00\u4e2a get_weather\u00a0\u51fd\u6570&#xff0c;\u5e76\u7528 &#064;tool\u00a0\u88c5\u9970\u5668\u5c06\u5176\u6ce8\u518c\u4e3a\u5de5\u5177\u3002<\/p>\n<p>\u4f46\u73b0\u5b9e\u9700\u6c42\u8fdc\u4e0d\u6b62\u4e8e\u6b64&#xff1a;<\/p>\n<ul>\n<li>\u60f3\u67e5\u9ad8\u5fb7\u5730\u56fe\u7684\u9a7e\u8f66\u8def\u7ebf&#xff1f;<\/li>\n<li>\u60f3\u901a\u8fc7 GitHub \u81ea\u52a8\u521b\u5efa Issue&#xff1f;<\/li>\n<li>\u60f3\u7528\u98de\u4e66\u673a\u5668\u4eba\u53d1\u9001\u901a\u77e5&#xff1f;<\/li>\n<\/ul>\n<p>\u96be\u9053\u6211\u4eec\u8981\u4e3a\u6bcf\u4e00\u4e2a\u670d\u52a1\u53bb\u9605\u8bfb API \u6587\u6863\u3001\u5904\u7406\u8ba4\u8bc1\u3001\u5c01\u88c5\u9519\u8bef\u3001\u7ef4\u62a4\u7248\u672c&#xff0c;\u518d\u624b\u5199\u51e0\u767e\u4e2a &#064;tool\u00a0 \u51fd\u6570\u5417&#xff1f;<\/p>\n<p>\u8fd9\u6b63\u662f \u201c\u5de5\u5177\u5b64\u5c9b\u201d\u95ee\u9898\u2014\u2014\u6bcf\u4e2a Agent \u90fd\u5728\u91cd\u590d\u9020\u8f6e\u5b50&#xff0c;\u65e0\u6cd5\u5171\u4eab\u3001\u96be\u4ee5\u590d\u7528\u3001\u7ef4\u62a4\u6210\u672c\u6781\u9ad8\u3002<\/p>\n<p>Model Context Protocol&#xff08;MCP&#xff09;\u7684\u8bde\u751f&#xff0c;\u5c31\u662f\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002<\/p>\n<p>MCP \u628a\u5de5\u5177\u5265\u79bb\u51fa\u6765&#xff0c;\u653e\u5230\u72ec\u7acb\u7684Server\u91cc&#xff1a;<\/p>\n<ul>\n<li>\u5b83\u53ef\u4ee5\u662f\u4e2a USB \u8bbe\u5907&#xff08;\u652f\u6301 Stdio \u63d2\u62d4&#xff09;&#xff1b;<\/li>\n<li>\u4e5f\u53ef\u4ee5\u662f\u4e2a Wifi \u70ed\u70b9 &#xff08;\u652f\u6301 HTTP \u8fde\u63a5&#xff09;\u3002<\/li>\n<\/ul>\n<p>\u6709\u4e86MCP\u7684Agent&#xff0c;\u624d\u53ef\u4ee5\u81ea\u7531\u8c03\u7528\u6210\u767e\u4e0a\u5343\u4e2a\u5de5\u5177&#xff0c;\u8ba9Agent\u7684\u80fd\u529b\u98de\u901f\u6269\u5f20\u3002<\/p>\n<p>\u5bf9\u4e8eMCP\u7684\u57fa\u7840\u7bc7\u4e0e\u8fdb\u9636\u7bc7&#xff0c;\u6211\u4eec\u5c06\u9010\u4e2a\u5b66\u4e60MCP\u7684\u670d\u52a1\u7aef\u4e0e\u5ba2\u6237\u7aef\u642d\u5efa\u3002<\/p>\n<h3><\/h3>\n<hr \/>\n<h3>\u4e00\u3001\u4e3a\u4ec0\u4e48\u5148\u5b66\u670d\u52a1\u7aef<\/h3>\n<p>\u6309\u5e38\u7406&#xff0c;\u6211\u4eec\u6216\u8bb8\u5e94\u8be5\u5148\u5b66\u4f1a\u201c\u5982\u4f55\u63a5\u5165\u522b\u4eba\u7684 MCP \u670d\u52a1\u201d&#xff08;\u5ba2\u6237\u7aef&#xff09;&#xff0c;\u518d\u5b66\u4e60\u201c\u5982\u4f55\u53d1\u5e03\u81ea\u5df1\u7684\u670d\u52a1\u201d&#xff08;\u670d\u52a1\u7aef&#xff09;\u3002 \u4f46\u5728 MCP \u7684\u5b66\u4e60\u8def\u5f84\u4e2d&#xff0c;\u8fd9\u4e2a\u987a\u5e8f\u6070\u6070\u5e94\u8be5\u53cd\u8fc7\u6765\u3002 \u539f\u56e0\u5f88\u7b80\u5355&#xff1a;<\/p>\n<p>\u670d\u52a1\u7aef\u9002\u5408\u201c\u6781\u901f\u4e0a\u624b\u201d&#xff0c;\u800c\u5ba2\u6237\u7aef\u9002\u5408\u201c\u6df1\u5ea6\u8fdb\u9636\u201d\u3002<\/p>\n<hr \/>\n<p>\u2705 \u670d\u52a1\u7aef&#xff1a;\u6781\u4f4e\u95e8\u69db&#xff0c;\u6240\u89c1\u5373\u6240\u5f97<\/p>\n<p>\u5f97\u76ca\u4e8e\u00a0FastMCP\u00a0\u8fd9\u6837\u9ad8\u8d28\u91cf\u6846\u67b6\u7684\u5b58\u5728&#xff0c;\u670d\u52a1\u7aef\u7684\u5f00\u53d1\u5df2\u7ecf\u53d8\u5f97\u6781\u5176\u7b80\u5355\u3002\u4f60\u4e0d\u9700\u8981\u5904\u7406\u590d\u6742\u7684\u534f\u8bae\u63e1\u624b&#xff0c;\u53ea\u9700\u5199\u4e00\u4e2a\u5e26\u7c7b\u578b\u63d0\u793a\u7684\u666e\u901a Python \u51fd\u6570&#xff0c;\u52a0\u4e2a\u88c5\u9970\u5668&#xff0c;\u5b83\u5c31\u7acb\u523b\u53d8\u6210\u4e86\u4e00\u4e2a\u6807\u51c6\u5de5\u5177\u3002\u914d\u5408 CherryStudio \u8fd9\u6837\u7684\u53ef\u89c6\u5316\u5ba2\u6237\u7aef&#xff0c;\u4f60\u80fd\u7acb\u523b\u770b\u5230\u81ea\u5df1\u7684\u4ee3\u7801\u8dd1\u8d77\u6765&#xff0c;\u83b7\u5f97\u6781\u5f3a\u7684\u6b63\u53cd\u9988\u3002<\/p>\n<p>\u26a0\ufe0f \u5ba2\u6237\u7aef&#xff1a;\u4e0d\u4ec5\u662f\u8c03\u7528&#xff0c;\u66f4\u662f\u67b6\u6784<\/p>\n<p>\u867d\u7136\u793e\u533a\u5df2\u7ecf\u51fa\u73b0\u4e86\u5982 langchain-mcp-adapters  \u8fd9\u6837\u7684\u5c01\u88c5\u5e93&#xff0c;\u80fd\u8ba9\u4f60\u4e00\u952e\u8fde\u63a5\u3002\u4f46\u4f5c\u4e3aAgent \u5168\u6808\u5de5\u7a0b\u5e08&#xff0c;\u5982\u679c\u53ea\u5b66\u4f1a\u8c03\u7528\u4e00\u4e2a\u5c01\u88c5\u597d\u7684\u00a0load_tools()\u00a0\u51fd\u6570&#xff0c;\u4f60\u6c38<\/p>\n<p>\u8fdc\u65e0\u6cd5\u7406\u89e3 MCP \u7684\u771f\u6b63\u5a01\u529b&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u5b83\u662f\u5982\u4f55\u8de8\u8d8a\u8fdb\u7a0b&#xff08;Stdio&#xff09;\u4e0e Node.js \u670d\u52a1\u5bf9\u8bdd\u7684&#xff1f;<\/p>\n<\/li>\n<li>\n<p>\u5b83\u662f\u5982\u4f55\u901a\u8fc7 HTTP (SSE) \u5b9e\u73b0\u8fdc\u7a0b\u6d41\u5f0f\u4f20\u8f93\u7684&#xff1f;<\/p>\n<\/li>\n<li>\n<p>\u5f53\u8fde\u63a5\u65ad\u5f00\u6216\u62a5\u9519\u65f6&#xff0c;\u5982\u4f55\u4f18\u96c5\u5730\u5904\u7406\u8d44\u6e90\u91ca\u653e&#xff1f;<\/p>\n<\/li>\n<\/ul>\n<p>\u8fd9\u4e9b\u5e95\u5c42\u901a\u4fe1\u673a\u5236\u548c\u751f\u547d\u5468\u671f\u7ba1\u7406&#xff0c;\u88ab\u5c01\u88c5\u5e93\u5b8c\u7f8e\u5730\u201c\u9690\u85cf\u201d\u4e86\u3002 \u6b63\u56e0\u5982\u6b64&#xff0c;\u5b98\u65b9\u548c\u4e3b\u6d41\u5de5\u5177&#xff08;\u5982 Cursor\u3001Trae&#xff09;\u90fd\u9f13\u52b1\u4f60\u5148\u6210\u4e3a\u201c\u5de5\u5177\u63d0\u4f9b\u8005\u201d\u3002<\/p>\n<p>\u56e0\u6b64&#xff0c;\u6211\u4eec\u7684\u7b56\u7565\u662f&#xff1a;<\/p>\n<li>\n<p>\u5148\u653b\u670d\u52a1\u7aef (\u672c\u7ae0)&#xff1a;\u5229\u7528\u00a0FastMCP\u00a0\u7684\u4fbf\u5229\u6027&#xff0c;5\u5206\u949f\u6784\u5efa\u51fa\u53ef\u7528\u7684\u5de5\u5177&#xff0c;\u5efa\u7acb\u4fe1\u5fc3&#xff0c;\u7406\u89e3 MCP \u7684\u201c\u53cc\u6a21\u201d&#xff08;Stdio\/HTTP&#xff09;\u5f62\u6001\u3002<\/p>\n<\/li>\n<li>\n<p>\u540e\u78e8\u5ba2\u6237\u7aef (\u4e0b\u4e00\u7ae0)&#xff1a;\u4e0d\u6ee1\u8db3\u4e8e\u201c\u8c03\u5305\u201d&#xff0c;\u6211\u4eec\u5c06\u4eb2\u624b\u62c6\u89e3\u901a\u4fe1\u9ed1\u76d2&#xff0c;\u624b\u5199\u4e00\u4e2a\u751f\u4ea7\u7ea7\u7684\u53cc\u6a21\u5ba2\u6237\u7aef\u3002\u53ea\u6709\u9020\u8fc7\u4e00\u6b21\u8f6e\u5b50&#xff0c;\u4f60\u624d\u6709\u8d44\u683c\u8bf4\u81ea\u5df1\u201c\u7cbe\u901a\u201d\u4e86 MCP \u67b6\u6784\u3002&#xff08;\u5f53\u7136&#xff0c;\u5728\u5f7b\u5e95\u7406\u89e3\u539f\u7406\u540e&#xff0c;\u6211\u4eec\u4e5f\u4f1a\u4ecb\u7ecd\u5b98\u65b9\u5e93\u4f5c\u4e3a\u751f\u4ea7\u73af\u5883\u7684\u66ff\u4ee3\u65b9\u6848&#xff09;\u3002<\/p>\n<\/li>\n<h3>\u4e8c\u3001\u6781\u901f\u4e0a\u624b&#xff1a;\u5f00\u53d1\u7b2c\u4e00\u4e2a\u57fa\u4e8eFastMCP\u7684Stdio Server<\/h3>\n<p>\u6211\u4eec\u5148\u4ece\u6700\u7b80\u5355\u7684\u5f00\u59cb&#xff1a;\u672c\u5730\u7ba1\u9053\u6a21\u5f0f&#xff08;Stdio&#xff09;\u3002<\/p>\n<p>\u8fd9\u662fCursor\u3001Trae\u00a0\u7b49\u672c\u5730\u5e94\u7528\u8fde\u63a5\u5de5\u5177\u7684\u6807\u51c6\u65b9\u5f0f\u3002<\/p>\n<p>\u5728\u6ca1\u6709\u6846\u67b6\u4e4b\u524d&#xff0c;\u6211\u4eec\u5199MCP Server\u9700\u8981\u5904\u7406\u5404\u79cd\u590d\u6742\u7684\u534f\u8bae\u683c\u5f0f\u3002\u4f46\u501f\u52a9FastMCP&#xff0c;\u6211\u4eec\u53ea\u9700\u4f1a\u5199Python\u51fd\u6570\u5373\u53ef&#xff1a;<\/p>\n<p> # stdio_server.py<br \/>\nfrom mcp.server.fastmcp import FastMCP<\/p>\n<p># \u521d\u59cb\u5316\u670d\u52a1<br \/>\n# WeatherService \u662f\u670d\u52a1\u7684\u540d\u5b57<br \/>\nmcp &#061; FastMCP(&#034;WeatherService&#034;)<\/p>\n<p># \u4e1a\u52a1\u903b\u8f91\u5de5\u5177<br \/>\n&#064;mcp.tool()<br \/>\nasync def get_weather(city:str):<br \/>\n    &#034;&#034;&#034;<br \/>\n    \u67e5\u8be2\u6307\u5b9a\u57ce\u5e02\u7684\u5b9e\u65f6\u5929\u6c14\u3002<br \/>\n    \u5982\u679c\u662f\u6b64\u65f6\u6b64\u523b\u7684\u5929\u6c14\u8bf7\u6c42&#xff0c;\u8c03\u7528\u6b64\u5de5\u5177\u3002<br \/>\n    &#034;&#034;&#034;<br \/>\n    # \u6a21\u62df\u771f\u5b9e\u7684\u7f51\u7edc\u8bf7\u6c42(\u4f60\u53ef\u4ee5\u6362\u6210\u81ea\u5df1\u7684\u5929\u6c14API)<br \/>\n    # \u5728MCP\u4e2d&#xff0c;\u5de5\u5177\u51fd\u6570\u53ef\u4ee5\u662fasync\u7684&#xff0c;FastMCP\u4f1a\u81ea\u52a8\u5904\u7406<br \/>\n    return f&#034;{city}\u7684\u5929\u6c14\u662f:\u6674&#xff0c;\u6c14\u6e2925\u2103&#xff0c;\u98ce\u529b3\u7ea7&#034;<\/p>\n<p># \u542f\u52a8\u5165\u53e3<br \/>\nif __name__ &#061;&#061; &#039;__main__&#039;:<br \/>\n    # \u9ed8\u8ba4\u8fd0\u884c\u65b9\u5f0f:Stdio(\u6807\u51c6\u8f93\u5165\u8f93\u51fa)<br \/>\n    # \u8fd9\u79cd\u6a21\u5f0f\u4e0b&#xff0c;\u7a0b\u5e8f\u542f\u52a8\u540e\u4f1a\u201c\u6302\u8d77\u201d\u7b49\u5f85\u6307\u4ee4&#xff0c;\u4e0d\u4f1a\u6709\u4efb\u4f55\u6253\u5370\u8f93\u51fa\u3002<br \/>\n    mcp.run() <\/p>\n<p>\u4ee3\u7801\u89e3\u6790&#xff1a;<\/p>\n<ul>\n<li>1. \u81ea\u52a8Schema\u751f\u6210&#xff1a;\n<ul>\n<li>\u770b\u4ee3\u7801\u4e2d\u7684city:str\u3002FastMCP \u4f1a\u81ea\u52a8\u8bfb\u53d6\u8fd9\u4e9b\u7c7b\u578b\u6ce8\u91ca&#xff08;Type Hints&#xff09;\u3002\u751f\u6210JSON Schema \u544a\u8bc9 LLM&#xff1a;\u201c\u8fd9\u4e2a\u5de5\u5177\u9700\u8981\u4e00\u4e2a\u5b57\u7b26\u4e32\u7c7b\u578b\u7684city\u53c2\u6570\u2019\u201d\u3002<\/li>\n<li>\u5207\u8bb0&#xff1a;\u5199MCP\u5de5\u5177&#xff0c;\u5fc5\u987b\u5199 Type Hints&#xff0c;\u4e0d\u7136LLM\u4e0d\u77e5\u9053\u5982\u4f55\u8c03\u7528\u3002<\/li>\n<\/ul>\n<\/li>\n<li>2. Docstring \u8bf4\u660e\u4e66&#xff1a;\n<ul>\n<li>\u51fd\u6570\u4e0b\u65b9\u7684\u6ce8\u91ca&#xff08;&#034;&#034;&#034;\u67e5\u8be2\u6307\u5b9a&#8230;&#034;&#034;&#034;&#xff09;\u4f1a\u88ab\u81ea\u52a8\u63d0\u53d6\u4e3a\u6587\u6863\u63cf\u8ff0\u3002LLM \u9760\u8fd9\u4e2a\u6765\u51b3\u5b9a\u4ec0\u4e48\u60c5\u51b5\u4e0b\u8c03\u7528\u8fd9\u4e2a\u5de5\u5177\u3002<\/li>\n<\/ul>\n<\/li>\n<li>3. Stdio \u7ba1\u9053\u8fde\u63a5&#xff1a;\n<ul>\n<li>mcp.run() \u9ed8\u8ba4\u5f00\u542f Stdio\u6a21\u5f0f\u3002\u6b64\u65f6 FastMCP \u4f1a\u63a5\u7ba1\u6807\u51c6\u8f93\u5165\/\u8f93\u51fa&#xff0c;\u5c06MCP\u6d88\u606f\u901a\u8fc7JSON\u6d41\u5904\u7406\u3002<\/li>\n<li>\u5c3d\u91cf\u4e0d\u8981\u5728Server\u6216\u5de5\u5177\u51fd\u6570\u4e2d\u968f\u610f\u4f7f\u7528print()\u8f93\u51fa\u6d88\u606f&#xff0c;\u56e0\u4e3aStdout \u662f MCP\u534f\u8bae\u901a\u9053&#xff0c;\u968f\u610f\u8f93\u51fa\u4f1a\u7834\u574f\u6d88\u606f\u683c\u5f0f&#xff0c;\u5bfc\u81f4\u5ba2\u6237\u7aef\u89e3\u6790\u5931\u8d25\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>\u4e09\u3001\u6d4b\u8bd5MCP\u94fe\u63a5&#xff1a;CherryStudio\u521d\u4f53\u9a8c<\/h3>\n<p>Server \u4ee3\u7801\u5199\u597d\u4e86&#xff0c;\u5199\u8d77\u6765\u611f\u89c9\u975e\u5e38\u7b80\u5355&#xff0c;\u4f46\u6211\u4eec\u600e\u4e48\u77e5\u9053\u5b83\u80fd\u4e0d\u80fd\u7528&#xff1f;\u6211\u4eec\u8fd8\u6ca1\u5199 Client \u6d4b\u8bd5\u4ee3\u7801&#xff08;\u90a3\u662f\u4e0b\u4e00\u7ae0\u7684\u4e8b&#xff09;\u3002\u8fd9\u65f6\u5019&#xff0c;\u73b0\u6210\u7684Cherry Studio\u4f5c\u4e3a\u76ee\u524d\u5bf9MCP\u652f\u6301\u6700\u597d\u7684\u5ba2\u6237\u7aef\u4e4b\u4e00&#xff0c;\u5c31\u662f\u975e\u5e38\u597d\u7684\u8c03\u8bd5\u5668&#xff1a;<\/p>\n<h4>1. \u4e0b\u8f7d\u4e0e\u5b89\u88c5<\/h4>\n<p>\u70b9\u5f00\u00a0https:\/\/www.cherry-ai.com\/\u00a0&#xff0c;<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"436\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725065047-6a645cc7279a1.png\" width=\"1403\" \/>\u200b\u200b<\/p>\n<p>\u4e0b\u8f7d\u8be5\u6587\u4ef6\u5e76\u5b89\u88c5\u597d&#xff08;\u5b89\u88c5\u6d41\u7a0b\u975e\u5e38\u7b80\u6613&#xff09;\u3002<\/p>\n<h4>\u00a02. \u914d\u7f6eMCP<\/h4>\n<p>\u4e0b\u8f7d\u597d\u540e&#xff0c;\u70b9\u51fb\u53f3\u4e0a\u89d2\u8bbe\u7f6e&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"370\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725065047-6a645cc76dd2c.png\" width=\"585\" \/>\u200b\u200b<\/p>\n<p>\u70b9\u51fbMCP\u8fdb\u5230\u8fd9\u91cc&#xff0c;\u518d\u70b9\u51fb\u6dfb\u52a0-\u5feb\u901f\u521b\u5efa&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"560\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725065047-6a645cc7c4ebf.png\" width=\"1410\" \/>\u200b\u200b<\/p>\n<p>\u5728\u8fd9\u91cc&#xff0c;\u6211\u4eec\u628a\u5982\u4e0b\u4fe1\u606f\u586b\u5145\u5b8c\u6574&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u7c7b\u578b (Type)&#xff1a;stdio\u00a0 |\u00a0 \u901a\u4fe1\u65b9\u5f0f<\/p>\n<\/li>\n<li>\n<p>\u540d\u79f0 (Name)&#xff1a;Weather-Local\u00a0 | MCP\u5de5\u5177\u540d<\/p>\n<\/li>\n<li>\n<p>\u547d\u4ee4 (Command)&#xff1a; python.exe\u7684\u7edd\u5bf9\u8def\u5f84\u00a0 |\u00a0 \u542f\u52a8py\u811a\u672c\u7684\u89e3\u91ca\u5668\u00a0<\/p>\n<\/li>\n<li>\n<p>\u53c2\u6570 (Args)&#xff1a;\u7edd\u5bf9\u8def\u5f84\/path\/to\/weather_server.py\u00a0 |\u00a0 \u4f60\u7684\u670d\u52a1\u5668\u672c\u5730\u4f4d\u7f6e<\/p>\n<\/li>\n<\/ul>\n<p>\u26a0\ufe0f \u5982\u679c\u4f60\u7684python.exe\u89e3\u91ca\u5668\u662f\u5728venv\u73af\u5883\u4e0b&#xff0c;\u4e00\u5b9a\u8981\u660e\u786e\u6307\u5b9a\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"850\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725065048-6a645cc80ac1d.png\" width=\"1440\" \/>\u200b\u200b\u5982\u56fe&#xff0c;\u914d\u7f6e\u5b8c\u6210\u540e&#xff0c;\u5148\u6309\u4fdd\u5b58&#xff0c;\u5e76\u6309\u786e\u8ba4&#xff1a;<\/p>\n<p>\u00a0<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"139\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725065048-6a645cc85b588.png\" width=\"321\" \/>\u200b\u200b\u5f53\u770b\u5230\u6709\u5de5\u5177\u4e0e\u5c0f\u7248\u672c\u53f7\u65f6&#xff0c;\u610f\u5473\u7740\u4f60\u5df2\u8fde\u63a5\u6210\u529f\u3002<\/p>\n<p>\u8fd4\u56de\u9996\u9875&#xff0c;\u6211\u4eec\u6d4b\u8bd5\u4e0b\u6548\u679c&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"341\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725065048-6a645cc867cdf.png\" width=\"1266\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"473\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725065048-6a645cc88eff4.png\" width=\"428\" \/>\u200b\u200b\u6d4b\u8bd5\u6210\u529f\u3002<\/p>\n<p>\u26a0\ufe0f\u00a0 \u63a8\u8350\u8fd9\u91cc\u4f7f\u7528Qween3\u4f5c\u4e3a\u6d4b\u8bd5\u6a21\u578b&#xff0c;\u9ed8\u8ba4\u7684GLM-4.5\u5bf9MCP\u652f\u6301\u6709\u70b9\u5c0f\u95ee\u9898\u3002<\/p>\n<p>\u5728\u8fd9\u91cc&#xff0c;\u4f60\u53ef\u4ee5\u5c1d\u8bd5\u53cd\u590d\u4fee\u6539\u4f60\u7684MCP\u670d\u52a1\u5668&#xff0c;\u5e76\u4e0d\u65ad\u5f00\u5173MCP\u6309\u94ae&#xff0c;\u6765\u6d4b\u8bd5MCP\u7684\u8fde\u63a5\u6548\u679c\u5982\u4f55\u3002<\/p>\n<h3>\u56db\u3001\u7406\u89e3MCP\u7684 Transport\u00a0\u901a\u4fe1\u673a\u5236<\/h3>\n<p>\u5728\u4e0a\u4e00\u8282\u4e2d&#xff0c;\u6211\u4eec\u6210\u529f\u4f7f\u7528 Stdio \u6a21\u5f0f \u542f\u52a8\u4e86\u4e00\u4e2a\u672c\u5730 MCP Server\u3002\u4f60\u53ef\u80fd\u4f1a\u7591\u60d1&#xff1a;<\/p>\n<p>\u201c\u65e2\u7136 Stdio \u662f\u672c\u5730\u901a\u4fe1&#xff0c;\u4e3a\u4ec0\u4e48\u6211\u7528 npx &#064;amap\/&#8230; \u65f6&#xff0c;\u611f\u89c9\u50cf\u662f\u2018\u8fdc\u7a0b\u8c03\u7528\u4e86\u9ad8\u5fb7\u5730\u56fe\u2019&#xff1f;\u201d<\/p>\n<p>\u5176\u5b9e&#xff0c;\u8fd9\u79cd\u201c\u8fdc\u7a0b\u611f\u201d\u662f\u4e00\u79cd\u90e8\u7f72\u5c42\u9762\u7684\u9519\u89c9&#xff0c;\u901a\u4fe1\u672c\u8eab\u4ecd\u662f\u7eaf\u672c\u5730\u7684\u3002\u4e0b\u9762\u6211\u4eec\u5c31\u6765\u5f7b\u5e95\u5398\u6e05 Stdio \u4e0e Streamable HTTP \u7684\u672c\u8d28\u533a\u522b\u3002<\/p>\n<h4>1. Stdio&#xff1a;\u771f\u6b63\u7684\u672c\u5730\u8fdb\u7a0b\u95f4\u901a\u4fe1&#xff08;IPC&#xff09;<\/h4>\n<p>Stdio&#xff08;Standard Input\/Output&#xff09;\u7684\u672c\u8d28\u662f \u7236\u5b50\u8fdb\u7a0b\u4e4b\u95f4\u7684\u533f\u540d\u7ba1\u9053\u901a\u4fe1\u3002\u5b83\u4e0d\u7ecf\u8fc7\u7f51\u7edc\u534f\u8bae\u6808&#xff0c;\u5b8c\u5168\u5728\u64cd\u4f5c\u7cfb\u7edf\u5185\u5b58\u4e2d\u5b8c\u6210\u6570\u636e\u4ea4\u6362\u3002<\/p>\n<h5>\u573a\u666f\u4e00&#xff1a;\u7eaf\u672c\u5730\u5f00\u53d1&#xff08;\u524d\u6587\u6240\u7528\u7684\u65b9\u6cd5&#xff09;<\/h5>\n<ul>\n<li>\u8fd0\u884c python weather_server.py\u00a0<\/li>\n<li>\u5ba2\u6237\u7aef&#xff08;\u5982 CherryStudio&#xff09;\u901a\u8fc7subprocess\u00a0\u542f\u52a8\u8be5\u811a\u672c<\/li>\n<li>\u53cc\u65b9\u901a\u8fc7 stdin\/stdout \u4ea4\u6362 JSON-RPC \u6d88\u606f<\/li>\n<li>\u2705 \u96f6\u7f51\u7edc\u5f00\u9500&#xff0c;\u5ef6\u8fdf\u6781\u4f4e&#xff08;~0.01ms&#xff09;<\/li>\n<li>\u274c \u4ec5\u9650\u540c\u4e00\u53f0\u673a\u5668<\/li>\n<\/ul>\n<h5>\u573a\u666f\u4e8c&#xff1a;\u201c\u4f2a\u8fdc\u7a0b\u201d\u2014\u2014\u901a\u8fc7 npx\/uvx\u00a0\u4e34\u65f6\u6267\u884c<\/h5>\n<p>\u5f53\u4f60\u6267\u884c&#xff1a;<\/p>\n<p> npx &#064;amap\/amap-maps-mcp-server YOUR_KEY <\/p>\n<p>\u5b9e\u9645\u53d1\u751f\u4e86\u4e09\u6b65&#xff1a;<\/p>\n<li>\u8054\u7f51\u4e0b\u8f7d&#xff08;\u4e00\u6b21\u6027&#xff09;&#xff1a;npx\u00a0\u4ece npm \u4ed3\u5e93\u62c9\u53d6\u5305\u5e76\u7f13\u5b58\u5230\u672c\u5730&#xff1b;<\/li>\n<li>\u672c\u5730\u542f\u52a8&#xff1a;\u5728\u4f60\u7684\u673a\u5668\u4e0a\u7acb\u5373\u8fd0\u884c\u8fd9\u4e2a Node.js \u811a\u672c&#xff0c;\u751f\u6210\u4e00\u4e2a\u5b50\u8fdb\u7a0b&#xff1b;<\/li>\n<li>Stdio \u901a\u4fe1&#xff1a;\u5ba2\u6237\u7aef\u901a\u8fc7 stdin\/stdout \u4e0e\u8fd9\u4e2a\u672c\u5730\u5b50\u8fdb\u7a0b\u5bf9\u8bdd\u3002<\/li>\n<p>&#x1f511; \u5173\u952e\u70b9&#xff1a;\u65e0\u8bba\u4ee3\u7801\u6765\u81ea\u54ea\u91cc&#xff0c;\u53ea\u8981\u7528 Stdio \u542f\u52a8&#xff0c;\u670d\u52a1\u7aef\u8fdb\u7a0b\u5c31\u4e00\u5b9a\u8fd0\u884c\u5728\u4f60\u7684\u672c\u5730\u673a\u5668\u4e0a\u3002<\/p>\n<p>\u56e0\u6b64&#xff0c;\u8fd9\u4ecd\u7136\u662f \u672c\u5730 IPC&#xff0c;\u53ea\u662f\u201c\u5de5\u5177\u6765\u6e90\u201d\u662f\u8fdc\u7a0b\u7684&#xff0c;\u901a\u4fe1\u8fc7\u7a0b\u4ece\u672a\u79bb\u5f00\u672c\u673a\u3002<\/p>\n<hr \/>\n<h4>2. Stdio \u7684\u5c40\u9650&#xff1a;\u4e3a\u4f55\u4e0d\u80fd\u7528\u4e8e\u751f\u4ea7&#xff1f;<\/h4>\n<p>\u5c3d\u7ba1 Stdio \u7b80\u5355\u9ad8\u6548&#xff0c;\u4f46\u5b83\u5929\u751f\u4e0d\u9002\u5408\u751f\u4ea7\u73af\u5883&#xff1a;<\/p>\n<table>\n<tr>\u95ee\u9898\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>\u274c \u65e0\u6cd5\u8de8\u673a\u5668<\/td>\n<td>\u670d\u52a1\u7aef\u5fc5\u987b\u4e0e\u5ba2\u6237\u7aef\u540c\u673a\u8fd0\u884c&#xff0c;\u65e0\u6cd5\u90e8\u7f72\u5230\u4e91\u670d\u52a1\u5668\u4f9b\u56e2\u961f\u5171\u4eab<\/td>\n<\/tr>\n<tr>\n<td>\u274c \u65e0\u6301\u4e45\u5316<\/td>\n<td>\u6bcf\u6b21\u8c03\u7528\u90fd\u9700\u91cd\u65b0\u542f\u52a8\u8fdb\u7a0b&#xff0c;\u51b7\u542f\u52a8\u5f00\u9500\u5927<\/td>\n<\/tr>\n<tr>\n<td>\u274c \u65e0\u5e76\u53d1\u652f\u6301<\/td>\n<td>\u4e00\u4e2a Stdio \u8fde\u63a5 &#061; \u4e00\u4e2a\u8fdb\u7a0b&#xff0c;\u96be\u4ee5\u652f\u6491\u591a\u7528\u6237\u6216\u591a Agent \u5e76\u53d1<\/td>\n<\/tr>\n<tr>\n<td>\u274c \u53ef\u9760\u6027\u5dee<\/td>\n<td>\u8fdb\u7a0b\u5d29\u6e83\u3001\u73af\u5883\u53d8\u91cf\u9519\u8bef\u3001\u6743\u9650\u95ee\u9898\u90fd\u4f1a\u5bfc\u81f4\u8fde\u63a5\u77ac\u95f4\u65ad\u88c2<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&#x1f4a1; Stdio \u7684\u5b9a\u4f4d\u5f88\u660e\u786e&#xff1a;\u5feb\u901f\u9a8c\u8bc1\u3001\u672c\u5730\u5f00\u53d1\u3001\u684c\u9762\u5e94\u7528\u3002 \u5b83\u662f\u201c\u9020\u5de5\u5177\u201d\u7684\u6700\u4f73\u8d77\u70b9&#xff0c;\u4f46\u4e0d\u662f\u201c\u7528\u5de5\u5177\u201d\u7684\u7ec8\u6781\u5f62\u6001\u3002<\/p>\n<hr \/>\n<h4>3. \u5347\u7ea7\u5230\u751f\u4ea7&#xff1a;\u4e3a\u4ec0\u4e48\u5fc5\u987b\u7528 Streamable HTTP&#xff1f;<\/h4>\n<p>\u5f53\u6211\u4eec\u8981\u5c06 MCP \u5de5\u5177\u90e8\u7f72\u5230\u4e91\u7aef\u3001\u4f9b\u591a\u4eba\u6216\u591a\u4e2a Agent \u5171\u4eab\u65f6&#xff0c;\u5fc5\u987b\u5207\u6362\u5230 Streamable HTTP\u3002<\/p>\n<p>\u26a0\ufe0f \u6ce8\u610f&#xff1a;\u8fd9\u91cc\u7684\u201cStreamable HTTP\u201d\u4e0d\u662f\u8001\u7684 HTTP\/1.1&#xff0c;\u800c\u662f\u4e00\u79cd\u652f\u6301\u771f\u6b63\u53cc\u5411\u5b9e\u65f6\u901a\u4fe1\u7684\u73b0\u4ee3\u534f\u8bae&#xff08;\u57fa\u4e8e HTTP\/2 \u6216 HTTP\/3&#xff09;&#xff0c;\u7528\u8d77\u6765\u8ddf WebSocket \u5dee\u4e0d\u591a&#xff0c;\u4f46\u90e8\u7f72\u66f4\u7b80\u5355\u3002<\/p>\n<h5>\u4e3a\u4ec0\u4e48\u4e0d\u7528\u5e38\u89c4 HTTP&#xff1f;<\/h5>\n<table>\n<tr>\u7279\u6027\u5e38\u89c4 HTTP\/1.1Streamable HTTP&#xff08;MCP \u63a8\u8350&#xff09;<\/tr>\n<tbody>\n<tr>\n<td>\u8fde\u63a5\u6a21\u578b<\/td>\n<td>\u77ed\u8fde\u63a5&#xff08;\u8bf7\u6c42-\u54cd\u5e94\u540e\u5173\u95ed&#xff09;<\/td>\n<td>\u6301\u4e45\u957f\u8fde\u63a5&#xff0c;\u4f5c\u4e3a\u901a\u4fe1\u96a7\u9053<\/td>\n<\/tr>\n<tr>\n<td>\u901a\u4fe1\u65b9\u5411<\/td>\n<td>\u534a\u53cc\u5de5&#xff08;\u5ba2\u6237\u7aef\u95ee \u2192 \u670d\u52a1\u7aef\u7b54&#xff09;<\/td>\n<td>\u5168\u53cc\u5de5&#xff0c;\u53cc\u65b9\u53ef\u968f\u65f6\u4e3b\u52a8\u53d1\u6d88\u606f<\/td>\n<\/tr>\n<tr>\n<td>\u72b6\u6001\u7ba1\u7406<\/td>\n<td>\u65e0\u72b6\u6001&#xff08;\u6bcf\u6b21\u8bf7\u6c42\u72ec\u7acb&#xff09;<\/td>\n<td>\u5f3a\u6709\u72b6\u6001&#xff0c;\u53ef\u8ffd\u8e2a\u4efb\u52a1\u4e0a\u4e0b\u6587<\/td>\n<\/tr>\n<tr>\n<td>\u6548\u7387<\/td>\n<td>\u9ad8\u5e76\u53d1\u4f46\u9ad8\u5f00\u9500&#xff08;\u91cd\u590d\u5efa\u8fde\u3001\u5934\u90e8\u5197\u4f59&#xff09;<\/td>\n<td>\u591a\u8def\u590d\u7528&#xff0c;\u5355\u8fde\u63a5\u627f\u8f7d\u591a RPC \u6d41<\/td>\n<\/tr>\n<tr>\n<td>\u9002\u7528\u573a\u666f<\/td>\n<td>\u9759\u6001\u8d44\u6e90\u3001\u7b80\u5355 API<\/td>\n<td>\u5b9e\u65f6\u534f\u4f5c\u3001Agent \u63a7\u5236\u3001\u6d41\u5f0f\u63a8\u7406<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h5>Streamable HTTP \u7684\u4e09\u5927\u6838\u5fc3\u4f18\u52bf<\/h5>\n<li>\n<p>\u6301\u7eed\u7684\u72b6\u6001\u8ffd\u8e2a Agent \u7684\u63a8\u7406\u5e38\u662f\u591a\u6b65\u7684&#xff08;Plan \u2192 Act \u2192 Observe \u2192 Reflect&#xff09;\u3002Streamable HTTP \u901a\u8fc7\u957f\u8fde\u63a5\u7ef4\u6301\u4e0a\u4e0b\u6587&#xff0c;\u907f\u514d\u53cd\u590d\u4f20\u8f93\u5197\u4f59\u5386\u53f2\u3002<\/p>\n<\/li>\n<li>\n<p>\u539f\u751f\u5168\u53cc\u5de5 JSON-RPC \u670d\u52a1\u7aef\u53ef\u5728\u6267\u884c\u4e2d\u4e3b\u52a8\u63a8\u9001\u65e5\u5fd7\u3001\u4e2d\u95f4\u7ed3\u679c\u3001\u6743\u9650\u8bf7\u6c42&#xff08;\u5982\u201c\u8bf7\u6388\u6743\u8bbf\u95ee\u4f60\u7684\u65e5\u5386\u201d&#xff09;&#xff0c;\u65e0\u9700\u7b49\u5f85\u5ba2\u6237\u7aef\u8f6e\u8be2\u3002<\/p>\n<\/li>\n<li>\n<p>\u6d41\u5f0f\u53cd\u9988\u4e0e\u63a7\u5236 \u4e0d\u4ec5\u8fd4\u56de\u6700\u7ec8\u7ed3\u679c&#xff0c;\u8fd8\u80fd\u5b9e\u65f6\u8f93\u51fa\u601d\u8003\u94fe&#xff08;Chain-of-Thought&#xff09;\u3001\u51fd\u6570\u8c03\u7528\u8f68\u8ff9\u3001\u8fdb\u5ea6\u6761\u7b49&#xff0c;\u6781\u5927\u63d0\u5347\u7528\u6237\u4f53\u9a8c\u4e0e\u53ef\u8c03\u8bd5\u6027\u3002<\/p>\n<\/li>\n<hr \/>\n<h4>4. \u4e24\u79cd Transport \u5bf9\u6bd4<\/h4>\n<table>\n<tr>\u7ef4\u5ea6StdioStreamable HTTP<\/tr>\n<tbody>\n<tr>\n<td>\u901a\u4fe1\u673a\u5236<\/td>\n<td>\u7236\u5b50\u8fdb\u7a0b &#043; \u533f\u540d\u7ba1\u9053<\/td>\n<td>\u5168\u53cc\u5de5 JSON-RPC over HTTP\/2<\/td>\n<\/tr>\n<tr>\n<td>\u5ef6\u8fdf<\/td>\n<td>~0.01ms<\/td>\n<td>~1\u201310ms<\/td>\n<\/tr>\n<tr>\n<td>\u5b89\u5168\u6027<\/td>\n<td>\u2b50\u2b50\u2b50\u2b50\u2b50&#xff08;\u8fdb\u7a0b\u9694\u79bb&#xff0c;\u65e0\u7f51\u7edc\u66b4\u9732&#xff09;<\/td>\n<td>\u2b50\u2b50\u2b50\u2b50&#xff08;\u9700\u914d\u5408 TLS\u3001\u8ba4\u8bc1&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u90e8\u7f72\u573a\u666f<\/td>\n<td>\u672c\u5730\u5f00\u53d1\u3001\u684c\u9762\u5e94\u7528<\/td>\n<td>\u4e91\u670d\u52a1\u3001\u56e2\u961f\u5171\u4eab\u3001\u751f\u4ea7\u73af\u5883<\/td>\n<\/tr>\n<tr>\n<td>\u662f\u5426\u5360\u7528\u7aef\u53e3<\/td>\n<td>\u274c \u5426<\/td>\n<td>\u2705 \u662f<\/td>\n<\/tr>\n<tr>\n<td>\u5178\u578b\u542f\u52a8\u65b9\u5f0f<\/td>\n<td>python server.py \u6216 npx pkg<\/td>\n<td>uvicorn server:app &#8211;host 0.0.0.0 &#8211;port 8000<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&#x1f4cc; \u4e00\u53e5\u8bdd\u603b\u7ed3&#xff1a; Stdio \u662f\u201c\u63d2 USB\u201d&#xff0c;\u5373\u63d2\u5373\u7528&#xff0c;\u4f46\u53ea\u80fd\u5728\u81ea\u5df1\u7535\u8111\u4e0a\u7528&#xff1b; Streamable HTTP \u662f\u201c\u8fde WiFi\u201d&#xff0c;\u7a0d\u590d\u6742&#xff0c;\u4f46\u80fd\u8ba9\u5168\u4e16\u754c\u7684 Agent \u90fd\u7528\u4e0a\u4f60\u7684\u5de5\u5177\u3002<\/p>\n<p>\u524d\u6587\u6211\u4eec\u5df2\u7ecf\u8bb2\u4e86Stdio\u7684\u751f\u4ea7\u5b9e\u73b0&#xff0c;\u4e0b\u4e00\u5c0f\u8282\u6211\u4eec\u5c06\u7ee7\u7eed\u9488\u5bf9 Streamable HTTP \u7684\u5b9e\u9645\u5b9e\u73b0\u3002<\/p>\n<p>\u6ce8&#xff1a;\u672c\u6587\u9488\u5bf9\u5de5\u7a0b\u7ec6\u8282\u5e76\u4e0d\u4f1a\u8bb2\u7684\u8fc7\u6df1&#xff0c;\u8bf8\u5982\u7236\u5b50\u8fdb\u7a0b\u3001JSON-RPC\u3001Schema\u7b49\u5404\u79cd\u672f\u8bed&#xff0c;\u4f1a\u5728\u4e0b\u4e00\u7ae0\u8fdb\u884c\u8be6\u7ec6\u62c6\u89e3\u3002\u6b64\u5904\u4ec5\u505a\u7b80\u5355\u4e86\u89e3\u5373\u53ef\u3002<\/p>\n<\/p>\n<p>\u26a0\ufe0f \u53e6\u5916&#xff0c;\u9488\u5bf9Transport\u7684\u53e6\u4e00\u79cd\u901a\u8baf\u673a\u5236sse&#xff0c;\u56e0\u4e3a\u5b83\u53ea\u652f\u6301\u5355\u5411\u9650\u5236&#xff0c;\u5df2\u88ab\u5b98\u65b9\u5f03\u7528&#xff0c;\u6b63\u9010\u6b65\u6dd8\u6c70&#xff0c;\u6545\u6b64\u5904\u4e0d\u505a\u8fc7\u591a\u63d0\u53ca\u3002<\/p>\n<h3>\u4e94\u3001\u67b6\u6784\u5347\u7ea7 \u2014\u2014 \u4e00\u952e\u5f00\u542f Streamable HTTP \u8fdc\u7a0b\u6a21\u5f0f<\/h3>\n<p>\u65e2\u7136\u8981\u652f\u6301\u8fdc\u7a0b\u8c03\u7528&#xff0c;\u4ee3\u7801\u4f1a\u4e0d\u4f1a\u53d8\u5f97\u590d\u6742&#xff1f;<\/p>\n<p>\u5b8c\u5168\u4e0d\u4f1a&#xff01;FastMCP \u5df2\u5c06\u5e95\u5c42\u7ec6\u8282\u5168\u90e8\u5c01\u88c5&#xff0c;\u4f60\u53ea\u9700\u6539\u52a8\u4e24\u884c\u914d\u7f6e\u3002<\/p>\n<p> # streamable_http_server.py<\/p>\n<p># &#8230;<\/p>\n<p># \u521b\u5efa\u670d\u52a1\u5b9e\u4f8b&#xff0c;\u6307\u5b9a\u76d1\u542c\u5730\u5740\u548c\u7aef\u53e3<br \/>\nmcp &#061; FastMCP(&#034;WeatherService&#034;,host&#061;&#034;0.0.0.0&#034;,port&#061;8001)<\/p>\n<p># &#8230;<\/p>\n<p># \u542f\u52a8\u5165\u53e3<br \/>\nif __name__ &#061;&#061; &#039;__main__&#039;:<br \/>\n    # \u8fd0\u884c\u65b9\u5f0f:Streamable HTTP<br \/>\n    # \u8fd9\u4f1a\u81ea\u52a8\u542f\u52a8 uvicorn \u670d\u52a1\u5668&#xff0c;\u652f\u6301\u8fdc\u7a0b\u8c03\u7528<br \/>\n    mcp.run(&#039;streamable-http&#039;)<\/p>\n<p>\u5728mcp\u521d\u59cb\u5316\u5904&#xff0c;\u6211\u4eec\u4e3a\u5176\u586b\u4e0ahost\u4e0eport\u7684\u4e3b\u673a\u4e0e\u7aef\u53e3&#xff0c;\u518d\u5728\u672b\u5c3erun\u5185\u6307\u5b9astreamable-http\u5373\u53ef\u3002<\/p>\n<p>\u8fd0\u884c\u67e5\u770b\u63a7\u5236\u53f0&#xff1a; <img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"205\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725065048-6a645cc8a599b.png\" width=\"883\" \/>\u200b<\/p>\n<p>\u670d\u52a1\u542f\u52a8&#xff0c;\u518d\u53bbCherryStudio\u91cc\u9a8c\u8bc1&#xff1a; <img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"405\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725065048-6a645cc8ba7f0.png\" width=\"625\" \/>\u200b<\/p>\n<p>MCP\u94fe\u63a5\u6210\u529f&#xff0c;\u518d\u53bb\u5bf9\u8bdd&#xff1a; <img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"276\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725065049-6a645cc91791e.png\" width=\"482\" \/>\u200b<\/p>\n<p>\u6ca1\u6709\u95ee\u9898&#xff0c;Agent \u6210\u529f\u8c03\u7528\u4f60\u7684\u8fdc\u7a0b\u670d\u52a1&#xff0c;\u5e76\u8fd4\u56de\u7ed3\u679c\u3002<\/p>\n<p>&#x1f4a1; \u66f4\u68d2\u7684\u662f&#xff1a;\u5f97\u76ca\u4e8e Streamable HTTP \u7684\u6d41\u5f0f\u7279\u6027&#xff0c;\u5de5\u5177\u8c03\u7528\u8fc7\u7a0b\u652f\u6301\u5b9e\u65f6\u65e5\u5fd7\u8f93\u51fa\u4e0e\u4e2d\u95f4\u72b6\u6001\u53cd\u9988&#xff0c;\u4f53\u9a8c\u6bd4 Stdio \u6a21\u5f0f\u66f4\u4e30\u5bcc&#xff08;\u5c24\u5176\u5728\u590d\u6742\u5de5\u5177\u573a\u666f\u4e0b&#xff09;\u3002<\/p>\n<h3>\u603b\u7ed3\u3001<\/h3>\n<p>\u672c\u7ae0\u6211\u4eec\u5f7b\u5e95\u638c\u63e1\u4e86 MCP\u00a0\u670d\u52a1\u7aef (Server) \u7684\u5f00\u53d1\u3002<\/p>\n<ul>\n<li>\n<p>\u6211\u4eec\u4f7f\u7528 FastMCP&#xff0c;\u4ec5\u7528\u88c5\u9970\u5668\u5c31\u5c06 Python \u51fd\u6570\u53d8\u6210\u4e86 AI \u5de5\u5177\u3002<\/p>\n<\/li>\n<li>\n<p>\u6211\u4eec\u7406\u89e3\u4e86 Stdio&#xff08;\u672c\u5730\u7ba1\u9053&#xff09;\u548c HTTP\/SSE&#xff08;\u8fdc\u7a0b\u7f51\u7edc&#xff09;\u4e24\u79cd\u66b4\u9732\u65b9\u5f0f\u7684\u533a\u522b\u3002<\/p>\n<\/li>\n<li>\n<p>\u6211\u4eec\u8bc1\u660e\u4e86&#xff1a;\u4e1a\u52a1\u903b\u8f91&#xff08;\u67e5\u5929\u6c14&#xff09;\u548c \u4f20\u8f93\u534f\u8bae&#xff08;Stdio\/HTTP&#xff09;\u662f\u5b8c\u5168\u89e3\u8026\u7684\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u9884\u544a&#xff1a;11 \u7bc7\u300aMCP \u8fdb\u9636\u7bc7\u300b<\/p>\n<p>\u73b0\u5728\u5de5\u5177\u9020\u597d\u4e86&#xff0c;CherryStudio\u4e5f\u80fd\u8fde\u4e0a\u4e86\u3002\u4f46\u662f&#xff0c;\u5982\u679c\u6211\u4eec\u81ea\u5df1\u7684py\u4ee3\u7801\u60f3\u8fde\u63a5\u8fd9\u4e2aServer&#xff0c;\u8be5\u600e\u4e48\u5199\u4ee3\u7801&#xff1f;\u4e0b\u4e00\u7bc7&#xff0c;\u6211\u4eec\u5c06\u6df1\u5165 \u5ba2\u6237\u7aef&#xff08;Client&#xff09;\u5f00\u53d1&#xff0c;\u624b\u5199\u4ee3\u7801\u53bb\u5bf9\u63a5\u6211\u4eec\u9020\u51fa\u6765\u7684\u8fd9\u4e2a\u53cc\u6a21\u4f20\u8f93 Server&#xff0c;\u5b8c\u6210\u6700\u540e\u7684\u95ed\u73af\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u535a\u5ba2\u914d\u5957\u4ee3\u7801\u53d1\u5e03\u4e8egithub&#xff1a;10 MCP \u57fa\u7840<br \/>\n\u76f8\u5173Agent\u4e13\u680f&#xff1a;Ai Agent\u6559\u5b66<br \/>\n\u672c\u7cfb\u5217\u6240\u6709\u535a\u5ba2\u5747\u914d\u5957Gihub\u5f00\u6e90\u4ee3\u7801&#xff0c;\u5f00\u7bb1\u5373\u7528&#xff0c;\u4ec5\u9700\u914d\u7f6eAPI_KEY\u3002<br \/>\n\u5982\u679c\u8be5Agent\u6559\u5b66\u7cfb\u5217\u5e2e\u5230\u4e86\u4f60&#xff0c;\u6b22\u8fce\u7ed9\u6211\u4e2aStar\u2b50&#xff01;<br \/>\n\u77e5\u8bc6\u70b9&#xff1a;Stdio\u4f20\u8f93 | Streamable HTTP | FastMCP\u6846\u67b6 | Transport\u901a\u4fe1 \u5e8f\u7ae0&#xff1a;\u4ece\u201c\u9020\u8f6e\u5b50\u201d\u5230<\/p>\n","protected":false},"author":2,"featured_media":82939,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[74,66,997,73,50],"topic":[],"class_list":["post-82949","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-agent","tag-ai","tag-langchain","tag-mcp","tag-50"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>[Ai Agent] 10 MCP\u57fa\u7840\uff1a\u5feb\u901f\u7f16\u5199\u4f60\u81ea\u5df1\u7684MCP\u670d\u52a1\u5668\uff08Server\uff09 - \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\/82949.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[Ai Agent] 10 MCP\u57fa\u7840\uff1a\u5feb\u901f\u7f16\u5199\u4f60\u81ea\u5df1\u7684MCP\u670d\u52a1\u5668\uff08Server\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u535a\u5ba2\u914d\u5957\u4ee3\u7801\u53d1\u5e03\u4e8egithub&#xff1a;10 MCP \u57fa\u7840 \u76f8\u5173Agent\u4e13\u680f&#xff1a;Ai Agent\u6559\u5b66 \u672c\u7cfb\u5217\u6240\u6709\u535a\u5ba2\u5747\u914d\u5957Gihub\u5f00\u6e90\u4ee3\u7801&#xff0c;\u5f00\u7bb1\u5373\u7528&#xff0c;\u4ec5\u9700\u914d\u7f6eAPI_KEY\u3002 \u5982\u679c\u8be5Agent\u6559\u5b66\u7cfb\u5217\u5e2e\u5230\u4e86\u4f60&#xff0c;\u6b22\u8fce\u7ed9\u6211\u4e2aStar\u2b50&#xff01; \u77e5\u8bc6\u70b9&#xff1a;Stdio\u4f20\u8f93 | Streamable HTTP | FastMCP\u6846\u67b6 | Transport\u901a\u4fe1 \u5e8f\u7ae0&#xff1a;\u4ece\u201c\u9020\u8f6e\u5b50\u201d\u5230\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/82949.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-25T06:50:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725065047-6a645cc7279a1.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=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/82949.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/82949.html\",\"name\":\"[Ai Agent] 10 MCP\u57fa\u7840\uff1a\u5feb\u901f\u7f16\u5199\u4f60\u81ea\u5df1\u7684MCP\u670d\u52a1\u5668\uff08Server\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-25T06:50:50+00:00\",\"dateModified\":\"2026-07-25T06:50:50+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/82949.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/82949.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/82949.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[Ai Agent] 10 MCP\u57fa\u7840\uff1a\u5feb\u901f\u7f16\u5199\u4f60\u81ea\u5df1\u7684MCP\u670d\u52a1\u5668\uff08Server\uff09\"}]},{\"@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":"[Ai Agent] 10 MCP\u57fa\u7840\uff1a\u5feb\u901f\u7f16\u5199\u4f60\u81ea\u5df1\u7684MCP\u670d\u52a1\u5668\uff08Server\uff09 - \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\/82949.html","og_locale":"zh_CN","og_type":"article","og_title":"[Ai Agent] 10 MCP\u57fa\u7840\uff1a\u5feb\u901f\u7f16\u5199\u4f60\u81ea\u5df1\u7684MCP\u670d\u52a1\u5668\uff08Server\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u535a\u5ba2\u914d\u5957\u4ee3\u7801\u53d1\u5e03\u4e8egithub&#xff1a;10 MCP \u57fa\u7840 \u76f8\u5173Agent\u4e13\u680f&#xff1a;Ai Agent\u6559\u5b66 \u672c\u7cfb\u5217\u6240\u6709\u535a\u5ba2\u5747\u914d\u5957Gihub\u5f00\u6e90\u4ee3\u7801&#xff0c;\u5f00\u7bb1\u5373\u7528&#xff0c;\u4ec5\u9700\u914d\u7f6eAPI_KEY\u3002 \u5982\u679c\u8be5Agent\u6559\u5b66\u7cfb\u5217\u5e2e\u5230\u4e86\u4f60&#xff0c;\u6b22\u8fce\u7ed9\u6211\u4e2aStar\u2b50&#xff01; \u77e5\u8bc6\u70b9&#xff1a;Stdio\u4f20\u8f93 | Streamable HTTP | FastMCP\u6846\u67b6 | Transport\u901a\u4fe1 \u5e8f\u7ae0&#xff1a;\u4ece\u201c\u9020\u8f6e\u5b50\u201d\u5230","og_url":"https:\/\/www.wsisp.com\/helps\/82949.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-25T06:50:50+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725065047-6a645cc7279a1.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/82949.html","url":"https:\/\/www.wsisp.com\/helps\/82949.html","name":"[Ai Agent] 10 MCP\u57fa\u7840\uff1a\u5feb\u901f\u7f16\u5199\u4f60\u81ea\u5df1\u7684MCP\u670d\u52a1\u5668\uff08Server\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-25T06:50:50+00:00","dateModified":"2026-07-25T06:50:50+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/82949.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/82949.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/82949.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"[Ai Agent] 10 MCP\u57fa\u7840\uff1a\u5feb\u901f\u7f16\u5199\u4f60\u81ea\u5df1\u7684MCP\u670d\u52a1\u5668\uff08Server\uff09"}]},{"@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\/82949","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=82949"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/82949\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/82939"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=82949"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=82949"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=82949"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=82949"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}