{"id":55397,"date":"2025-02-19T15:50:24","date_gmt":"2025-02-19T07:50:24","guid":{"rendered":"https:\/\/fwq.ai\/blog\/55397\/"},"modified":"2025-02-19T15:50:24","modified_gmt":"2025-02-19T07:50:24","slug":"mcp-%e5%92%8c-python-mcp-server-%e5%bc%80%e5%8f%91%e8%af%a6%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/55397\/","title":{"rendered":"MCP \u548c Python MCP Server \u5f00\u53d1\u8be6\u89e3"},"content":{"rendered":"<h2>\u521d\u8bc6MCP<\/h2>\n<p>MCP\uff08Model Context Protocol\uff09\uff0c\u662f\u4e00\u4e2a\u5f00\u53d1\u7684\u534f\u8bae\uff0c\u6807\u51c6\u5316\u4e86\u5e94\u7528\u7a0b\u5e8f\u5982\u4f55\u4e3a\u5927\u6a21\u578b\u63d0\u4f9b\u4e0a\u4e0b\u6587\u3002MCP\u63d0\u4f9b\u4e86\u4e00\u4e2a\u6807\u51c6\u7684\u4e3aLLM\u63d0\u4f9b\u6570\u636e\u3001\u5de5\u5177\u7684\u65b9\u5f0f\uff0c\u4f7f\u7528MCP\u4f1a\u66f4\u5bb9\u6613\u7684\u6784\u5efaAgent\u6216\u8005\u662f\u57fa\u4e8eLLM\u7684\u590d\u6742\u5de5\u4f5c\u6d41\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3>\u67b6\u6784<\/h3>\n<p>MCP\u662fCS\u7ed3\u6784\uff0c\u4e00\u4e2aMCP host\u5e94\u7528\u53ef\u4ee5\u94fe\u63a5\u591a\u4e2aMCP servers\u3002 <img decoding=\"async\" src=\"https:\/\/www.aisharenet.com\/wp-content\/uploads\/2025\/01\/b62f82ff6c20895.jpeg\" class=\"aligncenter\" title=\"MCP \u548c Python MCP Server \u5f00\u53d1\u8be6\u89e3\u63d2\u56fe\" alt=\"MCP \u548c Python MCP Server \u5f00\u53d1\u8be6\u89e3\u63d2\u56fe\" \/><\/p>\n<ul>\n<li> Host\uff1a\u9700\u8981\u901a\u8fc7MCP\u83b7\u5f97\u6570\u636e\u7684\u7a0b\u5e8f\uff0c\u4f8b\u5982Claude Desktop, IDEs\u6216\u8005\u4e00\u4e9bAI\u5de5\u5177\u7b49<\/li>\n<li>MCP Client: MCP\u534f\u8bae\u5ba2\u6237\u7aef\uff0c\u548cMCP Server\u662f\u4e00\u5bf9\u4e00\u652f\u6301\u7684\u3002<\/li>\n<li>MCP Server\uff1a\u9700\u8981\u901a\u8fc7MCP\u66b4\u9732\u4e00\u4e9b\u7279\u6b8a\u7684\u80fd\u529b\u7684\u8f7b\u5e94\u7528\u3002\u6839\u636eMCP\u534f\u8bae\u5b9a\u4e49\uff0cServer\u53ef\u4ee5\u63d0\u4f9b\u4e09\u79cd\u7c7b\u578b\u7684\u6807\u51c6\u80fd\u529b\uff0cResources\u3001Tools\u3001Prompts\uff0c\u6bcf\u4e2aServer\u53ef\u540c\u65f6\u63d0\u4f9b\u8005\u4e09\u79cd\u7c7b\u578b\u80fd\u529b\u6216\u5176\u4e2d\u4e00\u79cd\u3002\n<ul>\n<li>Resources\uff1a\u8d44\u6e90\uff0c\u7c7b\u4f3c\u4e8e\u6587\u4ef6\u6570\u636e\u8bfb\u53d6\uff0c\u53ef\u4ee5\u662f\u6587\u4ef6\u8d44\u6e90\u6216\u662fAPI\u54cd\u5e94\u8fd4\u56de\u7684\u5185\u5bb9\u3002<\/li>\n<li>Tools\uff1a\u5de5\u5177\uff0c\u7b2c\u4e09\u65b9\u670d\u52a1\u3001\u529f\u80fd\u51fd\u6570\uff0c\u901a\u8fc7\u6b64\u53ef\u63a7\u5236LLM\u53ef\u8c03\u7528\u54ea\u4e9b\u51fd\u6570\u3002<\/li>\n<li>Prompts\uff1a\u63d0\u793a\u8bcd\uff0c\u4e3a\u7528\u6237\u9884\u5148\u5b9a\u4e49\u597d\u7684\u5b8c\u6210\u7279\u5b9a\u4efb\u52a1\u7684\u6a21\u677f<\/li>\n<\/ul>\n<\/li>\n<li>Local Data Resources\uff1aMCP Server\u53ef\u4ee5\u5b89\u5168\u8bbf\u95ee\u7684\u672c\u5730\u7684\u6587\u4ef6\u3001\u6570\u636e\u5e93\u3001\u670d\u52a1\u7b49\u3002<\/li>\n<li>Remote Service\uff1aMCP Server\u53ef\u901a\u8fc7\u7f51\u7edc\uff08\u5982 API\uff09\u8fde\u63a5\u7684\u5916\u90e8\u7cfb\u7edf\u3002<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p> <\/p>\n<p>MCP\u7684\u670d\u52a1\u793a\u610f\u56fe\uff1a <img decoding=\"async\" src=\"\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%200%200'%3E%3C\/svg%3E\" class=\"aligncenter\" title=\"MCP \u548c Python MCP Server \u5f00\u53d1\u8be6\u89e3\u63d2\u56fe1\" alt=\"MCP \u548c Python MCP Server \u5f00\u53d1\u8be6\u89e3\u63d2\u56fe1\" \/> <img decoding=\"async\" src=\"https:\/\/www.aisharenet.com\/wp-content\/uploads\/2025\/01\/0f4a7a66be4005e.jpeg\" class=\"aligncenter\" title=\"MCP \u548c Python MCP Server \u5f00\u53d1\u8be6\u89e3\u63d2\u56fe2\" alt=\"MCP \u548c Python MCP Server \u5f00\u53d1\u8be6\u89e3\u63d2\u56fe2\" \/> <\/p>\n<p>MCP Servers\u901a\u8fc7MCP Protocol\u5411Host Application\u63d0\u4f9b\u4e00\u4e9b\u529f\u80fd\u5217\u8868\uff08\u4f8b\u5982\u63d0\u4f9b\u4e00\u4e2a\u5de5\u5177\u5217\u8868\uff09\uff0c\u7136\u540eHost Application\u4f1a\u5c06\u8fd9\u4e2a\u5217\u8868\u683c\u5f0f\u5316\u6210\u4e00\u4e2aLLM\u80fd\u8bfb\u61c2\u7684\u683c\u5f0f\u3002 Host Application\u53ef\u4ee5\u5229\u7528\u8fd9\u4e2a\u529f\u80fd\u5217\u8868\u5411LLM\u53d1\u9001\u4e00\u4e9b\u9700\u8981\u5927\u6a21\u578b\u5904\u7406\u7684\u8bf7\u6c42\uff08\u8fd9\u5c31\u662fprompt\uff09\uff0cLLM\u4f1a\u6839\u636e\u8fd9\u6b21\u7684prompt\u8fd4\u56de\u4e00\u4e2atool_calls\u7684json\u5b57\u7b26\u4e32\u3002\u5f53Host Applicaiton\u63a5\u53d7\u5230\u8fd9\u4e2atool_calls\u540e\uff0c\u5c31\u4f1a\u8c03\u7528\u5bf9\u5e94\u7684MCP server\u5de5\u5177\u8fd4\u56de\u5bf9\u5e94\u7684\u7ed3\u679c\u4e86\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3>\u501f\u52a9Claude Desktop \u4f7f\u7528MCP<\/h3>\n<p>\u501f\u52a9Claude\u684c\u9762\u5ba2\u6237\u7aef\uff0c\u80af\u5b9a\u8981\u5148\u5b89\u88c5\u4e00\u4e2a\uff0c\u8fd9\u4e2a\u5b89\u88c5\u5c31\u8df3\u8fc7\u4e86\u3002\u6211\u4eec\u914d\u7f6e\u4e00\u4e2a\u6587\u4ef6\u7cfb\u7edf\u7684MCP Server\u3002 <img decoding=\"async\" src=\"\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%200%200'%3E%3C\/svg%3E\" class=\"aligncenter\" title=\"MCP \u548c Python MCP Server \u5f00\u53d1\u8be6\u89e3\u63d2\u56fe1\" alt=\"MCP \u548c Python MCP Server \u5f00\u53d1\u8be6\u89e3\u63d2\u56fe1\" \/> <img decoding=\"async\" src=\"https:\/\/www.aisharenet.com\/wp-content\/uploads\/2025\/01\/738ce12ea18182b.jpeg\" class=\"aligncenter\" title=\"MCP \u548c Python MCP Server \u5f00\u53d1\u8be6\u89e3\u63d2\u56fe3\" alt=\"MCP \u548c Python MCP Server \u5f00\u53d1\u8be6\u89e3\u63d2\u56fe3\" \/> <\/p>\n<p>\u7136\u540e\u9009\u62e9Developer\u4e0b\u7684Edit Config\u3001 <img decoding=\"async\" src=\"\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%200%200'%3E%3C\/svg%3E\" class=\"aligncenter\" title=\"MCP \u548c Python MCP Server \u5f00\u53d1\u8be6\u89e3\u63d2\u56fe1\" alt=\"MCP \u548c Python MCP Server \u5f00\u53d1\u8be6\u89e3\u63d2\u56fe1\" \/> <img decoding=\"async\" src=\"https:\/\/www.aisharenet.com\/wp-content\/uploads\/2025\/01\/80ba6f69d50532f.jpeg\" class=\"aligncenter\" title=\"MCP \u548c Python MCP Server \u5f00\u53d1\u8be6\u89e3\u63d2\u56fe4\" alt=\"MCP \u548c Python MCP Server \u5f00\u53d1\u8be6\u89e3\u63d2\u56fe4\" \/> <\/p>\n<p>\u6253\u5f00<code>claude_desktop_config.json<\/code>\uff0c\u5b8c\u6210\u6587\u4ef6\u7cfb\u7edf\u7684MCP Server\u914d\u7f6e\u3002(\u914d\u7f6e\u4e2dusername\u9700\u8981\u66ff\u6362\u6210\u81ea\u5df1\u81ea\u5df1\u7535\u8111\u7684\u7528\u6237\u540d\uff0c\u540c\u65f6\u4e5f\u9700\u8981\u672c\u5730\u5b89\u88c5node.js\u7684\u73af\u5883\u3002\uff09<\/p>\n<pre><code>{\r\n&nbsp;&nbsp;\"mcpServers\": {\r\n&nbsp; &nbsp;&nbsp;\"filesystem\": {\r\n&nbsp; &nbsp; &nbsp;&nbsp;\"\":&nbsp;\"npx\",\r\n&nbsp; &nbsp; &nbsp;&nbsp;\"args\": [\r\n&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\"-y\",\r\n&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\"@modelcontextprotocol\/server-filesystem\",\r\n&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\"\/Users\/username\/Desktop\",\r\n&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\"\/Users\/username\/Downloads\"\r\n&nbsp; &nbsp; &nbsp; ]\r\n&nbsp; &nbsp; }\r\n&nbsp; }\r\n}<\/code><\/pre>\n<p>\u914d\u7f6e\u5b8c\u6210\u540e\uff0c\u91cd\u542fCluade\u5ba2\u6237\u7aef\u3002\u5c31\u53ef\u4ee5\u8bd5\u4e00\u4e0b\u4e86\u3002<\/p>\n<p><img decoding=\"async\" src=\"\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%200%200'%3E%3C\/svg%3E\" class=\"aligncenter\" title=\"MCP \u548c Python MCP Server \u5f00\u53d1\u8be6\u89e3\u63d2\u56fe1\" alt=\"MCP \u548c Python MCP Server \u5f00\u53d1\u8be6\u89e3\u63d2\u56fe1\" \/> <img decoding=\"async\" src=\"https:\/\/www.aisharenet.com\/wp-content\/uploads\/2025\/01\/13fb93213b82ed3.jpeg\" class=\"aligncenter\" title=\"MCP \u548c Python MCP Server \u5f00\u53d1\u8be6\u89e3\u63d2\u56fe5\" alt=\"MCP \u548c Python MCP Server \u5f00\u53d1\u8be6\u89e3\u63d2\u56fe5\" \/> <\/p>\n<p>\u70b9\u51fb\u9524\u5b50\u7684icon\u5c31\u53ef\u4ee5\u770b\u5230MCP Server\u63d0\u4f9b\u7684\u5de5\u5177\u4e86\u3002<\/p>\n<p><img decoding=\"async\" src=\"\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%200%200'%3E%3C\/svg%3E\" class=\"aligncenter\" title=\"MCP \u548c Python MCP Server \u5f00\u53d1\u8be6\u89e3\u63d2\u56fe1\" alt=\"MCP \u548c Python MCP Server \u5f00\u53d1\u8be6\u89e3\u63d2\u56fe1\" \/> <img decoding=\"async\" src=\"https:\/\/www.aisharenet.com\/wp-content\/uploads\/2025\/01\/fe966dd21fdd1f0.jpeg\" class=\"aligncenter\" title=\"MCP \u548c Python MCP Server \u5f00\u53d1\u8be6\u89e3\u63d2\u56fe6\" alt=\"MCP \u548c Python MCP Server \u5f00\u53d1\u8be6\u89e3\u63d2\u56fe6\" \/> <\/p>\n<p>\u4e0b\u9762\u8f93\u5165\u5982\u4e0b\u7684prompt\u53ef\u4ee5\u8bd5\u4e00\u4e0b<\/p>\n<pre><code>Can you take all the images on my desktop and move them to a new folder called \u201cImages\u201d?\r\n<\/code><\/pre>\n<p>LLM\u7684\u53cd\u9988\u548c\u6587\u4ef6\u7cfb\u7edfMCP server\u6267\u884c\u7684\u65f6\u5019\uff0c\u8fd8\u6709\u51e0\u6b21\u6743\u9650\u7684\u63d0\u9192\uff0c\u8bb0\u5f97\u5141\u8bb8\u3002<\/p>\n<p><img decoding=\"async\" src=\"\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%200%200'%3E%3C\/svg%3E\" class=\"aligncenter\" title=\"MCP \u548c Python MCP Server \u5f00\u53d1\u8be6\u89e3\u63d2\u56fe1\" alt=\"MCP \u548c Python MCP Server \u5f00\u53d1\u8be6\u89e3\u63d2\u56fe1\" \/> <img decoding=\"async\" src=\"https:\/\/www.aisharenet.com\/wp-content\/uploads\/2025\/01\/cd9a070e2999119.jpeg\" class=\"aligncenter\" title=\"MCP \u548c Python MCP Server \u5f00\u53d1\u8be6\u89e3\u63d2\u56fe7\" alt=\"MCP \u548c Python MCP Server \u5f00\u53d1\u8be6\u89e3\u63d2\u56fe7\" \/> <\/p>\n<p>\u7136\u540e\u4f60\u5c31\u53ef\u4ee5\u770b\u5230LLM\u3001MCPServer\u5f00\u59cb\u5de5\u4f5c\u4e86\u3002<\/p>\n<p><img decoding=\"async\" src=\"\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%200%200'%3E%3C\/svg%3E\" class=\"aligncenter\" title=\"MCP \u548c Python MCP Server \u5f00\u53d1\u8be6\u89e3\u63d2\u56fe1\" alt=\"MCP \u548c Python MCP Server \u5f00\u53d1\u8be6\u89e3\u63d2\u56fe1\" \/> <img decoding=\"async\" src=\"https:\/\/www.aisharenet.com\/wp-content\/uploads\/2025\/01\/a48efbd2d05f732.jpeg\" class=\"aligncenter\" title=\"MCP \u548c Python MCP Server \u5f00\u53d1\u8be6\u89e3\u63d2\u56fe8\" alt=\"MCP \u548c Python MCP Server \u5f00\u53d1\u8be6\u89e3\u63d2\u56fe8\" \/> <\/p>\n<p>&nbsp;<\/p>\n<h2>MCP Server\u5f00\u53d1\u7684\u5165\u95e8\u6559\u7a0b\uff08python\u548cpip\uff09<\/h2>\n<p>\u4f7f\u7528python\u6280\u672f\u6808\u5f00\u53d1\u7684\u7b80\u5355mcp server<\/p>\n<p>&nbsp;<\/p>\n<h3>\u9700\u8981\u5b89\u88c5<\/h3>\n<p>MCP server\u7684\u9700\u8981\u4f7f\u7528python-sdk\uff0cpython\u9700\u8981 3.10\uff0c\u5b89\u88c5\u5982\u4e0b<\/p>\n<pre><code>pip install mcp\r\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>PS\uff1a MCP\u5b98\u65b9\u4f7f\u7528\u7684\u662fuv\u5305\u7ba1\u7406\u5de5\u5177\uff0c\u6211\u5e73\u65f6\u4f7f\u7528pip\u6bd4\u8f83\u591a\uff0c\u6240\u4ee5\u6587\u4e2d\u4ee5pip\u4e3a\u4e3b\u3002\u56e0\u4e3amcp\u7684\u4e00\u4e9b\u4f9d\u8d56\u5305\u7248\u672c\u5e76\u4e0d\u662f\u6700\u65b0\u7684\uff0c\u6240\u4ee5\u6700\u597d\u5f04\u4e00\u4e2a\u5e72\u51c0\u7684\u73af\u5883\u3002 \u5f00\u53d1\u4e00\u4e2aMCP Server\u9700\u8981\u7684\u8c03\u8bd5\u5ba2\u6237\u7aef\uff0cMCP inspector\u63d0\u4f9b\u4e86\u8fd9\u4e2a\u529f\u80fd<\/p>\n<pre><code>npx @modelcontextprotocol\/inspector &lt;command&gt; &lt;arg1&gt; &lt;arg2&gt;\r\n<\/code><\/pre>\n<p>\u5176\u4e2dcommand\u6211\u4eec\u8981\u662f\u4f7f\u7528python\u5199\u7684Server\uff0c\u5c31\u5e94\u8be5python\u3002<code>&lt;arg1&gt; &lt;arg2&gt;<\/code>\u662f\u53ef\u9009\u53c2\u6570\u3002 \u542f\u52a8\u540e<\/p>\n<p>&nbsp;<\/p>\n<h3>\u5f00\u53d1\u4e00\u4e2ademo\u7684MCP Server<\/h3>\n<p>MCP Server\uff1a\u9700\u8981\u901a\u8fc7MCP\u66b4\u9732\u4e00\u4e9b\u7279\u6b8a\u7684\u80fd\u529b\u7684\u8f7b\u5e94\u7528\u3002\u6839\u636eMCP\u534f\u8bae\u5b9a\u4e49\uff0cServer\u53ef\u4ee5\u63d0\u4f9b\u4e09\u79cd\u7c7b\u578b\u7684\u6807\u51c6\u80fd\u529b\uff0cResources\u3001Tools\u3001Prompts\uff0c\u6bcf\u4e2aServer\u53ef\u540c\u65f6\u63d0\u4f9b\u8005\u4e09\u79cd\u7c7b\u578b\u80fd\u529b\u6216\u5176\u4e2d\u4e00\u79cd\u3002<\/p>\n<ul>\n<li>Resources\uff1a\u8d44\u6e90\uff0c\u7c7b\u4f3c\u4e8e\u6587\u4ef6\u6570\u636e\u8bfb\u53d6\uff0c\u53ef\u4ee5\u662f\u6587\u4ef6\u8d44\u6e90\u6216\u662fAPI\u54cd\u5e94\u8fd4\u56de\u7684\u5185\u5bb9\u3002<\/li>\n<li>Tools\uff1a\u5de5\u5177\uff0c\u7b2c\u4e09\u65b9\u670d\u52a1\u3001\u529f\u80fd\u51fd\u6570\uff0c\u901a\u8fc7\u6b64\u53ef\u63a7\u5236LLM\u53ef\u8c03\u7528\u54ea\u4e9b\u51fd\u6570\u3002<\/li>\n<li>Prompts\uff1a\u63d0\u793a\u8bcd\uff0c\u4e3a\u7528\u6237\u9884\u5148\u5b9a\u4e49\u597d\u7684\u5b8c\u6210\u7279\u5b9a\u4efb\u52a1\u7684\u6a21\u677f<\/li>\n<\/ul>\n<p>\u4e0b\u9762\u6211\u4eec\u5229\u7528python-sdk,\u5bf9\u5982\u4e0a\u4e09\u79cd\u7c7b\u578b\u7684\u80fd\u529b\u8fdb\u884c\u4e00\u4e0b\u6f14\u793a\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3>Prompts<\/h3>\n<p>\u9996\u5148\u6211\u4eec\u4ee5prompt\u5f00\u59cb\uff0c\u901a\u8fc7<code>handle_list_promopts<\/code>\u5217\u51fa\u53ef\u7528\u7684\u63d0\u793a\u8bcd\u6a21\u677f\uff0c<code>handle_get_prompt<\/code>\u662f\u6839\u636e\u540d\u79f0\u83b7\u53d6\u7279\u5b9a\u7684\u63d0\u793a\u6a21\u677f\u3002<\/p>\n<pre>@server.list_prompts()\r\nasync def handle_list_prompts() -&gt; list[types.Prompt]:\r\n&nbsp; &nbsp;&nbsp;\"\"\"\r\n&nbsp; &nbsp; \u63d0\u793a\u6a21\u7248\u5b9a\u4e49\r\n&nbsp; &nbsp; \"\"\"\r\n&nbsp; &nbsp;&nbsp;return&nbsp;[\r\n&nbsp; &nbsp; &nbsp; &nbsp; types.Prompt(\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name=\"example-prompt\",\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; description=\"An example prompt template\",\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; arguments=[\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; types.PromptArgument(\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name=\"arg1\",\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; description=\"Example argument\",\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; required=True\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; )\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ]\r\n&nbsp; &nbsp; &nbsp; &nbsp; )\r\n&nbsp; &nbsp; ]\r\n\n@server.get_prompt()\r\nasync def handle_get_prompt(\r\n&nbsp; &nbsp; name: str,\r\n&nbsp; &nbsp; arguments: dict[str, str] | None\r\n) -&gt; types.GetPromptResult:\r\n&nbsp; &nbsp;&nbsp;\"\"\"\r\n&nbsp; &nbsp; \u63d0\u793a\u6a21\u677f\u5904\u7406\r\n&nbsp; &nbsp; \"\"\"\r\n&nbsp; &nbsp;&nbsp;if&nbsp;name !=&nbsp;\"example-prompt\":\r\n&nbsp; &nbsp; &nbsp; &nbsp; raise ValueError(f\"Unknown prompt: {name}\")\r\n\n&nbsp; &nbsp;&nbsp;return&nbsp;types.GetPromptResult(\r\n&nbsp; &nbsp; &nbsp; &nbsp; description=\"Example prompt\",\r\n&nbsp; &nbsp; &nbsp; &nbsp; messages=[\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; types.PromptMessage(\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; role=\"user\",\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; content=types.TextContent(\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;type=\"text\",\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; text=\"Example prompt text\"\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; )\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; )\r\n&nbsp; &nbsp; &nbsp; &nbsp; ]\r\n&nbsp; &nbsp; )<\/pre>\n<p>&nbsp;<\/p>\n<h3>Resources<\/h3>\n<p>\u8d44\u6e90\u7ba1\u7406\u529f\u80fd\u7684\u4ee3\u7801<code>list_resources<\/code>\u5217\u51fa\u53ef\u7528\u7684\u8d44\u6e90\uff0c\u8fd4\u56de\u4e00\u4e2a\u8d44\u6e90\u5217\u8868\u3002<code>read_resource<\/code>\u8bfb\u53d6\u6307\u5b9a URI \u7684\u8d44\u6e90\u5185\u5bb9\u3002SAMPLE_RESOURCES\u662f\u4e3a\u4e86\u6d4b\u8bd5\u5efa\u7acb\u7684\u4e00\u4e2ademo<\/p>\n<pre>@server.list_resources()\r\nasync def list_resources() -&gt; list[types.Resource]:\r\n&nbsp; &nbsp;&nbsp;\"\"\"\r\n&nbsp; &nbsp; \u8d44\u6e90\u5b9a\u4e49\r\n&nbsp; &nbsp; \"\"\"\r\n&nbsp; &nbsp;&nbsp;test='test'\r\n&nbsp; &nbsp;&nbsp;return&nbsp;[\r\n&nbsp; &nbsp; &nbsp; &nbsp; types.Resource(\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; uri=AnyUrl(f\"file:\/\/\/{test}.txt\"),\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name=test,\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; description=f\"A sample text resource named {test}\",\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mimeType=\"text\/plain\",\r\n&nbsp; &nbsp; &nbsp; &nbsp; )\r\n&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;# for name in SAMPLE_RESOURCES.keys()\r\n&nbsp; &nbsp; ]\r\nSAMPLE_RESOURCES={'test':'this demo is a mcp server!'}\r\n@server.read_resource()\r\nasync def read_resource(uri: AnyUrl) -&gt; str | bytes:\r\n&nbsp; &nbsp; assert uri.path is not None\r\n&nbsp; &nbsp;&nbsp;print(uri.path)\r\n&nbsp; &nbsp; name = uri.path.replace(\".txt\",&nbsp;\"\").lstrip(\"\/\")\r\n&nbsp; &nbsp;&nbsp;# print(name)\r\n&nbsp; &nbsp;&nbsp;if&nbsp;name not&nbsp;in&nbsp;SAMPLE_RESOURCES:\r\n&nbsp; &nbsp; &nbsp; &nbsp; raise ValueError(f\"Unknown resource: {uri}\")\r\n\n&nbsp; &nbsp;&nbsp;return&nbsp;SAMPLE_RESOURCES[name]<\/pre>\n<p>&nbsp;<\/p>\n<h3>Tools<\/h3>\n<pre>\u5de5\u5177\u5b9a\u4e49\u548c\u8c03\u7528\uff0c<code>handle_list_tools<\/code>\u5b9a\u4e49\u53ef\u7528\u7684\u5de5\u5177\uff0c\u4f7f\u7528 JSON Schema \u9a8c\u8bc1\u5de5\u5177\u53c2\u6570\u3002<code>handle_call_tool<\/code>\u5904\u7406\u5de5\u5177\u8c03\u7528\uff0c\u6839\u636e\u5de5\u5177\u540d\u79f0\u548c\u53c2\u6570\u6267\u884c\u76f8\u5e94\u7684\u64cd\u4f5c\u3002 @server.list_tools() async def handle_list_tools() -&gt; list[types.Tool]: &nbsp; &nbsp;&nbsp;\"\"\" &nbsp; &nbsp; \u5de5\u5177\u5b9a\u4e49. &nbsp; &nbsp; \u6bcf\u4e2a\u5de5\u5177\u90fd\u4f7f\u7528JSON Schema\u9a8c\u8bc1\u6307\u5b9a\u5176\u53c2\u6570. &nbsp; &nbsp; \"\"\" &nbsp; &nbsp;&nbsp;return&nbsp;[ &nbsp; &nbsp; &nbsp; &nbsp; types.Tool( &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name=\"demo-tool\", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; description=\"Get data tool for a param\", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; inputSchema={ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\"type\":&nbsp;\"object\", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\"properties\": { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\"param\": { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\"type\":&nbsp;\"string\", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\"description\":&nbsp;\"url\", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\"required\": [\"param\"], &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }, &nbsp; &nbsp; &nbsp; &nbsp; ) &nbsp; &nbsp; ] @server.call_tool() async def handle_call_tool( &nbsp; &nbsp; name: str, arguments: dict | None ) -&gt; list[Any]: &nbsp; &nbsp; logging.info(name) &nbsp; &nbsp;&nbsp;\"\"\" &nbsp; &nbsp; \u5904\u7406\u5de5\u5177\u8c03\u7528 &nbsp; &nbsp; \"\"\" &nbsp; &nbsp;&nbsp;if&nbsp;not arguments: &nbsp; &nbsp; &nbsp; &nbsp; raise ValueError(\"Missing arguments\") &nbsp; &nbsp;&nbsp;if&nbsp;name ==&nbsp;\"demo-tool\": &nbsp; &nbsp; &nbsp; &nbsp; param = arguments.get(\"param\") &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;if&nbsp;not param: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; raise ValueError(\"Missing state parameter\") &nbsp; &nbsp; &nbsp; &nbsp; param = param.upper() &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;return&nbsp;[ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; types.TextContent( &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;type=\"text\", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; text=f\"text:{param}\" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ) &nbsp; &nbsp; &nbsp; &nbsp; ] &nbsp; &nbsp;&nbsp;else: &nbsp; &nbsp; &nbsp; &nbsp; raise ValueError(f\"Unknown tool: {name}\")<\/pre>\n<p>&nbsp;<\/p>\n<h3>inspector<\/h3>\n<p>\u5982\u4e0b\u5df2\u7ecf\u5199\u597d\u4e86\u4e00\u4e2aMCP Server\uff0c\u53ef\u4ee5\u542f\u52a8MCP inspector\u8fdb\u884c\u8c03\u8bd5\uff0c\u5728Server\u4ee3\u7801\u6240\u5728\u76ee\u5f55\u8f93\u5165<\/p>\n<pre><code>npx @modelcontextprotocal\/inspector\r\n<\/code><\/pre>\n<p>\u542f\u52a8\u540e\uff0c\u5f97\u5230\u5982\u4e0b\u622a\u56fe\u6309\u7167\u56fe\u4e2d\u663e\u793a\uff0c\u8bbf\u95eehttp:\/\/localhost:5273\uff0c\u6309\u7167\u524d\u9762\u8bf4\u7684\uff0ctransport type\u9009\u62e9STDIO,command\u8f93\u5165python\uff0cArguments\u8f93\u5165server.py\uff08\u4e0a\u9762\u7684demo\u4ee3\u7801\u4fdd\u5b58\u5230\u4e86server.py\u7684\u6587\u4ef6\u91cc\u9762\uff09\uff0c\u70b9\u51fbconnect\u3002\u5728\u56fe\u4e0a\u901a\u8fc7\u5404\u4e2a\u7c7b\u578b\u8fdb\u5165\u5bf9\u5e94\u7684Server\u670d\u52a1\u7684\u8c03\u7528\uff0c\u5728Resources\u4e2d\u70b9\u51fbList Resource\uff0c\u5c31\u53ef\u4ee5\u5217\u51fa\u5168\u90e8\u7684resource\uff0c\u70b9\u51fb\u5bf9\u5e94\u7684resource\uff0c\u5c31\u53ef\u4ee5\u770b\u5230\u5177\u4f53resource\u7684\u5185\u5bb9\u3002<\/p>\n<p>\u8fd9\u6837\u5c31\u53ef\u4ee5\u548c\u6211\u4eec\u5df2\u7ecf\u5f00\u53d1\u597d\u7684MCP Server\u8fdb\u884c\u4ea4\u4e92\u4e86\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3>\u5982\u4f55\u914d\u7f6e\u5230Claude desktop\u4e2d<\/h3>\n<p>\u6309\u7167\u521a\u624d\u5728inspector\u4e2d\u7684\u547d\u4ee4\u914d\u7f6e\uff0c\u5c06\u8fd9\u4e2aMCP Server\u914d\u7f6e\u5230Claude\u4e2d\u3002\u70b9\u51fbClaude desktop\u7684setting\uff0c\u9009\u62e9developer\u7684tab\u540e\uff0c\u70b9\u51fbedit config\uff0c\u8df3\u8f6c\u5230claude_desktop_config.json\u3002<\/p>\n<p>\u76ee\u524d\u6211\u5df2\u7ecf\u5b89\u88c5\u4e86\u4e24\u4e2aMCP Server\uff0c\u914d\u7f6e\u5982\u4e0b\uff0c\u4e00\u4e2a\u662f\u6587\u4ef6\u6574\u7406\uff0c\u4e00\u4e2a\u662fplaywright\uff08\u8981\u901a\u8fc7npx\u5b89\u88c5playwright\u7684MCP Server\u3002<\/p>\n<pre><code>{\r\n&nbsp;&nbsp;\"mcpServers\": {\r\n&nbsp; &nbsp;&nbsp;\"filesystem\": {\r\n&nbsp; &nbsp; &nbsp;&nbsp;\"command\":&nbsp;\"npx\",\r\n&nbsp; &nbsp; &nbsp;&nbsp;\"args\": [\r\n&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\"-y\",\r\n&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\"@modelcontextprotocol\/server-filesystem\",\r\n&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\"\/Users\/crisschan\/Desktop\",\r\n&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\"\/Users\/crisschan\/Downloads\"\r\n&nbsp; &nbsp; &nbsp; ]\r\n&nbsp; &nbsp; },\r\n&nbsp; &nbsp; &nbsp;\"playwright\": {\r\n&nbsp; &nbsp; &nbsp;&nbsp;\"command\":&nbsp;\"npx\",\r\n&nbsp; &nbsp; &nbsp;&nbsp;\"args\": [\"-y\",&nbsp;\r\n&nbsp; &nbsp; &nbsp;&nbsp;\"@executeautomation\/playwright-mcp-server\"]\r\n&nbsp; &nbsp; }\r\n&nbsp; }\r\n}\r\n<\/code><\/pre>\n<p>\u5c06\u6211\u4eec\u81ea\u5df1\u7684demo\u670d\u52a1\u6309\u7167\u8fd9\u4e2a\u683c\u5f0f\u914d\u7f6e\u597d\uff0c\u7136\u540e\u4fdd\u5b58\u540e\u91cd\u542fClaude desktop\u3002<\/p>\n<pre><code>{\r\n&nbsp;&nbsp;\"mcpServers\": {\r\n&nbsp; &nbsp; ,\r\n&nbsp; &nbsp;&nbsp;\"demo\": {\r\n&nbsp; &nbsp; &nbsp;&nbsp;\"command\":&nbsp;\"\/opt\/anaconda3\/bin\/python3\",\r\n&nbsp; &nbsp; &nbsp;&nbsp;\"args\": [\"\/Users\/workspace\/pyspace\/try_mcp\/server.py\"]\r\n&nbsp; &nbsp; &nbsp; }\r\n&nbsp; }\r\n}\r\n<\/code><\/pre>\n<p>\u5176\u4e2d\u5728\u914d\u7f6e\u7684\u65f6\u5019\uff0ccommand\u5fc5\u987b\u662f\u5bf9\u5e94\u7248\u672c\u7684python\u7edd\u5bf9\u5730\u5740\uff0cargs\u4e2d\u7684server.py\u4ee3\u7801\u4f4d\u7f6e\u4e5f\u662f\u4e00\u6837\uff0c\u8981\u4f7f\u7528\u7edd\u5bf9\u5730\u5740\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u521d\u8bc6MCP MCP\uff08Model Context Protocol\uff09\uff0c\u662f\u4e00\u4e2a\u5f00\u53d1\u7684\u534f\u8bae\uff0c\u6807\u51c6\u5316\u4e86\u5e94\u7528\u7a0b\u5e8f\u5982\u4f55\u4e3a\u5927\u6a21\u578b\u63d0\u4f9b\u4e0a\u4e0b\u6587\u3002MCP\u63d0\u4f9b\u4e86\u4e00\u4e2a\u6807\u51c6\u7684\u4e3aLLM\u63d0\u4f9b\u6570\u636e\u3001\u5de5\u5177\u7684\u65b9\u5f0f\uff0c\u4f7f\u7528MCP\u4f1a\u66f4\u5bb9\u6613\u7684\u6784\u5efaAgent\u6216\u8005\u662f\u57fa\u4e8eLLM\u7684\u590d\u6742\u5de5\u4f5c\u6d41\u3002 &nbsp; \u67b6\u6784 MCP\u662fCS\u7ed3\u6784\uff0c\u4e00\u4e2aMCP host\u5e94\u7528\u53ef\u4ee5\u94fe\u63a5\u591a\u4e2aMCP servers\u3002 Host\uff1a\u9700\u8981\u901a\u8fc7MCP\u83b7\u5f97\u6570\u636e\u7684\u7a0b\u5e8f\uff0c\u4f8b\u5982Claude Desktop, IDEs\u6216\u8005\u4e00\u4e9bAI\u5de5\u5177\u7b49 MCP Client: MCP\u534f\u8bae\u5ba2\u6237\u7aef\uff0c\u548cMCP Server\u662f\u4e00\u5bf9\u4e00\u652f\u6301\u7684\u3002 MCP Server\uff1a\u9700\u8981\u901a\u8fc7MCP\u66b4\u9732\u4e00\u4e9b\u7279\u6b8a\u7684\u80fd\u529b\u7684\u8f7b\u5e94\u7528\u3002\u6839\u636eMCP\u534f\u8bae\u5b9a\u4e49\uff0cServer\u53ef\u4ee5\u63d0\u4f9b\u4e09\u79cd\u7c7b\u578b\u7684\u6807\u51c6\u80fd\u529b\uff0cResources\u3001Tools\u3001Prompts\uff0c\u6bcf\u4e2aServer\u53ef\u540c\u65f6\u63d0\u4f9b\u8005\u4e09\u79cd\u7c7b\u578b\u80fd\u529b\u6216\u5176\u4e2d\u4e00\u79cd\u3002 Resources\uff1a\u8d44\u6e90\uff0c\u7c7b\u4f3c\u4e8e\u6587\u4ef6\u6570\u636e\u8bfb\u53d6\uff0c\u53ef\u4ee5\u662f\u6587\u4ef6\u8d44\u6e90\u6216\u662fAPI\u54cd\u5e94\u8fd4\u56de\u7684\u5185\u5bb9\u3002 Tools\uff1a\u5de5\u5177\uff0c\u7b2c\u4e09\u65b9\u670d\u52a1\u3001\u529f\u80fd\u51fd\u6570\uff0c\u901a\u8fc7\u6b64\u53ef\u63a7\u5236LLM\u53ef\u8c03\u7528\u54ea\u4e9b\u51fd\u6570\u3002 Prompts\uff1a\u63d0\u793a\u8bcd\uff0c\u4e3a\u7528\u6237\u9884\u5148\u5b9a\u4e49\u597d\u7684\u5b8c\u6210\u7279\u5b9a\u4efb\u52a1\u7684\u6a21\u677f Local Data Resources\uff1aMCP Server\u53ef\u4ee5\u5b89\u5168\u8bbf\u95ee\u7684\u672c\u5730\u7684\u6587\u4ef6\u3001\u6570\u636e\u5e93\u3001\u670d\u52a1\u7b49\u3002 Remote Service\uff1aMCP Server\u53ef\u901a\u8fc7\u7f51\u7edc\uff08\u5982 API\uff09\u8fde\u63a5\u7684\u5916\u90e8\u7cfb\u7edf\u3002 &nbsp; MCP\u7684\u670d\u52a1\u793a\u610f\u56fe\uff1a MCP Servers\u901a\u8fc7MCP Protocol\u5411Host Application\u63d0\u4f9b\u4e00\u4e9b\u529f\u80fd\u5217\u8868\uff08\u4f8b\u5982\u63d0\u4f9b\u4e00\u4e2a\u5de5\u5177\u5217\u8868\uff09\uff0c\u7136\u540eHost Application\u4f1a\u5c06\u8fd9\u4e2a\u5217\u8868\u683c\u5f0f\u5316\u6210\u4e00\u4e2aLLM\u80fd\u8bfb\u61c2\u7684\u683c\u5f0f\u3002 Host Application\u53ef\u4ee5\u5229\u7528\u8fd9\u4e2a\u529f\u80fd\u5217\u8868\u5411LLM\u53d1\u9001\u4e00\u4e9b\u9700\u8981\u5927\u6a21\u578b\u5904\u7406\u7684\u8bf7\u6c42\uff08\u8fd9\u5c31\u662fprompt\uff09\uff0cLLM\u4f1a\u6839\u636e\u8fd9\u6b21\u7684prompt\u8fd4\u56de\u4e00\u4e2atool_calls\u7684json\u5b57\u7b26\u4e32\u3002\u5f53Host Applicaiton\u63a5\u53d7\u5230\u8fd9\u4e2atool_calls\u540e\uff0c\u5c31\u4f1a\u8c03\u7528\u5bf9\u5e94\u7684MCP server\u5de5\u5177\u8fd4\u56de\u5bf9\u5e94\u7684\u7ed3\u679c\u4e86\u3002 &nbsp; \u501f\u52a9Claude Desktop \u4f7f\u7528MCP \u501f\u52a9Claude\u684c\u9762\u5ba2\u6237\u7aef\uff0c\u80af\u5b9a\u8981\u5148\u5b89\u88c5\u4e00\u4e2a\uff0c\u8fd9\u4e2a\u5b89\u88c5\u5c31\u8df3\u8fc7\u4e86\u3002\u6211\u4eec\u914d\u7f6e\u4e00\u4e2a\u6587\u4ef6\u7cfb\u7edf\u7684MCP Server\u3002 \u7136\u540e\u9009\u62e9Developer\u4e0b\u7684Edit Config\u3001 \u6253\u5f00claude_desktop_config.json\uff0c\u5b8c\u6210\u6587\u4ef6\u7cfb\u7edf\u7684MCP Server\u914d\u7f6e\u3002(\u914d\u7f6e\u4e2dusername\u9700\u8981\u66ff\u6362\u6210\u81ea\u5df1\u81ea\u5df1\u7535\u8111\u7684\u7528\u6237\u540d\uff0c\u540c\u65f6\u4e5f\u9700\u8981\u672c\u5730\u5b89\u88c5node.js\u7684\u73af\u5883\u3002\uff09 { &nbsp;&nbsp;&#8220;mcpServers&#8221;: { &nbsp; &nbsp;&nbsp;&#8220;filesystem&#8221;: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-55397","post","type-post","status-publish","format-standard","hentry","category-ai"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/55397","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=55397"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/55397\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=55397"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=55397"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=55397"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}