{"id":3634,"date":"2026-08-17T10:35:13","date_gmt":"2026-08-17T02:35:13","guid":{"rendered":"https:\/\/ai.zhousir.top\/?p=3634"},"modified":"2026-08-17T10:40:42","modified_gmt":"2026-08-17T02:40:42","slug":"mcp%e6%9c%8d%e5%8a%a1%e5%8e%9f%e7%94%9f%e8%b0%83%e7%94%a8-%e4%bb%8e%e6%9c%ac%e5%9c%b0%e5%b7%a5%e5%85%b7%e5%88%b0%e5%85%a8%e4%b8%96%e7%95%8c","status":"publish","type":"post","link":"https:\/\/ai.zhousir.top\/?p=3634","title":{"rendered":"MCP\u670d\u52a1\u539f\u751f\u8c03\u7528-\u4ece\u672c\u5730\u5de5\u5177\u5230\u5168\u4e16\u754c"},"content":{"rendered":"<section id=\"wenyan\" style=\"font-family: system-ui, 'Apple Color Emoji', 'Segoe UI', 'Segoe UI Symbol', 'Noto Sans', Roboto, sans-serif; word-break: break-word; overflow-wrap: break-word; color: #000000; font-size: 16px; line-height: 1.75; caret-color: #000000;\" data-provider=\"WenYan\">\n<blockquote style=\"color: #555555; background-color: #fff9eb; background-image: none; padding: 16px 20px; margin: 20px 0px; border-width: 0px 0px 0px 4px; border-style: none none none solid; border-color: currentcolor currentcolor currentcolor #f8b43f; border-radius: 6px; font-style: normal; quotes: none;\">\n<p style=\"margin: 0.55em 0px; color: #555555; text-indent: 0px; padding: 0px; line-height: 1.75; font-style: normal; background: transparent;\">\u4e0a\u7bc7\u4f60\u5b66\u4f1a\u4e86\u5de5\u7a0b\u5316\u7ba1\u7406\u591a\u4e2a\u5de5\u5177\u2014\u2014\u6ce8\u518c\u8868\u6a21\u5f0f\u8ba9\u65b0\u589e\u5de5\u5177\u53ea\u9700\u4e00\u884c\u3002\u4f46\u4f60\u7684\u5de5\u5177\u662f\u81ea\u5df1\u5199\u7684\uff0c\u522b\u4eba\u7684\u5de5\u5177\u5462\uff1f\u8fd9\u7bc7\u8bb2 <strong style=\"color: #333333; font-weight: bold;\">MCP<\/strong>\u2014\u2014\u4e00\u5957\u6807\u51c6\u534f\u8bae\uff0c\u8ba9\u4efb\u4f55 AI \u5bbf\u4e3b\u90fd\u80fd\u4f7f\u7528\u4efb\u4f55 MCP \u670d\u52a1\uff0c\u4e0d\u9650\u7f16\u7a0b\u8bed\u8a00\uff0c\u4e0d\u9650\u4ea7\u54c1\u3002<\/p>\n<\/blockquote>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: #f0e6d0 currentcolor currentcolor; margin: 24px 0px;\" \/>\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; text-align: left; background: linear-gradient(to top, #f8b43f 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px; border: medium none currentcolor;\"><span style=\"color: #333333; font-weight: bold;\">\u5c0f\u660e\u7684\u65b0\u56f0\u60d1<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u7528\u6ce8\u518c\u8868\u6a21\u5f0f\u628a\u81ea\u5df1\u7684\u5de5\u5177\u7ba1\u7406\u5f97\u4e95\u4e95\u6709\u6761\u3002\u4f46\u4e0a\u5468\u63a5\u4e86\u4e2a\u9700\u6c42\uff0c\u8ba9\u4ed6\u5934\u75bc\u4e86\u2014\u2014<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u5ba2\u6237\u8bf4\uff1a&#8221;\u6211\u4eec\u7684 AI \u52a9\u624b\u80fd\u4e0d\u80fd\u67e5\u5168\u7403\u822a\u73ed\uff1f&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u60f3\uff0c\u81ea\u5df1\u5199\u822a\u73ed\u641c\u7d22 API\uff1fKiwi.com \u7684\u63a5\u53e3\u5f97\u7ffb\u6587\u6863\u3001\u5904\u7406\u8bf7\u6c42\u9650\u6d41\u3001\u641e\u5b9a\u7f13\u5b58\u2026\u2026\u5149\u662f\u641e\u6e05\u695a\u4ef7\u683c\u89c4\u5219\u5c31\u8981\u82b1\u4e00\u5468\u3002<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u4ed6\u53bb\u95ee\u8001\u5f20\u3002<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u8bf4\uff1a&#8221;\u4f60\u4e0d\u9700\u8981\u81ea\u5df1\u5199\u3002Kiwi.com \u5df2\u7ecf\u628a\u81ea\u5df1\u7684\u822a\u73ed\u641c\u7d22\u80fd\u529b\u5c01\u88c5\u6210\u4e86 <strong style=\"color: #333333; font-weight: bold;\">MCP \u670d\u52a1<\/strong>\uff0c\u4f60\u76f4\u63a5\u7528\u5c31\u884c\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;MCP\uff1f\u4ec0\u4e48\u4e1c\u897f\uff1f&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;<strong style=\"color: #333333; font-weight: bold;\">Model Context Protocol\uff0c\u6a21\u578b\u4e0a\u4e0b\u6587\u534f\u8bae\u3002<\/strong> \u5c31\u50cf USB \u63a5\u53e3\u4e00\u6837\u2014\u2014\u4efb\u4f55\u8bbe\u5907\u63d2\u4e0a\u5c31\u80fd\u7528\u3002MCP \u5c31\u662f\u5de5\u5177\u4e16\u754c\u7684 USB\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u95ee\uff1a&#8221;\u8fd9\u548c Function Calling \u6709\u4ec0\u4e48\u533a\u522b\uff1f&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u95ee\u5f97\u597d\u3002Function Calling \u548c MCP \u89e3\u51b3\u7684\u662f\u4e0d\u540c\u5c42\u9762\u7684\u95ee\u9898\u3002&#8221;<\/p>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: #f0e6d0 currentcolor currentcolor; margin: 24px 0px;\" \/>\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; text-align: left; background: linear-gradient(to top, #f8b43f 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px; border: medium none currentcolor;\"><span style=\"color: #333333; font-weight: bold;\">Function Calling vs MCP\uff1a\u4e0d\u662f\u4e00\u4e2a\u4e1c\u897f<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u5728\u767d\u677f\u4e0a\u753b\u4e86\u5f20\u5bf9\u6bd4\u8868\uff1a<\/p>\n<table style=\"display: inline-block !important; width: auto; max-width: 100%; overflow: auto; border-spacing: 0px; border-collapse: collapse; margin: 1rem 0px;\">\n<thead style=\"background: #fff9eb; color: #333333; text-align: left;\">\n<tr>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\"><\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">Function Calling<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">MCP<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><strong style=\"color: #333333; font-weight: bold;\">\u5e72\u4ec0\u4e48<\/strong><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u6a21\u578b\u5982\u4f55\u7ed3\u6784\u5316\u5730\u51b3\u5b9a\u300c\u8c03\u7528\u54ea\u4e2a\u51fd\u6570\u300d<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u5de5\u5177\u5982\u4f55\u4ee5\u6807\u51c6\u65b9\u5f0f\u66b4\u9732\u7ed9\u4efb\u610f AI \u5bbf\u4e3b<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><strong style=\"color: #333333; font-weight: bold;\">\u5de5\u5177\u653e\u54ea<\/strong><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">Agent \u8fdb\u7a0b\u5185\u7684 Python \u51fd\u6570<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u72ec\u7acb MCP Server \u8fdb\u7a0b<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><strong style=\"color: #333333; font-weight: bold;\">\u8c01\u7ba1\u7406\u5de5\u5177<\/strong><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u4f60\u81ea\u5df1\u7684 <code>main.py<\/code><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">Cursor \/ Claude Desktop \u7b49 Host<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><strong style=\"color: #333333; font-weight: bold;\">\u8de8\u4ea7\u54c1\u590d\u7528<\/strong><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u901a\u5e38\u8981\u91cd\u5199\u9002\u914d\u4ee3\u7801<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u4e00\u4efd Server\uff0c\u591a\u4e2a Host \u901a\u7528<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><strong style=\"color: #333333; font-weight: bold;\">\u534f\u8bae\u5c42\u7ea7<\/strong><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">OpenAI API \u5c42\u9762\u7684\u7ea6\u5b9a<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u72ec\u7acb\u4e8e\u4efb\u4f55\u6a21\u578b\u7684\u5f00\u653e\u6807\u51c6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u4e00\u4e2a\u7c7b\u6bd4\u2014\u2014&#8221;<\/p>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: #002b36;\"><code class=\"hljs\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: #93a1a1; background: #002b36;\">Function\u00a0Calling\u00a0\u2248\u00a0\u670d\u52a1\u5458\u61c2\u300c\u83dc\u5355\u683c\u5f0f\u300d\u00a0\u00a0\u00a0\u2190\u00a0\u80fd\u770b\u61c2\u53a8\u623f\u6709\u4ec0\u4e48\u83dc\nMCP\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u2248\u00a0\u6240\u6709\u9910\u5385\u6302\u540c\u4e00\u5957\u83dc\u5355\u7cfb\u7edf\u00a0\u00a0\u2190\u00a0\u6362\u4e00\u5bb6\u9910\u5385\uff08Host\uff09\u4e5f\u80fd\u70b9\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;Function Calling \u89e3\u51b3\u7684\u662f<strong style=\"color: #333333; font-weight: bold;\">\u6a21\u578b\u5185\u90e8<\/strong>\u7684\u95ee\u9898\uff1a\u6a21\u578b\u6536\u5230\u7528\u6237\u6d88\u606f\u540e\uff0c\u600e\u4e48\u51b3\u5b9a\u8981\u4e0d\u8981\u8c03\u51fd\u6570\u3001\u8c03\u54ea\u4e2a\u3002MCP \u89e3\u51b3\u7684\u662f<strong style=\"color: #333333; font-weight: bold;\">\u7cfb\u7edf\u95f4<\/strong>\u7684\u95ee\u9898\uff1a\u65e0\u8bba\u4f60\u7528 Cursor\u3001Claude Desktop \u8fd8\u662f\u81ea\u5df1\u5199\u7684 Agent\uff0c\u90fd\u80fd\u7528\u540c\u4e00\u5957\u534f\u8bae\u53d1\u73b0\u548c\u8c03\u7528\u5de5\u5177\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u8bf4\uff1a&#8221;\u6240\u4ee5 MCP \u662f\u5728 Function Calling \u4e4b\u4e0a\u52a0\u4e86\u4e00\u5c42\u2014\u2014\u628a&#8217;\u5de5\u5177&#8217;\u62bd\u8c61\u6210\u4e86\u72ec\u7acb\u670d\u52a1\uff1f&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u5b8c\u5168\u6b63\u786e\u3002\u4f60\u4e4b\u524d\u5199\u7684 Function Calling \u5de5\u5177\uff0c\u672c\u8d28\u4e0a\u662f Agent \u8fdb\u7a0b\u91cc\u7684\u4e00\u4e2a Python \u51fd\u6570\u3002MCP \u628a\u5b83\u53d8\u6210\u4e86\u4e00\u4e2a<strong style=\"color: #333333; font-weight: bold;\">\u72ec\u7acb\u8fdb\u7a0b<\/strong>\uff0c\u901a\u8fc7\u6807\u51c6\u534f\u8bae\u6765\u901a\u4fe1\u3002&#8221;<\/p>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: #f0e6d0 currentcolor currentcolor; margin: 24px 0px;\" \/>\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; text-align: left; background: linear-gradient(to top, #f8b43f 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px; border: medium none currentcolor;\"><span style=\"color: #333333; font-weight: bold;\">MCP \u7684\u4e09\u4e2a\u89d2\u8272<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u753b\u4e86\u5f20\u56fe\uff1a<\/p>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: #002b36;\"><code class=\"hljs\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: #93a1a1; background: #002b36;\">\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0MCP \u67b6\u6784\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\u2502\u00a0\u00a0\u7528\u6237 \u2500\u2500\u2192 Host\uff08Cursor\/Claude\uff09\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2510\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\u2502\u00a0\u00a0\u00a0\u00a0\u5927\u6a21\u578b\u00a0\u00a0\u00a0\u00a0MCP Client\uff08\u5185\u7f6e\uff09\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u250c\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2510\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u2502\u00a0\u00a0JSON-RPC \u2502\u00a0\u00a0\u2190 stdio \/ HTTP\u00a0\u00a0\u00a0\u00a0\n\u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u2514\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2518\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0MCP Server\uff08\u72ec\u7acb\u8fdb\u7a0b\uff09\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u251c\u2500\u2500 tool: \u67e5\u5929\u6c14\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u251c\u2500\u2500 tool: \u641c\u822a\u73ed\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u2514\u2500\u2500 tool: \u7b97\u6c47\u7387\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n<\/code><\/pre>\n<table style=\"display: inline-block !important; width: auto; max-width: 100%; overflow: auto; border-spacing: 0px; border-collapse: collapse; margin: 1rem 0px;\">\n<thead style=\"background: #fff9eb; color: #333333; text-align: left;\">\n<tr>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u89d2\u8272<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u662f\u4ec0\u4e48<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u672c\u8bfe\u4e2d\u7684\u5b9e\u4f53<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><strong style=\"color: #333333; font-weight: bold;\">Host<\/strong><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u7ba1\u5bf9\u8bdd UI\u3001\u8c03\u6a21\u578b\u3001\u51b3\u5b9a\u4f55\u65f6\u7528\u5de5\u5177<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">Cursor \/ Claude Desktop<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><strong style=\"color: #333333; font-weight: bold;\">Client<\/strong><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u4e0e Server \u901a\u4fe1\uff1a\u63e1\u624b\u3001\u5217\u51fa\u5de5\u5177\u3001\u8c03\u7528\u5de5\u5177<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">Host \u5185\u7f6e\u7684 MCP Client<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><strong style=\"color: #333333; font-weight: bold;\">Server<\/strong><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u58f0\u660e\u5e76\u6267\u884c\u5de5\u5177<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u4f60\u5199\u7684 <code>server.py<\/code> \u6216\u5916\u90e8\u7684 Kiwi.com MCP<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;Host \u662f\u7528\u6237\u76f4\u63a5\u7528\u7684\u4ea7\u54c1\uff0cClient \u662f Host \u5185\u90e8\u7684\u901a\u4fe1\u6a21\u5757\uff0cServer \u662f\u72ec\u7acb\u8fd0\u884c\u7684\u5de5\u5177\u63d0\u4f9b\u65b9\u3002<strong style=\"color: #333333; font-weight: bold;\">\u4e09\u8005\u5404\u5e72\u5404\u7684\u6d3b\uff0c\u901a\u8fc7\u6807\u51c6\u534f\u8bae\u4e32\u8d77\u6765\u3002<\/strong>&#8220;<\/p>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: #f0e6d0 currentcolor currentcolor; margin: 24px 0px;\" \/>\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; text-align: left; background: linear-gradient(to top, #f8b43f 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px; border: medium none currentcolor;\"><span style=\"color: #333333; font-weight: bold;\">\u4e24\u79cd\u4f20\u8f93\u65b9\u5f0f\uff1astdio \u548c HTTP<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u8bf4\uff1a&#8221;MCP \u652f\u6301\u4e24\u79cd\u4f20\u8f93\u65b9\u5f0f\uff0c\u5bf9\u5e94\u4e24\u79cd\u573a\u666f\uff1a&#8221;<\/p>\n<table style=\"display: inline-block !important; width: auto; max-width: 100%; overflow: auto; border-spacing: 0px; border-collapse: collapse; margin: 1rem 0px;\">\n<thead style=\"background: #fff9eb; color: #333333; text-align: left;\">\n<tr>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u4f20\u8f93\u65b9\u5f0f<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u539f\u7406<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u9002\u7528\u573a\u666f<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><strong style=\"color: #333333; font-weight: bold;\">stdio<\/strong><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">Host \u542f\u52a8\u5b50\u8fdb\u7a0b\uff0c\u901a\u8fc7 stdin\/stdout \u4f20 JSON-RPC<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u672c\u5730\u5de5\u5177\uff08\u81ea\u5df1\u5199\u7684 Server\uff09<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><strong style=\"color: #333333; font-weight: bold;\">HTTP<\/strong><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u76f4\u8fde\u516c\u7f51 HTTP \u7aef\u70b9<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u5916\u90e8\u670d\u52a1\uff08Kiwi \u822a\u73ed\u641c\u7d22\u7b49\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 style=\"font-size: 16px; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 24px; margin-bottom: 12px; padding-left: 12px; border-left: 4px solid #f8b43f;\"><span style=\"color: #333333; font-weight: bold;\">stdio\uff1a\u672c\u5730\u5de5\u5177<\/span><\/h3>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: #002b36;\"><code class=\"hljs\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: #93a1a1; background: #002b36;\">Host\uff08Cursor\uff09\u542f\u52a8\u5b50\u8fdb\u7a0b\n\u00a0\u00a0\u2502\n\u00a0\u00a0python\u00a0server.py\u00a0\u00a0\u00a0\u2190\u00a0\u4f60\u5199\u7684\u00a0Server\n\u00a0\u00a0\u2502\n\u00a0\u00a0stdin\/stdout\u00a0\u00a0\u2190\u00a0\u00a0\u534f\u8bae\u901a\u9053\uff08JSON-RPC\uff09\n\u00a0\u00a0stderr\u00a0\u00a0\u00a0\u00a0\u00a0\u2190\u00a0\u00a0\u8c03\u8bd5\u65e5\u5fd7\uff08\u4eba\u7c7b\u53ef\u8bfb\uff09\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\"><strong style=\"color: #333333; font-weight: bold;\">\u5173\u952e\u89c4\u5219\uff1astdout \u8d70\u534f\u8bae\uff0cstderr \u8d70\u65e5\u5fd7\u3002<\/strong> \u5982\u679c\u4f60\u5728 Server \u91cc\u5199 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">print(\"hello\")<\/code>\uff0c\u5b83\u6253\u5230 stdout \u4e0a\uff0cHost \u89e3\u6790 JSON-RPC \u65f6\u4f1a\u76f4\u63a5\u5d29\u6e83\u3002\u8c03\u8bd5\u65e5\u5fd7\u5fc5\u987b\u6253\u5230 stderr\uff1a<\/p>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: #002b36;\"><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: #93a1a1; background: #002b36;\"><span class=\"hljs-keyword\" style=\"color: #6c71c4;\">import<\/span>\u00a0sys\n<span class=\"hljs-built_in\" style=\"color: #2aa198;\">print<\/span>(<span class=\"hljs-string\" style=\"color: #859900;\">\"Server\u00a0started\"<\/span>,\u00a0file=sys.stderr)\u00a0\u00a0\u00a0<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u2705\u00a0\u6b63\u786e<\/span>\n<span class=\"hljs-built_in\" style=\"color: #2aa198;\">print<\/span>(<span class=\"hljs-string\" style=\"color: #859900;\">\"Server\u00a0started\"<\/span>)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u274c\u00a0\u4f1a\u641e\u574f\u534f\u8bae<\/span>\n<\/code><\/pre>\n<h3 style=\"font-size: 16px; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 24px; margin-bottom: 12px; padding-left: 12px; border-left: 4px solid #f8b43f;\"><span style=\"color: #333333; font-weight: bold;\">HTTP\uff1a\u5916\u90e8\u670d\u52a1<\/span><\/h3>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: #002b36;\"><code class=\"hljs\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: #93a1a1; background: #002b36;\">Host\uff08Cursor\uff09\u53d1\u8d77\u00a0HTTP\u00a0\u8bf7\u6c42\n\u00a0\u00a0\u2502\n\u00a0\u00a0https:\/\/mcp.kiwi.com\u00a0\u00a0\u00a0\u2190\u00a0\u522b\u4eba\u90e8\u7f72\u7684\u516c\u7f51\u00a0MCP\u00a0Server\n\u00a0\u00a0\u2502\n\u00a0\u00a0JSON-RPC\u00a0over\u00a0HTTP\n\u00a0\u00a0\u2502\n\u00a0\u00a0\u8fd4\u56de\u822a\u73ed\u6570\u636e\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;stdio \u9002\u5408\u4f60\u81ea\u5df1\u5199\u7684\u672c\u5730\u5de5\u5177\uff0cHTTP \u9002\u5408\u522b\u4eba\u63d0\u4f9b\u7684\u3001\u90e8\u7f72\u5728\u4e91\u7aef\u7684\u5de5\u5177\u3002Kiwi.com \u7684\u822a\u73ed\u641c\u7d22\u5c31\u662f\u4e00\u4e2a\u6807\u51c6\u7684 HTTP MCP \u670d\u52a1\u2014\u2014\u4f60\u4e0d\u9700\u8981\u88c5\u4efb\u4f55\u4e1c\u897f\uff0c\u8fde\u4e0a\u5c31\u80fd\u7528\u3002&#8221;<\/p>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: #f0e6d0 currentcolor currentcolor; margin: 24px 0px;\" \/>\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; text-align: left; background: linear-gradient(to top, #f8b43f 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px; border: medium none currentcolor;\"><span style=\"color: #333333; font-weight: bold;\">\u5b9e\u6218\u4e00\uff1a\u5199\u4e00\u4e2a\u6700\u5c0f MCP Server<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u8bf4\uff1a&#8221;\u5148\u5199\u4e00\u4e2a\u6700\u7b80\u5355\u7684 MCP Server\uff0c\u611f\u53d7\u4e00\u4e0b\u3002\u7528 FastMCP \u6846\u67b6\uff0c\u6838\u5fc3\u5c31\u4e09\u6b65\u2014\u2014<strong style=\"color: #333333; font-weight: bold;\">\u5efa Server \u2192 \u6ce8\u518c Tool \u2192 \u4ee5 stdio \u8fd0\u884c<\/strong>\u3002&#8221;<\/p>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: #002b36;\"><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: #93a1a1; background: #002b36;\"><span class=\"hljs-keyword\" style=\"color: #6c71c4;\">from<\/span>\u00a0mcp.server.fastmcp\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">import<\/span>\u00a0FastMCP\n\n<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a01.\u00a0\u521b\u5efa\u00a0Server\uff08\u540d\u5b57\u4f1a\u663e\u793a\u5728\u00a0Host\u00a0\u7684\u00a0MCP\u00a0\u9762\u677f\u91cc\uff09<\/span>\nmcp\u00a0=\u00a0FastMCP(<span class=\"hljs-string\" style=\"color: #859900;\">\"L1-HelloStdio\"<\/span>)\n\n<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a02.\u00a0\u6ce8\u518c\u5de5\u5177\uff1a\u7528\u00a0@mcp.tool()\u00a0\u88c5\u9970\u5668<\/span>\n<span class=\"hljs-meta\" style=\"color: #d33682;\">@mcp.tool()<\/span>\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">def<\/span>\u00a0<span class=\"hljs-title function_\" style=\"color: #268bd2;\">add<\/span>(<span class=\"hljs-params\">a:\u00a0<span class=\"hljs-built_in\" style=\"color: #2aa198;\">float<\/span>,\u00a0b:\u00a0<span class=\"hljs-built_in\" style=\"color: #2aa198;\">float<\/span><\/span>)\u00a0-&gt;\u00a0<span class=\"hljs-built_in\" style=\"color: #2aa198;\">float<\/span>:\n<span class=\"hljs-string\" style=\"color: #859900;\">\"\"\"Add\u00a0two\u00a0numbers\u00a0and\u00a0return\u00a0the\u00a0sum.\"\"\"<\/span>\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">return<\/span>\u00a0a\u00a0+\u00a0b\n\n<span class=\"hljs-meta\" style=\"color: #d33682;\">@mcp.tool()<\/span>\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">def<\/span>\u00a0<span class=\"hljs-title function_\" style=\"color: #268bd2;\">get_time<\/span>()\u00a0-&gt;\u00a0<span class=\"hljs-built_in\" style=\"color: #2aa198;\">str<\/span>:\n<span class=\"hljs-string\" style=\"color: #859900;\">\"\"\"Get\u00a0the\u00a0current\u00a0time\u00a0in\u00a0ISO\u00a08601\u00a0format.\"\"\"<\/span>\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">from<\/span>\u00a0datetime\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">import<\/span>\u00a0datetime\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">return<\/span>\u00a0datetime.now().isoformat()\n\n<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a03.\u00a0\u4ee5\u00a0stdio\u00a0\u6a21\u5f0f\u542f\u52a8<\/span>\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">if<\/span>\u00a0__name__\u00a0==\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"__main__\"<\/span>:\n\u00a0\u00a0mcp.run(transport=<span class=\"hljs-string\" style=\"color: #859900;\">\"stdio\"<\/span>)\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u6ce8\u610f\u51e0\u4e2a\u7ec6\u8282\uff1a&#8221;<\/p>\n<table style=\"display: inline-block !important; width: auto; max-width: 100%; overflow: auto; border-spacing: 0px; border-collapse: collapse; margin: 1rem 0px;\">\n<thead style=\"background: #fff9eb; color: #333333; text-align: left;\">\n<tr>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u8981\u70b9<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><strong style=\"color: #333333; font-weight: bold;\">\u7c7b\u578b\u6ce8\u89e3<\/strong><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>a: float<\/code>\u3001<code>b: float<\/code> \u4f1a\u81ea\u52a8\u751f\u6210\u5de5\u5177\u7684 JSON Schema<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><strong style=\"color: #333333; font-weight: bold;\">docstring<\/strong><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u5c31\u662f\u5de5\u5177\u7684 <code>description<\/code>\uff0c\u6a21\u578b\u9760\u5b83\u5224\u65ad\u4f55\u65f6\u8c03\u7528<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><strong style=\"color: #333333; font-weight: bold;\">FastMCP \u540d\u5b57<\/strong><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u4f1a\u51fa\u73b0\u5728 Cursor \u7684 MCP \u9762\u677f\uff0c\u8d77\u4e2a\u6709\u610f\u4e49\u7684\u540d\u5b57<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><strong style=\"color: #333333; font-weight: bold;\">transport=&#8221;stdio&#8221;<\/strong><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u8d70 stdin\/stdout\uff0c\u9002\u914d\u6240\u6709\u672c\u5730 Host<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u5bf9\u6bd4\u4f60\u4e4b\u524d\u5199 Function Calling \u5de5\u5177\u7684\u4ee3\u7801\u2014\u2014\u4e4b\u524d\u4f60\u8981\u624b\u5199 JSON Schema\u3001\u624b\u52a8\u7ef4\u62a4 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">available_functions<\/code> \u6620\u5c04\u8868\u3001\u4eb2\u81ea\u7ba1\u7406 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">messages<\/code> \u5217\u8868\u3002MCP Server \u91cc\u8fd9\u4e9b\u5168\u7701\u4e86\u2014\u2014\u6846\u67b6\u81ea\u52a8\u5904\u7406\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u8bf4\uff1a&#8221;\u770b\u7740\u6bd4 Function Calling \u7684\u5199\u6cd5\u8fd8\u7b80\u5355\uff1f&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u662f\u7684\u3002\u56e0\u4e3a MCP Server \u4e0d\u5173\u5fc3\u5bf9\u8bdd\u7f16\u6392\u2014\u2014\u7f16\u6392\u662f Host \u7684\u4e8b\u3002Server \u53ea\u7ba1\u4e00\u4ef6\u4e8b\uff1a<strong style=\"color: #333333; font-weight: bold;\">\u58f0\u660e\u5de5\u5177 + \u6267\u884c\u5de5\u5177<\/strong>\u3002\u8c03\u7528\u65f6\u673a\u3001\u53c2\u6570\u63d0\u53d6\u3001\u7ed3\u679c\u5c55\u793a\uff0c\u5168\u662f Host \u66ff\u4f60\u5e72\u7684\u3002&#8221;<\/p>\n<h3 style=\"font-size: 16px; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 24px; margin-bottom: 12px; padding-left: 12px; border-left: 4px solid #f8b43f;\"><span style=\"color: #333333; font-weight: bold;\">\u63a5\u5165 Cursor<\/span><\/h3>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u8bf4\uff1a&#8221;Server \u5199\u597d\u4e86\uff0c\u63a5\u4e0a Cursor \u8dd1\u8d77\u6765\u3002\u5728 Cursor \u7684 MCP \u914d\u7f6e\u91cc\u52a0\u4e00\u6bb5\uff1a&#8221;<\/p>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: #002b36;\"><code class=\"hljs language-json\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: #93a1a1; background: #002b36;\"><span class=\"hljs-punctuation\" style=\"color: #93a1a1;\">{<\/span>\n<span class=\"hljs-attr\" style=\"color: #cb4b16;\">\"mcpServers\"<\/span><span class=\"hljs-punctuation\" style=\"color: #93a1a1;\">:<\/span>\u00a0<span class=\"hljs-punctuation\" style=\"color: #93a1a1;\">{<\/span>\n<span class=\"hljs-attr\" style=\"color: #cb4b16;\">\"course-mcp-l1\"<\/span><span class=\"hljs-punctuation\" style=\"color: #93a1a1;\">:<\/span>\u00a0<span class=\"hljs-punctuation\" style=\"color: #93a1a1;\">{<\/span>\n<span class=\"hljs-attr\" style=\"color: #cb4b16;\">\"command\"<\/span><span class=\"hljs-punctuation\" style=\"color: #93a1a1;\">:<\/span>\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"python\"<\/span><span class=\"hljs-punctuation\" style=\"color: #93a1a1;\">,<\/span>\n<span class=\"hljs-attr\" style=\"color: #cb4b16;\">\"args\"<\/span><span class=\"hljs-punctuation\" style=\"color: #93a1a1;\">:<\/span>\u00a0<span class=\"hljs-punctuation\" style=\"color: #93a1a1;\">[<\/span><span class=\"hljs-string\" style=\"color: #859900;\">\"D:\/your-path\/server.py\"<\/span><span class=\"hljs-punctuation\" style=\"color: #93a1a1;\">]<\/span>\n<span class=\"hljs-punctuation\" style=\"color: #93a1a1;\">}<\/span>\n<span class=\"hljs-punctuation\" style=\"color: #93a1a1;\">}<\/span>\n<span class=\"hljs-punctuation\" style=\"color: #93a1a1;\">}<\/span>\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u4fdd\u5b58\u540e\uff0cCursor \u4f1a\u81ea\u52a8\u542f\u52a8\u5b50\u8fdb\u7a0b\u8fd0\u884c\u4f60\u7684 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">server.py<\/code>\u3002\u5728 MCP \u9762\u677f\u770b\u5230\u7eff\u706f\u548c <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">add<\/code>\u3001<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">get_time<\/code> \u4e24\u4e2a\u5de5\u5177\uff0c\u5c31\u8bf4\u660e\u63a5\u5165\u6210\u529f\u4e86\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u5728 Cursor \u5bf9\u8bdd\u91cc\u8bd5\u4e86\u8bd5\uff1a<\/p>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: #002b36;\"><code class=\"hljs\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: #93a1a1; background: #002b36;\">\u95ee\uff1a\u7528\u5de5\u5177\u7b97\u00a012.5\u00a0+\u00a07.5\n\u7b54\uff1a12.5\u00a0+\u00a07.5\u00a0=\u00a020.0\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u8fd9\u5c31\u901a\u4e86\u3002\u4e00\u53e5\u8bdd\u4e0d\u7528\u6539\uff0c\u5de5\u5177\u81ea\u52a8\u6ce8\u518c\u5230 Cursor \u91cc\u4e86\u3002&#8221;<\/p>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: #f0e6d0 currentcolor currentcolor; margin: 24px 0px;\" \/>\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; text-align: left; background: linear-gradient(to top, #f8b43f 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px; border: medium none currentcolor;\"><span style=\"color: #333333; font-weight: bold;\">\u5b9e\u6218\u4e8c\uff1a\u539f\u751f Client \u8c03\u7528\u5916\u90e8 HTTP MCP<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u53c8\u95ee\uff1a&#8221;\u81ea\u5df1\u5199\u7684 Server \u641e\u61c2\u4e86\u3002Kiwi.com \u90a3\u4e2a\u5916\u90e8 MCP \u670d\u52a1\u600e\u4e48\u7528\uff1f&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u5916\u90e8 HTTP MCP \u670d\u52a1\u4e0d\u9700\u8981\u4f60\u8d77 Server\u2014\u2014\u4eba\u5bb6\u5df2\u7ecf\u5728\u516c\u7f51\u4e0a\u8dd1\u4e86\u3002\u4f60\u9700\u8981\u7684\u662f\u4e00\u4e2a <strong style=\"color: #333333; font-weight: bold;\">MCP Client<\/strong>\uff0c\u53bb\u8fde\u5b83\u3001\u8c03\u5b83\u7684\u5de5\u5177\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u6253\u5f00\u4e86\u4ed6\u5199\u7684\u4ee3\u7801\u2014\u2014\u76f4\u63a5\u4f7f\u7528 MCP \u5b98\u65b9 SDK\uff0c\u4e0d\u4f9d\u8d56 LangChain \u7b49\u6846\u67b6\uff1a<\/p>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: #002b36;\"><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: #93a1a1; background: #002b36;\"><span class=\"hljs-keyword\" style=\"color: #6c71c4;\">import<\/span>\u00a0asyncio\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">import<\/span>\u00a0json\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">from<\/span>\u00a0datetime\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">import<\/span>\u00a0date,\u00a0timedelta\n\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">import<\/span>\u00a0httpx\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">from<\/span>\u00a0mcp\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">import<\/span>\u00a0ClientSession\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">from<\/span>\u00a0mcp.client.streamable_http\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">import<\/span>\u00a0streamable_http_client\n\nKIWI_MCP_URL\u00a0=\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"https:\/\/mcp.kiwi.com\"<\/span>\n\n\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">async<\/span>\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">def<\/span>\u00a0<span class=\"hljs-title function_\" style=\"color: #268bd2;\">main<\/span>():\n<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u6784\u9020\u67e5\u8be2\u53c2\u6570\uff1a\u67e5\u4e24\u5468\u540e\u4ece\u5e03\u62c9\u683c\u5230\u4f26\u6566\u7684\u822a\u73ed<\/span>\n\u00a0\u00a0departure\u00a0=\u00a0(date.today()\u00a0+\u00a0timedelta(days=<span class=\"hljs-number\" style=\"color: #cb4b16;\">14<\/span>)).strftime(<span class=\"hljs-string\" style=\"color: #859900;\">\"%d\/%m\/%Y\"<\/span>)\n\u00a0\u00a0args\u00a0=\u00a0{\n<span class=\"hljs-string\" style=\"color: #859900;\">\"flyFrom\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"PRG\"<\/span>,\n<span class=\"hljs-string\" style=\"color: #859900;\">\"flyTo\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"LON\"<\/span>,\n<span class=\"hljs-string\" style=\"color: #859900;\">\"departureDate\"<\/span>:\u00a0departure,\n<span class=\"hljs-string\" style=\"color: #859900;\">\"adults\"<\/span>:\u00a0<span class=\"hljs-number\" style=\"color: #cb4b16;\">1<\/span>,\n<span class=\"hljs-string\" style=\"color: #859900;\">\"currency\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"EUR\"<\/span>,\n<span class=\"hljs-string\" style=\"color: #859900;\">\"sort\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"price\"<\/span>,\n\u00a0\u00a0}\n\n<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0===\u00a0\u4e09\u6b65\uff1a\u8fde\u63a5\u00a0\u2192\u00a0\u63e1\u624b\u00a0\u2192\u00a0\u8c03\u7528\u00a0===<\/span>\n\n<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u7b2c1\u6b65\uff1a\u5efa\u7acb\u00a0HTTP\u00a0\u8fde\u63a5<\/span>\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">async<\/span>\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">with<\/span>\u00a0httpx.AsyncClient(timeout=<span class=\"hljs-number\" style=\"color: #cb4b16;\">90.0<\/span>)\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">as<\/span>\u00a0http:\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">async<\/span>\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">with<\/span>\u00a0streamable_http_client(KIWI_MCP_URL,\u00a0http_client=http)\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">as<\/span>\u00a0(\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0read,\u00a0write,\u00a0_get_session_id,\n\u00a0\u00a0\u00a0\u00a0):\n<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u7b2c2\u6b65\uff1a\u521b\u5efa\u4f1a\u8bdd\u5e76\u63e1\u624b<\/span>\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">async<\/span>\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">with<\/span>\u00a0ClientSession(read,\u00a0write)\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">as<\/span>\u00a0session:\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">await<\/span>\u00a0session.initialize()\n\n<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u7b2c3\u6b65a\uff1a\u5217\u51fa\u6240\u6709\u53ef\u7528\u5de5\u5177<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0tools\u00a0=\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">await<\/span>\u00a0session.list_tools()\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">for<\/span>\u00a0t\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">in<\/span>\u00a0tools.tools:\n<span class=\"hljs-built_in\" style=\"color: #2aa198;\">print<\/span>(<span class=\"hljs-string\" style=\"color: #859900;\">f\"\u00a0\u00a0<span class=\"hljs-subst\" style=\"color: #93a1a1;\">{t.name}<\/span>:\u00a0<span class=\"hljs-subst\" style=\"color: #93a1a1;\">{t.description[:<span class=\"hljs-number\" style=\"color: #cb4b16;\">60<\/span>]}<\/span>...\"<\/span>)\n\n<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u7b2c3\u6b65b\uff1a\u8c03\u7528\u5177\u4f53\u5de5\u5177<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0result\u00a0=\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">await<\/span>\u00a0session.call_tool(<span class=\"hljs-string\" style=\"color: #859900;\">\"search-flight\"<\/span>,\u00a0args)\n\n<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u89e3\u6790\u7ed3\u679c\uff08content\u00a0\u662f\u5217\u8868\uff0c\u6bcf\u4e2a\u5143\u7d20\u6709\u00a0.text\uff09<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0texts\u00a0=\u00a0[c.text\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">for<\/span>\u00a0c\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">in<\/span>\u00a0result.content\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">if<\/span>\u00a0c.<span class=\"hljs-built_in\" style=\"color: #2aa198;\">type<\/span>\u00a0==\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"text\"<\/span>]\n<span class=\"hljs-built_in\" style=\"color: #2aa198;\">print<\/span>(texts[<span class=\"hljs-number\" style=\"color: #cb4b16;\">0<\/span>])\n\n\nasyncio.run(main())\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u76ef\u7740\u4ee3\u7801\u770b\u4e86\u534a\u5206\u949f\uff1a&#8221;\u8fd9\u4e09\u6b65\u2026\u2026\u4e0d\u5c31\u662f\u8fde\u4e0a\u3001\u95ee\u6709\u4ec0\u4e48\u5de5\u5177\u3001\u8c03\u5de5\u5177\u5417\uff1f&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u5bf9\uff0c\u548c USB \u7684\u6d41\u7a0b\u4e00\u6a21\u4e00\u6837\u2014\u2014<strong style=\"color: #333333; font-weight: bold;\">\u63d2\u4e0a\u3001\u679a\u4e3e\u8bbe\u5907\u3001\u6536\u53d1\u6570\u636e<\/strong>\u3002<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">initialize<\/code> \u662f\u63e1\u624b\uff0c<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">list_tools<\/code> \u662f\u679a\u4e3e\u8bbe\u5907\uff0c<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">call_tool<\/code> \u662f\u8bfb\u5199\u6570\u636e\u3002&#8221;<\/p>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: #f0e6d0 currentcolor currentcolor; margin: 24px 0px;\" \/>\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; text-align: left; background: linear-gradient(to top, #f8b43f 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px; border: medium none currentcolor;\"><span style=\"color: #333333; font-weight: bold;\">\u9010\u6bb5\u62c6\u89e3<\/span><\/h2>\n<h3 style=\"font-size: 16px; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 24px; margin-bottom: 12px; padding-left: 12px; border-left: 4px solid #f8b43f;\"><span style=\"color: #333333; font-weight: bold;\">\u7b2c\u4e00\u6b65\uff1a\u5efa\u7acb\u8fde\u63a5<\/span><\/h3>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: #002b36;\"><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: #93a1a1; background: #002b36;\"><span class=\"hljs-keyword\" style=\"color: #6c71c4;\">async<\/span>\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">with<\/span>\u00a0httpx.AsyncClient(timeout=<span class=\"hljs-number\" style=\"color: #cb4b16;\">90.0<\/span>)\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">as<\/span>\u00a0http:\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">async<\/span>\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">with<\/span>\u00a0streamable_http_client(KIWI_MCP_URL,\u00a0http_client=http)\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">as<\/span>\u00a0(\n\u00a0\u00a0\u00a0\u00a0read,\u00a0write,\u00a0_get_session_id,\n\u00a0\u00a0):\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u8bf4\uff1a&#8221;<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">streamable_http_client<\/code> \u662f MCP SDK \u63d0\u4f9b\u7684\u8fde\u63a5\u5de5\u5382\u3002\u5b83\u7528 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">httpx<\/code> \u5efa\u7acb\u4e00\u4e2a\u5230 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">https:\/\/mcp.kiwi.com<\/code> \u7684 HTTP \u957f\u8fde\u63a5\uff0c\u8fd4\u56de\u4e09\u4e2a\u4e1c\u897f\uff1a&#8221;<\/p>\n<table style=\"display: inline-block !important; width: auto; max-width: 100%; overflow: auto; border-spacing: 0px; border-collapse: collapse; margin: 1rem 0px;\">\n<thead style=\"background: #fff9eb; color: #333333; text-align: left;\">\n<tr>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u8fd4\u56de\u503c<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u7c7b\u578b<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u4f5c\u7528<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>read<\/code><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u5f02\u6b65\u6d41<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u4ece Server \u8bfb\u53d6\u6d88\u606f<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>write<\/code><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u5f02\u6b65\u6d41<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u5411 Server \u53d1\u9001\u6d88\u606f<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>_get_session_id<\/code><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u51fd\u6570<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u83b7\u53d6\u4f1a\u8bdd ID\uff08\u8c03\u8bd5\u7528\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">read<\/code> \u548c <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">write<\/code> \u5c31\u662f\u4f60\u548c Server \u4e4b\u95f4\u7684\u901a\u4fe1\u901a\u9053\u3002\u540e\u9762\u6240\u6709\u4ea4\u4e92\u90fd\u901a\u8fc7\u8fd9\u4e24\u4e2a\u5bf9\u8c61\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u6ce8\u610f\uff1a<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">streamable_http_client<\/code> \u7528\u7684\u662f<strong style=\"color: #333333; font-weight: bold;\">\u6d41\u5f0f HTTP<\/strong>\uff08SSE\uff09\uff0c\u4e0d\u662f\u4e00\u95ee\u4e00\u7b54\u7684\u77ed\u8fde\u63a5\u3002Client \u4fdd\u6301\u8fde\u63a5\uff0c\u968f\u65f6\u63a5\u6536 Server \u63a8\u9001\u7684\u6d88\u606f\u3002&#8221;<\/p>\n<h3 style=\"font-size: 16px; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 24px; margin-bottom: 12px; padding-left: 12px; border-left: 4px solid #f8b43f;\"><span style=\"color: #333333; font-weight: bold;\">\u7b2c\u4e8c\u6b65\uff1a\u63e1\u624b<\/span><\/h3>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: #002b36;\"><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: #93a1a1; background: #002b36;\"><span class=\"hljs-keyword\" style=\"color: #6c71c4;\">async<\/span>\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">with<\/span>\u00a0ClientSession(read,\u00a0write)\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">as<\/span>\u00a0session:\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">await<\/span>\u00a0session.initialize()\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">ClientSession<\/code> \u7528 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">read<\/code> \u548c <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">write<\/code> \u521b\u5efa\u4f1a\u8bdd\u3002<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">initialize()<\/code> \u6267\u884c\u63e1\u624b\u2014\u2014Client \u544a\u8bc9 Server \u81ea\u5df1\u652f\u6301\u7684\u534f\u8bae\u7248\u672c\u548c\u80fd\u529b\uff0cServer \u56de\u5e94\u81ea\u5df1\u7684\u4fe1\u606f\u548c\u53ef\u7528\u80fd\u529b\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u63e1\u624b\u6210\u529f\u540e\uff0c<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">session<\/code> \u5c31\u662f\u4f60\u548c\u8fd9\u4e2a MCP Server \u7684\u4ea4\u4e92\u5165\u53e3\u3002\u6b64\u540e\u4e00\u5207\u64cd\u4f5c\u90fd\u901a\u8fc7\u5b83\u3002&#8221;<\/p>\n<h3 style=\"font-size: 16px; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 24px; margin-bottom: 12px; padding-left: 12px; border-left: 4px solid #f8b43f;\"><span style=\"color: #333333; font-weight: bold;\">\u7b2c\u4e09\u6b65a\uff1a\u5217\u51fa\u5de5\u5177<\/span><\/h3>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: #002b36;\"><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: #93a1a1; background: #002b36;\">tools\u00a0=\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">await<\/span>\u00a0session.list_tools()\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">for<\/span>\u00a0t\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">in<\/span>\u00a0tools.tools:\n<span class=\"hljs-built_in\" style=\"color: #2aa198;\">print<\/span>(<span class=\"hljs-string\" style=\"color: #859900;\">f\"\u00a0\u00a0<span class=\"hljs-subst\" style=\"color: #93a1a1;\">{t.name}<\/span>:\u00a0<span class=\"hljs-subst\" style=\"color: #93a1a1;\">{t.description[:<span class=\"hljs-number\" style=\"color: #cb4b16;\">60<\/span>]}<\/span>...\"<\/span>)\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">list_tools()<\/code> \u8fd4\u56de\u8fd9\u4e2a MCP Server \u63d0\u4f9b\u7684\u6240\u6709\u5de5\u5177\u5217\u8868\u3002\u6bcf\u4e2a\u5de5\u5177\u5305\u542b <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">name<\/code>\u3001<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">description<\/code>\u3001<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">inputSchema<\/code>\uff08JSON Schema \u53c2\u6570\u5b9a\u4e49\uff09\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u5bf9\u4e8e Kiwi MCP Server\uff0c\u8f93\u51fa\u7c7b\u4f3c\uff1a&#8221;<\/p>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: #002b36;\"><code class=\"hljs\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: #93a1a1; background: #002b36;\">\u00a0\u00a0search-flight:\u00a0Search\u00a0for\u00a0the\u00a0cheapest\u00a0flights\u00a0and\u00a0return...\n\u00a0\u00a0search-multi-city:\u00a0Search\u00a0for\u00a0multi-city\u00a0flights...\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u4f60\u5148\u770b\u4e00\u773c\u6709\u4ec0\u4e48\u5de5\u5177\uff0c\u786e\u8ba4\u5de5\u5177\u540d\u548c\u53c2\u6570\u683c\u5f0f\u2014\u2014<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">search-flight<\/code> \u7684\u65e5\u671f\u683c\u5f0f\u662f <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">dd\/mm\/yyyy<\/code>\uff0c\u4e0d\u662f ISO \u683c\u5f0f\uff0c\u4e0d\u662f\u7f8e\u5f0f <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">mm\/dd\/yyyy<\/code>\u3002<strong style=\"color: #333333; font-weight: bold;\">\u76f4\u63a5\u7528\uff0c\u522b\u731c\u3002<\/strong>&#8220;<\/p>\n<h3 style=\"font-size: 16px; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 24px; margin-bottom: 12px; padding-left: 12px; border-left: 4px solid #f8b43f;\"><span style=\"color: #333333; font-weight: bold;\">\u7b2c\u4e09\u6b65b\uff1a\u8c03\u7528\u5de5\u5177<\/span><\/h3>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: #002b36;\"><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: #93a1a1; background: #002b36;\">args\u00a0=\u00a0{\n<span class=\"hljs-string\" style=\"color: #859900;\">\"flyFrom\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"PRG\"<\/span>,\n<span class=\"hljs-string\" style=\"color: #859900;\">\"flyTo\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"LON\"<\/span>,\n<span class=\"hljs-string\" style=\"color: #859900;\">\"departureDate\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"15\/08\/2026\"<\/span>,\n<span class=\"hljs-string\" style=\"color: #859900;\">\"adults\"<\/span>:\u00a0<span class=\"hljs-number\" style=\"color: #cb4b16;\">1<\/span>,\n<span class=\"hljs-string\" style=\"color: #859900;\">\"currency\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"EUR\"<\/span>,\n<span class=\"hljs-string\" style=\"color: #859900;\">\"sort\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"price\"<\/span>,\n}\n\nresult\u00a0=\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">await<\/span>\u00a0session.call_tool(<span class=\"hljs-string\" style=\"color: #859900;\">\"search-flight\"<\/span>,\u00a0args)\ntexts\u00a0=\u00a0[c.text\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">for<\/span>\u00a0c\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">in<\/span>\u00a0result.content\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">if<\/span>\u00a0c.<span class=\"hljs-built_in\" style=\"color: #2aa198;\">type<\/span>\u00a0==\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"text\"<\/span>]\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">call_tool<\/code> \u662f\u6700\u6838\u5fc3\u7684\u8c03\u7528\u2014\u2014\u4f20\u5165\u5de5\u5177\u540d\u548c\u53c2\u6570\uff0c\u62ff\u5230\u7ed3\u679c\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u6ce8\u610f <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">result.content<\/code> \u7684\u7ed3\u6784\u2014\u2014\u5b83\u4e0d\u662f\u7b80\u5355\u7684\u5b57\u7b26\u4e32\uff0c\u800c\u662f\u4e00\u4e2a <strong style=\"color: #333333; font-weight: bold;\">content \u5217\u8868<\/strong>\uff0c\u6bcf\u4e2a\u5143\u7d20\u6709 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">type<\/code> \u5b57\u6bb5\uff1a&#8221;<\/p>\n<table style=\"display: inline-block !important; width: auto; max-width: 100%; overflow: auto; border-spacing: 0px; border-collapse: collapse; margin: 1rem 0px;\">\n<thead style=\"background: #fff9eb; color: #333333; text-align: left;\">\n<tr>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">content.type<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u542b\u4e49<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>\"text\"<\/code><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u6587\u672c\uff0c\u901a\u8fc7 <code>.text<\/code> \u83b7\u53d6<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>\"image\"<\/code><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u56fe\u7247\uff08base64\uff09\uff0c\u901a\u8fc7 <code>.data<\/code> + <code>.mimeType<\/code> \u83b7\u53d6<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>\"resource\"<\/code><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u8d44\u6e90\u5f15\u7528\uff0c\u901a\u8fc7 <code>.resource<\/code> \u83b7\u53d6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u6240\u4ee5\u83b7\u53d6\u6587\u672c\u7ed3\u679c\u7684\u6807\u51c6\u5199\u6cd5\u662f\uff1a&#8221;<\/p>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: #002b36;\"><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: #93a1a1; background: #002b36;\">texts\u00a0=\u00a0[c.text\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">for<\/span>\u00a0c\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">in<\/span>\u00a0result.content\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">if<\/span>\u00a0c.<span class=\"hljs-built_in\" style=\"color: #2aa198;\">type<\/span>\u00a0==\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"text\"<\/span>]\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u4e0d\u8981\u76f4\u63a5 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">result.content[0].text<\/code>\u2014\u2014\u5982\u679c Server \u8fd4\u56de\u7684\u7b2c\u4e00\u4e2a content \u4e0d\u662f text \u7c7b\u578b\uff0c\u4f60\u5c31\u70b8\u4e86\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u8bf4\uff1a&#8221;\u539f\u6765 MCP \u4e0d\u53ea\u662f\u6587\u672c\uff0c\u8fd8\u80fd\u8fd4\u56de\u56fe\u7247\u548c\u8d44\u6e90\uff1f&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u5bf9\u3002MCP \u534f\u8bae\u4e0d\u53ea\u7ba1 Tool\uff0c\u8fd8\u7ba1 <strong style=\"color: #333333; font-weight: bold;\">Resource<\/strong>\uff08\u6587\u4ef6\u3001\u56fe\u7247\u7b49\u6570\u636e\uff09\u548c <strong style=\"color: #333333; font-weight: bold;\">Prompt<\/strong>\uff08\u6a21\u677f\u5316\u7684\u63d0\u793a\u8bcd\uff09\u3002\u4f46\u5165\u95e8\u9636\u6bb5\u5148\u641e\u61c2 Tool \u8c03\u7528\u5c31\u591f\u4e86\u3002&#8221;<\/p>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: #f0e6d0 currentcolor currentcolor; margin: 24px 0px;\" \/>\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; text-align: left; background: linear-gradient(to top, #f8b43f 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px; border: medium none currentcolor;\"><span style=\"color: #333333; font-weight: bold;\">\u8f85\u52a9\u51fd\u6570\uff1a\u538b\u7f29\u7ed3\u679c<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u8865\u5145\u9053\uff1a&#8221;\u822a\u73ed\u641c\u7d22\u53ef\u80fd\u8fd4\u56de\u51e0\u767e\u6761\u7ed3\u679c\uff0c\u76f4\u63a5 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">print<\/code> \u4f1a\u5237\u5c4f\u3002\u5b9e\u9645\u4ee3\u7801\u91cc\u52a0\u4e86\u4e2a <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">_summarize_search<\/code> \u51fd\u6570\uff1a&#8221;<\/p>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: #002b36;\"><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: #93a1a1; background: #002b36;\"><span class=\"hljs-keyword\" style=\"color: #6c71c4;\">def<\/span>\u00a0<span class=\"hljs-title function_\" style=\"color: #268bd2;\">_summarize_search<\/span>(<span class=\"hljs-params\">raw:\u00a0<span class=\"hljs-built_in\" style=\"color: #2aa198;\">str<\/span>,\u00a0limit:\u00a0<span class=\"hljs-built_in\" style=\"color: #2aa198;\">int<\/span>\u00a0=\u00a0<span class=\"hljs-number\" style=\"color: #cb4b16;\">3<\/span><\/span>)\u00a0-&gt;\u00a0<span class=\"hljs-built_in\" style=\"color: #2aa198;\">str<\/span>:\n\u00a0\u00a0data\u00a0=\u00a0json.loads(raw)\n\u00a0\u00a0itineraries\u00a0=\u00a0data.get(<span class=\"hljs-string\" style=\"color: #859900;\">\"itineraries\"<\/span>)\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">or<\/span>\u00a0[]\n\u00a0\u00a0lines\u00a0=\u00a0[<span class=\"hljs-string\" style=\"color: #859900;\">f\"currency=<span class=\"hljs-subst\" style=\"color: #93a1a1;\">{data.get(<span class=\"hljs-string\" style=\"color: #859900;\">'currency'<\/span>)}<\/span>\u00a0\u00a0resultsCount=<span class=\"hljs-subst\" style=\"color: #93a1a1;\">{data.get(<span class=\"hljs-string\" style=\"color: #859900;\">'resultsCount'<\/span>)}<\/span>\"<\/span>]\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">for<\/span>\u00a0i,\u00a0it\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">in<\/span>\u00a0<span class=\"hljs-built_in\" style=\"color: #2aa198;\">enumerate<\/span>(itineraries[:limit],\u00a0<span class=\"hljs-number\" style=\"color: #cb4b16;\">1<\/span>):\n\u00a0\u00a0\u00a0\u00a0outbound\u00a0=\u00a0it.get(<span class=\"hljs-string\" style=\"color: #859900;\">\"outbound\"<\/span>)\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">or<\/span>\u00a0{}\n\u00a0\u00a0\u00a0\u00a0route\u00a0=\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"\u00a0-&gt;\u00a0\"<\/span>.join(outbound.get(<span class=\"hljs-string\" style=\"color: #859900;\">\"route\"<\/span>)\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">or<\/span>\u00a0[])\n\u00a0\u00a0\u00a0\u00a0lines.append(\n<span class=\"hljs-string\" style=\"color: #859900;\">f\"\u00a0\u00a0[<span class=\"hljs-subst\" style=\"color: #93a1a1;\">{i}<\/span>]\u00a0<span class=\"hljs-subst\" style=\"color: #93a1a1;\">{it.get(<span class=\"hljs-string\" style=\"color: #859900;\">'priceFormatted'<\/span>)}<\/span>\u00a0\u00a0<span class=\"hljs-subst\" style=\"color: #93a1a1;\">{route}<\/span>\u00a0\u00a0\"<\/span>\n<span class=\"hljs-string\" style=\"color: #859900;\">f\"<span class=\"hljs-subst\" style=\"color: #93a1a1;\">{outbound.get(<span class=\"hljs-string\" style=\"color: #859900;\">'departureTime'<\/span>)}<\/span>\u00a0-&gt;\u00a0<span class=\"hljs-subst\" style=\"color: #93a1a1;\">{outbound.get(<span class=\"hljs-string\" style=\"color: #859900;\">'arrivalTime'<\/span>)}<\/span>\"<\/span>\n\u00a0\u00a0\u00a0\u00a0)\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">return<\/span>\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"\\n\"<\/span>.join(lines)\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u6838\u5fc3\u903b\u8f91\u2014\u2014\u628a\u539f\u59cb JSON \u8f6c\u6210\u53ef\u8bfb\u7684\u6587\u672c\u6458\u8981\uff0c\u53ea\u5c55\u793a\u524d\u51e0\u6761\uff0c\u5176\u4f59\u7701\u7565\u3002\u8fd9\u5176\u5b9e\u5c31\u662f\u4f60\u4e4b\u540e\u5728 Agent \u91cc\u505a\u7684\u4e8b\u2014\u2014<strong style=\"color: #333333; font-weight: bold;\">\u628a\u5de5\u5177\u8fd4\u56de\u7684\u539f\u59cb\u6570\u636e\uff0c\u6574\u7406\u6210\u7528\u6237\u53ef\u4ee5\u770b\u7684\u4fe1\u606f\u3002<\/strong>&#8220;<\/p>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: #f0e6d0 currentcolor currentcolor; margin: 24px 0px;\" \/>\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; text-align: left; background: linear-gradient(to top, #f8b43f 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px; border: medium none currentcolor;\"><span style=\"color: #333333; font-weight: bold;\">stdio vs HTTP\uff1a\u600e\u4e48\u9009<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u5728\u767d\u677f\u4e0a\u603b\u7ed3\u4e86\u4e24\u79cd\u4f20\u8f93\u65b9\u5f0f\u7684\u5bf9\u6bd4\uff1a<\/p>\n<table style=\"display: inline-block !important; width: auto; max-width: 100%; overflow: auto; border-spacing: 0px; border-collapse: collapse; margin: 1rem 0px;\">\n<thead style=\"background: #fff9eb; color: #333333; text-align: left;\">\n<tr>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u5bf9\u6bd4\u7ef4\u5ea6<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">stdio<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">HTTP\uff08Streamable\uff09<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><strong style=\"color: #333333; font-weight: bold;\">\u901a\u4fe1\u65b9\u5f0f<\/strong><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u5b50\u8fdb\u7a0b stdin\/stdout<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">HTTP \u957f\u8fde\u63a5\uff08SSE\uff09<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><strong style=\"color: #333333; font-weight: bold;\">\u542f\u52a8\u65b9\u5f0f<\/strong><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">Host \u62c9\u8d77 Python \u8fdb\u7a0b<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">Client \u8fde\u63a5\u516c\u7f51 URL<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><strong style=\"color: #333333; font-weight: bold;\">\u9002\u7528\u573a\u666f<\/strong><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u672c\u5730\u5de5\u5177\u3001\u81ea\u5df1\u5199\u7684 Server<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u7b2c\u4e09\u65b9\u670d\u52a1\u3001\u4e91\u7aef\u90e8\u7f72\u7684 Server<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><strong style=\"color: #333333; font-weight: bold;\">\u4f9d\u8d56<\/strong><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">Python \u73af\u5883 + \u4f9d\u8d56\u5305<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u53ea\u9700\u8981\u7f51\u7edc + <code>httpx<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><strong style=\"color: #333333; font-weight: bold;\">Server \u5728\u54ea<\/strong><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u4f60\u7684\u673a\u5668\u4e0a<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u8fdc\u7a0b\u670d\u52a1\u5668<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><strong style=\"color: #333333; font-weight: bold;\">\u914d\u7f6e\u590d\u6742\u5ea6<\/strong><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u2b50\u2b50\uff08\u8981\u914d python \u8def\u5f84\uff09<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u2b50\uff08\u4e00\u4e2a URL\uff09<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><strong style=\"color: #333333; font-weight: bold;\">\u5178\u578b\u7528\u4f8b<\/strong><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u672c\u5730\u6587\u4ef6\u64cd\u4f5c\u3001\u6570\u636e\u5e93\u67e5\u8be2<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">Kiwi \u822a\u73ed\u641c\u7d22\u3001\u5929\u6c14 API<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u4e00\u53e5\u8bdd\u2014\u2014<strong style=\"color: #333333; font-weight: bold;\">\u81ea\u5df1\u5199\u7684\u5de5\u5177\u7528 stdio\uff0c\u522b\u4eba\u7684\u670d\u52a1\u7528 HTTP\u3002<\/strong>&#8220;<\/p>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: #f0e6d0 currentcolor currentcolor; margin: 24px 0px;\" \/>\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; text-align: left; background: linear-gradient(to top, #f8b43f 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px; border: medium none currentcolor;\"><span style=\"color: #333333; font-weight: bold;\">\u539f\u751f SDK vs \u5c01\u88c5\u6846\u67b6<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u95ee\uff1a&#8221;\u6211\u770b\u5230 LangChain \u4e5f\u6709 MCP Client\u2014\u2014<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">MultiServerMCPClient<\/code>\uff0c\u4f60\u4eec\u4e3a\u4ec0\u4e48\u4e0d\u7528\u5b83\uff1f&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u8bf4\uff1a&#8221;LangChain \u7684\u5c01\u88c5\u786e\u5b9e\u65b9\u4fbf\u2014\u2014\u51e0\u884c\u914d\u7f6e\u5c31\u80fd\u63a5\u5165\u591a\u4e2a MCP Server\u3002\u4f46\u5b83\u52a0\u4e86\u4e00\u5c42\u62bd\u8c61\uff0c\u5f53\u51fa\u95ee\u9898\u65f6\u4f60\u5f88\u96be\u5b9a\u4f4d\u662f\u54ea\u4e00\u5c42\u7684\u95ee\u9898\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u5bf9\u6bd4\u4e24\u79cd\u5199\u6cd5\uff1a&#8221;<\/p>\n<table style=\"display: inline-block !important; width: auto; max-width: 100%; overflow: auto; border-spacing: 0px; border-collapse: collapse; margin: 1rem 0px;\">\n<thead style=\"background: #fff9eb; color: #333333; text-align: left;\">\n<tr>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\"><\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">LangChain \u5c01\u88c5<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u539f\u751f MCP SDK<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><strong style=\"color: #333333; font-weight: bold;\">\u8fde\u63a5\u4ee3\u7801<\/strong><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u914d\u7f6e\u6587\u4ef6 + 3 \u884c<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>streamable_http_client<\/code> + <code>ClientSession<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><strong style=\"color: #333333; font-weight: bold;\">\u7406\u89e3\u6210\u672c<\/strong><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u4f4e\uff08\u8499\u5728\u9f13\u91cc\uff09<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u4e2d\uff08\u770b\u6e05\u5168\u8c8c\uff09<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><strong style=\"color: #333333; font-weight: bold;\">\u8c03\u8bd5\u96be\u5ea6<\/strong><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u9ad8\uff08\u5c01\u88c5\u5c42\u592a\u591a\uff09<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u4f4e\uff08\u6bcf\u4e2a\u73af\u8282\u53ef\u6253\u65ad\u70b9\uff09<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><strong style=\"color: #333333; font-weight: bold;\">\u5b9a\u4f4d\u95ee\u9898<\/strong><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u6846\u67b6\u5185\u90e8 \u2192 \u96be<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u76f4\u63a5\u770b SDK \u8c03\u7528 \u2192 \u6613<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;LangChain \u5c01\u88c5\u7248\uff1a&#8221;<\/p>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: #002b36;\"><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: #93a1a1; background: #002b36;\"><span class=\"hljs-keyword\" style=\"color: #6c71c4;\">from<\/span>\u00a0langchain_mcp_adapters.client\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">import<\/span>\u00a0MultiServerMCPClient\n\nclient\u00a0=\u00a0MultiServerMCPClient({\n<span class=\"hljs-string\" style=\"color: #859900;\">\"kiwi-com-flight-search\"<\/span>:\u00a0{\n<span class=\"hljs-string\" style=\"color: #859900;\">\"transport\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"http\"<\/span>,\n<span class=\"hljs-string\" style=\"color: #859900;\">\"url\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"https:\/\/mcp.kiwi.com\"<\/span>,\n\u00a0\u00a0}\n})\ntools\u00a0=\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">await<\/span>\u00a0client.get_tools()\u00a0\u00a0<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u4e00\u884c\u641e\u5b9a<\/span>\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u539f\u751f\u7248\uff1a&#8221;<\/p>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: #002b36;\"><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: #93a1a1; background: #002b36;\"><span class=\"hljs-keyword\" style=\"color: #6c71c4;\">from<\/span>\u00a0mcp\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">import<\/span>\u00a0ClientSession\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">from<\/span>\u00a0mcp.client.streamable_http\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">import<\/span>\u00a0streamable_http_client\n\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">async<\/span>\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">with<\/span>\u00a0streamable_http_client(url)\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">as<\/span>\u00a0(read,\u00a0write,\u00a0_):\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">async<\/span>\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">with<\/span>\u00a0ClientSession(read,\u00a0write)\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">as<\/span>\u00a0session:\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">await<\/span>\u00a0session.initialize()\n\u00a0\u00a0\u00a0\u00a0tools\u00a0=\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">await<\/span>\u00a0session.list_tools()\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u539f\u751f\u7248\u591a\u4e86\u51e0\u884c\uff0c\u4f46\u6bcf\u4e00\u6b65\u4f60\u90fd\u77e5\u9053\u5728\u5e72\u4ec0\u4e48\u3002<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">initialize<\/code> \u662f\u4ec0\u4e48\uff1f\u63e1\u624b\u3002<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">list_tools<\/code> \u662f\u4ec0\u4e48\uff1f\u5217\u51fa\u5de5\u5177\u3002\u51fa\u4e86\u95ee\u9898\u4f60\u77e5\u9053\u8be5\u67e5\u54ea\u4e00\u6b65\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\"><strong style=\"color: #333333; font-weight: bold;\">\u9009\u62e9\u5efa\u8bae<\/strong>\uff1a<\/p>\n<table style=\"display: inline-block !important; width: auto; max-width: 100%; overflow: auto; border-spacing: 0px; border-collapse: collapse; margin: 1rem 0px;\">\n<thead style=\"background: #fff9eb; color: #333333; text-align: left;\">\n<tr>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u573a\u666f<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u63a8\u8350<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u5feb\u901f\u9a8c\u8bc1\u3001\u539f\u578b\u5f00\u53d1<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">LangChain \u5c01\u88c5<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u751f\u4ea7\u73af\u5883\u3001\u9700\u8981\u7cbe\u7ec6\u63a7\u5236<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u539f\u751f MCP SDK<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u5b66\u4e60\u4e2d\u3001\u60f3\u7406\u89e3\u539f\u7406<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><strong style=\"color: #333333; font-weight: bold;\">\u539f\u751f MCP SDK<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: #f0e6d0 currentcolor currentcolor; margin: 24px 0px;\" \/>\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; text-align: left; background: linear-gradient(to top, #f8b43f 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px; border: medium none currentcolor;\"><span style=\"color: #333333; font-weight: bold;\">\u5b8c\u6574\u8c03\u7528\u6d41\u7a0b\u603b\u7ed3<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u5728\u767d\u677f\u4e0a\u753b\u4e86\u6574\u4e2a\u6d41\u7a0b\u7684\u65f6\u5e8f\u56fe\uff1a<\/p>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: #002b36;\"><code class=\"hljs\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: #93a1a1; background: #002b36;\">\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2510\u00a0\u00a0\u00a0\u00a0\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\u00a0\u00a0\u00a0\u00a0\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 \u4f60\u7684\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u00a0\u2502\u00a0\u00a0MCP\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u5916\u90e8 MCP Server\u00a0\u00a0\u2502\n\u2502 Client\u2502\u00a0\u00a0\u00a0\u00a0\u2502\u00a0\u00a0Client\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u00a0\u2502\u00a0\u00a0(kiwi.com)\u00a0\u00a0\u00a0\u00a0\u2502\n\u2502 (\u811a\u672c)\u2502\u00a0\u00a0\u00a0\u00a0\u2502 (SDK)\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u2502\n\u2514\u2500\u2500\u252c\u2500\u2500\u2500\u2518\u00a0\u00a0\u00a0\u00a0\u2514\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2518\u00a0\u00a0\u00a0\u00a0\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u8fde\u4e0a URL\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\u00a0\u00a0\u00a0\u2502\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2192\u2502\u00a0\u00a0\u00a0HTTP \u63e1\u624b\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u2502\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2192\u2502\n\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u2502\u2190\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2502\n\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\u00a0\u00a0\u00a0\u2502\u00a0\u00a0initialize() \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\u00a0\u00a0\u00a0\u2502\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2192\u2502\u00a0\u00a0JSON-RPC initialize \n\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u2502\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2192\u2502\n\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u2502\u2190\u2500\u2500 Server \u80fd\u529b\u58f0\u660e \u2500\u2500\u2502\n\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\u00a0\u00a0\u00a0\u2502\u00a0\u00a0list_tools() \u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\u00a0\u00a0\u00a0\u2502\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2192\u2502\u00a0\u00a0JSON-RPC list_tools \u2502\n\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u2502\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2192\u2502\n\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u2502\u2190\u2500\u2500 \u5de5\u5177\u5217\u8868 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2502\n\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u2502\u00a0\u00a0[search-flight, ...]\u2502\n\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\u00a0\u00a0\u00a0\u2502\u00a0\u00a0call_tool()\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\u00a0\u00a0\u00a0\u2502\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2192\u2502\u00a0\u00a0JSON-RPC call_tool\u00a0\u00a0\n\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u2502\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2192\u2502\n\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u2502\u2190\u2500\u2500 \u822a\u73ed\u6570\u636e \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2502\n\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u89e3\u6790\u7ed3\u679c\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\u00a0\u00a0\u00a0\u2502\u00a0\u00a0\u5c55\u793a\u822a\u73ed\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u5168\u7a0b\u5c31\u56db\u6b65\u2014\u2014\u8fde\u63a5\u3001\u63e1\u624b\u3001\u679a\u4e3e\u3001\u8c03\u7528\u3002\u548c Function Calling \u7684\u4e24\u8f6e\u5bf9\u8bdd\u6bd4\uff0cMCP \u591a\u4e86<strong style=\"color: #333333; font-weight: bold;\">\u679a\u4e3e\u5de5\u5177<\/strong>\u8fd9\u4e00\u6b65\u3002\u56e0\u4e3a MCP Server \u7684\u5de5\u5177\u5217\u8868\u4e0d\u662f\u4f60\u5728\u4ee3\u7801\u91cc\u5b9a\u4e49\u7684\uff0c\u800c\u662f Server \u52a8\u6001\u544a\u8bc9\u4f60\u7684\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u604d\u7136\uff1a&#8221;\u6240\u4ee5 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">list_tools()<\/code> \u5c31\u50cf Function Calling \u91cc\u4f60\u624b\u52a8\u5199\u7684 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">tools<\/code> \u5217\u8868\u2014\u2014\u53ea\u662f MCP \u91cc\u8fd9\u6b65\u662f\u81ea\u52a8\u7684\u3001\u52a8\u6001\u7684\uff01&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u5bf9\u3002\u8fd8\u6709\u4e00\u4e2a\u533a\u522b\u2014\u2014MCP \u91cc\u4f60\u4e0d\u9700\u8981\u7ba1 messages \u5217\u8868\u3001\u4e0d\u9700\u8981\u505a\u4e24\u8f6e API \u8c03\u7528\u3002\u8fd9\u4e9b\u662f Host\uff08Cursor \u7b49\uff09\u7684\u4e8b\u3002\u4f60\u4f5c\u4e3a Client\uff0c\u53ea\u9700\u8981<strong style=\"color: #333333; font-weight: bold;\">\u8c03\u5de5\u5177\u3001\u62ff\u7ed3\u679c<\/strong>\u3002&#8221;<\/p>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: #f0e6d0 currentcolor currentcolor; margin: 24px 0px;\" \/>\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; text-align: left; background: linear-gradient(to top, #f8b43f 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px; border: medium none currentcolor;\"><span style=\"color: #333333; font-weight: bold;\">\u4e94\u4e2a\u5fc5\u8e29\u7684\u5751<\/span><\/h2>\n<h3 style=\"font-size: 16px; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 24px; margin-bottom: 12px; padding-left: 12px; border-left: 4px solid #f8b43f;\"><span style=\"color: #333333; font-weight: bold;\">\u5751\u4e00\uff1astdout \u65e5\u5fd7\u641e\u574f\u534f\u8bae<\/span><\/h3>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: #002b36;\"><code class=\"hljs\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: #93a1a1; background: #002b36;\">#\u00a0\u274c\u00a0\u9519\u8bef\nprint(\"Server\u00a0started\")\u00a0\u00a0\u00a0#\u00a0\u6253\u5230\u00a0stdout\uff0cHost\u00a0\u5d29\u6e83\n\n#\u00a0\u2705\u00a0\u6b63\u786e\nimport\u00a0sys\nprint(\"Server\u00a0started\",\u00a0file=sys.stderr)\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">print()<\/code> \u9ed8\u8ba4\u8fdb stdout\uff0c\u800c stdio \u6a21\u5f0f\u4e0b stdout \u662f\u534f\u8bae\u901a\u9053\u3002\u4efb\u4f55\u975e JSON-RPC \u7684\u8f93\u51fa\u90fd\u4f1a\u7834\u574f\u534f\u8bae\u3002&#8221;<\/p>\n<h3 style=\"font-size: 16px; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 24px; margin-bottom: 12px; padding-left: 12px; border-left: 4px solid #f8b43f;\"><span style=\"color: #333333; font-weight: bold;\">\u5751\u4e8c\uff1a\u8def\u5f84\u914d\u7f6e\u9519\u8bef<\/span><\/h3>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">Cursor \u914d MCP \u65f6\u6700\u5e38\u89c1\u7684\u9519\u8bef\u2014\u2014\u8def\u5f84\u5199\u9519\u4e86\uff1a<\/p>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: #002b36;\"><code class=\"hljs language-json\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: #93a1a1; background: #002b36;\"><span class=\"hljs-comment\" style=\"color: #657b83;\">\/\/\u00a0\u274c\u00a0\u76f8\u5bf9\u8def\u5f84\uff08Cursor\u00a0\u4e0d\u77e5\u9053\u76f8\u5bf9\u4e8e\u54ea\uff09<\/span>\n<span class=\"hljs-punctuation\" style=\"color: #93a1a1;\">{<\/span><span class=\"hljs-attr\" style=\"color: #cb4b16;\">\"args\"<\/span><span class=\"hljs-punctuation\" style=\"color: #93a1a1;\">:<\/span>\u00a0<span class=\"hljs-punctuation\" style=\"color: #93a1a1;\">[<\/span><span class=\"hljs-string\" style=\"color: #859900;\">\"server.py\"<\/span><span class=\"hljs-punctuation\" style=\"color: #93a1a1;\">]<\/span><span class=\"hljs-punctuation\" style=\"color: #93a1a1;\">}<\/span>\n\n<span class=\"hljs-comment\" style=\"color: #657b83;\">\/\/\u00a0\u2705\u00a0\u7edd\u5bf9\u8def\u5f84<\/span>\n<span class=\"hljs-punctuation\" style=\"color: #93a1a1;\">{<\/span><span class=\"hljs-attr\" style=\"color: #cb4b16;\">\"args\"<\/span><span class=\"hljs-punctuation\" style=\"color: #93a1a1;\">:<\/span>\u00a0<span class=\"hljs-punctuation\" style=\"color: #93a1a1;\">[<\/span><span class=\"hljs-string\" style=\"color: #859900;\">\"D:\/my-project\/server.py\"<\/span><span class=\"hljs-punctuation\" style=\"color: #93a1a1;\">]<\/span><span class=\"hljs-punctuation\" style=\"color: #93a1a1;\">}<\/span>\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;Windows \u4e0a\u7528\u6b63\u659c\u6760 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">\/<\/code> \u6216\u53cc\u53cd\u659c\u6760 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">\\\\<\/code> \u90fd\u884c\uff0cJSON \u5fc5\u987b\u5408\u6cd5\u3002&#8221;<\/p>\n<h3 style=\"font-size: 16px; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 24px; margin-bottom: 12px; padding-left: 12px; border-left: 4px solid #f8b43f;\"><span style=\"color: #333333; font-weight: bold;\">\u5751\u4e09\uff1a\u5de5\u5177\u540d\u5199\u9519<\/span><\/h3>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: #002b36;\"><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: #93a1a1; background: #002b36;\"><span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u274c\u00a0list_tools\u00a0\u8fd4\u56de\u7684\u662f\u00a0\"search-flight\"\uff0c\u4f60\u5199\u6210\u4e86\u00a0\"search_flight\"<\/span>\nresult\u00a0=\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">await<\/span>\u00a0session.call_tool(<span class=\"hljs-string\" style=\"color: #859900;\">\"search_flight\"<\/span>,\u00a0args)\n<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u2192\u00a0Error:\u00a0Tool\u00a0not\u00a0found<\/span>\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;<strong style=\"color: #333333; font-weight: bold;\">\u6c38\u8fdc\u5148 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">list_tools()<\/code> \u770b\u4e00\u773c<\/strong>\uff0c\u62ff\u5230\u771f\u5b9e\u7684\u5de5\u5177\u540d\u518d\u8c03\u7528\u3002\u522b\u9760\u731c\u3002&#8221;<\/p>\n<h3 style=\"font-size: 16px; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 24px; margin-bottom: 12px; padding-left: 12px; border-left: 4px solid #f8b43f;\"><span style=\"color: #333333; font-weight: bold;\">\u5751\u56db\uff1a\u53c2\u6570\u683c\u5f0f\u4e0d\u5bf9<\/span><\/h3>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">Kiwi MCP \u7684\u65e5\u671f\u683c\u5f0f\u662f <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">dd\/mm\/yyyy<\/code>\uff0c\u4e0d\u662f Python \u9ed8\u8ba4\u7684 ISO \u683c\u5f0f\uff1a<\/p>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: #002b36;\"><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: #93a1a1; background: #002b36;\"><span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u274c\u00a0ISO\u00a0\u683c\u5f0f\uff08Server\u00a0\u4e0d\u8ba4\uff09<\/span>\ndeparture\u00a0=\u00a0date.today().isoformat()\u00a0\u00a0\u00a0<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\"2026-08-23\"<\/span>\n\n<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u2705\u00a0dd\/mm\/yyyy\uff08Server\u00a0\u7684\u5951\u7ea6\uff09<\/span>\ndeparture\u00a0=\u00a0date.today().strftime(<span class=\"hljs-string\" style=\"color: #859900;\">\"%d\/%m\/%Y\"<\/span>)\u00a0\u00a0\u00a0<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\"23\/08\/2026\"<\/span>\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u6bcf\u4e2a MCP Server \u6709\u81ea\u5df1\u7684\u53c2\u6570\u5951\u7ea6\u2014\u2014<code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">list_tools()<\/code> \u8fd4\u56de\u7684 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">inputSchema<\/code> \u91cc\u6709 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">description<\/code>\uff0c\u4ed4\u7ec6\u770b\u3002Kiwi \u7684\u63cf\u8ff0\u91cc\u5199\u4e86\u65e5\u671f\u683c\u5f0f\u662f <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">dd\/mm\/yyyy<\/code>\u3002&#8221;<\/p>\n<h3 style=\"font-size: 16px; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 24px; margin-bottom: 12px; padding-left: 12px; border-left: 4px solid #f8b43f;\"><span style=\"color: #333333; font-weight: bold;\">\u5751\u4e94\uff1a\u6ca1\u770b result.isError<\/span><\/h3>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: #002b36;\"><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: #93a1a1; background: #002b36;\">result\u00a0=\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">await<\/span>\u00a0session.call_tool(<span class=\"hljs-string\" style=\"color: #859900;\">\"search-flight\"<\/span>,\u00a0args)\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">if<\/span>\u00a0result.isError:\n<span class=\"hljs-built_in\" style=\"color: #2aa198;\">print<\/span>(<span class=\"hljs-string\" style=\"color: #859900;\">\"\u8c03\u7528\u5931\u8d25:\"<\/span>,\u00a0result.content[<span class=\"hljs-number\" style=\"color: #cb4b16;\">0<\/span>].text)\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">return<\/span>\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;MCP \u7684 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">call_tool<\/code> \u4e0d\u4f1a\u629b\u5f02\u5e38\u2014\u2014\u5373\u4f7f\u5931\u8d25\u4e5f\u8fd4\u56de\u7ed3\u679c\uff0c\u53ea\u662f <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">isError<\/code> \u4e3a <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">True<\/code>\u3002\u4e0d\u68c0\u67e5 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">isError<\/code> \u5c31\u628a\u9519\u8bef\u5f53\u6210\u6b63\u5e38\u6570\u636e\u5f80\u4e0b\u8d70\uff0c\u540e\u9762\u53ef\u80fd\u4f1a\u51fa\u83ab\u540d\u5176\u5999\u7684\u95ee\u9898\u3002&#8221;<\/p>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: #f0e6d0 currentcolor currentcolor; margin: 24px 0px;\" \/>\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; text-align: left; background: linear-gradient(to top, #f8b43f 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px; border: medium none currentcolor;\"><span style=\"color: #333333; font-weight: bold;\">\u6e90\u7801\u5168\u666f<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u628a\u5b8c\u6574\u7684\u5ba2\u6237\u7aef\u4ee3\u7801\u94fa\u5f00\uff0c\u8ba9\u5c0f\u660e\u5bf9\u7167\u7740\u521a\u624d\u7684\u62c6\u89e3\u770b\uff1a<\/p>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: #002b36;\"><code class=\"hljs language-python\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: #93a1a1; background: #002b36;\"><span class=\"hljs-string\" style=\"color: #859900;\">\"\"\"\n\u539f\u751f\u00a0MCP\u00a0SDK\u00a0\u8c03\u7528\u5916\u90e8\u00a0HTTP\u00a0MCP\u00a0\u670d\u52a1\u793a\u4f8b\n\u8fde\u63a5\u00a0Kiwi.com\u00a0\u822a\u73ed\u641c\u7d22\u00a0MCP\u00a0Server\n\"\"\"<\/span>\n\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">import<\/span>\u00a0asyncio\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">import<\/span>\u00a0json\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">from<\/span>\u00a0datetime\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">import<\/span>\u00a0date,\u00a0timedelta\n\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">import<\/span>\u00a0httpx\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">from<\/span>\u00a0mcp\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">import<\/span>\u00a0ClientSession\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">from<\/span>\u00a0mcp.client.streamable_http\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">import<\/span>\u00a0streamable_http_client\n\nKIWI_MCP_URL\u00a0=\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"https:\/\/mcp.kiwi.com\"<\/span>\n\n\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">def<\/span>\u00a0<span class=\"hljs-title function_\" style=\"color: #268bd2;\">_text_parts<\/span>(<span class=\"hljs-params\">result<\/span>):\n<span class=\"hljs-string\" style=\"color: #859900;\">\"\"\"\u63d0\u53d6\u7ed3\u679c\u4e2d\u7684\u6587\u672c\u5185\u5bb9\"\"\"<\/span>\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">return<\/span>\u00a0[c.text\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">for<\/span>\u00a0c\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">in<\/span>\u00a0result.content\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">if<\/span>\u00a0c.<span class=\"hljs-built_in\" style=\"color: #2aa198;\">type<\/span>\u00a0==\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"text\"<\/span>]\n\n\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">async<\/span>\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">def<\/span>\u00a0<span class=\"hljs-title function_\" style=\"color: #268bd2;\">main<\/span>():\n<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u67e5\u8be2\u53c2\u6570<\/span>\n\u00a0\u00a0departure\u00a0=\u00a0(date.today()\u00a0+\u00a0timedelta(days=<span class=\"hljs-number\" style=\"color: #cb4b16;\">14<\/span>)).strftime(<span class=\"hljs-string\" style=\"color: #859900;\">\"%d\/%m\/%Y\"<\/span>)\n\u00a0\u00a0args\u00a0=\u00a0{\n<span class=\"hljs-string\" style=\"color: #859900;\">\"flyFrom\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"PRG\"<\/span>,\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u51fa\u53d1\u5730\uff08\u5e03\u62c9\u683c\uff09<\/span>\n<span class=\"hljs-string\" style=\"color: #859900;\">\"flyTo\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"LON\"<\/span>,\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u76ee\u7684\u5730\uff08\u4f26\u6566\uff09<\/span>\n<span class=\"hljs-string\" style=\"color: #859900;\">\"departureDate\"<\/span>:\u00a0departure,\u00a0<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u65e5\u671f\u00a0dd\/mm\/yyyy<\/span>\n<span class=\"hljs-string\" style=\"color: #859900;\">\"adults\"<\/span>:\u00a0<span class=\"hljs-number\" style=\"color: #cb4b16;\">1<\/span>,\n<span class=\"hljs-string\" style=\"color: #859900;\">\"currency\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"EUR\"<\/span>,\n<span class=\"hljs-string\" style=\"color: #859900;\">\"sort\"<\/span>:\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"price\"<\/span>,\n\u00a0\u00a0}\n\n<span class=\"hljs-built_in\" style=\"color: #2aa198;\">print<\/span>(<span class=\"hljs-string\" style=\"color: #859900;\">f\"Connecting\u00a0to\u00a0<span class=\"hljs-subst\" style=\"color: #93a1a1;\">{KIWI_MCP_URL}<\/span>...\"<\/span>)\n\n<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0===\u00a0\u8fde\u63a5\u00a0\u2192\u00a0\u63e1\u624b\u00a0\u2192\u00a0\u8c03\u7528\u00a0===<\/span>\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">async<\/span>\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">with<\/span>\u00a0httpx.AsyncClient(timeout=<span class=\"hljs-number\" style=\"color: #cb4b16;\">90.0<\/span>)\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">as<\/span>\u00a0http:\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">async<\/span>\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">with<\/span>\u00a0streamable_http_client(KIWI_MCP_URL,\u00a0http_client=http)\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">as<\/span>\u00a0(\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0read,\u00a0write,\u00a0_,\n\u00a0\u00a0\u00a0\u00a0):\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">async<\/span>\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">with<\/span>\u00a0ClientSession(read,\u00a0write)\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">as<\/span>\u00a0session:\n<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u63e1\u624b<\/span>\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">await<\/span>\u00a0session.initialize()\n<span class=\"hljs-built_in\" style=\"color: #2aa198;\">print<\/span>(<span class=\"hljs-string\" style=\"color: #859900;\">\"Handshake\u00a0OK\"<\/span>)\n\n<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u5217\u51fa\u5de5\u5177<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0tools\u00a0=\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">await<\/span>\u00a0session.list_tools()\n<span class=\"hljs-built_in\" style=\"color: #2aa198;\">print<\/span>(<span class=\"hljs-string\" style=\"color: #859900;\">f\"Available\u00a0tools:\u00a0<span class=\"hljs-subst\" style=\"color: #93a1a1;\">{<span class=\"hljs-built_in\" style=\"color: #2aa198;\">sorted<\/span>(t.name\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">for<\/span>\u00a0t\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">in<\/span>\u00a0tools.tools)}<\/span>\"<\/span>)\n\n<span class=\"hljs-comment\" style=\"color: #657b83;\">#\u00a0\u8c03\u7528\u822a\u73ed\u641c\u7d22<\/span>\n<span class=\"hljs-built_in\" style=\"color: #2aa198;\">print<\/span>(<span class=\"hljs-string\" style=\"color: #859900;\">f\"Calling\u00a0search-flight\u00a0with\u00a0args=<span class=\"hljs-subst\" style=\"color: #93a1a1;\">{args}<\/span>\"<\/span>)\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0result\u00a0=\u00a0<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">await<\/span>\u00a0session.call_tool(<span class=\"hljs-string\" style=\"color: #859900;\">\"search-flight\"<\/span>,\u00a0args)\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0texts\u00a0=\u00a0_text_parts(result)\n\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">if<\/span>\u00a0result.isError:\n<span class=\"hljs-built_in\" style=\"color: #2aa198;\">print<\/span>(<span class=\"hljs-string\" style=\"color: #859900;\">f\"Error:\u00a0<span class=\"hljs-subst\" style=\"color: #93a1a1;\">{texts[<span class=\"hljs-number\" style=\"color: #cb4b16;\">0<\/span>]}<\/span>\"<\/span>)\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">return<\/span>\n\n<span class=\"hljs-built_in\" style=\"color: #2aa198;\">print<\/span>(<span class=\"hljs-string\" style=\"color: #859900;\">\"Results:\"<\/span>,\u00a0texts[<span class=\"hljs-number\" style=\"color: #cb4b16;\">0<\/span>][:<span class=\"hljs-number\" style=\"color: #cb4b16;\">500<\/span>])\n\n\n<span class=\"hljs-keyword\" style=\"color: #6c71c4;\">if<\/span>\u00a0__name__\u00a0==\u00a0<span class=\"hljs-string\" style=\"color: #859900;\">\"__main__\"<\/span>:\n\u00a0\u00a0asyncio.run(main())\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u8fd0\u884c\u8f93\u51fa\uff1a<\/p>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: #002b36;\"><code class=\"hljs\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: #93a1a1; background: #002b36;\">Connecting\u00a0to\u00a0https:\/\/mcp.kiwi.com...\nHandshake\u00a0OK\nAvailable\u00a0tools:\u00a0['search-flight',\u00a0'search-multi-city']\nCalling\u00a0search-flight\u00a0with\u00a0args={'flyFrom':\u00a0'PRG',\u00a0...}\nResults:\u00a0{\"currency\":\"EUR\",\"resultsCount\":15,\"itineraries\":[...]}\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u4ece\u8fde\u63a5\u5230\u62ff\u5230\u822a\u73ed\u6570\u636e\uff0c\u6838\u5fc3\u4ee3\u7801\u4e0d\u5230 30 \u884c\u3002&#8221;<\/p>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: #f0e6d0 currentcolor currentcolor; margin: 24px 0px;\" \/>\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; text-align: left; background: linear-gradient(to top, #f8b43f 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px; border: medium none currentcolor;\"><span style=\"color: #333333; font-weight: bold;\">\u548c Function Calling \u7684\u5173\u7cfb<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u8bf4\uff1a&#8221;\u6700\u540e\u5e2e\u4f60\u7406\u6e05 MCP \u548c Function Calling \u7684\u5173\u7cfb\u3002\u5b83\u4eec\u4e0d\u662f\u7ade\u4e89\u5173\u7cfb\uff0c\u662f<strong style=\"color: #333333; font-weight: bold;\">\u5206\u5de5\u534f\u4f5c<\/strong>\u3002&#8221;<\/p>\n<pre style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; overflow: auto hidden; max-width: 100%; box-sizing: border-box; position: relative; line-height: 1.5; border-radius: 4px; margin: 16px 0px; padding: 0.5em; white-space: pre; word-break: normal; overflow-wrap: normal; background: #002b36;\"><code class=\"hljs\" style=\"tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow: auto hidden; max-width: 100%; box-sizing: border-box; margin: 0.5em; padding: 3px 5px; white-space: nowrap; word-break: normal; overflow-wrap: normal; color: #93a1a1; background: #002b36;\">\u7528\u6237\uff1a\u300c\u5e2e\u6211\u67e5\u4ece\u6210\u90fd\u5230\u4e1c\u4eac\u6700\u4fbf\u5b9c\u7684\u822a\u73ed\u300d\n\u00a0\u00a0\u2502\n\u00a0\u00a0\u25bc\nCursor\uff08Host\uff09\n\u00a0\u00a0\u2502\u00a0\u7528\u5927\u6a21\u578b\u5206\u6790\u610f\u56fe\n\u00a0\u00a0\u2502\u00a0\u5927\u6a21\u578b\u8bf4\uff1a\u300c\u9700\u8981\u8c03\u00a0search-flight\u00a0\u5de5\u5177\u300d\n\u00a0\u00a0\u2502\n\u00a0\u00a0\u25bc\nCursor\u00a0\u7684\u00a0MCP\u00a0Client\n\u00a0\u00a0\u2502\u00a0\u901a\u8fc7\u00a0HTTP\u00a0\u8fde\u5230\u00a0Kiwi.com\u00a0MCP\u00a0Server\n\u00a0\u00a0\u2502\u00a0call_tool(\"search-flight\",\u00a0{...})\n\u00a0\u00a0\u25bc\nKiwi.com\u00a0MCP\u00a0Server\n\u00a0\u00a0\u2502\u00a0\u8fd4\u56de\u822a\u73ed\u6570\u636e\n\u00a0\u00a0\u25bc\nCursor\uff08Host\uff09\n\u00a0\u00a0\u2502\u00a0\u628a\u822a\u73ed\u6570\u636e\u5582\u7ed9\u5927\u6a21\u578b\n\u00a0\u00a0\u2502\u00a0\u5927\u6a21\u578b\u57fa\u4e8e\u771f\u5b9e\u6570\u636e\u751f\u6210\u56de\u7b54\n\u00a0\u00a0\u25bc\n\u300c\u6210\u90fd\u5230\u4e1c\u4eac\u6700\u4fbf\u5b9c\u7684\u822a\u73ed\u662f\u00a0XX\u00a0\u822a\u7a7a\uff0c1380\u5143\u2026\u2026\u300d\n<\/code><\/pre>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u770b\u6e05\u695a\u6ca1\uff1f<strong style=\"color: #333333; font-weight: bold;\">Function Calling \u7ba1\u300c\u6a21\u578b\u5982\u4f55\u51b3\u5b9a\u8c03\u54ea\u4e2a\u5de5\u5177\u300d\uff0cMCP \u7ba1\u300c\u5de5\u5177\u5982\u4f55\u88ab\u8c03\u7528\u300d<\/strong>\u3002Cursor \u5185\u90e8\u7528 Function Calling \u673a\u5236\u8ba9\u6a21\u578b\u9009\u5de5\u5177\uff0c\u901a\u8fc7 MCP Client \u53bb\u5b9e\u9645\u8c03\u7528\u5de5\u5177\u3002\u4e24\u5c42\u534f\u4f5c\u3002&#8221;<\/p>\n<table style=\"display: inline-block !important; width: auto; max-width: 100%; overflow: auto; border-spacing: 0px; border-collapse: collapse; margin: 1rem 0px;\">\n<thead style=\"background: #fff9eb; color: #333333; text-align: left;\">\n<tr>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u5c42<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u534f\u8bae\/\u673a\u5236<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u89e3\u51b3\u7684\u95ee\u9898<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u6a21\u578b\u5c42<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">Function Calling<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u6a21\u578b\u600e\u4e48\u9009\u5de5\u5177\u3001\u600e\u4e48\u586b\u53c2\u6570<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u4f20\u8f93\u5c42<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">MCP<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u5de5\u5177\u600e\u4e48\u66b4\u9732\u3001\u600e\u4e48\u8de8\u8fdb\u7a0b\u901a\u4fe1<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u4f60\u521a\u5165\u95e8\u65f6\u53ef\u4ee5\u4e0d\u7ba1 MCP\u2014\u2014Function Calling \u591f\u7528\u4e86\u3002\u4f46\u5f53\u4f60\u9700\u8981\u7528\u7684\u5de5\u5177\u4e0d\u662f\u81ea\u5df1\u5199\u7684\u3001\u800c\u662f\u522b\u4eba\u63d0\u4f9b\u7684\u2014\u2014\u6216\u8005\u4f60\u60f3\u8ba9\u522b\u4eba\u7528\u4f60\u7684\u5de5\u5177\u2014\u2014MCP \u5c31\u662f\u552f\u4e00\u6807\u51c6\u7b54\u6848\u3002&#8221;<\/p>\n<hr style=\"border-width: 1px medium medium; border-style: solid none none; border-color: #f0e6d0 currentcolor currentcolor; margin: 24px 0px;\" \/>\n<h2 style=\"display: inline-block; position: relative; font-weight: bold; color: #333333; line-height: 1.5; margin-top: 32px; margin-bottom: 16px; padding: 0px 6px 2px; text-align: left; background: linear-gradient(to top, #f8b43f 42%, transparent 42%); box-decoration-break: clone; -webkit-box-decoration-break: clone; font-size: 17px; border: medium none currentcolor;\"><span style=\"color: #333333; font-weight: bold;\">\u603b\u7ed3<\/span><\/h2>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u8001\u5f20\u5728\u767d\u677f\u4e0a\u5199\u4e86\u6700\u540e\u4e00\u53e5\u8bdd\uff1a<\/p>\n<blockquote style=\"color: #555555; background-color: #fff9eb; background-image: none; padding: 16px 20px; margin: 20px 0px; border-width: 0px 0px 0px 4px; border-style: none none none solid; border-color: currentcolor currentcolor currentcolor #f8b43f; border-radius: 6px; font-style: normal; quotes: none;\">\n<p style=\"margin: 0.55em 0px; color: #555555; text-indent: 0px; padding: 0px; line-height: 1.75; font-style: normal; background: transparent;\"><strong style=\"color: #333333; font-weight: bold;\">Function Calling \u8ba9\u4f60\u5199\u51fa\u80fd\u8c03\u5de5\u5177\u7684\u7a0b\u5e8f\u3002MCP \u8ba9\u4f60\u8c03\u7684\u5de5\u5177\u80fd\u88ab\u4efb\u4f55\u7a0b\u5e8f\u7528\u3002<\/strong><\/p>\n<\/blockquote>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u628a\u6574\u4e2a\u7b14\u8bb0\u6574\u7406\u6210\u4e86\u901f\u67e5\u8868\uff1a<\/p>\n<table style=\"display: inline-block !important; width: auto; max-width: 100%; overflow: auto; border-spacing: 0px; border-collapse: collapse; margin: 1rem 0px;\">\n<thead style=\"background: #fff9eb; color: #333333; text-align: left;\">\n<tr>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u6982\u5ff5<\/th>\n<th style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8;\" align=\"left\">\u4e00\u53e5\u8bdd<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">MCP \u662f\u4ec0\u4e48<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u6807\u51c6\u5316\u5de5\u5177\u66b4\u9732\u534f\u8bae\uff0c\u4e0d\u9650\u8bed\u8a00\u3001\u4e0d\u9650\u4ea7\u54c1<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">Host \/ Client \/ Server<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u5bbf\u4e3b \/ \u901a\u4fe1\u6a21\u5757 \/ \u5de5\u5177\u63d0\u4f9b\u65b9<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">stdio \u4f20\u8f93<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">stdout=\u534f\u8bae\u901a\u9053\uff0cstderr=\u8c03\u8bd5\u65e5\u5fd7\uff0c<code>print<\/code> \u53ea\u6253 stderr<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">HTTP \u4f20\u8f93<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u8fde\u516c\u7f51 URL\uff0c\u4e0d\u9700\u8981\u672c\u5730\u8d77\u8fdb\u7a0b<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">FastMCP Server<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u4e09\u6b65\uff1a<code>FastMCP()<\/code> + <code>@mcp.tool()<\/code> + <code>mcp.run(transport=\"stdio\")<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u539f\u751f Client<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u56db\u6b65\uff1a<code>streamable_http_client<\/code> \u2192 <code>ClientSession<\/code> \u2192 <code>initialize<\/code> \u2192 <code>call_tool<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>result.content<\/code><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u5217\u8868\u7ed3\u6784\uff0c\u5148\u5224\u65ad <code>type<\/code> \u518d\u53d6 <code>.text<\/code>\uff0c\u4e0d\u8981\u76f2\u53d6 <code>[0]<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\"><code>result.isError<\/code><\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u8c03\u7528\u53ef\u80fd\u6210\u529f\u4f46\u8fd4\u56de\u9519\u8bef\uff0c\u5fc5\u987b\u68c0\u67e5<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">\u548c FC \u7684\u5173\u7cfb<\/td>\n<td style=\"font-size: 0.75em; padding: 10px 12px; line-height: 1.6; border: 1px solid #f5e6c8; min-width: 100px;\" align=\"left\">FC \u7ba1\u6a21\u578b\u51b3\u7b56\uff0cMCP \u7ba1\u5de5\u5177\u66b4\u9732\uff1b\u4e24\u5c42\u534f\u4f5c\uff0c\u5404\u53f8\u5176\u804c<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u4ece\u5199\u7b2c\u4e00\u4e2a <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; background-color: #fff4e6; color: #d9480f; border-radius: 2px; font-size: 14px; padding: 2px 5px; word-break: break-word;\">@mcp.tool()<\/code> \u5230\u8c03\u5916\u90e8 HTTP MCP\uff0c\u6838\u5fc3\u5c31\u8fd9\u70b9\u4e1c\u897f\u3002\u5269\u4e0b\u7684\u2014\u2014Resources\u3001Prompts\u3001\u591a Server \u7ba1\u7406\u2014\u2014\u90fd\u662f\u5728\u8fd9\u4e2a\u57fa\u7840\u4e0a\u505a\u52a0\u6cd5\u3002&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">\u5c0f\u660e\u95ee\uff1a&#8221;\u90a3\u6211\u73b0\u5728\u5199\u7684\u90a3\u4e9b Function Calling \u5de5\u5177\uff0c\u8981\u4e0d\u8981\u6539\u6210 MCP\uff1f&#8221;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u770b\u573a\u666f\u3002&#8221;\u8001\u5f20\u8bf4\uff0c&#8221;\u5982\u679c\u53ea\u6709\u4f60\u4e00\u4e2a\u4eba\u7528\u3001\u53ea\u6709\u4e00\u4e2a Agent \u9879\u76ee\u2014\u2014Function Calling \u591f\u7528\u3002\u4f46\u5982\u679c\u4f60\u7684\u5de5\u5177\u4f1a\u88ab\u591a\u4e2a\u9879\u76ee\u590d\u7528\u3001\u6216\u8005\u4f60\u60f3\u8ba9\u522b\u4eba\u63a5\u4f60\u7684\u5de5\u5177\u2014\u2014\u4e0a MCP\u3002<strong style=\"color: #333333; font-weight: bold;\">MCP \u89e3\u51b3\u7684\u662f&#8217;\u590d\u7528&#8217;\u95ee\u9898\uff0c\u4e0d\u662f&#8217;\u529f\u80fd&#8217;\u95ee\u9898\u3002<\/strong>&#8220;<\/p>\n<p style=\"margin-top: 12px; margin-bottom: 12px; color: #333333; text-indent: 0px; padding-left: 0px;\">&#8220;\u5c31\u50cf\u4f60\u5199\u4e86\u4e2a\u8ba1\u7b97\u5668\u51fd\u6570\u2014\u2014\u81ea\u5df1\u7528\u5c31\u653e\u9879\u76ee\u91cc\uff0c\u60f3\u7ed9\u522b\u4eba\u7528\u5c31\u6253\u6210 pip \u5305\u3002MCP \u5c31\u662f\u5de5\u5177\u754c\u7684\u6253\u5305\u53d1\u5e03\u534f\u8bae\u3002&#8221;<\/p>\n<\/section>\n<section data-tool=\"MDX Notes\" data-website=\"https:\/\/mdxnotes.com\/\" data-pm-slice=\"0 0 []\"><\/section>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0a\u7bc7\u4f60\u5b66\u4f1a\u4e86\u5de5\u7a0b\u5316\u7ba1\u7406\u591a\u4e2a\u5de5\u5177\u2014\u2014\u6ce8\u518c\u8868\u6a21\u5f0f\u8ba9\u65b0\u589e\u5de5\u5177\u53ea\u9700\u4e00\u884c\u3002\u4f46\u4f60\u7684\u5de5\u5177\u662f\u81ea\u5df1\u5199\u7684\uff0c\u522b\u4eba\u7684\u5de5\u5177\u5462\uff1f\u8fd9\u7bc7\u8bb2 M [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3636,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[164,163],"tags":[167,168],"_links":{"self":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/3634"}],"collection":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3634"}],"version-history":[{"count":5,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/3634\/revisions"}],"predecessor-version":[{"id":3640,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/3634\/revisions\/3640"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/media\/3636"}],"wp:attachment":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3634"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3634"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3634"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}