{"id":8308,"date":"2025-04-04T15:43:10","date_gmt":"2025-04-04T06:43:10","guid":{"rendered":"https:\/\/www.lancard.com\/blog\/?p=8308"},"modified":"2025-04-07T10:14:19","modified_gmt":"2025-04-07T01:14:19","slug":"tried-to-develop-mcp-server","status":"publish","type":"post","link":"https:\/\/www.lancard.com\/blog\/2025\/04\/04\/tried-to-develop-mcp-server\/","title":{"rendered":"MCP\u30b5\u30fc\u30d0\u958b\u767a\u3092\u8a66\u3057\u3066\u307f\u305f"},"content":{"rendered":"<p>MCP\u30b5\u30fc\u30d0\u3092Python SDK\u3092\u4f7f\u3063\u3066\u3001\u4f5c\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<h2>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u4f5c\u6210<\/h2>\n<p>\u307e\u305a\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u304b\u3089\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"sh\">uvx create-mcp-server\n<\/code><\/pre>\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d\u7b49\u3092\u805e\u304b\u308c\u308b\u306e\u3067\u3001\u9069\u5f53\u306b\u5165\u529b\u3057\u307e\u3059\u3002\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u4f5c\u6210\u5f8c\u3001\u6307\u793a\u306b\u5f93\u3063\u3066\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"sh\">cd &lt;\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d&gt;\nuv sync --dev --all-extras\n<\/code><\/pre>\n<p><!--more--><\/p>\n<h2>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u8003\u5bdf<\/h2>\n<p>\u4f5c\u6210\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u300csrc\/test_notes\/server.py\u300d\u3092\u898b\u3066\u307f\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u30c7\u30b3\u30ec\u30fc\u30bf\u3092\u6301\u3064\u95a2\u6570\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>@server.list_resources()<\/li>\n<li>@server.read_resource()<\/li>\n<li>@server.list_prompts()<\/li>\n<li>@server.get_prompt()<\/li>\n<li>@server.list_tools()<\/li>\n<li>@server.call_tool()<\/li>\n<\/ul>\n<p><code>resource<\/code>\u3001<code>prompt<\/code>\u3001<code>tool<\/code>\u306e\u4e00\u89a7\u3092\u914d\u5217\u3067\u8fd4\u3059\u306e\u3068\u3001\u9805\u76ee\u306e\u5b9f\u884c\u7d50\u679c\u3092\u8fd4\u3059\u95a2\u6570\u306e\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>\u3053\u306eMCP\u30b5\u30fc\u30d0\u3092<code>Claude\u30c7\u30b9\u30af\u30c8\u30c3\u30d7<\/code>\u3068<code>Cline<\/code>\u3001<code>Claude\u30b3\u30fc\u30c9<\/code>\u306e\uff13\u3064\u306eMCP\u30db\u30b9\u30c8\u3067\u4f7f\u3063\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n<code>Claude\u30c7\u30b9\u30af\u30c8\u30c3\u30d7<\/code>\u3068<code>Cline<\/code>\u306fJSON\u30d5\u30a1\u30a4\u30eb\u306b\u3088\u3063\u3066\u8a2d\u5b9a\u3057\u307e\u3059\u3002<code>Claude\u30b3\u30fc\u30c9<\/code>\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"sh\">claude mcp add-json test-notes '{\"command\":\"uv\",\"args\":[\"--directory\",\"\/path\/to\/test-notes\",\"run\",\"test-notes\"]}'\n<\/code><\/pre>\n<p>MCP\u30db\u30b9\u30c8\u8d77\u52d5\u6642\u306bMCP\u30b5\u30fc\u30d0\u306f\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30d7\u30ed\u30bb\u30b9\u3068\u3057\u3066\u8d77\u52d5\u3057\u307e\u3059\u3002\u306a\u304aMCP\u30db\u30b9\u30c8\u7d42\u4e86\u6642\u306bMCP\u30b5\u30fc\u30d0\u306e\u30d7\u30ed\u30bb\u30b9\u306f\u7d42\u4e86\u3057\u307e\u305b\u3093\u3002\u305d\u306e\u5f8c\u306bMCP\u30db\u30b9\u30c8\u3092\u8d77\u52d5\u3059\u308b\u3068\u3001\u4e8c\u91cd\u306bMCP\u30b5\u30fc\u30d0\u306e\u30d7\u30ed\u30bb\u30b9\u304c\u8d77\u52d5\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\nMCP\u30b5\u30fc\u30d0\u8d77\u52d5\u6642\u306b<code>tool<\/code>\u7b49\u306e\u4e00\u89a7\u53d6\u5f97\u3057\u3066\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>\u3053\u306eMCP\u30b5\u30fc\u30d0\u306f\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u540d\u524d\u3068\u5185\u5bb9\u3092\u6301\u3064\u30ce\u30fc\u30c8\u3092\u8ffd\u52a0\u3059\u308b\u6a5f\u80fd\u3067\u3059\u3002<br \/>\n<code>tool<\/code>\u306f\u3001\uff13\u3064\u306eMCP\u30db\u30b9\u30c8\u3067\u5229\u7528\u3067\u304d\u307e\u3057\u305f\u304c\u3001<code>resource<\/code>\u3068<code>prompt<\/code>\u306f\u3001<code>Claude\u30c7\u30b9\u30af\u30c8\u30c3\u30d7<\/code>\u3067\u3057\u304b\u5229\u7528\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002<a href=\"https:\/\/modelcontextprotocol.io\/clients\">\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8<\/a>\u3092\u898b\u3066\u307f\u308b\u3068\u3001<code>Cline<\/code>\u306f<code>prompt<\/code>\u304cNG\u3067<code>resource<\/code>\u306fOK\u3001<code>Claude\u30b3\u30fc\u30c9<\/code>\u306f<code>prompt<\/code>\u304cOK\u3067<code>resource<\/code>\u306fNG\u3068\u66f8\u3044\u3066\u3042\u308b\u306e\u3067\u3001\u591a\u5206\u3084\u308a\u65b9\u304c\u5206\u304b\u3089\u306a\u304b\u3063\u305f\u3060\u3051\u3060\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001<a href=\"https:\/\/modelcontextprotocol.io\/quickstart\/server\">\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u30af\u30a4\u30c3\u30af\u30b9\u30bf\u30fc\u30c8<\/a>\u3067\u306f\u3001\u4e0a\u8a18\u306e\u5b9f\u88c5\u65b9\u6cd5\u3068\u306f\u3061\u3087\u3063\u3068\u9055\u3063\u3066\u3044\u3066\u3001\u30c7\u30b3\u30ec\u30fc\u30bf\u3092\u4f5c\u308b\u30af\u30e9\u30b9\u304cServer\u3067\u306f\u306a\u304f\u3001FastMCP\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\nFastMCP\u3092\u4f7f\u3046\u3068\u3001Python\u306e\u578b\u30d2\u30f3\u30c8\u3068docstring\u3092\u4f7f\u7528\u3057\u3066\u30c4\u30fc\u30eb\u5b9a\u7fa9\u3092\u81ea\u52d5\u751f\u6210\u3059\u308b\u306e\u3067\u3001\u4e00\u89a7\u3092\u8fd4\u3059\u95a2\u6570\u3092\u4f5c\u308b\u5fc5\u8981\u304c\u306a\u304f\u306a\u308a\u307e\u3059\u3002\u95a2\u6570\u306e\u30b3\u30e1\u30f3\u30c8\u304b\u3089\u4e00\u89a7\u3092\u751f\u6210\u3057\u8fd4\u3057\u3066\u304f\u308c\u307e\u3059\u3002<br \/>\n\u305f\u3060\u3001\u5b9f\u969b\u306bFastMCP\u3092\u4f7f\u3063\u3066MCP\u30b5\u30fc\u30d0\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u305f\u304c\u3001<code>Claude\u30c7\u30b9\u30af\u30c8\u30c3\u30d7<\/code>\u3068<code>Claude\u30b3\u30fc\u30c9<\/code>\u3067\u306f\u6b63\u5e38\u52d5\u4f5c\u3057\u307e\u3057\u305f\u304c\u3001<code>Cline<\/code>\u3067\u306fMCP\u30b5\u30fc\u30d0\u63a5\u7d9a\u6642\u306bListToolsRequest\u304c\u5931\u6557\u3057\u3001\u3046\u307e\u304f\u3044\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u305f\u3060\u8abf\u3079\u3066\u307f\u308b\u3068<a href=\"https:\/\/github.com\/cline\/cline\/issues\/1272\">issue<\/a>\u306b\u4e0a\u304c\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u305d\u306e\u3046\u3061<code>Cline<\/code>\u3067\u3082\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h2>SSH\u63a5\u7d9a\u3059\u308bMCP\u30b5\u30fc\u30d0\u3092\u4f5c\u3063\u3066\u307f\u308b<\/h2>\n<p>Cline\u3092\u4f7f\u3063\u3066\u4f5c\u3063\u3066\u3044\u304d\u307e\u3059\u3002LLM\u306fclaude-sonnet-3.7\u3067\u3059\u3002<\/p>\n<pre><code class=\"sh\">src\/ssh_connect\/server.py\u306fMCP\u30b5\u30fc\u30d0\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u3059\u3002\n\u3053\u308c\u3092\u53c2\u8003\u306b\u3001MCP\u3067SSH\u63a5\u7d9a\u3067\u304d\u308b\u30b3\u30fc\u30c9\u3092\u4f5c\u3063\u3066\u3002\n\u30db\u30b9\u30c8\u540d\u7b49\u306e\u8a2d\u5b9a\u306f\u3001MCP\u8a2d\u5b9a\u306eenv\u3067\u8a2d\u5b9a\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u3002\n<\/code><\/pre>\n<p>\u3053\u308c\u3060\u3051\u3067\u3001\u307b\u307c\u5b8c\u6210\u3057\u307e\u3057\u305f\u3002<br \/>\n\u4ee5\u4e0b\u306e<code>tool<\/code>\u3092\u4f5c\u6210\u3057\u3066\u304f\u308c\u307e\u3057\u305f\u3002<\/p>\n<ul>\n<li>connect<\/li>\n<li>disconnect<\/li>\n<li>execute<\/li>\n<li>upload<\/li>\n<li>download<\/li>\n<li>list_files<\/li>\n<\/ul>\n<p>paramiko\u3092\u4f7f\u3063\u3066SSH\u3057\u3066\u3044\u307e\u3059\u3002\u983c\u3093\u3067\u3082\u306a\u3044\u306e\u306bsftp\u3067\u30d5\u30a1\u30a4\u30eb\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u30fb\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u30fb\u30d5\u30a1\u30a4\u30eb\u4e00\u89a7\u306e\u30c4\u30fc\u30eb\u3082\u4f5c\u3063\u3066\u304f\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u305f\u3060\u5b9f\u969b\u306b<code>Cline<\/code>\u3067\u5b9f\u884c\u3057\u3066\u307f\u308b\u3068\u3001<code>Cline<\/code>\u306f\u3053\u306eMCP\u306e\u4f7f\u3044\u65b9\u304c\u5206\u304b\u3089\u305a\u3001\u4f7f\u3048\u307e\u305b\u3093\u3067\u3057\u305f\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30d7\u30ed\u30f3\u30d7\u30c8\u3067\u4fee\u6b63\u4f9d\u983c\u3057\u307e\u3057\u305f\u3002<\/p>\n<pre><code class=\"sh\">Cline\u3067\u5b9f\u884c\u3057\u305f\u3089\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u4f7f\u3044\u65b9\u304c\u5206\u304b\u3089\u306a\u3044\u3068\u8a00\u308f\u308c\u305f\u3002\n\nThe user wants to establish an SSH connection. Based on the environment details, I can see that we're in a directory that appears to be an SSH connection tool for MCP (Model Context Protocol). The directory structure shows files like server.py in the src\/ssh_connect\/ directory and an example file ssh_example.py in the examples\/ directory.\nI should first understand what this SSH connection tool does and how to use it. Let me examine some of the key files to understand how to proceed.\nFirst, let's look at the README.md file to get an overview of the project\n\n\u6bce\u56de\u3001README.md\u3092\u898b\u308b\u3053\u3068\u306a\u304f\u3001\u4f7f\u3048\u308b\u3088\u3046\u306b\u3057\u305f\u3044\u3002\n<\/code><\/pre>\n<p>\u305d\u306e\u7d50\u679c\u3001\u30c4\u30fc\u30eb\u4e00\u89a7\u3092\u8fd4\u3059\u95a2\u6570\u3092\u4fee\u6b63\u3057\u3001\u5404\u30c4\u30fc\u30eb\u306bdescription\u3092\u8ffd\u52a0\u3057\u3066\u304f\u308c\u307e\u3057\u305f\u3002<br \/>\n\u8ffd\u52a0\u3057\u305f\u5404\u30c4\u30fc\u30eb\u306edescription\u306f\u3001VSC\u306eCline\u306e<code>MCP Servers<\/code>\u306b\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2025\/04\/cline-mcp-connect.png\" alt=\"\" width=\"346\" height=\"546\" class=\"aligncenter size-full wp-image-8313\" srcset=\"https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2025\/04\/cline-mcp-connect.png 346w, https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2025\/04\/cline-mcp-connect-253x400.png 253w\" sizes=\"auto, (max-width: 346px) 100vw, 346px\" \/><br \/>\n\u3053\u308c\u3067Cline\u306fMCP\u30b5\u30fc\u30d0\u8d77\u52d5\u3057\u3066ListToolsRequest\u3059\u308c\u3070\u3001\u3053\u306eMCP\u30b5\u30fc\u30d0\u306e\u4f7f\u3044\u65b9\u304c\u308f\u304b\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<br \/>\n\u4ee5\u4e0b\u3001\u5b9f\u884c\u7d50\u679c\u3067\u3059\u3002<\/p>\n<pre><code class=\"sh\">User:SSH\u63a5\u7d9a\u3057\u3066\u3002\u8a2d\u5b9a\u306f\u74b0\u5883\u5909\u6570\u304b\u3089\u53d6\u5f97\u3057\u3066\u3002\nAssistant: Successfully connected to the SSH server at 192.168.1.35 on port 22 with username lanuser. The connection is now established and ready for use.\nIs there anything specific you'd like me to do with this SSH connection? For example, I can:\n\nExecute commands on the remote system\nList files in a directory\nUpload or download files\nTake notes about what we find\n\nUser:\u5b9f\u884c\u3057\u3066\u308b\u30d7\u30ed\u30bb\u30b9\u4e00\u89a7\u3092\u8868\u793a\u3057\u3066\u3002\nAssistant:\u73fe\u5728\u306e\u30b7\u30b9\u30c6\u30e0\u3067\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u30d7\u30ed\u30bb\u30b9\u306e\u4e00\u89a7\u3092\u8868\u793a\u3057\u307e\u3057\u305f\u3002\u4e3b\u306a\u30d7\u30ed\u30bb\u30b9\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\uff1a\n\n\u30b7\u30b9\u30c6\u30e0\u95a2\u9023\u30d7\u30ed\u30bb\u30b9\uff1a\n\n\/sbin\/init\uff08PID 1\uff09- \u30b7\u30b9\u30c6\u30e0\u306e\u6700\u521d\u306e\u30d7\u30ed\u30bb\u30b9\nsystemd-journald\u3001systemd-udevd\u3001systemd-resolved \u306a\u3069\u306e\u30b7\u30b9\u30c6\u30e0\u30b5\u30fc\u30d3\u30b9\n\u30ab\u30fc\u30cd\u30eb\u30b9\u30ec\u30c3\u30c9\uff08[kthreadd]\u3001[kworker]\u306a\u3069\uff09\n\n\n\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u95a2\u9023\uff1a\n\nNetworkManager\uff08PID 369\uff09\nwpa_supplicant\uff08PID 429\uff09- \u7121\u7dda\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\nsshd\uff08PID 1425\uff09- SSH\u30b5\u30fc\u30d0\u30fc\n\n\n\u30b0\u30e9\u30d5\u30a3\u30c3\u30af\u95a2\u9023\uff1a\n\nXorg\uff08PID 1829\uff09\ngdm3\uff08PID 1279\uff09- GNOME\u30c7\u30a3\u30b9\u30d7\u30ec\u30a4\u30de\u30cd\u30fc\u30b8\u30e3\ngnome-shell\uff08PID 2715\uff09\n\n\n\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u95a2\u9023\uff1a\n\nnvargus-daemon\uff08PID 1235\uff09\nnvfancontrol\uff08PID 1038\uff09- \u30d5\u30a1\u30f3\u5236\u5fa1\nbluetoothd\uff08PID 1034\uff09- Bluetooth\u7ba1\u7406\n\n\n\u30b3\u30f3\u30c6\u30ca\u95a2\u9023\uff1a\n\ndockerd\uff08PID 1617\uff09\ncontainerd\uff08PID 1261\uff09\n\n\n\u30e6\u30fc\u30b6\u30fc\u30bb\u30c3\u30b7\u30e7\u30f3\uff1a\n\n\u73fe\u5728\u306eSSH\u30bb\u30c3\u30b7\u30e7\u30f3\uff08PID 3458\u30013502\uff09\nbash\uff08PID 3352\uff09\n\n\u30b7\u30b9\u30c6\u30e0\u306f\u8907\u6570\u306e\u30e6\u30fc\u30b6\u30fc\uff08root\u3001gdm\u3001lanuser \u306a\u3069\uff09\u3067\u30d7\u30ed\u30bb\u30b9\u3092\u5b9f\u884c\u3057\u3066\u304a\u308a\u3001GNOME\u74b0\u5883\u304c\u7a3c\u50cd\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\u3002\u307e\u305f\u3001Docker\u95a2\u9023\u306e\u30d7\u30ed\u30bb\u30b9\u3082\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u30b3\u30f3\u30c6\u30ca\u6280\u8853\u304c\u4f7f\u7528\u53ef\u80fd\u306a\u72b6\u614b\u3067\u3059\u3002\n<\/code><\/pre>\n<p>\u4f5c\u6210\u3057\u305f\u30b3\u30fc\u30c9\u306f<a href=\"https:\/\/github.com\/t-suganuma\/ssh-connect-mcp-server\">\u3053\u308c<\/a>\u3067\u3059\u3002<br \/>\n\u306a\u305c\u304b\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u30b7\u30a7\u30eb\u3084HTML\u306e\u30ac\u30a4\u30c9\u307e\u3067\u4f5c\u3063\u3066\u304f\u308c\u307e\u3057\u305f\u3002<\/p>\n<h2>MCP\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3092\u4f5c\u3063\u3066\u307f\u308b<\/h2>\n<p>\u3053\u308c\u3082Cline\u3067\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<pre><code class=\"sh\">@https:\/\/modelcontextprotocol.io\/quickstart\/client \n\u4e0a\u8a18\u3092\u53c2\u8003\u306bpython\u3067MCP\u30b5\u30fc\u30d0\u306b\u63a5\u7d9a\u3067\u304d\u308b\u30c1\u30e3\u30c3\u30c8\u30dc\u30c3\u30c8\u3092\u4f5c\u3063\u3066\u3002\n<\/code><\/pre>\n<p>\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3060\u3051\u3067\u306a\u304f\u3001\u30c6\u30b9\u30c8\u7528\u306eMCP\u30b5\u30fc\u30d0\u3092\u4f5c\u6210\u3057\u3066\u304f\u308c\u307e\u3057\u305f\u304c\u3001<br \/>\n\u30c6\u30b9\u30c8\u7528\u306eMCP\u30b5\u30fc\u30d0\u304c\u6b63\u5e38\u52d5\u4f5c\u3057\u306a\u304b\u3063\u305f\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u30d7\u30ed\u30f3\u30d7\u30c8\u3067\u4fee\u6b63\u3092\u304a\u9858\u3044\u3057\u307e\u3057\u305f\u3002<\/p>\n<pre><code class=\"sh\">@https:\/\/modelcontextprotocol.io\/quickstart\/server\n\u306eMCP\u30b5\u30fc\u30d0\u306e\u4f5c\u308a\u65b9\u3092\u898b\u308b\u3068\u3001test_server.py\u3068\u3060\u3044\u3076\u9055\u3046\u3088\u3046\u3067\u3059\u3002\nFastMCP\u3092\u4f7f\u3063\u3066\u4f5c\u308a\u76f4\u3057\u3066\u3002\n<\/code><\/pre>\n<p>\u30c6\u30b9\u30c8\u7528\u306eMCP\u30b5\u30fc\u30d0\u3067\u52d5\u4f5c\u78ba\u8a8d\u5f8c\u3001\u5148\u7a0b\u4f5c\u3063\u305fSSH\u63a5\u7d9a\u306eMCP\u30b5\u30fc\u30d0\u3067\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"sh\">uv run client.py - --directory ~src\/samples\/test-mcp-server\/ssh-connect run ssh-connect --env SSH_HOST=192.168.1.35 --env SSH_PORT=22 --env SSH_USERNAME=lanuser --env SSH_PASSWORD=****\n<\/code><\/pre>\n<p>\u7d50\u679c\u3001\u307b\u307c\u3046\u307e\u304f\u3044\u304d\u307e\u3057\u305f\u304c\u3001\u6642\u3005\u4f55\u6545\u304b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u304c\u51fa\u307e\u3059\u3002<\/p>\n<pre><code class=\"sh\">'ToolUseBlock' object has no attribute 'text'\n<\/code><\/pre>\n<p>\u6a5f\u4f1a\u304c\u3042\u308c\u3070\u3001MCP\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3092Slack\u3067\u4f5c\u3063\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-facebook nolightbox\" data-provider=\"facebook\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Facebook\" href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F8308&amp;t=MCP%E3%82%B5%E3%83%BC%E3%83%90%E9%96%8B%E7%99%BA%E3%82%92%E8%A9%A6%E3%81%97%E3%81%A6%E3%81%BF%E3%81%9F&amp;s=100&amp;p[url]=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F8308&amp;p[images][0]=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-content%2Fuploads%2F2025%2F04%2Fcline-mcp-connect.png&amp;p[title]=MCP%E3%82%B5%E3%83%BC%E3%83%90%E9%96%8B%E7%99%BA%E3%82%92%E8%A9%A6%E3%81%97%E3%81%A6%E3%81%BF%E3%81%9F\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"Facebook\" title=\"Share on Facebook\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/facebook.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-twitter nolightbox\" data-provider=\"twitter\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Twitter\" href=\"http:\/\/twitter.com\/share?url=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F8308&amp;text=MCP%E3%82%B5%E3%83%BC%E3%83%90%E9%96%8B%E7%99%BA%E3%82%92%E8%A9%A6%E3%81%97%E3%81%A6%E3%81%BF%E3%81%9F\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"twitter\" title=\"Share on Twitter\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/twitter.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-linkedin nolightbox\" data-provider=\"linkedin\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Linkedin\" href=\"https:\/\/www.linkedin.com\/shareArticle?mini=true&amp;url=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F8308&amp;title=MCP%E3%82%B5%E3%83%BC%E3%83%90%E9%96%8B%E7%99%BA%E3%82%92%E8%A9%A6%E3%81%97%E3%81%A6%E3%81%BF%E3%81%9F\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"linkedin\" title=\"Share on Linkedin\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/linkedin.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-tumblr nolightbox\" data-provider=\"tumblr\" target=\"_blank\" rel=\"nofollow\" title=\"Share on tumblr\" href=\"https:\/\/tumblr.com\/share?s=&amp;v=3&amp;t=MCP%E3%82%B5%E3%83%BC%E3%83%90%E9%96%8B%E7%99%BA%E3%82%92%E8%A9%A6%E3%81%97%E3%81%A6%E3%81%BF%E3%81%9F&amp;u=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F8308\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"tumblr\" title=\"Share on tumblr\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/tumblr.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-mail nolightbox\" data-provider=\"mail\" rel=\"nofollow\" title=\"Share by email\" href=\"mailto:?subject=MCP%E3%82%B5%E3%83%BC%E3%83%90%E9%96%8B%E7%99%BA%E3%82%92%E8%A9%A6%E3%81%97%E3%81%A6%E3%81%BF%E3%81%9F&amp;body=%E3%82%B7%E3%82%A7%E3%82%A2%E3%81%99%E3%82%8B%EF%BC%9A:%20https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F8308\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"mail\" title=\"Share by email\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/mail.png\" \/><\/a>","protected":false},"excerpt":{"rendered":"<p>MCP\u30b5\u30fc\u30d0\u3092Python SDK\u3092\u4f7f\u3063\u3066\u3001\u4f5c\u3063\u3066\u307f\u307e\u3057\u305f\u3002 \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u4f5c\u6210 \u307e\u305a\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u304b\u3089\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u4f5c\u6210\u3057\u307e\u3059\u3002 uvx create-mcp-server \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d\u7b49\u3092\u805e\u304b\u308c\u308b\u306e\u3067\u3001\u9069\u5f53\u306b\u5165\u529b\u3057\u307e\u3059 [&hellip;]<\/p>\n","protected":false},"author":25,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31],"tags":[230],"class_list":["post-8308","post","type-post","status-publish","format-standard","hentry","category-python","tag-ai"],"_links":{"self":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/8308","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/users\/25"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/comments?post=8308"}],"version-history":[{"count":9,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/8308\/revisions"}],"predecessor-version":[{"id":8318,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/8308\/revisions\/8318"}],"wp:attachment":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/media?parent=8308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/categories?post=8308"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/tags?post=8308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}