{"id":51351,"date":"2025-08-10T21:35:44","date_gmt":"2025-08-10T13:35:44","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/51351.html"},"modified":"2025-08-10T21:35:44","modified_gmt":"2025-08-10T13:35:44","slug":"%e6%89%8b%e6%90%93mcp%e5%85%a8%e6%b5%81%e7%a8%8b%e6%8c%87%e5%8d%97%ef%bc%9a%e4%bb%8e%e6%9c%ac%e5%9c%b0%e5%bc%80%e5%8f%91%e9%83%a8%e7%bd%b2%e5%88%b0pypi%e5%85%ac%e5%bc%80%e5%8f%91%e5%b8%83","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/51351.html","title":{"rendered":"\u624b\u6413MCP\u5168\u6d41\u7a0b\u6307\u5357\uff1a\u4ece\u672c\u5730\u5f00\u53d1\u90e8\u7f72\u5230PyPI\u516c\u5f00\u53d1\u5e03"},"content":{"rendered":"<h2>1\u3001\u5173\u4e8eMCP<\/h2>\n<h3>1.1\u3001\u4ec0\u4e48\u662fMCP<\/h3>\n<p>MCP\u662f\u4e00\u4e2a\u7531Anthropic\u516c\u53f8\u63a8\u51fa\u7684\u5f00\u6e90\u6807\u51c6&#xff0c;\u65e8\u5728\u7edf\u4e00AI\u6a21\u578b\u4e0e\u5916\u90e8\u5de5\u5177\u53ca\u6570\u636e\u6e90\u7684\u4ea4\u4e92\u65b9\u5f0f\u3002\u5728MCP\u51fa\u73b0\u4e4b\u524d&#xff0c;\u5f00\u53d1\u8005\u9700\u8981\u4e3a\u6bcf\u4e00\u4e2aAI\u9700\u8981\u63a5\u5165\u7684\u5e94\u7528\u7f16\u5199\u7279\u5b9a\u7684\u96c6\u6210\u4ee3\u7801&#xff0c;\u8fc7\u7a0b\u7e41\u7410\u4e14\u96be\u4ee5\u6269\u5c55\u3002MCP\u7684\u51fa\u73b0\u6539\u53d8\u4e86\u8fd9\u4e00\u73b0\u72b6&#xff0c;\u5b83\u5c31\u5982\u540c\u4e00\u4e2a\u4e3aAI\u5e94\u7528\u6253\u9020\u7684\u201cUSB-C\u201d\u63a5\u53e3&#xff0c;\u63d0\u4f9b\u4e86\u4e00\u4e2a\u6807\u51c6\u5316\u7684\u8fde\u63a5\u65b9\u5f0f&#xff0c;\u8ba9AI\u6a21\u578b\u53ef\u4ee5\u8f7b\u677e\u5730\u4e0e\u4e0d\u540c\u7684\u6570\u636e\u6e90\u548c\u5de5\u5177\u8fdb\u884c\u8fde\u63a5\u548c\u901a\u4fe1\u3002<\/p>\n<p>\u7b80\u800c\u8a00\u4e4b&#xff0c;MCP\u5141\u8bb8AI\u5e94\u7528&#xff08;\u4f5c\u4e3a\u5ba2\u6237\u7aef&#xff09;\u4e0e\u5916\u90e8\u5de5\u5177\u6216\u6570\u636e\u6e90&#xff08;\u4f5c\u4e3a\u670d\u52a1\u5668&#xff09;\u4e4b\u95f4\u5efa\u7acb\u5b89\u5168\u7684\u53cc\u5411\u8fde\u63a5\u3002\u8fd9\u610f\u5473\u7740&#xff0c;AI\u4e0d\u4ec5\u53ef\u4ee5\u4ece\u5916\u90e8\u83b7\u53d6\u4fe1\u606f\u4ee5\u751f\u6210\u66f4\u7cbe\u51c6\u7684\u56de\u7b54&#xff0c;\u66f4\u53ef\u4ee5\u201c\u8c03\u7528\u201d\u8fd9\u4e9b\u5de5\u5177\u53bb\u6267\u884c\u5177\u4f53\u7684\u64cd\u4f5c&#xff0c;\u6bd4\u5982\u5728\u60a8\u7684\u4ee3\u7801\u5e93\u4e2d\u8fdb\u884c\u641c\u7d22&#xff0c;\u6216\u8005\u5411\u56e2\u961f\u6210\u5458\u53d1\u9001\u5373\u65f6\u6d88\u606f\u3002\u5bf9\u4e8e\u5f00\u53d1\u8005\u800c\u8a00&#xff0c;\u65e0\u8bba\u662f\u60f3\u8981\u5c06\u81ea\u5df1\u7684\u6570\u636e\u901a\u8fc7MCP\u670d\u52a1\u5668\u66b4\u9732\u7ed9AI&#xff0c;\u8fd8\u662f\u5f00\u53d1\u80fd\u591f\u8fde\u63a5\u8fd9\u4e9b\u670d\u52a1\u5668\u7684AI\u5e94\u7528&#xff0c;\u90fd\u53d8\u5f97\u66f4\u52a0\u7b80\u5355\u548c\u9ad8\u6548\u3002<img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810133532-6898a02423d1e.gif\" alt=\"output.gif\" \/><\/p>\n<h3>1.2\u3001MCP\u7684\u672c\u8d28\u4e0e\u4ef7\u503c<\/h3>\n<p>MCP \u7684\u6838\u5fc3\u4ef7\u503c\u5728\u4e8e\u63d0\u4f9b\u4e00\u79cd\u6807\u51c6\u5316\u7684\u65b9\u5f0f&#xff0c;\u8ba9 AI \u6a21\u578b\u4e0e\u5916\u90e8\u4e16\u754c\u8fdb\u884c\u4ea4\u4e92\u3002\u5728 MCP \u51fa\u73b0\u4e4b\u524d&#xff0c;\u5f00\u53d1\u8005\u9700\u8981\u4e3a\u6bcf\u4e2a AI \u96c6\u6210\u521b\u5efa\u5b9a\u5236\u5316\u7684\u89e3\u51b3\u65b9\u6848&#xff0c;\u8fd9\u5bfc\u81f4\u4e86\u4e25\u91cd\u7684\u788e\u7247\u5316\u95ee\u9898\u3002 MCP \u89e3\u51b3\u4e86\u8fd9\u4e9b\u95ee\u9898&#xff0c;\u5b83\u63d0\u4f9b\u4e86\u4ee5\u4e0b\u5173\u952e\u4ef7\u503c&#xff1a;<\/p>\n<ul>\n<li>\u7edf\u4e00\u96c6\u6210\u6807\u51c6:\u4e00\u4e2a\u534f\u8bae\u5bf9\u63a5\u6240\u6709\u96c6\u6210&#xff0c;\u964d\u4f4e\u5f00\u53d1\u96be\u5ea6<\/li>\n<li>\u5b9e\u65f6\u6570\u636e\u66f4\u65b0:\u652f\u6301\u52a8\u6001\u6570\u636e\u4ea4\u4e92\u800c\u975e\u9759\u6001\u8fde\u63a5<\/li>\n<li>\u81ea\u52a8\u5de5\u5177\u53d1\u73b0:\u652f\u6301\u52a8\u6001\u5de5\u5177\u53d1\u73b0\u548c\u4e0a\u4e0b\u6587\u5904\u7406<\/li>\n<li>\u9690\u79c1\u4fdd\u62a4:\u6570\u636e\u548c\u5de5\u5177\u4e0d\u9700\u4e0a\u4f20\u8fdc\u7aef&#xff0c;\u4fdd\u62a4\u6570\u636e\u9690\u79c1<\/li>\n<li>\u5f00\u53d1\u6548\u7387:\u663e\u8457\u51cf\u5c11\u5f00\u53d1\u65f6\u95f4&#xff0c;\u63d0\u9ad8\u7cfb\u7edf\u53ef\u9760\u6027<\/li>\n<\/ul>\n<h3>1.3MCP\u539f\u7406<\/h3>\n<ul>\n<li>\n<p>\u7ed3\u6784\u5316\u4e0a\u4e0b\u6587\u6574\u5408:MCP \u901a\u8fc7\u5b9a\u4e49\u6807\u51c6\u5316\u7684\u8d44\u6e90\u63cf\u8ff0\u4e0e\u8c03\u7528\u673a\u5236(\u57fa\u4e8e JSON-RPC 2.0 \u534f\u8bae)&#xff0c;\u4f7f\u6a21\u578b\u80fd\u591f\u81ea\u52a8\u83b7\u53d6\u7ed3\u6784\u5316\u6570\u636e\u6e90&#xff0c;\u5982\u672c\u5730\u6587\u4ef6\u7cfb\u7edf\u3001\u4f01\u4e1a\u6570\u636e\u5e93\u6216\u5b9e\u65f6 API\u6570\u636e\u3002\u76f8\u8f83\u4e8e\u65e9\u671f\u624b\u52a8\u62fc\u63a5\u975e\u7ed3\u6784\u5316\u6570\u636e\u7684prompt \u8bbe\u8ba1\u65b9\u5f0f&#xff0c;\u8fd9\u79cd\u52a8\u6001\u4e0a\u4e0b\u6587\u52a0\u8f7d\u5c06\u4fe1\u606f\u83b7\u53d6\u5ef6\u8fdf\u964d\u4f4e 90%\u4ee5\u4e0a&#xff0c;\u540c\u65f6\u4fdd\u8bc1\u4e86\u6570\u636e\u5b8c\u6574\u6027\u4e0e\u65f6\u6548\u6027\u3002<\/p>\n<\/li>\n<li>\n<p>\u53cc\u5411\u4ea4\u4e92\u673a\u5236\u521b\u65b0:\u4f20\u7edf Function Cal \u4ec5\u652f\u6301\u5355\u5411\u8bf7\u6c42-\u54cd\u5e94\u6a21\u5f0f&#xff0c;\u800c MCP \u5141\u8bb8\u670d\u52a1\u5668\u4e3b\u52a8\u63a8\u9001\u6570\u636e(\u5982\u8bbe\u5907\u72b6\u6001\u544a\u8b66)\u6216\u8bf7\u6c42\u7528\u6237\u6388\u6743\u8fd9\u79cd\u53cc\u5411\u901a\u4fe1\u80fd\u529b\u4f7f\u6a21\u578b\u5728\u533b\u7597\u8bca\u65ad\u7b49\u573a\u666f\u4e2d&#xff0c;\u80fd\u5b9e\u65f6\u83b7\u53d6\u6700\u65b0\u68c0\u6d4b\u62a5\u544a\u5e76\u89e6\u53d1\u4e8c\u6b21\u786e\u8ba4\u6d41\u7a0b&#xff0c;\u663e\u8457\u63d0\u5347\u4e86\u590d\u6742\u51b3\u7b56\u7684\u53ef\u9760\u6027\u3002<\/p>\n<\/li>\n<li>\n<p>\u591a\u6a21\u6001\u4e0a\u4e0b\u6587\u7ba1\u7406:MCP \u652f\u6301\u5bf9\u8bdd\u4e0a\u4e0b\u6587\u7684\u6807\u51c6\u5316\u5b58\u50a8\u4e0e\u8de8\u4f1a\u8bdd\u7ee7\u627f\u3002\u4f8b\u5982\u5728\u5ba2\u670d\u573a\u666f\u4e2d&#xff0c;\u6a21\u578b\u53ef\u6301\u4e45\u5316\u7528\u6237\u5386\u53f2\u8ba2\u5355\u4fe1\u606f&#xff0c;\u7ed3\u5408\u5f53\u524d\u54a8\u8be2\u5185\u5bb9\u751f\u6210\u7cbe\u51c6\u56de\u590d&#xff0c;\u907f\u514d\u4e86\u4f20\u7edf\u65b9\u6848\u4e2d\u9700\u8981\u53cd\u590d\u4eba\u5de5\u6ce8\u5165\u5386\u53f2\u6570\u636e\u7684\u4f4e\u6548\u64cd\u4f5c <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810133532-6898a0246a532.png\" alt=\"image.png\" \/><\/p>\n<\/li>\n<\/ul>\n<h3>1.4MCP\u548cAPI\u7684\u533a\u522b<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810133532-6898a024c3ae3.png\" alt=\"image.png\" \/> \u4e3e\u4e2a\u4f8b\u5b50&#xff0c;\u4f8b\u5982:\u4f60\u8981\u5f00\u53d1\u4e00\u4e2a AI \u884c\u7a0b\u89c4\u5212\u52a9\u624b \u7528 API \u5f00\u53d1:\u8981\u5355\u72ec\u63a5\u5165 Google Calendar API\u3001\u90ae\u4ef6 API\u3001\u822a\u53f8 API&#xff0c;\u6bcf\u4e2a\u90fd\u8981\u5199\u8ba4\u8bc1\u3001\u9519\u8bef\u5904\u7406\u4f7f\u7528 MCP:AI\u52a9\u624b\u53ef\u4ee5\u65e0\u7f1d\u67e5\u8be2\u65e5\u7a0b\u3001\u9884\u8ba2\u822a\u73ed\u3001\u53d1\u9001\u786e\u8ba4\u90ae\u4ef6&#xff0c;\u800c\u65e0\u9700\u4e3a\u6bcf\u4e2a\u5de5\u5177\u7f16\u5199\u7279\u5b9a\u96c6\u6210\u3002\u53ea\u63a5\u5165 MCP \u534f\u4ee5AI \u80fd\u81ea\u52a8\u8bbf\u95ee\u8fd9\u4e9b\u670d\u52a1(\u5982:\u770b\u65e5\u5386 \u2192 \u6539\u822a\u73ed \u2192 \u53d1\u90ae\u4ef6)<\/p>\n<p>MCP \u662f\u4e00\u4e2a\u4e3a AI \u800c\u8bbe\u8ba1\u7684\u201c\u667a\u80fd\u6807\u51c6\u8fde\u63a5\u534f\u8bae\u201d&#xff0c;\u8ba9\u6a21\u578b\u80fd\u50cf\u63d2 USB-C\u4e00\u6837\u81ea\u7531\u8bbf\u95ee\u5404\u79cd\u5de5\u5177\u548c\u6570\u636e\u6e90&#xff0c;\u800c\u4e0d\u518d\u53d7\u9650\u4e8e\u4e00\u4e2a\u4e2a\u9ebb\u70e6\u7684 API \u63a5\u53e3\u3002<\/p>\n<p>\u7531\u4e8e\u4f7f\u7528 MCP \u8fd8\u662f\u9700\u8981\u6709\u4e00\u5b9a\u7684\u6280\u672f\u57fa\u7840&#xff0c;\u6240\u4ee5\u76ee\u524d MCP \u57fa\u672c\u90fd\u662f\u5f00\u53d1\u8005\u5728\u4f7f\u7528&#xff0c;\u4e0a\u624b\u96be\u5ea6\u8fd8\u662f\u6709\u70b9\u9ad8\u3002<\/p>\n<h2>2\u3001\u624b\u6413\u4e00\u4e2aMCP<\/h2>\n<h3>2.1\u3001\u57fa\u7840\u73af\u5883\u642d\u5efa<\/h3>\n<h4>2.1.1\u3001\u5b89\u88c5UV<\/h4>\n<p>uv\u662f\u76ee\u524d\u70ed\u5ea6\u6700\u9ad8\u7684python\u73af\u5883\u7ba1\u7406\u5de5\u5177 \u5b98\u65b9\u7f51\u5740&#xff1a;https:\/\/docs.astral.sh\/uv\/getting-started\/installation\/#__tabbed_1_2 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810133533-6898a0251ca05.png\" alt=\"image.png\" \/><\/p>\n<p>\u6211\u4eec\u8fd9\u91cc\u4f7f\u7528\u7684\u662fWindows\u7248\u672c&#xff0c;\u9009\u62e9\u5bf9\u5e94\u7684\u7248\u672c&#xff0c;\u7136\u540e\u590d\u5236\u5bf9\u5e94\u7684\u547d\u4ee4<\/p>\n<p>powershell -ExecutionPolicy ByPass -c <span class=\"token string\">&#034;irm https:\/\/astral.sh\/uv\/install.ps1 | iex&#034;<\/span><\/p>\n<p>\u6253\u5f00\u7535\u8111\u7684PowerShell&#xff0c;\u4ee5\u7ba1\u7406\u5458\u7684\u8eab\u4efd\u8fdb\u884c\u8fd0\u884c <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810133534-6898a0264f540.png\" alt=\"image.png\" \/> \u5728\u7ec8\u7aef\u4e2d\u8f93\u5165\u4e0a\u9762\u7684\u547d\u4ee4&#xff0c;\u5f53\u51fa\u73b0\u4e86Downloading\u5c31\u8bf4\u660e\u5b89\u88c5\u6210\u529f\u4e86<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810133534-6898a02695834.png\" alt=\"image.png\" \/> \u7ec8\u7aef\u5c06uv\u5b89\u88c5\u5728\u4e86C:\\\\Users\\\\27890\\\\.local\\\\bin\u8fd9\u4e2a\u8def\u5f84\u4e0b&#xff0c;\u63a5\u4e0b\u6765\u6211\u4eec\u9700\u8981\u5c06\u8fd9\u4e2a\u8def\u5f84\u52a0\u5165\u5230\u73af\u5883\u53d8\u91cf\u4e2d&#xff0c;\u4e0d\u7136\u7cfb\u7edf\u662f\u8bc6\u522b\u4e0d\u4e86\u8fd9\u4e2a\u547d\u4ee4\u7684&#xff0c;\u51fa\u73b0\u4e0b\u65b9\u7684\u62a5\u9519\u73b0\u8c61\u7684 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810133534-6898a026dfe64.png\" alt=\"image.png\" \/> \u6253\u5f00\u73af\u5883\u53d8\u91cf <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810133535-6898a02707e74.png\" alt=\"image.png\" \/> \u70b9\u51fb\u73af\u5883\u53d8\u91cf <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810133535-6898a0274d5d6.png\" alt=\"image.png\" \/> \u5728\u7cfb\u7edf\u53d8\u91cf\u4e2d\u627e\u5230Path\u70b9\u51fb\u7f16\u8f91 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810133535-6898a02770c6f.png\" alt=\"image.png\" \/> \u70b9\u51fb\u65b0\u5efa&#xff0c;\u5c06\u6211\u4eec\u5b89\u88c5uv\u7684\u8def\u5f84\u586b\u5199\u8fdb\u53bb&#xff0c;\u7136\u540e\u70b9\u51fb\u786e\u5b9a\u5373\u53ef <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810133535-6898a027b5d09.png\" alt=\"image.png\" \/><\/p>\n<p>\u8fd9\u91cc\u4e3a\u4e86\u68c0\u6d4b\u662f\u5426\u5b89\u88c5\u6210\u529f\u4e86&#xff0c;\u9700\u8981\u8fdb\u884c\u6d4b\u8bd5\u64cd\u4f5c&#xff0c;\u8f93\u5165\u4e0b\u65b9\u547d\u4ee4<\/p>\n<p>uv python list<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810133536-6898a02802273.png\" alt=\"image.png\" \/> \u6210\u529f\u663e\u793a\u4e0a\u65b9\u7684\u6587\u4ef6&#xff0c;\u8bf4\u660e\u4f60\u5b89\u88c5\u6210\u529f\u4e86<\/p>\n<h4>2.1.2\u3001\u65b0\u5efaMCP\u6587\u4ef6\u5939<\/h4>\n<p>\u63a5\u4e0b\u6765\u6211\u4eec\u5728D\u76d8\u521b\u5efa\u4e00\u4e2aMCP\u6587\u4ef6\u5939\u6765\u8fdb\u884cMCP\u7684\u5f00\u53d1 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810133536-6898a028a56ce.png\" alt=\"image.png\" \/> \u7136\u540e\u5728\u8fd9\u4e2a\u6587\u4ef6\u6253\u5f00\u7ec8\u7aef&#xff0c;\u5bf9\u8fd9\u4e2a\u6587\u4ef6\u5939\u8fdb\u884c\u4e00\u4e2a\u521d\u59cb\u5316\u64cd\u4f5c<\/p>\n<p>uv init <span class=\"token builtin class-name\">.<\/span> -p <span class=\"token number\">3.13<\/span><\/p>\n<p>\u521d\u59cb\u5316\u540e\u6587\u4ef6\u5939\u4f1a\u591a\u51fa\u521d\u59cb\u5316\u6587\u4ef6 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810133537-6898a02984be5.png\" alt=\"image.png\" \/> \u540c\u6837\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5MCP\u7684SDK&#xff0c;\u4e5f\u5c31\u662f\u5f00\u53d1\u5de5\u5177\u5305<\/p>\n<p>uv <span class=\"token function\">add<\/span> <span class=\"token string\">&#034;mcp[cli]&#034;<\/span><\/p>\n<p>\u5982\u679c\u4f60\u51fa\u73b0\u4e86\u4e0b\u9762\u7684\u62a5\u9519&#xff0c;\u4e0d\u8981\u8c0e&#xff0c;\u53ea\u9700\u8981\u4fee\u6539\u4e0b\u6587\u4ef6\u5939\u7684\u547d\u4ee4\u5c31\u6210\u529f\u8fd0\u884c\u4e86&#xff0c;\u56e0\u4e3a\u6211\u8fd9\u91cc\u7684\u6587\u4ef6\u5939\u7684\u540d\u79f0\u53eb\u505aMCP&#xff0c;\u6211\u521b\u5efa\u7684\u9879\u76ee\u7684\u540d\u5b57\u548c\u60a8\u8bd5\u56fe\u5b89\u88c5\u7684\u5e93&#xff08;SDK&#xff09;\u7684\u540d\u5b57\u5b8c\u5168\u4e00\u6837&#xff0c;\u90fd\u53eb\u00a0mcp\u3002 \u4e00\u4e2a\u9879\u76ee\u4e0d\u80fd\u628a\u81ea\u5df1\u4f5c\u4e3a\u81ea\u5df1\u7684\u4f9d\u8d56\u9879\u3002 uv\u00a0\u4e3a\u4e86\u9632\u6b62\u8fd9\u79cd\u5faa\u73af\u4f9d\u8d56\u548c\u6df7\u4e71&#xff0c;\u76f4\u63a5\u62a5\u9519\u5e76\u963b\u6b62\u4e86\u8fd9\u6b21\u5b89\u88c5\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810133538-6898a02ab0507.png\" alt=\"image.png\" \/> \u5c06\u6587\u4ef6\u5939\u6539\u6210\u4e86mcp_test\u4e4b\u540e\u91cd\u65b0\u8f93\u5165\u4e0b\u65b9\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5MCP\u7684SDK<\/p>\n<p>uv <span class=\"token function\">add<\/span> <span class=\"token string\">&#034;mcp[cli]&#034;<\/span><\/p>\n<p>\u5982\u679c\u4f60\u8fd8\u662f\u51fa\u73b0\u540c\u6837\u7684\u62a5\u9519&#xff0c;\u4f60\u5c06\u6574\u4e2a\u9879\u76ee\u6587\u4ef6\u5939\u5220\u9664&#xff0c;\u7136\u540e\u91cd\u65b0\u8fdb\u884c\u4e0a\u9762\u7684\u521d\u59cb\u5316\u64cd\u4f5c \u5728\u5b89\u88c5SDK\u7684\u65f6\u5019\u9700\u8981\u8fdb\u884c\u7b49\u5f85\u4e00\u4f1a\u513f \u5b89\u88c5\u597d\u4e86\u5982\u4e0b&#xff1a; <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810133538-6898a02aec2b0.png\" alt=\"\" \/><\/p>\n<h4>2.1.2\u3001\u5b89\u88c5trae\u62d3\u5c55<\/h4>\n<p>\u5c06\u6587\u4ef6\u5939\u62d6\u5165\u5230trae\u4e2d \u5728\u62d3\u5c55\u4e2d\u5b89\u88c5Python\u548cPython Debugger\u8fd9\u4e24\u4e2a\u63d2\u4ef6 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810133540-6898a02c95e2e.png\" alt=\"image.png\" \/><\/p>\n<h3>2.2\u3001\u4ee3\u7801\u7f16\u5199\u4ee5\u53ca\u4ee3\u7801\u8bb2\u89e3<\/h3>\n<p>\u6253\u5f00python-mcp\u5b98\u7f51https:\/\/github.com\/modelcontextprotocol\/python-sdk \u8fd9\u4e2a\u5b98\u7f51\u91cc\u9762\u5c31\u662f\u5173\u4e8e\u5982\u4f55\u642d\u5efaMCP\u7684\u82f1\u6587\u6559\u7a0b \u5c06\u4e0b\u65b9\u4ee3\u7801\u8fdb\u884c\u590d\u5236\u6211\u4eec\u8fdb\u884c\u5feb\u901f\u5165\u95e8\u64cd\u4f5c <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810133540-6898a02ccaf38.png\" alt=\"\" \/><\/p>\n<p># -*- coding: utf-8 -*-<br \/>\n&#034;&#034;&#034;<br \/>\nFastMCP \u5feb\u901f\u5165\u95e8\u793a\u4f8b\u3002<br \/>\n\u9996\u5148&#xff0c;\u8bf7\u5207\u6362\u5230 &#096;examples\/snippets\/clients&#096; \u76ee\u5f55&#xff0c;\u7136\u540e\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u542f\u52a8\u670d\u52a1\u5668&#xff1a;<br \/>\n\u00a0 \u00a0 uv run server fastmcp_quickstart stdio<br \/>\n&#034;&#034;&#034;<br \/>\n# \u4ece mcp.server.fastmcp \u6a21\u5757\u4e2d\u5bfc\u5165 FastMCP \u7c7b&#xff0c;\u8fd9\u662f\u6784\u5efa MCP \u670d\u52a1\u5668\u7684\u6838\u5fc3\u3002<br \/>\nfrom mcp.server.fastmcp import FastMCP<br \/>\n# \u521b\u5efa\u4e00\u4e2a MCP \u670d\u52a1\u5668\u5b9e\u4f8b&#xff0c;\u5e76\u5c06\u5176\u547d\u540d\u4e3a &#034;Demo&#034;\u3002<br \/>\n# \u8fd9\u4e2a\u540d\u5b57\u4f1a\u5411\u8fde\u63a5\u5230\u6b64\u670d\u52a1\u5668\u7684 AI \u5ba2\u6237\u7aef\u5c55\u793a\u3002<br \/>\nmcp &#061; FastMCP(&#034;Demo&#034;)<br \/>\n# \u4f7f\u7528 &#064;mcp.tool() \u88c5\u9970\u5668\u6765\u5b9a\u4e49\u4e00\u4e2a\u201c\u5de5\u5177\u201d\u3002<br \/>\n# \u5de5\u5177\u662f AI \u53ef\u4ee5\u8c03\u7528\u7684\u5177\u4f53\u51fd\u6570&#xff0c;\u7528\u4e8e\u6267\u884c\u7279\u5b9a\u7684\u64cd\u4f5c\u3002<br \/>\n&#064;mcp.tool()<br \/>\ndef add(a: int, b: int) -&gt; int:<br \/>\n\u00a0 \u00a0 &#034;&#034;&#034;<br \/>\n\u00a0 \u00a0 \u8fd9\u4e2a\u5de5\u5177\u7684\u529f\u80fd\u662f\u8ba1\u7b97\u4e24\u4e2a\u6574\u6570\u7684\u548c\u3002<br \/>\n\u00a0 \u00a0 \u6587\u6863\u5b57\u7b26\u4e32&#xff08;docstring&#xff09;\u4f1a\u4f5c\u4e3a\u5de5\u5177\u7684\u63cf\u8ff0&#xff0c;\u5e2e\u52a9 AI \u7406\u89e3\u5176\u529f\u80fd\u3002<br \/>\n\u00a0 \u00a0 &#034;&#034;&#034;<br \/>\n\u00a0 \u00a0 return a &#043; b<br \/>\n# \u4f7f\u7528 &#064;mcp.resource() \u88c5\u9970\u5668\u6765\u5b9a\u4e49\u4e00\u4e2a\u201c\u8d44\u6e90\u201d\u3002<br \/>\n# \u8d44\u6e90\u4ee3\u8868 AI \u53ef\u4ee5\u8bbf\u95ee\u7684\u6570\u636e\u6216\u4fe1\u606f\u3002\u8fd9\u91cc\u7684\u8def\u5f84 &#034;greeting:\/\/{name}&#034; \u662f\u52a8\u6001\u7684&#xff0c;<br \/>\n# {name} \u90e8\u5206\u53ef\u4ee5\u88ab\u5b9e\u9645\u7684\u540d\u79f0\u66ff\u6362&#xff0c;\u4f8b\u5982 &#034;greeting:\/\/World&#034;\u3002<br \/>\n&#064;mcp.resource(&#034;greeting:\/\/{name}&#034;)<br \/>\ndef get_greeting(name: str) -&gt; str:<br \/>\n\u00a0 \u00a0 &#034;&#034;&#034;<br \/>\n\u00a0 \u00a0 \u6839\u636e\u63d0\u4f9b\u7684\u540d\u79f0&#xff0c;\u83b7\u53d6\u4e00\u53e5\u4e2a\u6027\u5316\u7684\u95ee\u5019\u8bed\u3002<br \/>\n\u00a0 \u00a0 &#034;&#034;&#034;<br \/>\n\u00a0 \u00a0 # \u4f7f\u7528 f-string \u683c\u5f0f\u5316\u5b57\u7b26\u4e32&#xff0c;\u8fd4\u56de\u5305\u542b\u540d\u5b57\u7684\u95ee\u5019\u8bed\u3002<br \/>\n\u00a0 \u00a0 return f&#034;Hello, {name}!&#034;<br \/>\n# \u4f7f\u7528 &#064;mcp.prompt() \u88c5\u9970\u5668\u6765\u5b9a\u4e49\u4e00\u4e2a\u201c\u63d0\u793a\u8bcd\u6a21\u677f\u201d\u3002<br \/>\n# \u8fd9\u4e2a\u529f\u80fd\u53ef\u4ee5\u6839\u636e\u8f93\u5165\u52a8\u6001\u751f\u6210\u66f4\u590d\u6742\u7684\u3001\u7528\u4e8e\u6307\u5bfc\u5927\u8bed\u8a00\u6a21\u578b&#xff08;LLM&#xff09;\u7684\u6307\u4ee4&#xff08;Prompt&#xff09;\u3002<br \/>\n&#064;mcp.prompt()<br \/>\ndef greet_user(name: str, style: str &#061; &#034;friendly&#034;) -&gt; str:<br \/>\n\u00a0 \u00a0 &#034;&#034;&#034;<br \/>\n\u00a0 \u00a0 \u6839\u636e\u7ed9\u5b9a\u7684\u540d\u5b57\u548c\u98ce\u683c&#xff0c;\u751f\u6210\u4e00\u53e5\u95ee\u5019\u8bed\u7684\u63d0\u793a\u8bcd\u3002<br \/>\n\u00a0 \u00a0 &#034;&#034;&#034;<br \/>\n\u00a0 \u00a0 # \u5b9a\u4e49\u4e00\u4e2a\u5b57\u5178&#xff0c;\u5b58\u50a8\u4e0d\u540c\u98ce\u683c\u5bf9\u5e94\u7684\u63d0\u793a\u8bcd\u6587\u672c\u3002<br \/>\n\u00a0 \u00a0 styles &#061; {<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 &#034;friendly&#034;: &#034;Please write a warm, friendly greeting&#034;,<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 &#034;formal&#034;: &#034;Please write a formal, professional greeting&#034;,<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 &#034;casual&#034;: &#034;Please write a casual, relaxed greeting&#034;,<br \/>\n\u00a0 \u00a0 }<\/p>\n<p>\u00a0 \u00a0 # \u6839\u636e\u4f20\u5165\u7684 style \u53c2\u6570&#xff0c;\u4ece\u5b57\u5178\u4e2d\u83b7\u53d6\u5bf9\u5e94\u7684\u63d0\u793a\u8bcd\u3002<br \/>\n\u00a0 \u00a0 # \u5982\u679c style \u53c2\u6570\u65e0\u6548\u6216\u672a\u63d0\u4f9b&#xff0c;\u5219\u9ed8\u8ba4\u4f7f\u7528 &#034;friendly&#034; \u98ce\u683c\u3002<br \/>\n\u00a0 \u00a0 # \u6700\u540e&#xff0c;\u5c06\u9009\u62e9\u7684\u98ce\u683c\u63d0\u793a\u8bcd\u4e0e\u7528\u6237\u540d\u7ec4\u5408&#xff0c;\u5f62\u6210\u4e00\u4e2a\u5b8c\u6574\u7684\u6307\u4ee4\u3002<br \/>\n\u00a0 \u00a0 return f&#034;{styles.get(style, styles[&#039;friendly&#039;])} for someone named {name}.&#034;<\/p>\n<p>\u5c06\u4ee3\u7801\u7c98\u8d34\u5230main.py\u4e2d&#xff0c;\u8fd9\u4e2a\u6587\u4ef6\u5c31\u662f\u6211\u4eec\u7684\u5f00\u53d1\u6587\u4ef6\u4e86 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810133542-6898a02ec3a99.png\" alt=\"image.png\" \/> \u4e00\u4e2aMCP\u53ef\u4ee5\u6709\u591a\u4e2a\u529f\u80fd&#xff0c;\u5728\u5bf9\u5e94\u7684\u529f\u80fd\u51fd\u6570\u4e0a\u9762\u6807\u8bc6&#064;MCP.tool() <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810133543-6898a02fbf3f0.png\" alt=\"image.png\" \/> \u6bd4\u5982\u8bf4\u8fd9\u4e2a\u51fd\u6570\u7684\u4f5c\u7528\u5c31\u662f\u8f93\u5165\u4e24\u4e2a\u6574\u6570&#xff0c;\u7136\u540e\u8c03\u7528MCP\u83b7\u53d6\u8fd9\u4e24\u4e2a\u6574\u6570\u7684\u548c \u4e0b\u9762\u7684resource\u548cprompt\u51fd\u6570\u90fd\u662f\u63d0\u4f9b\u4e00\u4e2amcp\u4f53\u9a8c\u611f\u7684 <img decoding=\"async\" src=\"2025-08-100jcwj1bn24r.png\" alt=\"image.png\" \/><\/p>\n<h4>2.2.1\u3001MCP\u534f\u8bae\u8bb2\u89e3<\/h4>\n<p>\u5173\u4e8e\u8fd9\u4e2a\u4ee3\u7801<\/p>\n<p>if __name__ &#061;&#061; &#034;__main__&#034;:<\/p>\n<p>\u00a0 \u00a0 mcp.run(transport&#061;&#034;stdio&#034;)<\/p>\n<p>\u5176\u4e2dmcp.run()\u4e2d\u53ef\u4ee5\u586b\u5199\u4e0d\u540c\u7684\u534f\u8bae&#xff0c;\u4e0b\u9762\u7ed9\u5927\u5bb6\u7b80\u5355\u89e3\u91ca\u4e0b\u4e0d\u540c\u7684\u534f\u8bae\u4e4b\u95f4\u7684\u533a\u522b&#xff1a; mcp.run()\u51fd\u6570\u901a\u8fc7\u4e0d\u540c\u7684&#034;\u534f\u8bae\u201d\u53c2\u6570&#xff0c;\u51b3\u5b9a\u4e86\u4f60\u7684 MCP \u670d\u52a1\u4ee5\u4f55\u79cd\u65b9\u5f0f\u66b4\u9732\u7ed9\u5916\u90e8\u4ee5\u53ca\u5982\u4f55\u4e0e\u5ba2\u6237\u7aef\u901a\u4fe1\u3002<\/p>\n<p>MCP\u670d\u52a1\u5668:\u4e09\u79cd\u4f20\u8f93\u6a21\u5f0f\u8be6\u89e3<\/p>\n<ul>\n<li>1\u3001\u6a21\u5f0f\u4e00&#xff1a;stdio(\u6807\u51c6\u8f93\u5165\/\u8f93\u51fa) \u5de5\u4f5c\u539f\u7406:\u901a\u8fc7\u547d\u4ee4\u884c\u7684\u6807\u51c6\u8f93\u5165(stdin)\u548c\u6807\u51c6\u8f93\u51fa(stdout)\u8fdb\u884c\u76f4\u63a5\u7684\u8fdb\u7a0b\u95f4\u901a\u4fe1&#xff0c;\u65e0\u7f51\u7edc\u5f00\u9500\u3002 \u9002\u7528\u573a\u666f:\u672c\u5730\u5f00\u53d1\u3001\u5355\u5143\u6d4b\u8bd5\u3001\u811a\u672c\u96c6\u6210\u3002<\/li>\n<li>2.\u6a21\u5f0f\u4e8c: (http(\u6807\u51c6Web API)- \u901a\u7528\u4e0e\u5f00\u653e\u7684\u884c\u4e1a\u6807\u51c6 \u5de5\u4f5c\u539f\u7406:\u5c06\u670d\u52a1\u5668\u4f5c\u4e3a\u6807\u51c6\u7684Web API\u8fd0\u884c&#xff0c;\u901a\u8fc7\u201d\u8bf7\u6c42-\u54cd\u5e94\u201d\u6a21\u5f0f\u4e0e\u5ba2\u6237\u7aef\u4ea4\u4e92&#xff0c;\u901a\u5e38\u4f7f\u7528JSON\u683c\u5f0f\u3002 \u9002\u7528\u573a\u666f:\u516c\u5171API\u3001Web\u5e94\u7528\u540e\u7aef\u3001\u901a\u7528\u5fae\u670d\u52a1\u3002<\/li>\n<li>3.\u6a21\u5f0f\u4e09:SSE(Server-Sent Events)-\u5b9e\u65f6\u6d41\u5f0f\u54cd\u5e94\u7684\u6700\u4f73\u9009\u62e9 SSE \u662f\u4e00\u79cd\u7f51\u9875\u6280\u672f&#xff0c;\u5b83\u5141\u8bb8\u670d\u52a1\u5668\u5728\u4e0e\u5ba2\u6237\u7aef\u5efa\u7acb\u4e00\u4e2a\u6301\u4e45\u7684HTTP\u8fde\u63a5\u540e&#xff0c;\u5355\u5411\u5730\u3001\u6301\u7eed\u5730\u5411\u5ba2\u6237\u7aef\u63a8\u9001\u6570\u636e\u6d41\u3002\u8fd9\u4e0e\u4f20\u7edf\u7684\u201c\u4e00\u6b21\u8bf7\u6c42&#xff0c;\u4e00\u6b21\u5b8c\u6574\u54cd\u5e94\u201d\u7684HTTP\u6a21\u5f0f\u5b8c\u5168\u4e0d\u540c\u3002 \u5de5\u4f5c\u539f\u7406&#xff1a;\n<ul>\n<li>1\u3001\u5ba2\u6237\u7aef\u53d1\u8d77\u8bf7\u6c42: \u5ba2\u6237\u7aef(\u5982\u6d4f\u89c8\u5668)\u5411MCP\u670d\u52a1\u5668\u7684\u4e00\u4e2a\u7279\u5b9a\u7aef\u70b9\u53d1\u8d77\u4e00\u4e2a\u666e\u901a\u7684HTTP\u8bf7\u6c42\u3002<\/li>\n<li>2\u3001\u670d\u52a1\u5668\u4fdd\u6301\u8fde\u63a5: \u670d\u52a1\u5668\u6536\u5230\u8bf7\u6c42\u540e&#xff0c;\u4e0d\u7acb\u5373\u5173\u95ed\u8fde\u63a5&#xff0c;\u800c\u662f\u8fd4\u56de\u4e00\u4e2a\u7279\u6b8a\u7684\u54cd\u5e94\u5934 content-Type:text\/event-stream&#xff0c;\u5e76\u4fdd\u6301\u8be5\u8fde\u63a5\u5904\u4e8e\u6253\u5f00\u72b6\u6001\u3002<\/li>\n<li>3\u3001\u670d\u52a1\u5668\u63a8\u9001\u6570\u636e:\u5f53MCP\u670d\u52a1\u5185\u90e8\u6709\u65b0\u7684\u6570\u636e\u4ea7\u751f\u65f6(\u4f8b\u5982&#xff0c;\u5927\u8bed\u8a00\u6a21\u578b\u751f\u6210\u4e86\u4e0b\u4e00\u4e2a\u8bcd\u6216\u4e00\u5c0f\u6bb5\u6587\u672c)&#xff0c;\u670d\u52a1\u5668\u4f1a\u7acb\u5373\u5c06\u8fd9\u4e9b\u6570\u636e\u5757\u901a\u8fc7\u8fd9\u4e2a\u6253\u5f00\u7684\u8fde\u63a5\u53d1\u9001\u7ed9\u5ba2\u6237\u7aef\u3002<\/li>\n<li>4\u3001\u5ba2\u6237\u7aef\u63a5\u6536\u4e8b\u4ef6: \u5ba2\u6237\u7aef\u4f1a\u6301\u7eed\u76d1\u542c\u8fd9\u4e2a\u8fde\u63a5&#xff0c;\u6bcf\u5f53\u6536\u5230\u4e00\u4e2a\u6570\u636e\u5757&#xff0c;\u5c31\u4f1a\u89e6\u53d1\u4e00\u4e2a\u4e8b\u4ef6&#xff0c;\u4ece\u800c\u53ef\u4ee5\u5b9e\u65f6\u5730\u5904\u7406\u548c\u5c55\u793a\u65b0\u6570\u636e\u3002 \u5bf9\u4e8eAI\u5e94\u7528&#xff0c;\u8fd9\u901a\u5e38\u610f\u5473\u7740: \u4e00\u4e2a\u751f\u6210\u957f\u6587\u672c\u7684\u8bf7\u6c42&#xff0c;\u7528\u6237\u4e0d\u5fc5\u7b49\u5f85\u51e0\u5341\u79d2\u770b\u5230\u5168\u90e8\u7ed3\u679c&#xff0c;\u800c\u662f\u80fd\u50cf\u5728ChatGPT\u4e2d\u4e00\u6837&#xff0c;\u770b\u7740\u6587\u5b57\u4e00\u4e2a\u4e00\u4e2a\u5730\u201c\u6d41\u201d\u51fa\u6765\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u6838\u5fc3\u4f18\u52bf<\/p>\n<ul>\n<li>\u6781\u4f73\u7684\u6d41\u5f0f\u4f53\u9a8c: \u8fd9\u662f SSE \u5728AI\u9886\u57df\u6700\u5927\u7684\u4f18\u52bf\u3002\u5bf9\u4e8eLLM\u751f\u6210\u3001\u6587\u4ef6\u5904\u7406\u7b49\u8017\u65f6\u4efb\u52a1&#xff0c;\u5b83\u53ef\u4ee5\u5b9e\u65f6\u53cd\u9988\u8fdb\u5ea6\u548c\u7ed3\u679c&#xff0c;\u6781\u5927\u5730\u63d0\u5347\u4e86\u7528\u6237\u4f53\u9a8c\u548c\u5e94\u7528\u7684\u201c\u54cd\u5e94\u611f\u201d<\/li>\n<li>\u57fa\u4e8e\u6807\u51c6HTTP:\u5b83\u6784\u5efa\u5728\u4f20\u7edf\u7684HTTP\u4e4b\u4e0a&#xff0c;\u5b9e\u73b0\u6bd4WebSocket\u66f4\u7b80\u5355&#xff0c;\u4e14\u80fd\u5f88\u597d\u5730\u517c\u5bb9\u73b0\u6709\u7684\u7f51\u7edc\u57fa\u7840\u8bbe\u65bd(\u5982\u53cd\u5411\u4ee3\u7406\u3001\u8d1f\u8f7d\u5747\u8861\u5668)<\/li>\n<li>\u5185\u7f6e\u91cd\u8fde\u673a\u5236:SSE\u6807\u51c6\u5305\u542b\u4e86\u5ba2\u6237\u7aef\u5728\u8fde\u63a5\u610f\u5916\u65ad\u5f00\u540e\u81ea\u52a8\u91cd\u65b0\u8fde\u63a5\u7684\u673a\u5236&#xff0c;\u589e\u52a0\u4e86\u7cfb\u7edf\u7684\u5065\u58ee\u6027\u3002<\/li>\n<\/ul>\n<p>\u5c40\u9650\u6027<\/p>\n<ul>\n<li>\u5355\u5411\u901a\u4fe1: \u6570\u636e\u6d41\u53ea\u80fd\u4ece\u670d\u52a1\u5668\u5230\u5ba2\u6237\u7aef\u3002\u5982\u679c\u5ba2\u6237\u7aef\u5728\u5efa\u7acb\u8fde\u63a5\u540e\u8fd8\u9700\u8981\u5411\u670d\u52a1\u5668\u53d1\u9001\u6d88\u606f&#xff0c;SSE \u5219\u65e0\u80fd\u4e3a\u529b&#xff0c;\u6b64\u65f6\u9700\u8981\u8003\u8651WebSocket\u3002<\/li>\n<li>\u8fde\u63a5\u6570\u9650\u5236: \u6d4f\u89c8\u5668\u5bf9\u5355\u4e2a\u57df\u540d\u4e0b\u7684\u5e76\u53d1HTTP\u8fde\u63a5\u6570\u6709\u9650\u5236(\u901a\u5e38\u662f6\u4e2a)&#xff0c;\u6bcf\u4e2aSSE\u8fde\u63a5\u90fd\u4f1a\u8ba1\u5165\u5176\u4e2d,<\/li>\n<\/ul>\n<p>\u6700\u4f73\u5b9e\u8df5 SSE\u662f\u5b9e\u73b0AI\u6a21\u578b\u6d41\u5f0f\u8f93\u51fa\u7684\u201c\u6740\u624b\u7ea7\u201c\u529f\u80fd\u3002<\/p>\n<ul>\n<li>\u5927\u8bed\u8a00\u6a21\u578b\u6587\u672c\u751f\u6210: \u9010\u5b57\u6216\u9010\u53e5\u8fd4\u56de\u751f\u6210\u7684\u5185\u5bb9,<\/li>\n<li>\u4efb\u52a1\u72b6\u6001\u5b9e\u65f6\u66f4\u65b0: \u5982\u201c\u6a21\u578b\u52a0\u8f7d\u4e2d\u2026\u201d\u3001\u201c\u6570\u636e\u5904\u7406\u4e2d\u2026\u201d\u3001\u201c\u751f\u6210\u5b8c\u6210\u201d<\/li>\n<li>\u5b9e\u65f6\u901a\u77e5\u7cfb\u7edf:\u5411\u7528\u6237\u63a8\u9001\u7cfb\u7edf\u901a\u77e5\u3001\u65b0\u6d88\u606f\u63d0\u9192\u7b49 \u603b\u7ed3\u4e0e\u9009\u578b\u5bf9\u6bd4 \u597d\u7684&#xff0c;\u8fd9\u662f\u6839\u636e\u60a8\u63d0\u4f9b\u7684\u56fe\u7247\u5185\u5bb9\u751f\u6210\u7684Markdown\u683c\u5f0f\u8868\u683c&#xff1a;<\/li>\n<\/ul>\n<table>\n<tr>\u7279\u6027stdio (\u6807\u51c6\u8f93\u5165\/\u8f93\u51fa)http (\u6807\u51c6Web API)SSE (\u670d\u52a1\u5668\u53d1\u9001\u4e8b\u4ef6)<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">\u4ea4\u4e92\u6a21\u5f0f<\/td>\n<td align=\"left\">\u672c\u5730\u8fdb\u7a0b\u95f4\u901a\u4fe1<\/td>\n<td align=\"left\">\u8bf7\u6c42-\u54cd\u5e94 (Request-Response)<\/td>\n<td align=\"left\">\u5355\u5411\u6d41\u5f0f\u63a8\u9001 (One-way Push)<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u6570\u636e\u683c\u5f0f<\/td>\n<td align=\"left\">\u6587\u672c (JSON Lines)<\/td>\n<td align=\"left\">\u6587\u672c (JSON)<\/td>\n<td align=\"left\">\u6587\u672c (Event-Stream Format)<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u6838\u5fc3\u7528\u9014<\/td>\n<td align=\"left\">\u672c\u5730\u5f00\u53d1\u4e0e\u6d4b\u8bd5<\/td>\n<td align=\"left\">\u6784\u5efa\u901a\u7528\u7684\u3001\u53ef\u8c03\u7528\u7684API<\/td>\n<td align=\"left\">\u5b9e\u73b0\u670d\u52a1\u5668\u5230\u5ba2\u6237\u7aef\u7684\u5b9e\u65f6\u6570\u636e\u6d41<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u9002\u7528\u573a\u666f<\/td>\n<td align=\"left\">\u672c\u5730\u811a\u672c\u3001\u8c03\u8bd5<\/td>\n<td align=\"left\">\u901a\u7528API\u3001\u65e0\u72b6\u6001\u4efb\u52a1<\/td>\n<td align=\"left\">LLM\u6d41\u5f0f\u8f93\u51fa\u3001\u5b9e\u65f6\u901a\u77e5\u3001\u8fdb\u5ea6\u66f4\u65b0<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u590d\u6742\u5ea6<\/td>\n<td align=\"left\">\u975e\u5e38\u4f4e<\/td>\n<td align=\"left\">\u8f83\u4f4e<\/td>\n<td align=\"left\">\u4f4e\u4e8eWebSocket&#xff0c;\u9ad8\u4e8e\u6807\u51c6HTTP<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u5b9e\u65f6\u6027<\/td>\n<td align=\"left\">&#8211;<\/td>\n<td align=\"left\">\u5dee (\u9700\u8f6e\u8be2)<\/td>\n<td align=\"left\">\u9ad8 (\u670d\u52a1\u5668\u4e3b\u52a8\u63a8\u9001)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ul>\n<li>\u672c\u5730\u5f00\u53d1:\u4f18\u5148\u4f7f\u7528 Stdio&#xff0c;\u7b80\u5355\u9ad8\u6548\u3002<\/li>\n<li>\u5355\u5411\u6570\u636e\u63a8\u9001:\u77ed\u671f\u9879\u76ee\u53ef\u8003\u8651 SSE&#xff0c;\u957f\u671f\u5efa\u8bae\u8fc1\u79fb\u81f3 Streamable HTTP<\/li>\n<li>\u9ad8\u5e76\u53d1\u5206\u7cfb\u7edf:\u5fc5\u987b\u4f7f\u7528 Streamable HTTP&#xff0c;\u5c24\u5176\u9700\u53cc\u5411\u4ea4\u4e92\u65f6<\/li>\n<\/ul>\n<h3>2.3\u3001\u672c\u5730MCP\u90e8\u7f72<\/h3>\n<h4>2.3.1\u3001stdio\u7248\u672c<\/h4>\n<p>\u8fd9\u91cc\u5148\u5c1d\u8bd5stdio\u534f\u8bae\u7684\u6d4b\u8bd5&#xff0c;\u8fdb\u884c\u672c\u5730MCP\u90e8\u7f72\u7684\u64cd\u4f5c \u5c06\u4e3b\u51fd\u6570\u4fee\u6539\u4e3a&#xff1a;<\/p>\n<p>if __name__ &#061;&#061; &#034;__main__&#034;:<\/p>\n<p>\u00a0 \u00a0 mcp.run(transport&#061;&#034;stdio&#034;)<\/p>\n<p>\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165\u547d\u4ee4\u8fd0\u884cmain.py<\/p>\n<p>python main.py<\/p>\n<p>\u5982\u679c\u4f60\u8f93\u5165\u5b8c\u547d\u4ee4\u5c31\u76f4\u63a5\u9000\u51fa\u4e86\u7684\u8bdd&#xff0c;\u70b9\u51fb\u8fd9\u91cc\u7684\u4e09\u89d2\u5f62\u8fdb\u884c\u7a0b\u5e8f\u8fd0\u884c&#xff0c;\u6548\u679c\u5982\u4e0b <img decoding=\"async\" src=\"2025-08-10x4lrudts3ey.png\" alt=\"image.png\" \/> \u8fd9\u91cc\u672c\u5730\u5c31\u8fd0\u884c\u8d77\u6765\u4e86&#xff0c;\u6253\u5f00MCP\u6dfb\u52a0\u754c\u9762 \u5c06\u4e0b\u65b9\u547d\u4ee4\u8f93\u5165\u8fdb\u53bb<\/p>\n<p>{<br \/>\n\u00a0 &#034;mcpServers&#034;: {<br \/>\n\u00a0 \u00a0 &#034;mcp-plus&#034;: {<br \/>\n\u00a0 \u00a0 \u00a0 &#034;command&#034;: &#034;D:\\\\\\\\mcp_test\\\\\\\\.venv\\\\\\\\Scripts\\\\\\\\python.exe&#034;,<br \/>\n\u00a0 \u00a0 \u00a0 &#034;args&#034;: [<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 &#034;D:\\\\\\\\mcp_test\\\\\\\\main.py&#034;<br \/>\n\u00a0 \u00a0 \u00a0 ]<br \/>\n\u00a0 \u00a0 }<br \/>\n\u00a0 }<br \/>\n}<\/p>\n<p><img decoding=\"async\" src=\"2025-08-10zdjustflj4x.png\" alt=\"image.png\" \/> \u8fd9\u4e2a\u6837\u5b50\u6211\u4eec\u5c31\u624b\u6413\u6210\u529f\u4e86 <img decoding=\"async\" src=\"2025-08-10nh1h0qvu224.png\" alt=\"image.png\" \/> \u5982\u679c\u4f60\u51fa\u73b0\u4e86\u4e0b\u9762\u7684\u9519\u8bef&#xff0c;\u8bf4\u660e\u4f60\u7684 MCP \u5ba2\u6237\u7aef\u5728\u6267\u884c\u00a0main.py\u00a0\u811a\u672c\u65f6&#xff0c;\u4f7f\u7528\u7684\u662f\u4e00\u4e2a\u6ca1\u6709\u5b89\u88c5\u00a0mcp\u00a0\u5e93\u7684 Python \u73af\u5883\u3002 \u7b80\u5355\u6765\u8bf4&#xff0c;\u4f60\u7535\u8111\u4e0a\u53ef\u80fd\u88c5\u4e86\u591a\u4e2a Python\u3002\u867d\u7136\u4f60\u5728\u4e0b\u65b9\u7684\u7ec8\u7aef\u91cc\u6fc0\u6d3b\u4e86\u00a0(mcp-test)\u00a0\u8fd9\u4e2a\u865a\u62df\u73af\u5883&#xff0c;\u5e76\u4e14\u00a0mcp\u00a0\u5e93\u4e5f\u786e\u5b9e\u88c5\u5728\u4e86\u8fd9\u4e2a\u73af\u5883\u91cc&#xff0c; <img decoding=\"async\" src=\"2025-08-10w4laamlkezl.png\" alt=\"image.png\" \/> \u5f53\u5b83\u6839\u636e\u914d\u7f6e\u53bb\u6267\u884c\u547d\u4ee4\u65f6&#xff0c;\u5b83\u5f88\u53ef\u80fd\u8c03\u7528\u4e86\u7cfb\u7edf\u7684\u5168\u5c40 Python \u89e3\u91ca\u5668&#xff0c;\u800c\u60a8\u7684\u5168\u5c40 Python \u91cc\u5e76\u6ca1\u6709\u5b89\u88c5\u00a0mcp\u00a0\u5e93&#xff0c;\u6240\u4ee5\u5b83\u5c31\u62a5\u9519\u8bf4\u201c\u627e\u4e0d\u5230 mcp \u8fd9\u4e2a\u6a21\u5757\u201d\u3002<\/p>\n<p>\u8981\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898&#xff0c;\u6211\u4eec\u4e0d\u80fd\u53ea\u544a\u8bc9\u5ba2\u6237\u7aef\u8fd0\u884c\u00a0python&#xff0c;\u800c\u662f\u5fc5\u987b\u660e\u786e\u5730\u544a\u8bc9\u5b83\u4f7f\u7528\u54ea\u4e2a\u865a\u62df\u73af\u5883\u91cc\u7684\u00a0python.exe\u3002<\/p>\n<p>\u201ccommand\u201d: \u201cD:\\\\mcp_test\\\\.venv\\\\Scripts\\\\python.exe\u201d<\/p>\n<ul>\n<li>\n<p>\u6211\u4eec\u5c06\u539f\u6765\u7684\u00a0\u201ccommand\u201d: \u201cpython\u201d\u00a0\u4fee\u6539\u4e3a\u4e86\u4e00\u4e2a\u7edd\u5bf9\u8def\u5f84\u3002<\/p>\n<\/li>\n<li>\n<p>\u8fd9\u4e2a\u8def\u5f84\u76f4\u63a5\u6307\u5411\u4e86\u60a8\u00a0mcp_test\u00a0\u9879\u76ee\u4e2d&#xff0c;\u7531\u00a0uv\u00a0\u521b\u5efa\u7684\u865a\u62df\u73af\u5883 (.venv) \u91cc\u7684\u00a0python.exe\u00a0\u6587\u4ef6\u3002<\/p>\n<\/li>\n<li>\n<p>\u8fd9\u6837\u505a\u53ef\u4ee5\u786e\u4fdd\u65e0\u8bba\u5ba2\u6237\u7aef\u4ece\u54ea\u91cc\u8c03\u7528&#xff0c;\u90fd\u5fc5\u5b9a\u4f1a\u4f7f\u7528\u8fd9\u4e2a\u6b63\u786e\u7684\u3001\u5b89\u88c5\u4e86\u00a0mcp\u00a0\u5e93\u7684 Python \u89e3\u91ca\u5668\u6765\u8fd0\u884c\u60a8\u7684\u811a\u672c\u3002<\/p>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"2025-08-10xrl3nry35u3.png\" alt=\"image.png\" \/> \u8fd9\u91cc\u6211\u4eec\u5c31\u6210\u529f\u8c03\u7528\u4e86\u8fd9\u6b3emcp\u4e86 \u5982\u679c\u4f60\u5728\u505a\u6d4b\u8bd5\u7684\u65f6\u5019\u51fa\u95ee\u9898\u4e86&#xff0c;\u4f60\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u7684\u7edd\u5bf9\u8def\u5f84\u8fdb\u884c\u6587\u4ef6\u7684\u6267\u884c&#xff0c;\u524d\u9762\u7684\u662f\u4f60\u7684\u6587\u4ef6\u5939\u8def\u5f84<\/p>\n<p>d:\/mcp_test\/.venv\/Scripts\/python.exe d:\/mcp_test\/main.py<\/p>\n<h4>2.3.2\u3001SSE\u7248\u672c<\/h4>\n<p>\u5c06\u4e3b\u51fd\u6570\u4e2d\u7684\u6539\u6210\u5982\u4e0b&#xff1a;<\/p>\n<p><span class=\"token keyword\">if<\/span> __name__ <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token string\">&#034;__main__&#034;<\/span><span class=\"token builtin class-name\">:<\/span><\/p>\n<p>    mcp.run<span class=\"token punctuation\">(<\/span>transport<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;sse&#034;<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>\u8fd0\u884c\u7a0b\u5e8f&#xff0c;\u4ed6\u8fd9\u91cc\u663e\u793a\u4e86\u4e00\u4e2a\u672c\u5730\u7684\u7aef\u53e3 <img decoding=\"async\" src=\"2025-08-10vhbgeayxnxx.png\" alt=\"image.png\" \/> \u5c06\u4e0b\u9762\u7684\u4ee3\u7801\u52a0\u5165\u5230mcp\u4e2d<\/p>\n<p><span class=\"token punctuation\">{<\/span><\/p>\n<p>  <span class=\"token string\">&#034;mcpServers&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token punctuation\">{<\/span><\/p>\n<p>    <span class=\"token string\">&#034;plus&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token punctuation\">{<\/span><\/p>\n<p>      <span class=\"token string\">&#034;url&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;http:\/\/127.0.0.1:8000\/sse&#034;<\/span><\/p>\n<p>    <span class=\"token punctuation\">}<\/span><\/p>\n<p>  <span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token punctuation\">}<\/span><\/p>\n<p><img decoding=\"async\" src=\"2025-08-10urcgshq1gaz.png\" alt=\"image.png\" \/><\/p>\n<p>\u5728trae\u4e2d\u5c31\u663e\u793a\u8fde\u63a5\u6210\u529f\u4e86&#xff0c;\u6211\u8fd9\u91cc\u662f\u5c06\u4ee3\u7801\u5728codebuddy\u8fdb\u884c\u8fd0\u884c&#xff0c;\u7136\u540e\u5728trae\u4e2d\u8fdb\u884c\u6d4b\u8bd5\u94fe\u63a5&#xff0c;\u4e0b\u9762\u662fcodebuddy\u7684\u7ec8\u7aef\u4fe1\u606f&#xff0c;\u8bf4\u660e\u6211\u4eec\u94fe\u63a5\u6210\u529f\u4e86 <img decoding=\"async\" src=\"2025-08-10dnfhddjzlyk.png\" alt=\"image.png\" \/> \u5e76\u4e14\u6211\u4eec\u7684http:\/\/127.0.0.1:8000\/sse\u4e5f\u662f\u5b58\u5728\u4fe1\u606f\u7684 <img decoding=\"async\" src=\"2025-08-10mifub0kyzvt.png\" alt=\"image.png\" \/><\/p>\n<p>\u8fdb\u884c\u8fd0\u7b97\u6d4b\u8bd5\u6548\u679c\u5982\u4e0b&#xff1a; <img decoding=\"async\" src=\"2025-08-10yqcl3utvevt.png\" alt=\"image.png\" \/> \u5e76\u4e14\u83b7\u5f97\u7ed3\u679c\u4e4b\u540e&#xff0c;\u8fd9\u91cc\u662f\u672c\u5730\u7aef\u53e3sse\u4e0a\u662f\u4f1a\u663e\u793aping\u7684\u4fe1\u606f\u7684 <img decoding=\"async\" src=\"2025-08-10jhor1mzuv1n.png\" alt=\"image.png\" \/><\/p>\n<p>\u597d\u4e86&#xff0c;\u5230\u8fd9\u91cc\u6211\u4eec\u5c31\u5b8c\u6210\u4e86\u4e00\u4e2a\u7b80\u5355MCP\u7684\u5f00\u53d1\u64cd\u4f5c\u4e86<\/p>\n<h2>3\u3001\u9ad8\u7ea7MCP\u642d\u5efa<\/h2>\n<p>\u8fd9\u91cc\u6211\u4eec\u642d\u5efa\u4e86\u4e24\u6b3eMCP&#xff0c;\u7eafai&#xff0c; \u9879\u76ee\u5730\u5740\u5982\u4e0b&#xff1a; \u56fe\u7247\u7d20\u63cf\u5316MCP GitHub\u5730\u5740 \u6296\u97f3\u6570\u636e\u5206\u6790MCP GitHub\u5730\u5740 <img decoding=\"async\" src=\"2025-08-10tdszfmsv4uu.png\" alt=\"image.png\" \/> <img decoding=\"async\" src=\"2025-08-10i5rwko4ddhi.png\" alt=\"image.png\" \/><\/p>\n<p>\u5982\u679c\u4f60\u60f3\u4f7f\u7528\u7684\u8bdd\u53ef\u4ee5\u6765\u9b54\u642d\u793e\u533a\u6765\u4f7f\u7528 https:\/\/www.modelscope.cn\/mcp\/servers\/Undoom\/undoom-douyin-data-analysis https:\/\/www.modelscope.cn\/mcp\/servers\/Undoom\/undoom-sketch-mcp <img decoding=\"async\" src=\"2025-08-10uqtn3dwiomi.png\" alt=\"image.png\" \/><\/p>\n<p>\u5982\u679c\u4f60\u73b0\u5728\u672c\u5730\u6709\u4e86\u4e00\u4e2a\u641e\u597d\u4e86\u7684\u9879\u76ee&#xff0c;\u4f60\u53ef\u4ee5\u90e8\u7f72\u5230pypi\u4e0a&#xff0c;\u8fd9\u4e2a\u4ec5\u9650\u4e8epy\u4ee3\u7801\u5b9e\u73b0\u7684mcp&#xff0c;\u5982\u679c\u4f60\u7684\u57fa\u7840\u8bed\u8a00\u662fjava\u7684\u8bdd&#xff0c;\u5c31\u53bbnpm\u4e0a\u90e8\u7f72<\/p>\n<p>\u8fd9\u4e2a\u90e8\u7f72\u7684\u64cd\u4f5c\u4f60\u53ef\u4ee5\u53bb\u641c\u7d22&#xff0c;\u5982\u4f55\u5c06\u672c\u5730\u9879\u76ee\u8fdb\u884c\u6253\u5305\u5e76\u4e14\u53d1\u5e03\u5230pypi\u4e0a \u5c06\u60a8\u7684\u672c\u5730MCP (Model Context Protocol) \u9879\u76ee\u6253\u5305\u5e76\u53d1\u5e03\u5230PyPI&#xff0c;\u53ef\u4ee5\u8ba9\u5176\u4ed6\u5f00\u53d1\u8005\u901a\u8fc7pip install\u547d\u4ee4\u8f7b\u677e\u5b89\u88c5\u548c\u4f7f\u7528\u60a8\u7684\u4ee3\u7801\u3002\u672c\u6559\u7a0b\u5c06\u4e3a\u60a8\u63d0\u4f9b\u8be6\u7ec6\u7684\u6b65\u9aa4\u6307\u5bfc\u3002 \u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u6b65\u9aa4 \u6253\u5305\u7136\u540e\u53d1\u5e03&#xff0c;\u6574\u4e2a\u8fc7\u7a0b\u4f60\u5b8c\u5168\u901a\u8fc7ai\u64cd\u4f5c\u5373\u53ef \u6700\u91cd\u8981\u7684\u5c31\u662f\u6ce8\u518cpypi&#xff0c;\u7136\u540e\u8fdb\u884ctoken\u7684\u83b7\u53d6&#xff0c;\u5176\u4ed6\u7684\u65e0\u6240\u8c13 \u5982\u679c\u4f60\u5728uv\u7684\u65f6\u5019\u51fa\u73b0\u4e86\u5361\u987f\u6216\u8005\u4e0d\u80fd\u8fdb\u884cuv sync\u7b49\u7b49\u7684\u64cd\u4f5c&#xff0c;\u4f60\u76f4\u63a5\u8ba9ai\u5e2e\u4f60\u57fa\u4e8e\u6e05\u534e\u6e90\u751f\u6210\u547d\u4ee4\u5373\u53ef<\/p>\n<p>\u4e0b\u9762\u7684\u90e8\u7f72\u662fai\u751f\u6210\u7684&#xff0c;\u4ec5\u4f9b\u53c2\u8003&#xff0c;\u5b9e\u9645\u8fd8\u662f\u4ee5\u771f\u5b9e\u64cd\u4f5c\u4e3a\u4e3b<\/p>\n<h4>\u7b2c\u4e00\u6b65&#xff1a;\u51c6\u5907\u60a8\u7684\u9879\u76ee\u7ed3\u6784<\/h4>\n<p>\u4e00\u4e2a\u6807\u51c6\u7684Python\u9879\u76ee\u7ed3\u6784\u5bf9\u4e8e\u6253\u5305\u81f3\u5173\u91cd\u8981\u3002\u5982\u679c\u60a8\u7684\u9879\u76ee\u540d\u4e3amy_mcp_project&#xff0c;\u5efa\u8bae\u91c7\u7528\u4ee5\u4e0b\u76ee\u5f55\u7ed3\u6784&#xff1a;<\/p>\n<p>my_mcp_project\/<br \/>\n\u251c\u2500\u2500 my_mcp_project\/<br \/>\n\u2502   \u251c\u2500\u2500 __init__.py<br \/>\n\u2502   \u2514\u2500\u2500 main.py<br \/>\n\u251c\u2500\u2500 tests\/<br \/>\n\u2502   \u2514\u2500\u2500 test_main.py<br \/>\n\u251c\u2500\u2500 README.md<br \/>\n\u251c\u2500\u2500 LICENSE<br \/>\n\u251c\u2500\u2500 pyproject.toml<br \/>\n\u2514\u2500\u2500 setup.py<\/p>\n<ul>\n<li>my_mcp_project\/my_mcp_project\/: \u8fd9\u662f\u60a8\u7684Python\u5305\u76ee\u5f55&#xff0c;\u5176\u4e2d\u5305\u542b\u9879\u76ee\u7684\u6838\u5fc3\u4ee3\u7801\u3002<\/li>\n<li>__init__.py: \u8fd9\u4e2a\u7a7a\u6587\u4ef6\u544a\u8bc9Python\u8be5\u76ee\u5f55\u662f\u4e00\u4e2a\u5305\u3002<\/li>\n<li>README.md: \u9879\u76ee\u7684\u8be6\u7ec6\u8bf4\u660e\u6587\u4ef6&#xff0c;\u4f7f\u7528Markdown\u683c\u5f0f\u7f16\u5199\u3002 \u5b83\u5c06\u663e\u793a\u5728PyPI\u7684\u9879\u76ee\u9875\u9762\u4e0a\u3002<\/li>\n<li>LICENSE: \u5305\u542b\u60a8\u7684\u9879\u76ee\u8bb8\u53ef\u8bc1\u7684\u6587\u672c\u6587\u4ef6\u3002\u9009\u62e9\u4e00\u4e2a\u5f00\u6e90\u8bb8\u53ef\u8bc1\u5f88\u91cd\u8981&#xff0c;\u4f8b\u5982MIT\u8bb8\u53ef\u8bc1\u3002<\/li>\n<li>pyproject.toml: \u8fd9\u4e2a\u6587\u4ef6\u544a\u8bc9\u6784\u5efa\u5de5\u5177&#xff08;\u5982pip&#xff09;\u6784\u5efa\u9879\u76ee\u6240\u9700\u7684\u5185\u5bb9\u3002<\/li>\n<li>setup.py: \u8fd9\u662fsetuptools\u7684\u6784\u5efa\u811a\u672c&#xff0c;\u5305\u542b\u4e86\u9879\u76ee\u7684\u5143\u6570\u636e&#xff0c;\u5982\u540d\u79f0\u3001\u7248\u672c\u548c\u4f9d\u8d56\u9879\u3002<\/li>\n<\/ul>\n<h4>\u7b2c\u4e8c\u6b65&#xff1a;\u521b\u5efa\u5fc5\u8981\u7684\u914d\u7f6e\u6587\u4ef6<\/h4>\n<li>\n<p>pyproject.toml<\/p>\n<p>\u5728\u9879\u76ee\u6839\u76ee\u5f55\u4e0b\u521b\u5efapyproject.toml\u6587\u4ef6&#xff0c;\u5e76\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\u3002\u8fd9\u6307\u5b9a\u4e86\u6784\u5efa\u9879\u76ee\u6240\u9700\u7684\u4f9d\u8d56\u3002<\/p>\n<p> [build-system]<br \/>\nrequires &#061; [&#034;setuptools&gt;&#061;42&#034;, &#034;wheel&#034;]<br \/>\nbuild-backend &#061; &#034;setuptools.build_meta&#034;\n <\/li>\n<li>\n<p>setup.py<\/p>\n<p>\u521b\u5efasetup.py\u6587\u4ef6\u3002\u8fd9\u662f\u6253\u5305\u7684\u6838\u5fc3&#xff0c;\u5b83\u5b9a\u4e49\u4e86\u9879\u76ee\u7684\u5404\u79cd\u5c5e\u6027\u3002<\/p>\n<p> <span class=\"token keyword\">import<\/span> setuptools<\/p>\n<p><span class=\"token keyword\">with<\/span> <span class=\"token builtin\">open<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;README.md&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;r&#034;<\/span><span class=\"token punctuation\">,<\/span> encoding<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;utf-8&#034;<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">as<\/span> fh<span class=\"token punctuation\">:<\/span><br \/>\n    long_description <span class=\"token operator\">&#061;<\/span> fh<span class=\"token punctuation\">.<\/span>read<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>setuptools<span class=\"token punctuation\">.<\/span>setup<span class=\"token punctuation\">(<\/span><br \/>\n    name<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;my_mcp_project&#034;<\/span><span class=\"token punctuation\">,<\/span>  <span class=\"token comment\"># \u66ff\u6362\u4e3a\u60a8\u7684\u5305\u540d<\/span><br \/>\n    version<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;0.0.1&#034;<\/span><span class=\"token punctuation\">,<\/span>  <span class=\"token comment\"># \u60a8\u7684\u5305\u7684\u521d\u59cb\u7248\u672c<\/span><br \/>\n    author<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;Your Name&#034;<\/span><span class=\"token punctuation\">,<\/span>  <span class=\"token comment\"># \u60a8\u7684\u540d\u5b57<\/span><br \/>\n    author_email<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;your.email&#064;example.com&#034;<\/span><span class=\"token punctuation\">,<\/span>  <span class=\"token comment\"># \u60a8\u7684\u90ae\u7bb1<\/span><br \/>\n    description<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;A small example package for MCP&#034;<\/span><span class=\"token punctuation\">,<\/span>  <span class=\"token comment\"># \u9879\u76ee\u7684\u7b80\u77ed\u63cf\u8ff0<\/span><br \/>\n    long_description<span class=\"token operator\">&#061;<\/span>long_description<span class=\"token punctuation\">,<\/span><br \/>\n    long_description_content_type<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;text\/markdown&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    url<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;https:\/\/github.com\/yourusername\/my_mcp_project&#034;<\/span><span class=\"token punctuation\">,<\/span>  <span class=\"token comment\"># \u9879\u76ee\u7684URL<\/span><br \/>\n    packages<span class=\"token operator\">&#061;<\/span>setuptools<span class=\"token punctuation\">.<\/span>find_packages<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    classifiers<span class=\"token operator\">&#061;<\/span><span class=\"token punctuation\">[<\/span><br \/>\n        <span class=\"token string\">&#034;Programming Language :: Python :: 3&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token string\">&#034;License :: OSI Approved :: MIT License&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token string\">&#034;Operating System :: OS Independent&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    python_requires<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#039;&gt;&#061;3.10&#039;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token comment\"># \u6307\u5b9a\u9879\u76ee\u4f9d\u8d56\u7684Python\u7248\u672c [12]<\/span><br \/>\n    install_requires<span class=\"token operator\">&#061;<\/span><span class=\"token punctuation\">[<\/span><br \/>\n        <span class=\"token comment\"># \u5728\u6b64\u5217\u51fa\u60a8\u7684\u9879\u76ee\u4f9d\u8d56\u9879&#xff0c;\u4f8b\u5982&#xff1a;<\/span><br \/>\n        <span class=\"token comment\"># &#034;requests&#034;,<\/span><br \/>\n        <span class=\"token string\">&#034;mcp[cli]&#034;<\/span> <span class=\"token comment\"># \u5982\u679c\u60a8\u7684\u9879\u76ee\u4f9d\u8d56\u4e8eMCP [12]<\/span><br \/>\n    <span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span><br \/>\n<span class=\"token punctuation\">)<\/span><\/p>\n<p>\u5173\u952e\u53c2\u6570\u8bf4\u660e:<\/p>\n<ul>\n<li>name: \u60a8\u5728PyPI\u4e0a\u53d1\u5e03\u7684\u5305\u7684\u540d\u79f0&#xff0c;\u9700\u8981\u662f\u552f\u4e00\u7684\u3002<\/li>\n<li>version: \u5305\u7684\u7248\u672c\u53f7\u3002 \u6bcf\u6b21\u66f4\u65b0\u65f6\u90fd\u9700\u8981\u589e\u52a0\u7248\u672c\u53f7\u3002<\/li>\n<li>author, author_email: \u4f5c\u8005\u4fe1\u606f\u3002<\/li>\n<li>description, long_description: \u9879\u76ee\u7684\u7b80\u77ed\u548c\u8be6\u7ec6\u63cf\u8ff0\u3002<\/li>\n<li>url: \u901a\u5e38\u662f\u9879\u76ee\u7684GitHub\u4ed3\u5e93\u5730\u5740\u3002<\/li>\n<li>packages: setuptools.find_packages()\u4f1a\u81ea\u52a8\u53d1\u73b0\u9879\u76ee\u4e2d\u7684\u6240\u6709\u5305\u3002<\/li>\n<li>install_requires: \u5217\u51fa\u60a8\u7684\u9879\u76ee\u6b63\u5e38\u8fd0\u884c\u6240\u9700\u7684\u7b2c\u4e09\u65b9\u5e93\u3002<\/li>\n<\/ul>\n<\/li>\n<h4>\u7b2c\u4e09\u6b65&#xff1a;\u6ce8\u518cPyPI\u8d26\u6237<\/h4>\n<p>\u60a8\u9700\u8981\u5728PyPI (Python Package Index) \u5b98\u7f51\u4e0a\u6ce8\u518c\u4e00\u4e2a\u8d26\u6237\u624d\u80fd\u53d1\u5e03\u60a8\u7684\u5305\u3002<\/p>\n<ul>\n<li>\u5b98\u65b9PyPI: https:\/\/pypi.org\/<\/li>\n<\/ul>\n<p>\u6ce8\u518c\u5b8c\u6210\u540e&#xff0c;\u5efa\u8bae\u5728\u60a8\u7684\u8d26\u6237\u8bbe\u7f6e\u4e2d\u751f\u6210\u4e00\u4e2aAPI\u4ee4\u724c&#xff08;API token&#xff09;\u7528\u4e8e\u4e0a\u4f20&#xff0c;\u8fd9\u6bd4\u76f4\u63a5\u4f7f\u7528\u7528\u6237\u540d\u548c\u5bc6\u7801\u66f4\u5b89\u5168\u3002<\/p>\n<h4>\u7b2c\u56db\u6b65&#xff1a;\u6253\u5305\u60a8\u7684\u9879\u76ee<\/h4>\n<li>\n<p>\u5b89\u88c5\u6784\u5efa\u5de5\u5177<\/p>\n<p>\u786e\u4fdd\u60a8\u5df2\u7ecf\u5b89\u88c5\u4e86setuptools\u548cwheel&#xff1a;<\/p>\n<p> pip <span class=\"token function\">install<\/span> &#8211;upgrade setuptools wheel\n <\/li>\n<li>\n<p>\u751f\u6210\u5206\u53d1\u6863\u6848<\/p>\n<p>\u5728\u60a8\u7684\u9879\u76ee\u6839\u76ee\u5f55\u4e0b&#xff08;\u4e0esetup.py\u540c\u7ea7&#xff09;&#xff0c;\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4&#xff1a;<\/p>\n<p> python setup.py sdist bdist_wheel<\/p>\n<p>\u8be5\u547d\u4ee4\u4f1a\u751f\u6210\u4e24\u4e2a\u6587\u4ef6\u5728dist\u76ee\u5f55\u4e0b&#xff1a;\u4e00\u4e2a.tar.gz\u6e90\u7801\u5f52\u6863\u548c\u4e00\u4e2a.whl wheel\u6587\u4ef6\u3002<\/p>\n<\/li>\n<h4>\u7b2c\u4e94\u6b65&#xff1a;\u4e0a\u4f20\u5230PyPI<\/h4>\n<li>\n<p>\u5b89\u88c5Twine<\/p>\n<p>Twine\u662f\u5b98\u65b9\u63a8\u8350\u7684\u7528\u4e8e\u5c06\u5305\u4e0a\u4f20\u5230PyPI\u7684\u5b89\u5168\u5de5\u5177\u3002<\/p>\n<p> pip <span class=\"token function\">install<\/span> &#8211;upgrade twine\n <\/li>\n<li>\n<p>\u4f7f\u7528Twine\u4e0a\u4f20<\/p>\n<p>\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u5c06dist\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\u4e0a\u4f20\u5230PyPI\u3002<\/p>\n<p> twine upload dist\/*<\/p>\n<p>\u7cfb\u7edf\u4f1a\u63d0\u793a\u60a8\u8f93\u5165PyPI\u7684\u7528\u6237\u540d\u548c\u5bc6\u7801\u3002\u5982\u679c\u60a8\u4f7f\u7528\u7684\u662fAPI\u4ee4\u724c&#xff0c;\u7528\u6237\u540d\u4e3a__token__&#xff0c;\u5bc6\u7801\u4e3a\u60a8\u751f\u6210\u7684\u4ee4\u724c&#xff08;\u5305\u62ecpypi-\u524d\u7f00&#xff09;\u3002<\/p>\n<\/li>\n<h4>\u7b2c\u516d\u6b65&#xff1a;\u9a8c\u8bc1\u60a8\u7684\u53d1\u5e03<\/h4>\n<p>\u4e0a\u4f20\u6210\u529f\u540e&#xff0c;\u60a8\u5e94\u8be5\u80fd\u5728PyPI\u4e0a\u770b\u5230\u60a8\u7684\u9879\u76ee\u9875\u9762\u3002\u7b49\u5f85\u51e0\u5206\u949f\u540e&#xff0c;\u60a8\u6216\u5176\u4ed6\u7528\u6237\u5c31\u53ef\u4ee5\u901a\u8fc7pip\u6765\u5b89\u88c5\u60a8\u7684\u5305\u4e86&#xff1a;<\/p>\n<p>pip <span class=\"token function\">install<\/span> my_mcp_project<\/p>\n<h4>\u9488\u5bf9MCP Server\u7684\u7279\u522b\u8bf4\u660e<\/h4>\n<p>\u6839\u636e\u641c\u7d22\u7ed3\u679c&#xff0c;MCP Server\u662f\u4e00\u4e2a\u7279\u5b9a\u7684\u9879\u76ee\u7c7b\u578b&#xff0c;\u53ef\u80fd\u9700\u8981\u4f9d\u8d56mcp\u5305\u3002 \u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b&#xff0c;\u8bf7\u786e\u4fdd\u5728setup.py\u7684install_requires\u4e2d\u52a0\u5165\u4e86&#034;mcp[cli]&#034;\u6216\u7c7b\u4f3c\u7684\u4f9d\u8d56\u9879\u3002<\/p>\n<p>\u6b64\u5916&#xff0c;\u4e00\u4e9bMCP Server\u7684\u53d1\u5e03\u6307\u5357\u63d0\u5230\u4e86\u4f7f\u7528uv\u8fd9\u4e2a\u5de5\u5177\u94fe\u6765\u7ba1\u7406Python\u9879\u76ee\u3002 \u867d\u7136\u672c\u6559\u7a0b\u4f7f\u7528\u7684\u662f\u66f4\u4e3a\u901a\u7528\u7684pip\u548csetuptools&#xff0c;\u4f46uv\u4e5f\u662f\u4e00\u4e2a\u503c\u5f97\u4e86\u89e3\u7684\u73b0\u4ee3\u5316Python\u6253\u5305\u548c\u9879\u76ee\u7ba1\u7406\u5de5\u5177\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb2.4w\u6b21\uff0c\u70b9\u8d5e84\u6b21\uff0c\u6536\u85cf57\u6b21\u3002MCP\u662f\u4e00\u4e2a\u7531Anthropic\u516c\u53f8\u63a8\u51fa\u7684\u5f00\u6e90\u6807\u51c6\uff0c\u65e8\u5728\u7edf\u4e00AI\u6a21\u578b\u4e0e\u5916\u90e8\u5de5\u5177\u53ca\u6570\u636e\u6e90\u7684\u4ea4\u4e92\u65b9\u5f0f\u3002\u5728MCP\u51fa\u73b0\u4e4b\u524d\uff0c\u5f00\u53d1\u8005\u9700\u8981\u4e3a\u6bcf\u4e00\u4e2aAI\u9700\u8981\u63a5\u5165\u7684\u5e94\u7528\u7f16\u5199\u7279\u5b9a\u7684\u96c6\u6210\u4ee3\u7801\uff0c\u8fc7\u7a0b\u7e41\u7410\u4e14\u96be\u4ee5\u6269\u5c55\u3002MCP\u7684\u51fa\u73b0\u6539\u53d8\u4e86\u8fd9\u4e00\u73b0\u72b6\uff0c\u5b83\u5c31\u5982\u540c\u4e00\u4e2a\u4e3aAI\u5e94\u7528\u6253\u9020\u7684\u201cUSB-C\u201d\u63a5\u53e3\uff0c\u63d0\u4f9b\u4e86\u4e00\u4e2a\u6807\u51c6\u5316\u7684\u8fde\u63a5\u65b9\u5f0f\uff0c\u8ba9AI\u6a21\u578b\u53ef\u4ee5\u8f7b\u677e\u5730\u4e0e\u4e0d\u540c\u7684\u6570\u636e\u6e90\u548c\u5de5\u5177\u8fdb\u884c\u8fde\u63a5\u548c\u901a\u4fe1\u3002\u7b80\u800c\u8a00\u4e4b\uff0cMCP\u5141\u8bb8AI\u5e94\u7528\uff08\u4f5c\u4e3a\u5ba2\u6237\u7aef\uff09\u4e0e\u5916\u90e8\u5de5\u5177\u6216\u6570\u636e\u6e90\uff08\u4f5c\u4e3a\u670d\u52a1\u5668\uff09\u4e4b\u95f4\u5efa\u7acb\u5b89\u5168\u7684\u53cc\u5411\u8fde\u63a5\u3002<\/p>\n","protected":false},"author":2,"featured_media":51331,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[666],"topic":[],"class_list":["post-51351","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-microsoft"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u624b\u6413MCP\u5168\u6d41\u7a0b\u6307\u5357\uff1a\u4ece\u672c\u5730\u5f00\u53d1\u90e8\u7f72\u5230PyPI\u516c\u5f00\u53d1\u5e03 - \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\/51351.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u624b\u6413MCP\u5168\u6d41\u7a0b\u6307\u5357\uff1a\u4ece\u672c\u5730\u5f00\u53d1\u90e8\u7f72\u5230PyPI\u516c\u5f00\u53d1\u5e03 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb2.4w\u6b21\uff0c\u70b9\u8d5e84\u6b21\uff0c\u6536\u85cf57\u6b21\u3002MCP\u662f\u4e00\u4e2a\u7531Anthropic\u516c\u53f8\u63a8\u51fa\u7684\u5f00\u6e90\u6807\u51c6\uff0c\u65e8\u5728\u7edf\u4e00AI\u6a21\u578b\u4e0e\u5916\u90e8\u5de5\u5177\u53ca\u6570\u636e\u6e90\u7684\u4ea4\u4e92\u65b9\u5f0f\u3002\u5728MCP\u51fa\u73b0\u4e4b\u524d\uff0c\u5f00\u53d1\u8005\u9700\u8981\u4e3a\u6bcf\u4e00\u4e2aAI\u9700\u8981\u63a5\u5165\u7684\u5e94\u7528\u7f16\u5199\u7279\u5b9a\u7684\u96c6\u6210\u4ee3\u7801\uff0c\u8fc7\u7a0b\u7e41\u7410\u4e14\u96be\u4ee5\u6269\u5c55\u3002MCP\u7684\u51fa\u73b0\u6539\u53d8\u4e86\u8fd9\u4e00\u73b0\u72b6\uff0c\u5b83\u5c31\u5982\u540c\u4e00\u4e2a\u4e3aAI\u5e94\u7528\u6253\u9020\u7684\u201cUSB-C\u201d\u63a5\u53e3\uff0c\u63d0\u4f9b\u4e86\u4e00\u4e2a\u6807\u51c6\u5316\u7684\u8fde\u63a5\u65b9\u5f0f\uff0c\u8ba9AI\u6a21\u578b\u53ef\u4ee5\u8f7b\u677e\u5730\u4e0e\u4e0d\u540c\u7684\u6570\u636e\u6e90\u548c\u5de5\u5177\u8fdb\u884c\u8fde\u63a5\u548c\u901a\u4fe1\u3002\u7b80\u800c\u8a00\u4e4b\uff0cMCP\u5141\u8bb8AI\u5e94\u7528\uff08\u4f5c\u4e3a\u5ba2\u6237\u7aef\uff09\u4e0e\u5916\u90e8\u5de5\u5177\u6216\u6570\u636e\u6e90\uff08\u4f5c\u4e3a\u670d\u52a1\u5668\uff09\u4e4b\u95f4\u5efa\u7acb\u5b89\u5168\u7684\u53cc\u5411\u8fde\u63a5\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/51351.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-10T13:35:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810133532-6898a02423d1e.gif\" \/>\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=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/51351.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/51351.html\",\"name\":\"\u624b\u6413MCP\u5168\u6d41\u7a0b\u6307\u5357\uff1a\u4ece\u672c\u5730\u5f00\u53d1\u90e8\u7f72\u5230PyPI\u516c\u5f00\u53d1\u5e03 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-10T13:35:44+00:00\",\"dateModified\":\"2025-08-10T13:35:44+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/51351.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/51351.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/51351.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u624b\u6413MCP\u5168\u6d41\u7a0b\u6307\u5357\uff1a\u4ece\u672c\u5730\u5f00\u53d1\u90e8\u7f72\u5230PyPI\u516c\u5f00\u53d1\u5e03\"}]},{\"@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\u6413MCP\u5168\u6d41\u7a0b\u6307\u5357\uff1a\u4ece\u672c\u5730\u5f00\u53d1\u90e8\u7f72\u5230PyPI\u516c\u5f00\u53d1\u5e03 - \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\/51351.html","og_locale":"zh_CN","og_type":"article","og_title":"\u624b\u6413MCP\u5168\u6d41\u7a0b\u6307\u5357\uff1a\u4ece\u672c\u5730\u5f00\u53d1\u90e8\u7f72\u5230PyPI\u516c\u5f00\u53d1\u5e03 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb2.4w\u6b21\uff0c\u70b9\u8d5e84\u6b21\uff0c\u6536\u85cf57\u6b21\u3002MCP\u662f\u4e00\u4e2a\u7531Anthropic\u516c\u53f8\u63a8\u51fa\u7684\u5f00\u6e90\u6807\u51c6\uff0c\u65e8\u5728\u7edf\u4e00AI\u6a21\u578b\u4e0e\u5916\u90e8\u5de5\u5177\u53ca\u6570\u636e\u6e90\u7684\u4ea4\u4e92\u65b9\u5f0f\u3002\u5728MCP\u51fa\u73b0\u4e4b\u524d\uff0c\u5f00\u53d1\u8005\u9700\u8981\u4e3a\u6bcf\u4e00\u4e2aAI\u9700\u8981\u63a5\u5165\u7684\u5e94\u7528\u7f16\u5199\u7279\u5b9a\u7684\u96c6\u6210\u4ee3\u7801\uff0c\u8fc7\u7a0b\u7e41\u7410\u4e14\u96be\u4ee5\u6269\u5c55\u3002MCP\u7684\u51fa\u73b0\u6539\u53d8\u4e86\u8fd9\u4e00\u73b0\u72b6\uff0c\u5b83\u5c31\u5982\u540c\u4e00\u4e2a\u4e3aAI\u5e94\u7528\u6253\u9020\u7684\u201cUSB-C\u201d\u63a5\u53e3\uff0c\u63d0\u4f9b\u4e86\u4e00\u4e2a\u6807\u51c6\u5316\u7684\u8fde\u63a5\u65b9\u5f0f\uff0c\u8ba9AI\u6a21\u578b\u53ef\u4ee5\u8f7b\u677e\u5730\u4e0e\u4e0d\u540c\u7684\u6570\u636e\u6e90\u548c\u5de5\u5177\u8fdb\u884c\u8fde\u63a5\u548c\u901a\u4fe1\u3002\u7b80\u800c\u8a00\u4e4b\uff0cMCP\u5141\u8bb8AI\u5e94\u7528\uff08\u4f5c\u4e3a\u5ba2\u6237\u7aef\uff09\u4e0e\u5916\u90e8\u5de5\u5177\u6216\u6570\u636e\u6e90\uff08\u4f5c\u4e3a\u670d\u52a1\u5668\uff09\u4e4b\u95f4\u5efa\u7acb\u5b89\u5168\u7684\u53cc\u5411\u8fde\u63a5\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/51351.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-10T13:35:44+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810133532-6898a02423d1e.gif"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/51351.html","url":"https:\/\/www.wsisp.com\/helps\/51351.html","name":"\u624b\u6413MCP\u5168\u6d41\u7a0b\u6307\u5357\uff1a\u4ece\u672c\u5730\u5f00\u53d1\u90e8\u7f72\u5230PyPI\u516c\u5f00\u53d1\u5e03 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-10T13:35:44+00:00","dateModified":"2025-08-10T13:35:44+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/51351.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/51351.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/51351.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u624b\u6413MCP\u5168\u6d41\u7a0b\u6307\u5357\uff1a\u4ece\u672c\u5730\u5f00\u53d1\u90e8\u7f72\u5230PyPI\u516c\u5f00\u53d1\u5e03"}]},{"@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\/51351","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=51351"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/51351\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/51331"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=51351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=51351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=51351"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=51351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}