{"id":22540,"date":"2025-11-06T14:43:26","date_gmt":"2025-11-06T14:43:26","guid":{"rendered":"https:\/\/pokecon.jp\/job\/?p=22540"},"modified":"2025-11-06T14:43:26","modified_gmt":"2025-11-06T14:43:26","slug":"mcp-python-sdk%e3%81%aeclientsessiongroup%e3%81%a7%e8%a4%87%e6%95%b0%e3%81%aemcp%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%81%a8%e6%8e%a5%e7%b6%9a%e3%81%99%e3%82%8b-mntsq-tech%e3%83%96%e3%83%ad","status":"publish","type":"post","link":"https:\/\/pokecon.jp\/job\/22540\/","title":{"rendered":"MCP Python SDK\u306eClientSessionGroup\u3067\u8907\u6570\u306eMCP\u30b5\u30fc\u30d0\u30fc\u3068\u63a5\u7d9a\u3059\u308b &#8211; MNTSQ Tech\u30d6\u30ed\u30b0"},"content":{"rendered":"\n<\/p>\n<div>\n<p><span itemscope=\"\" itemtype=\"http:\/\/schema.org\/Photograph\"><img decoding=\"async\" src=\"https:\/\/cdn-ak.f.st-hatena.com\/images\/fotolife\/t\/teal_green\/20251106\/20251106174022.png\" width=\"589\" height=\"85\" loading=\"lazy\" title=\"\" class=\"hatena-fotolife\" itemprop=\"image\"\/><\/span><\/p>\n<p>\u3053\u3093\u306b\u3061\u306f\u3001<ruby>MNTSQ<rp>(<\/rp><rt><a target=\"_blank\" class=\"keyword\" href=\"https:\/\/d.hatena.ne.jp\/keyword\/%A5%E2%A5%F3%A5%C6%A5%B9%A5%AD%A5%E5%A1%BC\">\u30e2\u30f3\u30c6\u30b9\u30ad\u30e5\u30fc<\/a><\/rt><rp>)<\/rp><\/ruby>\u3067<a target=\"_blank\" class=\"keyword\" href=\"https:\/\/d.hatena.ne.jp\/keyword\/%A5%A2%A5%EB%A5%B4%A5%EA%A5%BA%A5%E0\">\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0<\/a>\u30a8\u30f3\u30b8\u30cb\u30a2\uff08AI\u30a8\u30f3\u30b8\u30cb\u30a2\uff09\u3092\u3057\u3066\u3044\u308b\u6e05\u6c34\u3067\u3059\u3002<\/p>\n<p>MNTSQ\u306e\u30d7\u30ed\u30c0\u30af\u30c8\u3092LLM\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u30d7\u30ed\u30c0\u30af\u30c8\u306b\u9032\u5316\u3055\u305b\u308b\u3079\u304f\u3001LLMOps\u306b\u95a2\u3059\u308b\u5b9f\u88c5\u304c\u5897\u3048\u3066\u304d\u305f\u4eca\u65e5\u3053\u306e\u9803\u3067\u3059\u3002<\/p>\n<p>\u3053\u308c\u3089\u306e\u5b9f\u88c5\u306e\u904e\u7a0b\u3067\u3001<strong>\u8907\u6570\u306e<a target=\"_blank\" class=\"keyword\" href=\"https:\/\/d.hatena.ne.jp\/keyword\/MCP\">MCP<\/a>\u30b5\u30fc\u30d0\u30fc\u306b\u63a5\u7d9a\u3057\u3066\u30bb\u30c3\u30b7\u30e7\u30f3\u3092\u7ba1\u7406\u3059\u308b\u306b\u306f\u3069\u306e\u3088\u3046\u306a\u5b9f\u88c5\u304c\u30d9\u30b9\u30c8\u304b\uff1f<\/strong>\u3068\u3044\u3046\u554f\u984c\u306b\u3076\u3064\u304b\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u81ea\u524d\u3067\u30e9\u30c3\u30d1\u30fc\u30af\u30e9\u30b9\u3092\u5b9f\u88c5\u3059\u308b\u3057\u304b\u65b9\u6cd5\u306f\u306a\u3044\u306e\u304b\u3001\u3068\u601d\u3063\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001<a target=\"_blank\" href=\"https:\/\/github.com\/modelcontextprotocol\/python-sdk\">MCP Python SDK<\/a>\u306b<strong><code>ClientSessionGroup<\/code><\/strong>\u3068\u3044\u3046\u30af\u30e9\u30b9\u304c\u3042\u308b\u3053\u3068\u3092\u767a\u898b\u3057\u305f\u306e\u3067\u3001\u3053\u308c\u3092\u4f7f\u3046\u3068\u826f\u3055\u305d\u3046\u3060\u3068\u3044\u3046\u7d50\u8ad6\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u79c1\u304c\u8abf\u3079\u305f\u9650\u308a\u3067\u306f\u3001<code>ClientSessionGroup<\/code>\u306e\u4f7f\u7528\u65b9\u6cd5\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u3066\u3044\u308b\u8a18\u4e8b\u306a\u3069\u306f\u898b\u3064\u3051\u3089\u308c\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u305d\u306e\u305f\u3081\u3001\u672c\u8a18\u4e8b\u3067<a target=\"_blank\" class=\"keyword\" href=\"https:\/\/d.hatena.ne.jp\/keyword\/MCP\">MCP<\/a> <a target=\"_blank\" class=\"keyword\" href=\"https:\/\/d.hatena.ne.jp\/keyword\/Python\">Python<\/a> <a target=\"_blank\" class=\"keyword\" href=\"https:\/\/d.hatena.ne.jp\/keyword\/SDK\">SDK<\/a>\u306e<code>ClientSessionGroup<\/code>\u306e\u4ed5\u69d8\u3084\u4f7f\u3044\u65b9\u3001<code>ClientSession<\/code>\u3068\u306e\u9055\u3044\u306a\u3069\u3092\u6574\u7406\u3057\u3066\u307e\u3068\u3081\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<h3 id=\"\u524d\u63d0\">\u524d\u63d0<\/h3>\n<p><a target=\"_blank\" class=\"keyword\" href=\"https:\/\/d.hatena.ne.jp\/keyword\/MCP\">MCP<\/a>\u306e\u5b9f\u88c5\u306b\u306fAnthropic\u306e<a target=\"_blank\" href=\"https:\/\/github.com\/modelcontextprotocol\/python-sdk\">MCP Python SDK<\/a>\u306e\u30d0\u30fc\u30b8\u30e7\u30f31.19.0\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002\u4eca\u5f8c\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u306b\u3088\u3063\u3066\u4ed5\u69d8\u304c\u5909\u66f4\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u70b9\u306b\u3054\u7559\u610f\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><iframe src=\"https:\/\/hatenablog-parts.com\/embed?url=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk\" title=\"GitHub - modelcontextprotocol\/python-sdk: The official Python SDK for Model Context Protocol servers and clients\" class=\"embed-card embed-webcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;\" loading=\"lazy\"><\/iframe><cite class=\"hatena-citation\"><a target=\"_blank\" href=\"https:\/\/github.com\/modelcontextprotocol\/python-sdk\">github.com<\/a><\/cite><\/p>\n<h3 id=\"\u5358\u4e00MCP\u30b5\u30fc\u30d0\u30fc\u3068\u63a5\u7d9a\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\">\u5358\u4e00<a target=\"_blank\" class=\"keyword\" href=\"https:\/\/d.hatena.ne.jp\/keyword\/MCP\">MCP<\/a>\u30b5\u30fc\u30d0\u30fc\u3068\u63a5\u7d9a\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/h3>\n<p>\u5358\u4e00\u306e<a target=\"_blank\" class=\"keyword\" href=\"https:\/\/d.hatena.ne.jp\/keyword\/MCP\">MCP<\/a>\u30b5\u30fc\u30d0\u30fc\u3068\u63a5\u7d9a\u3059\u308b\u30df\u30cb\u30de\u30e0\u306a\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u4ee5\u4e0b\u306b\u793a\u3057\u307e\u3059\u3002\u3053\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306f\u516c\u5f0f<a target=\"_blank\" class=\"keyword\" href=\"https:\/\/d.hatena.ne.jp\/keyword\/GitHub\">GitHub<\/a>\u3067\u7d39\u4ecb\u3055\u308c\u3066\u3044\u308b<a target=\"_blank\" href=\"https:\/\/github.com\/modelcontextprotocol\/python-sdk\/blob\/main\/examples\/snippets\/clients\/streamable_basic.py\">\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/a>\u3092\u5c11\u3057\u6539\u5909\u3057\u305f\u3082\u306e\u3067\u3059\u3002\u3053\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u8907\u6570\u306e<a target=\"_blank\" class=\"keyword\" href=\"https:\/\/d.hatena.ne.jp\/keyword\/MCP\">MCP<\/a>\u30b5\u30fc\u30d0\u30fc\u3068\u63a5\u7d9a\u3067\u304d\u308b\u3088\u3046\u306b\u62e1\u5f35\u3057\u3001\u6bd4\u8f03\u3059\u308b\u5f62\u5f0f\u3067\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"code lang-python\" data-lang=\"python\" data-unlink=\"\"><span class=\"synPreProc\">import<\/span> asyncio\n\n<span class=\"synPreProc\">from<\/span> mcp <span class=\"synPreProc\">import<\/span> ClientSession\n<span class=\"synPreProc\">from<\/span> mcp.client.streamable_http <span class=\"synPreProc\">import<\/span> streamablehttp_client\n\n<span class=\"synStatement\">async<\/span> <span class=\"synStatement\">def<\/span> <span class=\"synIdentifier\">main<\/span>():\n    mcp_server_url = <span class=\"synConstant\">\"http:\/\/127.0.0.1:8000\/echo\/mcp\"<\/span>\n    <span class=\"synStatement\">async<\/span> <span class=\"synStatement\">with<\/span> streamablehttp_client(mcp_server_url) <span class=\"synStatement\">as<\/span> (read_stream, write_stream, _):\n        <span class=\"synStatement\">async<\/span> <span class=\"synStatement\">with<\/span> ClientSession(read_stream, write_stream) <span class=\"synStatement\">as<\/span> session:\n            <span class=\"synStatement\">await<\/span> session.initialize()\n\n            tools = (<span class=\"synStatement\">await<\/span> session.list_tools()).tools\n            <span class=\"synIdentifier\">print<\/span>(f<span class=\"synConstant\">\"Available tools: {[tool.name for tool in tools]}\"<\/span>)\n\n            result = <span class=\"synStatement\">await<\/span> session.call_tool(\n                name=<span class=\"synConstant\">\"echo\"<\/span>, arguments={<span class=\"synConstant\">\"message\"<\/span>: <span class=\"synConstant\">\"Hello, world!\"<\/span>}\n            )\n            <span class=\"synIdentifier\">print<\/span>(f<span class=\"synConstant\">\"Call tool result: {result}\"<\/span>)\n\n<span class=\"synStatement\">if<\/span> __name__ == <span class=\"synConstant\">\"__main__\"<\/span>:\n    asyncio.run(main())\n<\/pre>\n<p><code>streamablehttp_client<\/code>\u3092\u4f7f\u7528\u3057\u3066<a target=\"_blank\" class=\"keyword\" href=\"https:\/\/d.hatena.ne.jp\/keyword\/MCP\">MCP<\/a>\u30b5\u30fc\u30d0\u30fc\u306b\u63a5\u7d9a\u3057\u3001<code>ClientSession<\/code>\u3092\u4f7f\u7528\u3057\u3066\u30bb\u30c3\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><a target=\"_blank\" class=\"keyword\" href=\"https:\/\/d.hatena.ne.jp\/keyword\/MCP\">MCP<\/a>\u30b5\u30fc\u30d0\u30fc\u304c\u4e00\u3064\u3060\u3051\u306a\u3089\u3070\u3001\u3053\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u307b\u307c\u30b3\u30d4\u30da\u3059\u308b\u5f62\u3067\u5b9f\u88c5\u3067\u304d\u308b\u306e\u3067\u3059\u304c\u3001<strong>\u8907\u6570<a target=\"_blank\" class=\"keyword\" href=\"https:\/\/d.hatena.ne.jp\/keyword\/MCP\">MCP<\/a>\u30b5\u30fc\u30d0\u30fc\u306e\u5834\u5408\u306f\u3069\u306e\u3088\u3046\u306b\u5b9f\u88c5\u3059\u308c\u3070\u826f\u3044\u3067\u3057\u3087\u3046\u304b\uff1f<\/strong><\/p>\n<h3 id=\"ClientSessionGroup\u3092\u4f7f\u3063\u3066\u8907\u6570\u306eMCP\u30b5\u30fc\u30d0\u30fc\u3068\u63a5\u7d9a\u3059\u308b\"><code>ClientSessionGroup<\/code>\u3092\u4f7f\u3063\u3066\u8907\u6570\u306e<a target=\"_blank\" class=\"keyword\" href=\"https:\/\/d.hatena.ne.jp\/keyword\/MCP\">MCP<\/a>\u30b5\u30fc\u30d0\u30fc\u3068\u63a5\u7d9a\u3059\u308b<\/h3>\n<p><strong>\u3053\u306e\u3088\u3046\u306a\u7528\u9014\u306e\u305f\u3081\u306b<code>ClientSessionGroup<\/code>\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059<\/strong>\u3002\u516c\u5f0f\u306e<a target=\"_blank\" href=\"https:\/\/modelcontextprotocol.github.io\/python-sdk\/api\/?h=clientsess#mcp.ClientSessionGroup\">API\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9<\/a>\u3067\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u7d39\u4ecb\u3055\u308c\u3066\u3044\u307e\u3059\uff08\u7b46\u8005\u306b\u3088\u308b\u65e5\u672c\u8a9e\u8a33\uff09\u3002<\/p>\n<blockquote>\n<p>\u8907\u6570\u306e<a target=\"_blank\" class=\"keyword\" href=\"https:\/\/d.hatena.ne.jp\/keyword\/MCP\">MCP<\/a>\u30b5\u30fc\u30d0\u30fc\u3078\u306e\u63a5\u7d9a\u3092\u7ba1\u7406\u3059\u308b\u305f\u3081\u306e\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30af\u30e9\u30b9\u3002<\/p>\n<p>\u3053\u306e\u30af\u30e9\u30b9\u306f\u3001\u30b5\u30fc\u30d0\u30fc\u63a5\u7d9a\u306e\u7ba1\u7406\u6a5f\u80fd\u3092<a target=\"_blank\" class=\"keyword\" href=\"https:\/\/d.hatena.ne.jp\/keyword\/%A5%AB%A5%D7%A5%BB%A5%EB%B2%BD\">\u30ab\u30d7\u30bb\u30eb\u5316<\/a>\u3059\u308b\u5f79\u5272\u3092\u62c5\u3046\u3002\u63a5\u7d9a\u3055\u308c\u305f\u3059\u3079\u3066\u306e\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u63d0\u4f9b\u3055\u308c\u308b\u30c4\u30fc\u30eb\u3001\u30ea\u30bd\u30fc\u30b9\u3001\u304a\u3088\u3073\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u96c6\u7d04\u3059\u308b\u3002<\/p>\n<\/blockquote>\n<p>\u5148\u307b\u3069\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u8907\u6570<a target=\"_blank\" class=\"keyword\" href=\"https:\/\/d.hatena.ne.jp\/keyword\/MCP\">MCP<\/a>\u30b5\u30fc\u30d0\u30fc\u3078\u3068\u63a5\u7d9a\u3067\u304d\u308b\u3088\u3046\u306b\u62e1\u5f35\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"code lang-python\" data-lang=\"python\" data-unlink=\"\"><span class=\"synPreProc\">import<\/span> asyncio\n\n<span class=\"synPreProc\">from<\/span> mcp <span class=\"synPreProc\">import<\/span> ClientSessionGroup\n<span class=\"synPreProc\">from<\/span> mcp.client.session_group <span class=\"synPreProc\">import<\/span> StreamableHttpParameters\n\n<span class=\"synStatement\">async<\/span> <span class=\"synStatement\">def<\/span> <span class=\"synIdentifier\">main<\/span>():\n    mcp_server_urls = [\n        <span class=\"synConstant\">\"http:\/\/127.0.0.1:8000\/echo\/mcp\"<\/span>,\n        <span class=\"synConstant\">\"http:\/\/127.0.0.1:8001\/math\/mcp\"<\/span>,\n    ]\n    \n    <span class=\"synStatement\">async<\/span> <span class=\"synStatement\">with<\/span> ClientSessionGroup(\n        component_name_hook=<span class=\"synStatement\">lambda<\/span> name, server_info: f<span class=\"synConstant\">\"{server_info.name}.{name}\"<\/span>\n    ) <span class=\"synStatement\">as<\/span> session_group:\n        <span class=\"synStatement\">for<\/span> url <span class=\"synStatement\">in<\/span> mcp_server_urls:\n            \n            <span class=\"synStatement\">await<\/span> session_group.connect_to_server(StreamableHttpParameters(url=url))\n\n        \n        tools = session_group.tools.values()\n        <span class=\"synIdentifier\">print<\/span>(f<span class=\"synConstant\">\"Available tools: {[tool.name for tool in tools]}\"<\/span>)\n        tool_names = session_group.tools.keys()\n        <span class=\"synIdentifier\">print<\/span>(f<span class=\"synConstant\">\"Tool names: {tool_names}\"<\/span>)\n\n        \n        result = <span class=\"synStatement\">await<\/span> session_group.call_tool(\n            name=<span class=\"synConstant\">\"EchoServer.echo\"<\/span>, args={<span class=\"synConstant\">\"message\"<\/span>: <span class=\"synConstant\">\"Hello, world!\"<\/span>}\n        )\n        <span class=\"synIdentifier\">print<\/span>(f<span class=\"synConstant\">\"Call tool result: {result}\"<\/span>)\n\n        result = <span class=\"synStatement\">await<\/span> session_group.call_tool(\n            name=<span class=\"synConstant\">\"MathServer.add_two\"<\/span>, args={<span class=\"synConstant\">\"n\"<\/span>: <span class=\"synConstant\">10<\/span>}\n        )\n        <span class=\"synIdentifier\">print<\/span>(f<span class=\"synConstant\">\"Call tool result: {result}\"<\/span>)\n\n<span class=\"synStatement\">if<\/span> __name__ == <span class=\"synConstant\">\"__main__\"<\/span>:\n    asyncio.run(main())\n<\/pre>\n<p>\u5358\u4e00<a target=\"_blank\" class=\"keyword\" href=\"https:\/\/d.hatena.ne.jp\/keyword\/MCP\">MCP<\/a>\u306e\u5834\u5408\u3068\u306e\u5dee\u5206\u3092\u4e00\u3064\u305a\u3064\u898b\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h4 id=\"1-ClientSession\u306e\u4ee3\u308f\u308a\u306bClientSessionGroup\u3092\u4f7f\u7528\u3057\u3066session_group\u3092\u4f5c\u6210\">1. <code>ClientSession<\/code>\u306e\u4ee3\u308f\u308a\u306b<code>ClientSessionGroup<\/code>\u3092\u4f7f\u7528\u3057\u3066<code>session_group<\/code>\u3092\u4f5c\u6210<\/h4>\n<p><code>ClientSession<\/code>\u3092<a target=\"_blank\" class=\"keyword\" href=\"https:\/\/d.hatena.ne.jp\/keyword\/%A5%A4%A5%F3%A5%B9%A5%BF%A5%F3%A5%B9\">\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9<\/a>\u5316\u3059\u308b\u3068\u304d\u3068\u306f\u7570\u306a\u308a<code>read_stream<\/code>\u3084<code>write_stream<\/code>\u306a\u3069\u306f\u4e0d\u8981\u3067\u3059\u3002\u7a7a\u306e\u30bb\u30c3\u30b7\u30e7\u30f3\u30b0\u30eb\u30fc\u30d7\u3092\u4f5c\u6210\u3057\u3001\u5f8c\u304b\u3089\u30bb\u30c3\u30b7\u30e7\u30f3\u3092\u8ffd\u52a0\u3057\u3066\u3044\u304f\u65b9\u5f0f\u3067\u3042\u308b\u305f\u3081\u3067\u3059\u3002\u307e\u305f\u3001<a target=\"_blank\" class=\"keyword\" href=\"https:\/\/d.hatena.ne.jp\/keyword\/MCP\">MCP<\/a>\u30b5\u30fc\u30d0\u30fc\u9593\u3067\u306e\u30c4\u30fc\u30eb\u540d\u306e\u885d\u7a81\u3092\u907f\u3051\u308b\u305f\u3081\u306b\u3001<code>component_name_hook<\/code>\u3092\u4e0e\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h4 id=\"2-ClientSessionGroupconnect_to_server\u3092\u4f7f\u3044MCP\u30b5\u30fc\u30d0\u30fc\u3068\u63a5\u7d9a\u30bb\u30c3\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\">2. <code>ClientSessionGroup.connect_to_server<\/code>\u3092\u4f7f\u3044\u3001<a target=\"_blank\" class=\"keyword\" href=\"https:\/\/d.hatena.ne.jp\/keyword\/MCP\">MCP<\/a>\u30b5\u30fc\u30d0\u30fc\u3068\u63a5\u7d9a\u30fb\u30bb\u30c3\u30b7\u30e7\u30f3\u3092\u4f5c\u6210<\/h4>\n<p><strong><code>ClientSessionGroup.connect_to_server<\/code>\u306b<a target=\"_blank\" class=\"keyword\" href=\"https:\/\/d.hatena.ne.jp\/keyword\/MCP\">MCP<\/a>\u30b5\u30fc\u30d0\u30fc\u306eURL\u3092\u6e21\u3059\u3060\u3051\u3067\u3001\u5185\u90e8\u3067<a target=\"_blank\" class=\"keyword\" href=\"https:\/\/d.hatena.ne.jp\/keyword\/MCP\">MCP<\/a>\u30b5\u30fc\u30d0\u30fc\u306b\u63a5\u7d9a\u3057\u3001\u30bb\u30c3\u30b7\u30e7\u30f3\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059<\/strong>\u3002\u4ee5\u4e0b\u306b<code>connect_to_server<\/code>\u30e1\u30bd\u30c3\u30c9\u5185\u90e8\u306e\u51e6\u7406\u3092\u4e00\u90e8\u629c\u7c8b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"code lang-python\" data-lang=\"python\" data-unlink=\"\">        session_stack = contextlib.AsyncExitStack()\n        <span class=\"synStatement\">try<\/span>:\n            \n            <span class=\"synStatement\">else<\/span>:\n                client = streamablehttp_client(\n                    url=server_params.url,\n                    headers=server_params.headers,\n                    timeout=server_params.timeout,\n                    sse_read_timeout=server_params.sse_read_timeout,\n                    terminate_on_close=server_params.terminate_on_close,\n                )\n                read, write, _ = <span class=\"synStatement\">await<\/span> session_stack.enter_async_context(client)\n\n            session = <span class=\"synStatement\">await<\/span> session_stack.enter_async_context(mcp.ClientSession(read, write))\n            result = <span class=\"synStatement\">await<\/span> session.initialize()\n<\/pre>\n<p>\u5b9f\u88c5\u3092\u78ba\u8a8d\u3059\u308b\u3068\u3001\u5358\u4e00<a target=\"_blank\" class=\"keyword\" href=\"https:\/\/d.hatena.ne.jp\/keyword\/MCP\">MCP<\/a>\u306e\u5834\u5408\u3068\u540c\u69d8\u306b<\/p>\n<ol>\n<li><code>streamblehttp_client<\/code>\u3067<a target=\"_blank\" class=\"keyword\" href=\"https:\/\/d.hatena.ne.jp\/keyword\/MCP\">MCP<\/a>\u30b5\u30fc\u30d0\u30fc\u306b\u63a5\u7d9a<\/li>\n<li><code>ClientSession<\/code>\u3067\u30bb\u30c3\u30b7\u30e7\u30f3\u3092\u4f5c\u6210<\/li>\n<li><code>ClientSession.initialize<\/code>\u3067\u521d\u671f\u5316<\/li>\n<\/ol>\n<p>\u3092\u5b9f\u884c\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002\u3053\u306e\u3088\u3046\u306b<strong>\u5358\u4e00<a target=\"_blank\" class=\"keyword\" href=\"https:\/\/d.hatena.ne.jp\/keyword\/MCP\">MCP<\/a>\u306e\u5834\u5408\u3068\u540c\u3058\u3088\u3046\u306b\u4f5c\u6210\u3057\u305f\u30bb\u30c3\u30b7\u30e7\u30f3<\/strong>\u3092\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u30b9\u30bf\u30c3\u30af\u306b\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3067\u3001\u8907\u6570\u30bb\u30c3\u30b7\u30e7\u30f3\u3092\u7ba1\u7406\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h4 id=\"3-ClientSessionGrouptools\u304b\u3089\u5168\u3066\u306e\u30c4\u30fc\u30eb\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\">3. <code>ClientSessionGroup.tools<\/code>\u304b\u3089\u5168\u3066\u306e\u30c4\u30fc\u30eb\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b<\/h4>\n<p><code>ClientSessionGroup.tools<\/code>\u3067\u5168\u3066\u306e\u30c4\u30fc\u30eb\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u3059\u3002dict\u3092\u8fd4\u3059\u306e\u3067<code>.values()<\/code>\u3092\u3064\u3051\u308b\u3053\u3068\u3067\u3001<strong>\u5358\u4e00<a target=\"_blank\" class=\"keyword\" href=\"https:\/\/d.hatena.ne.jp\/keyword\/MCP\">MCP<\/a>\u306e\u5834\u5408\u306e<code>(await session.list_tools()).tools<\/code>\u3068\u540c\u7b49\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong>\u3092\u5f97\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u305f\u3060\u3057\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u76f8\u9055\u70b9\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ol>\n<li><code>ClientSessionGroup<\/code>\u306f\u3001<code>connect_to_server<\/code>\u306e\u5b9f\u884c\u6642\u306b\u3001\u5185\u90e8\u3067<code>ClientSession.tool_list<\/code>\u3092\u547c\u3073\u51fa\u3057\u307e\u3059\u3002<code>ClientSessionGroup.tools<\/code>\u306f\u3059\u3067\u306b\u53d6\u5f97\u6e08\u307f\u306e\u30c4\u30fc\u30eb\u7fa4\u3092\u8fd4\u3059property\u3067\u3042\u308a\u3001\u305d\u306e\u5834\u3067<code>ClientSession.tool_list<\/code>\u3092\u547c\u3073\u51fa\u3057\u3066\u3044\u308b\u308f\u3051\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/li>\n<li><code>ClientSessionGroup.tool<\/code>\u306f<code>{\u201d\u30c4\u30fc\u30eb\u540d\u201d: Tool\u30aa\u30d6\u30b8\u30a7\u30af\u30c8}<\/code>\u306edict\u3092\u8fd4\u3057\u307e\u3059\u3002\u3053\u306e\u201d\u30c4\u30fc\u30eb\u540d\u201d\u306f<code>component_name_hook<\/code>\u95a2\u6570\u306b\u3088\u3063\u3066\u4ed8\u3051\u3089\u308c\u305f\u540d\u524d\u3067\u3059\u3002\u4e00\u65b9\u3067\u3001<strong><code>Tool<\/code>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e<code>name<\/code>\u5c5e\u6027\u306f\u5143\u306e\u30c4\u30fc\u30eb\u540d\u306e\u307e\u307e<\/strong>\u3067\u3042\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u5f8c\u306b<code>call_tool<\/code>\u3092\u5b9f\u884c\u3059\u308b\u3068\u304d\u306f<code>component_name_hook<\/code>\u95a2\u6570\u306b\u3088\u3063\u3066\u4ed8\u3051\u3089\u308c\u305f\u540d\u524d\u3067\u547c\u3073\u51fa\u3059\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3088\u3063\u3066<strong>LLM\u306b<code>Tool<\/code>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4e0e\u3048\u308b\u3068\u304d\u3082\u3001<code>component_name_hook<\/code>\u95a2\u6570\u306b\u3088\u3063\u3066\u4ed8\u3051\u3089\u308c\u305f\u540d\u524d\u306b\u5dee\u3057\u66ff\u3048\u305f<code>Tool<\/code>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4e0e\u3048\u308b<\/strong>\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059<sup id=\"fnref:1\"><a target=\"_blank\" href=\"#fn:1\" rel=\"footnote\">1<\/a><\/sup>\u3002<\/li>\n<\/ol>\n<p>\u307e\u305f\u3001prompt\u3084resource\u306b\u3064\u3044\u3066\u3082\u4e0a\u8a18\u306e\u4ed5\u69d8\u304c\u5f53\u3066\u306f\u307e\u308a\u307e\u3059\u3002<\/p>\n<h4 id=\"4-ClientSessionGroupcall_tool\u3067\u5404\u7a2e\u30c4\u30fc\u30eb\u3092\u5b9f\u884c\u3059\u308b\">4. <code>ClientSessionGroup.call_tool<\/code>\u3067\u5404\u7a2e\u30c4\u30fc\u30eb\u3092\u5b9f\u884c\u3059\u308b<\/h4>\n<p><strong><code>ClientSessionGroup.call_tool<\/code>\u306f<code>ClientSession.call_tool<\/code>\u3068\u307b\u307c\u540c\u7b49\u306b\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059<\/strong>\u3002\u4ee5\u4e0b\u306b<code>ClientSessionGroup.call_tool<\/code>\u306e\u30b3\u30fc\u30c9\u3092\u629c\u7c8b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"code lang-python\" data-lang=\"python\" data-unlink=\"\">    <span class=\"synStatement\">async<\/span> <span class=\"synStatement\">def<\/span> <span class=\"synIdentifier\">call_tool<\/span>(self, name: <span class=\"synIdentifier\">str<\/span>, args: <span class=\"synIdentifier\">dict<\/span>[<span class=\"synIdentifier\">str<\/span>, Any]) -&gt; types.CallToolResult:\n        <span class=\"synConstant\">\"\"\"Executes a tool given its name and arguments.\"\"\"<\/span>\n        session = self._tool_to_session[name]\n        session_tool_name = self.tools[name].name\n        <span class=\"synStatement\">return<\/span> <span class=\"synStatement\">await<\/span> session.call_tool(session_tool_name, args)\n<\/pre>\n<p>\u898b\u3066\u306e\u901a\u308a\u5185\u90e8\u306e\u5b9f\u88c5\u306f\u7c21\u7d20\u306a\u3082\u306e\u3067\u3059\u3002\u4e0e\u3048\u3089\u308c\u305f\u30c4\u30fc\u30eb\u540d\u304c\u3069\u306e\u30bb\u30c3\u30b7\u30e7\u30f3\u306b\u5c5e\u3059\u308b\u30c4\u30fc\u30eb\u304b\u3092\u89e3\u6c7a\u3059\u308b\u51e6\u7406\u304c\u631f\u307e\u3063\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u70b9\u3092\u9664\u3051\u3070\u3001\u5358\u306b<code>ClientSession.call_tool<\/code>\u3092\u547c\u3073\u51fa\u3059\u95a2\u6570\u3068\u8a00\u3063\u3066\u826f\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<h3 id=\"\u307e\u3068\u3081\">\u307e\u3068\u3081<\/h3>\n<p>\u672c\u8a18\u4e8b\u3067\u306f<a target=\"_blank\" class=\"keyword\" href=\"https:\/\/d.hatena.ne.jp\/keyword\/MCP\">MCP<\/a> <a target=\"_blank\" class=\"keyword\" href=\"https:\/\/d.hatena.ne.jp\/keyword\/Python\">Python<\/a> <a target=\"_blank\" class=\"keyword\" href=\"https:\/\/d.hatena.ne.jp\/keyword\/SDK\">SDK<\/a>\u306e<code>ClientSessionGroup<\/code>\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002\u305c\u3072\u958b\u767a\u306e\u53c2\u8003\u306b\u3057\u3066\u3044\u305f\u3060\u3051\u305f\u3089\u5e78\u3044\u3067\u3059\u3002<\/p>\n<p>MNTSQ\u3067\u306f\u3001\u30d7\u30ed\u30c0\u30af\u30c8\u3092LLM\u30cd\u30a4\u30c6\u30a3\u30d6\u306b\u9032\u5316\u3055\u305b\u308b\u3079\u304f\u3001LLM\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u3092\u642d\u8f09\u3057\u305f\u65b0\u6a5f\u80fd\u3084\u3001LLM\u306e\u904b\u7528\u30fb\u6539\u5584\u306e\u305f\u3081\u306e\u57fa\u76e4\uff08LLMOps\uff09\u3092\u92ed\u610f\u958b\u767a\u30fb\u69cb\u7bc9\u4e2d\u3067\u3059\u3002\u3082\u3057MNTSQ\u306e\u4ed5\u4e8b\u306b\u3054\u8208\u5473\u3092\u6301\u3063\u3066\u3044\u305f\u3060\u3051\u305f\u3089\u3001<strong>\u305c\u3072\u304a\u6c17\u8efd\u306b\u30ab\u30b8\u30e5\u30a2\u30eb\u9762\u8ac7\u3067\u304a\u8a71\u3057\u3057\u307e\u3057\u3087\u3046\uff01<\/strong><\/p>\n<p><iframe src=\"https:\/\/hatenablog-parts.com\/embed?url=https%3A%2F%2Fcareers.mntsq.co.jp%2Fmntsq-for-engineers\" title=\"Technology at MNTSQ\" class=\"embed-card embed-webcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;\" loading=\"lazy\"><\/iframe><cite class=\"hatena-citation\"><a target=\"_blank\" href=\"https:\/\/careers.mntsq.co.jp\/mntsq-for-engineers\">careers.mntsq.co.jp<\/a><\/cite><\/p>\n<p><iframe src=\"https:\/\/hatenablog-parts.com\/embed?url=https%3A%2F%2Fnote.mntsq.co.jp%2Fn%2Fnd94260d3658e\" title=\"MNTSQ\u306eAI\u30a8\u30f3\u30b8\u30cb\u30a2\u9078\u8003\u8ab2\u984c\u3092\u516c\u958b\u3057\u307e\u3059\uff5cMNTSQ\u682a\u5f0f\u4f1a\u793e\" class=\"embed-card embed-webcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;\" loading=\"lazy\"><\/iframe><cite class=\"hatena-citation\"><a target=\"_blank\" href=\"https:\/\/note.mntsq.co.jp\/n\/nd94260d3658e\">note.mntsq.co.jp<\/a><\/cite><\/p>\n<p><iframe src=\"https:\/\/hatenablog-parts.com\/embed?url=https%3A%2F%2Ftech.mntsq.co.jp%2Fentry%2F2025%2F07%2F15%2F172532\" title=\"Gemini\u306eStructured output\u3067\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u578b\u3092\u77ef\u6b63\u3059\u308b\u305f\u3081\u306eTips 7\u9078 - MNTSQ Tech\u30d6\u30ed\u30b0\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\" loading=\"lazy\"><\/iframe><cite class=\"hatena-citation\"><a target=\"_blank\" href=\"https:\/\/tech.mntsq.co.jp\/entry\/2025\/07\/15\/172532\">tech.mntsq.co.jp<\/a><\/cite><\/p>\n<div class=\"auth\">\n<h3 class=\"auth-ttl\" id=\"\u3053\u306e\u8a18\u4e8b\u3092\u66f8\u3044\u305f\u4eba\">\u3053\u306e\u8a18\u4e8b\u3092\u66f8\u3044\u305f\u4eba<\/h3>\n<div class=\"auth-box\">\n        <img decoding=\"async\" src=\"https:\/\/avatars.githubusercontent.com\/u\/38450658?v=4\" alt=\"tealgreen0503\" title=\"tealgreen0503\" itemprop=\"image\" class=\"auth-img\"\/><\/p><\/div>\n<\/div>\n<\/div>\n<p><script>(function(d, s, id) {\n  var js, fjs = d.getElementsByTagName(s)[0];\n  if (d.getElementById(id)) return;\n  js = d.createElement(s); js.id = id;\n  js.src = \"\/\/connect.facebook.net\/ja_JP\/sdk.js#xfbml=1&appId=719729204785177&version=v17.0\";\n  fjs.parentNode.insertBefore(js, fjs);\n}(document, 'script', 'facebook-jssdk'));<\/script><br \/>\n<br \/>\n<br \/><a href=\"https:\/\/tech.mntsq.co.jp\/entry\/2025\/11\/06\/173525\">\u5143\u306e\u8a18\u4e8b\u3092\u78ba\u8a8d\u3059\u308b <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\u3053\u3093\u306b\u3061\u306f\u3001MNTSQ(\u30e2\u30f3\u30c6\u30b9\u30ad\u30e5\u30fc)\u3067\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u30a8\u30f3\u30b8\u30cb\u30a2\uff08AI\u30a8\u30f3\u30b8\u30cb\u30a2\uff09\u3092\u3057\u3066\u3044\u308b\u6e05\u6c34\u3067\u3059\u3002 MNTSQ\u306e\u30d7\u30ed\u30c0\u30af\u30c8\u3092LLM\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u30d7\u30ed\u30c0\u30af\u30c8\u306b\u9032\u5316\u3055\u305b\u308b\u3079\u304f\u3001LLMOps\u306b\u95a2\u3059\u308b\u5b9f\u88c5\u304c\u5897\u3048\u3066\u304d\u305f\u4eca\u65e5\u3053\u306e\u9803 [&hellip;]","protected":false},"author":1,"featured_media":22541,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-22540","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-company-tec"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>MCP Python SDK\u306eClientSessionGroup\u3067\u8907\u6570\u306eMCP\u30b5\u30fc\u30d0\u30fc\u3068\u63a5\u7d9a\u3059\u308b - MNTSQ Tech\u30d6\u30ed\u30b0 - \u30dd\u30b1\u30b3\u30f3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/tech.mntsq.co.jp\/entry\/2025\/11\/06\/173525\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MCP Python SDK\u306eClientSessionGroup\u3067\u8907\u6570\u306eMCP\u30b5\u30fc\u30d0\u30fc\u3068\u63a5\u7d9a\u3059\u308b - MNTSQ Tech\u30d6\u30ed\u30b0 - \u30dd\u30b1\u30b3\u30f3\" \/>\n<meta property=\"og:description\" content=\"\u3053\u3093\u306b\u3061\u306f\u3001MNTSQ(\u30e2\u30f3\u30c6\u30b9\u30ad\u30e5\u30fc)\u3067\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u30a8\u30f3\u30b8\u30cb\u30a2\uff08AI\u30a8\u30f3\u30b8\u30cb\u30a2\uff09\u3092\u3057\u3066\u3044\u308b\u6e05\u6c34\u3067\u3059\u3002 MNTSQ\u306e\u30d7\u30ed\u30c0\u30af\u30c8\u3092LLM\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u30d7\u30ed\u30c0\u30af\u30c8\u306b\u9032\u5316\u3055\u305b\u308b\u3079\u304f\u3001LLMOps\u306b\u95a2\u3059\u308b\u5b9f\u88c5\u304c\u5897\u3048\u3066\u304d\u305f\u4eca\u65e5\u3053\u306e\u9803 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/tech.mntsq.co.jp\/entry\/2025\/11\/06\/173525\" \/>\n<meta property=\"og:site_name\" content=\"\u30dd\u30b1\u30b3\u30f3\" \/>\n<meta property=\"article:published_time\" content=\"2025-11-06T14:43:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/pokecon.jp\/job\/wp-content\/uploads\/2025\/11\/https3A2F2Fcdn-ak.f.st-hatena.com2Fimages2Ffotolife2Ft2Fteal_green2F202511062F2025110617402.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1300\" \/>\n\t<meta property=\"og:image:height\" content=\"188\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"info@pokecon.jp\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"info@pokecon.jp\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"2\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/tech.mntsq.co.jp\\\/entry\\\/2025\\\/11\\\/06\\\/173525#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/pokecon.jp\\\/job\\\/22540\\\/\"},\"author\":{\"name\":\"info@pokecon.jp\",\"@id\":\"https:\\\/\\\/pokecon.jp\\\/job\\\/#\\\/schema\\\/person\\\/16c9f07b1ba984d165d9aee259bda997\"},\"headline\":\"MCP Python SDK\u306eClientSessionGroup\u3067\u8907\u6570\u306eMCP\u30b5\u30fc\u30d0\u30fc\u3068\u63a5\u7d9a\u3059\u308b &#8211; MNTSQ Tech\u30d6\u30ed\u30b0\",\"datePublished\":\"2025-11-06T14:43:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/pokecon.jp\\\/job\\\/22540\\\/\"},\"wordCount\":77,\"image\":{\"@id\":\"https:\\\/\\\/tech.mntsq.co.jp\\\/entry\\\/2025\\\/11\\\/06\\\/173525#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/pokecon.jp\\\/job\\\/wp-content\\\/uploads\\\/2025\\\/11\\\/https3A2F2Fcdn-ak.f.st-hatena.com2Fimages2Ffotolife2Ft2Fteal_green2F202511062F2025110617402.png\",\"articleSection\":[\"\u4f01\u696d\u30c6\u30c3\u30af\"],\"inLanguage\":\"ja\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/pokecon.jp\\\/job\\\/22540\\\/\",\"url\":\"https:\\\/\\\/tech.mntsq.co.jp\\\/entry\\\/2025\\\/11\\\/06\\\/173525\",\"name\":\"MCP Python SDK\u306eClientSessionGroup\u3067\u8907\u6570\u306eMCP\u30b5\u30fc\u30d0\u30fc\u3068\u63a5\u7d9a\u3059\u308b - MNTSQ Tech\u30d6\u30ed\u30b0 - \u30dd\u30b1\u30b3\u30f3\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/pokecon.jp\\\/job\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/tech.mntsq.co.jp\\\/entry\\\/2025\\\/11\\\/06\\\/173525#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/tech.mntsq.co.jp\\\/entry\\\/2025\\\/11\\\/06\\\/173525#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/pokecon.jp\\\/job\\\/wp-content\\\/uploads\\\/2025\\\/11\\\/https3A2F2Fcdn-ak.f.st-hatena.com2Fimages2Ffotolife2Ft2Fteal_green2F202511062F2025110617402.png\",\"datePublished\":\"2025-11-06T14:43:26+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/pokecon.jp\\\/job\\\/#\\\/schema\\\/person\\\/16c9f07b1ba984d165d9aee259bda997\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/tech.mntsq.co.jp\\\/entry\\\/2025\\\/11\\\/06\\\/173525#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/tech.mntsq.co.jp\\\/entry\\\/2025\\\/11\\\/06\\\/173525\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/tech.mntsq.co.jp\\\/entry\\\/2025\\\/11\\\/06\\\/173525#primaryimage\",\"url\":\"https:\\\/\\\/pokecon.jp\\\/job\\\/wp-content\\\/uploads\\\/2025\\\/11\\\/https3A2F2Fcdn-ak.f.st-hatena.com2Fimages2Ffotolife2Ft2Fteal_green2F202511062F2025110617402.png\",\"contentUrl\":\"https:\\\/\\\/pokecon.jp\\\/job\\\/wp-content\\\/uploads\\\/2025\\\/11\\\/https3A2F2Fcdn-ak.f.st-hatena.com2Fimages2Ffotolife2Ft2Fteal_green2F202511062F2025110617402.png\",\"width\":1300,\"height\":188},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/tech.mntsq.co.jp\\\/entry\\\/2025\\\/11\\\/06\\\/173525#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u30db\u30fc\u30e0\",\"item\":\"https:\\\/\\\/pokecon.jp\\\/job\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MCP Python SDK\u306eClientSessionGroup\u3067\u8907\u6570\u306eMCP\u30b5\u30fc\u30d0\u30fc\u3068\u63a5\u7d9a\u3059\u308b &#8211; MNTSQ Tech\u30d6\u30ed\u30b0\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/pokecon.jp\\\/job\\\/#website\",\"url\":\"https:\\\/\\\/pokecon.jp\\\/job\\\/\",\"name\":\"\u30dd\u30b1\u30b3\u30f3\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/pokecon.jp\\\/job\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/pokecon.jp\\\/job\\\/#\\\/schema\\\/person\\\/16c9f07b1ba984d165d9aee259bda997\",\"name\":\"info@pokecon.jp\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2b0549cd9f7907c092ca5fbb283baf72337f235726e4b46fa39ec0b701ac2fe2?s=96&d=wavatar&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2b0549cd9f7907c092ca5fbb283baf72337f235726e4b46fa39ec0b701ac2fe2?s=96&d=wavatar&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2b0549cd9f7907c092ca5fbb283baf72337f235726e4b46fa39ec0b701ac2fe2?s=96&d=wavatar&r=g\",\"caption\":\"info@pokecon.jp\"},\"url\":\"https:\\\/\\\/pokecon.jp\\\/job\\\/author\\\/infopokecon-jp\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"MCP Python SDK\u306eClientSessionGroup\u3067\u8907\u6570\u306eMCP\u30b5\u30fc\u30d0\u30fc\u3068\u63a5\u7d9a\u3059\u308b - MNTSQ Tech\u30d6\u30ed\u30b0 - \u30dd\u30b1\u30b3\u30f3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/tech.mntsq.co.jp\/entry\/2025\/11\/06\/173525","og_locale":"ja_JP","og_type":"article","og_title":"MCP Python SDK\u306eClientSessionGroup\u3067\u8907\u6570\u306eMCP\u30b5\u30fc\u30d0\u30fc\u3068\u63a5\u7d9a\u3059\u308b - MNTSQ Tech\u30d6\u30ed\u30b0 - \u30dd\u30b1\u30b3\u30f3","og_description":"\u3053\u3093\u306b\u3061\u306f\u3001MNTSQ(\u30e2\u30f3\u30c6\u30b9\u30ad\u30e5\u30fc)\u3067\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u30a8\u30f3\u30b8\u30cb\u30a2\uff08AI\u30a8\u30f3\u30b8\u30cb\u30a2\uff09\u3092\u3057\u3066\u3044\u308b\u6e05\u6c34\u3067\u3059\u3002 MNTSQ\u306e\u30d7\u30ed\u30c0\u30af\u30c8\u3092LLM\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u30d7\u30ed\u30c0\u30af\u30c8\u306b\u9032\u5316\u3055\u305b\u308b\u3079\u304f\u3001LLMOps\u306b\u95a2\u3059\u308b\u5b9f\u88c5\u304c\u5897\u3048\u3066\u304d\u305f\u4eca\u65e5\u3053\u306e\u9803 [&hellip;]","og_url":"https:\/\/tech.mntsq.co.jp\/entry\/2025\/11\/06\/173525","og_site_name":"\u30dd\u30b1\u30b3\u30f3","article_published_time":"2025-11-06T14:43:26+00:00","og_image":[{"width":1300,"height":188,"url":"https:\/\/pokecon.jp\/job\/wp-content\/uploads\/2025\/11\/https3A2F2Fcdn-ak.f.st-hatena.com2Fimages2Ffotolife2Ft2Fteal_green2F202511062F2025110617402.png","type":"image\/png"}],"author":"info@pokecon.jp","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"info@pokecon.jp","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"2\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/tech.mntsq.co.jp\/entry\/2025\/11\/06\/173525#article","isPartOf":{"@id":"https:\/\/pokecon.jp\/job\/22540\/"},"author":{"name":"info@pokecon.jp","@id":"https:\/\/pokecon.jp\/job\/#\/schema\/person\/16c9f07b1ba984d165d9aee259bda997"},"headline":"MCP Python SDK\u306eClientSessionGroup\u3067\u8907\u6570\u306eMCP\u30b5\u30fc\u30d0\u30fc\u3068\u63a5\u7d9a\u3059\u308b &#8211; MNTSQ Tech\u30d6\u30ed\u30b0","datePublished":"2025-11-06T14:43:26+00:00","mainEntityOfPage":{"@id":"https:\/\/pokecon.jp\/job\/22540\/"},"wordCount":77,"image":{"@id":"https:\/\/tech.mntsq.co.jp\/entry\/2025\/11\/06\/173525#primaryimage"},"thumbnailUrl":"https:\/\/pokecon.jp\/job\/wp-content\/uploads\/2025\/11\/https3A2F2Fcdn-ak.f.st-hatena.com2Fimages2Ffotolife2Ft2Fteal_green2F202511062F2025110617402.png","articleSection":["\u4f01\u696d\u30c6\u30c3\u30af"],"inLanguage":"ja"},{"@type":"WebPage","@id":"https:\/\/pokecon.jp\/job\/22540\/","url":"https:\/\/tech.mntsq.co.jp\/entry\/2025\/11\/06\/173525","name":"MCP Python SDK\u306eClientSessionGroup\u3067\u8907\u6570\u306eMCP\u30b5\u30fc\u30d0\u30fc\u3068\u63a5\u7d9a\u3059\u308b - MNTSQ Tech\u30d6\u30ed\u30b0 - \u30dd\u30b1\u30b3\u30f3","isPartOf":{"@id":"https:\/\/pokecon.jp\/job\/#website"},"primaryImageOfPage":{"@id":"https:\/\/tech.mntsq.co.jp\/entry\/2025\/11\/06\/173525#primaryimage"},"image":{"@id":"https:\/\/tech.mntsq.co.jp\/entry\/2025\/11\/06\/173525#primaryimage"},"thumbnailUrl":"https:\/\/pokecon.jp\/job\/wp-content\/uploads\/2025\/11\/https3A2F2Fcdn-ak.f.st-hatena.com2Fimages2Ffotolife2Ft2Fteal_green2F202511062F2025110617402.png","datePublished":"2025-11-06T14:43:26+00:00","author":{"@id":"https:\/\/pokecon.jp\/job\/#\/schema\/person\/16c9f07b1ba984d165d9aee259bda997"},"breadcrumb":{"@id":"https:\/\/tech.mntsq.co.jp\/entry\/2025\/11\/06\/173525#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/tech.mntsq.co.jp\/entry\/2025\/11\/06\/173525"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/tech.mntsq.co.jp\/entry\/2025\/11\/06\/173525#primaryimage","url":"https:\/\/pokecon.jp\/job\/wp-content\/uploads\/2025\/11\/https3A2F2Fcdn-ak.f.st-hatena.com2Fimages2Ffotolife2Ft2Fteal_green2F202511062F2025110617402.png","contentUrl":"https:\/\/pokecon.jp\/job\/wp-content\/uploads\/2025\/11\/https3A2F2Fcdn-ak.f.st-hatena.com2Fimages2Ffotolife2Ft2Fteal_green2F202511062F2025110617402.png","width":1300,"height":188},{"@type":"BreadcrumbList","@id":"https:\/\/tech.mntsq.co.jp\/entry\/2025\/11\/06\/173525#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u30db\u30fc\u30e0","item":"https:\/\/pokecon.jp\/job\/"},{"@type":"ListItem","position":2,"name":"MCP Python SDK\u306eClientSessionGroup\u3067\u8907\u6570\u306eMCP\u30b5\u30fc\u30d0\u30fc\u3068\u63a5\u7d9a\u3059\u308b &#8211; MNTSQ Tech\u30d6\u30ed\u30b0"}]},{"@type":"WebSite","@id":"https:\/\/pokecon.jp\/job\/#website","url":"https:\/\/pokecon.jp\/job\/","name":"\u30dd\u30b1\u30b3\u30f3","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/pokecon.jp\/job\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/pokecon.jp\/job\/#\/schema\/person\/16c9f07b1ba984d165d9aee259bda997","name":"info@pokecon.jp","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/secure.gravatar.com\/avatar\/2b0549cd9f7907c092ca5fbb283baf72337f235726e4b46fa39ec0b701ac2fe2?s=96&d=wavatar&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/2b0549cd9f7907c092ca5fbb283baf72337f235726e4b46fa39ec0b701ac2fe2?s=96&d=wavatar&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2b0549cd9f7907c092ca5fbb283baf72337f235726e4b46fa39ec0b701ac2fe2?s=96&d=wavatar&r=g","caption":"info@pokecon.jp"},"url":"https:\/\/pokecon.jp\/job\/author\/infopokecon-jp\/"}]}},"_links":{"self":[{"href":"https:\/\/pokecon.jp\/job\/wp-json\/wp\/v2\/posts\/22540","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pokecon.jp\/job\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pokecon.jp\/job\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pokecon.jp\/job\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pokecon.jp\/job\/wp-json\/wp\/v2\/comments?post=22540"}],"version-history":[{"count":1,"href":"https:\/\/pokecon.jp\/job\/wp-json\/wp\/v2\/posts\/22540\/revisions"}],"predecessor-version":[{"id":22542,"href":"https:\/\/pokecon.jp\/job\/wp-json\/wp\/v2\/posts\/22540\/revisions\/22542"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pokecon.jp\/job\/wp-json\/wp\/v2\/media\/22541"}],"wp:attachment":[{"href":"https:\/\/pokecon.jp\/job\/wp-json\/wp\/v2\/media?parent=22540"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pokecon.jp\/job\/wp-json\/wp\/v2\/categories?post=22540"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pokecon.jp\/job\/wp-json\/wp\/v2\/tags?post=22540"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}