{"id":77221,"date":"2025-04-25T12:20:00","date_gmt":"2025-04-25T03:20:00","guid":{"rendered":"https:\/\/www.creationline.com\/tech-blog\/?p=77221"},"modified":"2025-04-25T11:26:48","modified_gmt":"2025-04-25T02:26:48","slug":"langchain%e3%81%a7mcp-model-context-protocol%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%81%bf%e3%82%88%e3%81%86-langchain-mcp-python","status":"publish","type":"post","link":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77221","title":{"rendered":"LangChain\u3067MCP (Model Context Protocol)\u3092\u4f7f\u3063\u3066\u307f\u3088\u3046 #langchain #mcp #python"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u306f\u3058\u3081\u306b<\/h2>\n\n\n\n<p>2024\u5e7411\u6708\u672b\u3001\u751f\u6210AI\u30c1\u30e3\u30c3\u30c8<a href=\"https:\/\/claude.ai\/\" target=\"_blank\" rel=\"noreferrer noopener\">Claude<\/a>\u3067\u8457\u540d\u306a<a href=\"https:\/\/www.anthropic.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Anthropic<\/a>\u304c\u3001<a href=\"https:\/\/www.anthropic.com\/news\/model-context-protocol\" target=\"_blank\" rel=\"noreferrer noopener\">Model Context Protocol (MCP)\u306e\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u5316\u3092\u767a\u8868<\/a>\u3057\u307e\u3057\u305f\u3002\u305d\u306e\u5f8c\u30012025\u5e743\u6708\u304b\u30894\u6708\u306b\u304b\u3051\u3066\u6025\u901f\u306b\u6ce8\u76ee\u3092\u96c6\u3081\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4e8b\u524d\u77e5\u8b58\u3068\u3057\u3066<a href=\"https:\/\/platform.openai.com\/docs\/guides\/function-calling?api-mode=responses\" target=\"_blank\" rel=\"noreferrer noopener\">OpenAI\u306eFunction calling<\/a>\u3092\u898b\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002\u7c21\u5358\u306b\u8a00\u3046\u3068GPT\u306a\u3069OpenAI\u306eLLM\u30e2\u30c7\u30eb\u3068\u5916\u90e8\u30b5\u30fc\u30d3\u30b9\u3092\u9023\u643a\u3059\u308b\u4ed5\u7d44\u307f\u3067\u3059\u3002\u904e\u53bb\u8a18\u4e8b\u300c<a href=\"https:\/\/www.creationline.com\/tech-blog\/76708\" target=\"_blank\" rel=\"noreferrer noopener\">LangGraph\u306eTool calling\u3067OpenAI API\u306eFunction calling\u3092\u8a66\u3057\u3066\u307f\u3088\u3046<\/a>\u300d\u3082\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p>MCP\u306f\u3001\u3053\u306e\u300cLLM\u30e2\u30c7\u30eb\u3068\u5916\u90e8\u30b5\u30fc\u30d3\u30b9\u3092\u9023\u643a\u3059\u308b\u4ed5\u7d44\u307f\u300d\u3092\u7d71\u4e00\u3057\u3088\u3046\u3068\u3044\u3046\u8a66\u307f\u3067\u3059\u3002 <a href=\"https:\/\/openai.github.io\/openai-agents-python\/mcp\/\" target=\"_blank\" rel=\"noreferrer noopener\">OpenAI\u3067\u3082MCP\u3092\u63a1\u7528<\/a>\u3057\u3001MCP\u304c\u30c7\u30d5\u30a1\u30af\u30c8\u30b9\u30bf\u30f3\u30c0\u30fc\u30c9\u306b\u306a\u308b\u671f\u5f85\u304c\u81a8\u3089\u3093\u3067\u3044\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u672c\u7a3f\u3067\u306f<a href=\"https:\/\/www.langchain.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">LangChain<\/a>\u306e<a href=\"https:\/\/github.com\/langchain-ai\/langchain-mcp-adapters\" target=\"_blank\" rel=\"noreferrer noopener\">MCP Adapters<\/a>\u3092\u5229\u7528\u3057\u3066\u3001MCP\u306e\u30c7\u30e2\u30f3\u30b9\u30c8\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u3057\u3066\u307f\u307e\u3059\u3002\u306a\u304a\u3001MCP\u306e\u8a73\u7d30\u306a\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u306a\u3069\u306f\u672c\u7a3f\u3067\u306f\u89e6\u308c\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u524d\u63d0\u6761\u4ef6<\/h2>\n\n\n\n<p>\u6b21\u306e\u74b0\u5883\u3067\u5b9f\u65bd\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Python 3.13.3<\/li>\n\n\n\n<li>LangChain 0.3.14<\/li>\n\n\n\n<li>LangChain MCP Adapters 0.0.9<\/li>\n\n\n\n<li>LangChain OpenAI 0.3.14<\/li>\n<\/ul>\n\n\n\n<p>LLM\u30e2\u30c7\u30eb\u306f <a href=\"https:\/\/azure.microsoft.com\/ja-jp\/products\/ai-services\/openai-service\" target=\"_blank\" rel=\"noreferrer noopener\">Azure OpenAI<\/a> \u3092\u901a\u3057\u3066\u4f7f\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30b7\u30f3\u30b0\u30eb\u30b5\u30fc\u30d0\u306e\u4f8b<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">MCP\u30b5\u30fc\u30d0<\/h3>\n\n\n\n<p><a href=\"https:\/\/github.com\/langchain-ai\/langchain-mcp-adapters\/tree\/langchain-mcp-adapters%3D%3D0.0.9?tab=readme-ov-file#quickstart\" target=\"_blank\" rel=\"noreferrer noopener\">\u672c\u5bb6\u30af\u30a4\u30c3\u30af\u30b9\u30bf\u30fc\u30c8<\/a>\u306e\u30b3\u30fc\u30c9\u3092\u305d\u306e\u307e\u307e\u4f7f\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># math_server.py\nfrom mcp.server.fastmcp import FastMCP\n\nmcp = FastMCP(\"Math\")\n\n@mcp.tool()\ndef add(a: int, b: int) -> int:\n    \"\"\"Add two numbers\"\"\"\n    return a + b\n\n@mcp.tool()\ndef multiply(a: int, b: int) -> int:\n    \"\"\"Multiply two numbers\"\"\"\n    return a * b\n\nif __name__ == \"__main__\":\n    mcp.run(transport=\"stdio\")<\/pre>\n\n\n\n<p>\u8db3\u3057\u7b97\u3068\u304b\u3051\u7b97\u3092\u884c\u3046MCP\u30b5\u30fc\u30d0\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u300cMCP\u30b5\u30fc\u30d0\u300d\u3068\u3044\u3046\u540d\u524d\u306a\u306e\u3067\u52d8\u9055\u3044\u3057\u3084\u3059\u3044\u3067\u3059\u304c\u3001\u3053\u306e\u30b5\u30f3\u30d7\u30eb\u3067\u306f\u3001\u3069\u3053\u304b\u30ea\u30e2\u30fc\u30c8\u306b\u300c\u30b5\u30fc\u30d0\u300d\u3092\u7acb\u3066\u3066\u8d77\u52d5\u3057\u3066\u304a\u304f\u306e\u3067\u306f\u306a\u304f\u3001MCP\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3068\u540c\u4e00\u30de\u30b7\u30f3\u4e0a\u3067\u5b9f\u884c\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002 <code>transport=\"stdio\"<\/code> \u3068\u3042\u308b\u3088\u3046\u306b\u3001MCP\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30fb\u30b5\u30fc\u30d0\u9593\u306f\u6a19\u6e96\u5165\u51fa\u529b\u3067\u901a\u4fe1\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">MCP\u30af\u30e9\u30a4\u30a2\u30f3\u30c8<\/h3>\n\n\n\n<p><a href=\"https:\/\/github.com\/langchain-ai\/langchain-mcp-adapters\/tree\/langchain-mcp-adapters%3D%3D0.0.9?tab=readme-ov-file#client\" target=\"_blank\" rel=\"noreferrer noopener\">\u672c\u5bb6\u30af\u30a4\u30c3\u30af\u30b9\u30bf\u30fc\u30c8<\/a>\u306e\u30b3\u30fc\u30c9\u306f\u6b21\u306e\u30b7\u30f3\u30bf\u30c3\u30af\u30b9\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u52d5\u4f5c\u3057\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">  File \"\/home\/dai\/langgraph\/client.py\", line 17\n    async with stdio_client(server_params) as (read, write):\n    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nSyntaxError: 'async with' outside async function<\/pre>\n\n\n\n<p><a href=\"https:\/\/github.com\/langchain-ai\/langchain-mcp-adapters\/issues\/39\" target=\"_blank\" rel=\"noreferrer noopener\">SyntaxError: 'async with' outside async function<\/a>\u3068\u3044\u3046\u30d0\u30b0\u30ec\u30dd\u30fc\u30c8\u304c\u51fa\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u306a\u305c\u304b\u5374\u4e0b\u3055\u308c\u3066\u304a\u308a\u3001\u5225\u9014 <a href=\"https:\/\/github.com\/ababdotai\/awesome-agent-quickstart\/tree\/72da1351d893c1e8cf96d5bed46eb99e019134d9\/langchain-mcp-adapters\/clients\" target=\"_blank\" rel=\"noreferrer noopener\">ready-to-use examples<\/a> \u304c\u63d0\u4f9b\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u305d\u3061\u3089\u3092\u53c2\u8003\u306b\u3001\u30b3\u30fc\u30c9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002Azure OpenAI\u306b\u63a5\u7d9a\u3059\u308b\u3088\u3046\u306b\u4fee\u6b63\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import asyncio\nfrom mcp import ClientSession, StdioServerParameters\nfrom mcp.client.stdio import stdio_client\n\nfrom langchain_mcp_adapters.tools import load_mcp_tools\nfrom langgraph.prebuilt import create_react_agent\n\nfrom langchain_openai import AzureChatOpenAI\nimport os\nfrom dotenv import load_dotenv\nload_dotenv()\nmodel = AzureChatOpenAI(\n    azure_deployment = os.getenv(\"AZURE_OPENAI_MODEL_NAME\"),\n    api_version = os.getenv(\"AZURE_OPENAI_API_VERSION\"),\n    temperature = 0.95,\n    max_tokens = 1024,\n)\n\nserver_params = StdioServerParameters(\n    command=\"python\",\n    args=[\n        os.path.join(\n            os.path.dirname(os.path.abspath(__file__)),\n            \"math_server.py\",\n        ),\n    ],\n)\n\nasync def run_agent():\n    async with stdio_client(server_params) as (read, write):\n        async with ClientSession(read, write) as session:\n            # Initialize the connection\n            await session.initialize()\n\n            # Get tools\n            tools = await load_mcp_tools(session)\n\n            # Create and run the agent\n            agent = create_react_agent(model, tools)\n            agent_response = await agent.ainvoke({\"messages\": \"what's (3 + 5) x 12?\"})\n            return agent_response\n\nif __name__ == \"__main__\":\n    result = asyncio.run(run_agent())\n    print(result)\n    print(result[\"messages\"][-1].content)<\/pre>\n\n\n\n<p>\u3053\u3053\u3067\u306f<a href=\"https:\/\/langchain-ai.github.io\/langgraph\/how-tos\/create-react-agent\/\" target=\"_blank\" rel=\"noreferrer noopener\">LangGraph\u306ecreate_react_agent<\/a>\u3092\u4f7f\u3063\u3066\u3001\u8d77\u52d5\u3057\u305fMCP\u30b5\u30fc\u30d0\u306b <code>what's (3 + 5) x 12?<\/code> \u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u308a\u3001\u53d7\u3051\u53d6\u3063\u305f\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8868\u793a\u3059\u308b\u3068\u3044\u3046\u5f62\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b9f\u884c\u4f8b<\/h3>\n\n\n\n<p>MCP\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3092\u5b9f\u884c\u3059\u308b\u3068\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[04\/23\/25 16:55:29] INFO     Processing request of type            server.py:534\n                             ListToolsRequest\n[04\/23\/25 16:55:31] INFO     Processing request of type            server.py:534\n                             CallToolRequest\n                    INFO     Processing request of type            server.py:534\n                             CallToolRequest\n\n(((\u4e2d\u7565)))\n\nThe result of (3 + 5) x 12 is 96.<\/pre>\n\n\n\n<p>\u6b63\u3057\u3044\u7d50\u679c\u304c\u5f97\u3089\u308c\u307e\u3057\u305f\u3002\u5185\u90e8\u3067MCP\u30b5\u30fc\u30d0\u3092\u8d77\u52d5\u3057\u3001\u305d\u3061\u3089\u306b\u51e6\u7406\u3092\u884c\u308f\u305b\u305f\u3088\u3046\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30de\u30eb\u30c1\u30b5\u30fc\u30d0\u306e\u4f8b<\/h2>\n\n\n\n<p>2\u3064\u306eMCP\u30b5\u30fc\u30d0\u3068\u3084\u308a\u3068\u308a\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">MCP\u30b5\u30fc\u30d0<\/h3>\n\n\n\n<p>1\u3064\u76ee\u306eMCP\u30b5\u30fc\u30d0\u306f\u3001\u30b7\u30f3\u30b0\u30eb\u30b5\u30fc\u30d0\u306e\u8db3\u3057\u7b97\u30fb\u304b\u3051\u7b97\u30b5\u30fc\u30d0\u3092\u305d\u306e\u307e\u307e\u7528\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>2\u3064\u76ee\u306eMCP\u30b5\u30fc\u30d0\u306f\u3001\u6307\u5b9a\u306e\u5834\u6240\u306e\u5929\u6c17\u3092\u8fd4\u3059\u300c\u3075\u308a\u3092\u3059\u308b\u300d\u30b5\u30fc\u30d0\u3067\u3059\u3002<a href=\"https:\/\/github.com\/langchain-ai\/langchain-mcp-adapters\/tree\/langchain-mcp-adapters%3D%3D0.0.9?tab=readme-ov-file#server-1\" target=\"_blank\" rel=\"noreferrer noopener\">\u672c\u5bb6\u30af\u30a4\u30c3\u30af\u30b9\u30bf\u30fc\u30c8<\/a>\u306e\u30b3\u30fc\u30c9\u305d\u306e\u307e\u307e\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># weather_server.py\nfrom typing import List\nfrom mcp.server.fastmcp import FastMCP\n\nmcp = FastMCP(\"Weather\")\n\n@mcp.tool()\nasync def get_weather(location: str) -> str:\n    \"\"\"Get weather for location.\"\"\"\n    return \"It's always sunny in New York\"\n\nif __name__ == \"__main__\":\n    mcp.run(transport=\"sse\")<\/pre>\n\n\n\n<p>\u3053\u3061\u3089\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001HTTP\u30b5\u30fc\u30d0\u3068\u3057\u3066\u8d77\u52d5\u3057\u3066\u5f85\u3061\u53d7\u3051\u72b6\u614b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">(langgraph) % .\/weather_server.py\nINFO:     Started server process [842369]\nINFO:     Waiting for application startup.\nINFO:     Application startup complete.\nINFO:     Uvicorn running on http:\/\/0.0.0.0:8000 (Press CTRL+C to quit)<\/pre>\n\n\n\n<p><code>transport=\"sse\"<\/code> \u306fMCP\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30fb\u30b5\u30fc\u30d0\u9593\u306e\u901a\u4fe1\u3092<a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Server-sent_events\" target=\"_blank\" rel=\"noreferrer noopener\">SSE (Server-Sent Events)<\/a> \u3067\u884c\u3046\u3053\u3068\u3092\u610f\u5473\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306a\u3089\u3070\u6a19\u6e96\u5165\u51fa\u529b\u3068\u7570\u306a\u308a\u3001\u30ea\u30e2\u30fc\u30c8\u306b\u30b5\u30fc\u30d0\u3092\u7acb\u3066\u3066\u304a\u304f\u3053\u3068\u304c\u3067\u304d\u305d\u3046\u3067\u3059\u304c\u3001\u30b5\u30f3\u30d7\u30eb\u3067\u306f\u8a8d\u8a3c\u306a\u3069\u3092\u884c\u3063\u3066\u3044\u306a\u3044\u305f\u3081\u30ed\u30fc\u30ab\u30eb\u8d77\u52d5\u306b\u7559\u3081\u3066\u304a\u304f\u3079\u304d\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">MCP\u30af\u30e9\u30a4\u30a2\u30f3\u30c8<\/h3>\n\n\n\n<p><a href=\"https:\/\/github.com\/langchain-ai\/langchain-mcp-adapters\/tree\/langchain-mcp-adapters%3D%3D0.0.9?tab=readme-ov-file#client-1\" target=\"_blank\" rel=\"noreferrer noopener\">\u672c\u5bb6\u30af\u30a4\u30c3\u30af\u30b9\u30bf\u30fc\u30c8<\/a>\u306e\u30b3\u30fc\u30c9\u306f\u3001\u3084\u306f\u308a\u6b21\u306e\u30b7\u30f3\u30bf\u30c3\u30af\u30b9\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u52d5\u4f5c\u3057\u307e\u305b\u3093\u3002\u610f\u56f3\u7684\u306b\u4e0d\u5b8c\u5168\u306a\u30b3\u30fc\u30c9\u306a\u306e\u3067\u3057\u3087\u3046\u304b\uff1f<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">(langgraph) % python client.py\n  File \"\/home\/dai\/langgraph\/client.py\", line 7\n    async with MultiServerMCPClient(\n    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nSyntaxError: 'async with' outside async function<\/pre>\n\n\n\n<p>\u3084\u306f\u308a\u5225\u9014 <a href=\"https:\/\/github.com\/ababdotai\/awesome-agent-quickstart\/tree\/72da1351d893c1e8cf96d5bed46eb99e019134d9\/langchain-mcp-adapters\/clients\" target=\"_blank\" rel=\"noreferrer noopener\">ready-to-use examples<\/a> \u304c\u63d0\u4f9b\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001Azure OpenAI\u306b\u63a5\u7d9a\u3059\u308b\u3088\u3046\u306b\u4fee\u6b63\u3057\u3066\u30b3\u30fc\u30c9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">from dotenv import load_dotenv\nload_dotenv()\n\nimport asyncio\nimport os\nfrom langchain_mcp_adapters.client import MultiServerMCPClient\nfrom langgraph.prebuilt import create_react_agent\n\nfrom langchain_openai import AzureChatOpenAI\nfrom dotenv import load_dotenv\nload_dotenv()\nmodel = AzureChatOpenAI(\n    azure_deployment = os.getenv(\"AZURE_OPENAI_MODEL_NAME\"),\n    api_version = os.getenv(\"AZURE_OPENAI_API_VERSION\"),\n    temperature = 0.95,\n    max_tokens = 1024,\n)\n\nasync def run_agent():\n    async with MultiServerMCPClient(\n        {\n            \"math\": {\n                \"command\": \"python\",\n                \"args\": [\n                    os.path.join(\n                        os.path.dirname(os.path.abspath(__file__)),\n                        \"math_server.py\",\n                    ),\n                ],\n                \"transport\": \"stdio\",\n            },\n            \"weather\": {\n                # make sure you start your weather server on port 8000\n                \"url\": f\"http:\/\/localhost:8000\/sse\",\n                \"transport\": \"sse\",\n            }\n        }\n    ) as client:\n        agent = create_react_agent(model, client.get_tools())\n        math_response = await agent.ainvoke({\"messages\": \"what's (3 + 5) x 12?\"})\n        print(math_response[\"messages\"][-1].content)\n        weather_response = await agent.ainvoke({\"messages\": \"what is the weather in nyc?\"})\n        print(weather_response[\"messages\"][-1].content)\n\nif __name__ == \"__main__\":\n    asyncio.run(run_agent())<\/pre>\n\n\n\n<p>\u3053\u3053\u3067\u306f<a href=\"https:\/\/langchain-ai.github.io\/langgraph\/how-tos\/create-react-agent\/\" target=\"_blank\" rel=\"noreferrer noopener\">LangGraph\u306ecreate_react_agent<\/a>\u3092\u4f7f\u3063\u3066\u3001\u8d77\u52d5\u3057\u305fMCP\u30b5\u30fc\u30d0\u306b <code>what's (3 + 5) x 12?<\/code> \u30e1\u30c3\u30bb\u30fc\u30b8\u3068 <code>what is the weather in nyc?<\/code> \u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u308a\u3001\u53d7\u3051\u53d6\u3063\u305f\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8868\u793a\u3059\u308b\u3068\u3044\u3046\u5f62\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b9f\u884c\u4f8b<\/h3>\n\n\n\n<p>MCP\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3092\u5b9f\u884c\u3059\u308b\u3068\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[04\/24\/25 12:25:00] INFO     Processing request of type            server.py:534\n                             ListToolsRequest\n[04\/24\/25 12:25:02] INFO     Processing request of type            server.py:534\n                             CallToolRequest\n[04\/24\/25 12:25:03] INFO     Processing request of type            server.py:534\n                             CallToolRequest\nThe result of \\((3 + 5) \\times 12\\) is 96.\nThe weather in New York City is sunny. Enjoy the sunshine!<\/pre>\n\n\n\n<p>\u307e\u305a\u5185\u90e8\u3067\u8db3\u3057\u7b97\u3068\u304b\u3051\u7b97\u3092\u884c\u3046MCP\u30b5\u30fc\u30d0\u3092\u8d77\u52d5\u3057\u3001\u305d\u3061\u3089\u306b\u51e6\u7406\u3092\u884c\u308f\u305b\u3066\u6b63\u3057\u3044\u8a08\u7b97\u7d50\u679c\u3092\u5c0e\u304d\u51fa\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u6307\u5b9a\u306e\u5834\u6240\u306e\u5929\u6c17\u3092\u8fd4\u3059\u300c\u3075\u308a\u3092\u3059\u308b\u300d\u30b5\u30fc\u30d0\u306e\u51fa\u529b\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">INFO:     Started server process [842369]\nINFO:     Waiting for application startup.\nINFO:     Application startup complete.\nINFO:     Uvicorn running on http:\/\/0.0.0.0:8000 (Press CTRL+C to quit)\nINFO:     127.0.0.1:41918 - \"GET \/sse HTTP\/1.1\" 200 OK\nINFO:     127.0.0.1:41930 - \"POST \/messages\/?session_id=23c3c99f32db4797ac856b1e55290426 HTTP\/1.1\" 202 Accepted\nINFO:     127.0.0.1:41930 - \"POST \/messages\/?session_id=23c3c99f32db4797ac856b1e55290426 HTTP\/1.1\" 202 Accepted\nINFO:     127.0.0.1:41930 - \"POST \/messages\/?session_id=23c3c99f32db4797ac856b1e55290426 HTTP\/1.1\" 202 Accepted\n[04\/24\/25 12:25:00] INFO     Processing request of type            server.py:534\n                             ListToolsRequest\nINFO:     127.0.0.1:41930 - \"POST \/messages\/?session_id=23c3c99f32db4797ac856b1e55290426 HTTP\/1.1\" 202 Accepted\n[04\/24\/25 12:25:05] INFO     Processing request of type            server.py:534\n                             CallToolRequest<\/pre>\n\n\n\n<p>GET\u3084POST\u306b\u3088\u3063\u3066\u30a2\u30af\u30bb\u30b9\u304c\u3042\u3063\u305f\u3053\u3068\u304c\u308f\u304b\u308a\u3001Processing request of type ListToolsRequest\u3068CallToolRequest\u3067MCP\u30b5\u30fc\u30d0\u3067\u51e6\u7406\u3092\u884c\u3063\u305f\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002\u3053\u3061\u3089\u3067\u300cNYC\u306e\u5929\u6c17\u300d\u3092\u8fd4\u3057\u305f\u3068\u601d\u308f\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u307e\u3068\u3081<\/h2>\n\n\n\n<p>\u672c\u7a3f\u3067\u306f<a href=\"https:\/\/www.langchain.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">LangChain<\/a>\u306e<a href=\"https:\/\/github.com\/langchain-ai\/langchain-mcp-adapters\" target=\"_blank\" rel=\"noreferrer noopener\">MCP Adapters<\/a>\u306e\u30b5\u30f3\u30d7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u3001<a href=\"https:\/\/modelcontextprotocol.io\/introduction\" target=\"_blank\" rel=\"noreferrer noopener\">MCP (Model Context Protocol)<\/a>\u306e\u3055\u308f\u308a\u3092\u898b\u3066\u307f\u307e\u3057\u305f\u3002\u5b9f\u969b\u306e\u51e6\u7406\u3092\u884c\u3046MCP\u30b5\u30fc\u30d0\u306e\u4f5c\u308a\u8fbc\u307f\u306f\u5f53\u7136\u306a\u304c\u3089\u5fc5\u8981\u3067\u3042\u308b\u3082\u306e\u306e\u3001MCP\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3068\u306a\u308b\u547c\u3073\u51fa\u3057\u90e8\u5206\u306f\u304b\u306a\u308a\u7c21\u5358\u306b\u4f5c\u6210\u3067\u304d\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n\n\n\n<p>MCP\u30b5\u30fc\u30d0\u306f\u65e2\u306b<a href=\"https:\/\/github.com\/modelcontextprotocol\/servers\" target=\"_blank\" rel=\"noreferrer noopener\">\u591a\u304f\u304c\u7528\u610f<\/a>\u3055\u308c\u3066\u304a\u308a\u3001\u3059\u3050\u306b\u3067\u3082\u5b9f\u7528\u7684\u306b\u4f7f\u3048\u305d\u3046\u3067\u3059\u3002\u305f\u3060\u3057\u305d\u306e\u624b\u8efd\u3055\u30fb\u67d4\u8edf\u3055\u3086\u3048\u306b\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u9762\u3067\u306e\u5fc3\u914d\u304c\u3042\u308a\u307e\u3059\u3002\u307e\u3060\u767b\u5834\u3057\u305f\u3070\u304b\u308a\u3067\u5341\u5206\u306b\u6210\u719f\u3057\u3066\u306a\u3044\u304c\u6545\u306b\u3001\u63a1\u7528\u306b\u306f\u614e\u91cd\u3055\u304c\u5fc5\u8981\u3068\u306a\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p>\u5f15\u304d\u7d9a\u304d\u3001MCP\u304c\u3069\u306e\u3088\u3046\u306b\u9032\u5316\u3057\u3066\u3044\u304f\u304b\u3092\u8ffd\u3063\u3066\u3044\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u306f\u3058\u3081\u306b 2024\u5e7411\u6708\u672b\u3001\u751f\u6210AI\u30c1\u30e3\u30c3\u30c8Claude\u3067\u8457\u540d\u306aAnthropic\u304c\u3001Model Context Protocol (MCP)\u306e\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u5316\u3092\u767a\u8868\u3057\u307e\u3057\u305f\u3002\u305d\u306e\u5f8c\u30012025\u5e743\u6708\u304b\u30894\u6708\u306b\u304b\u3051\u3066\u6025\u901f [&#8230;]<\/p>\n","protected":false},"author":2,"featured_media":77223,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":""},"categories":[779,58,817,31,1004,323],"tags":[],"class_list":["post-77221","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai","category-azure","category-chatgpt-ai","category-higuchi","category-llm","category-python"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>LangChain\u3067MCP (Model Context Protocol)\u3092\u4f7f\u3063\u3066\u307f\u3088\u3046 #langchain #mcp #python - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3<\/title>\n<meta name=\"description\" content=\"AI, Azure, ChatGPT\uff06AI, d-higuchi, LLM, Python |\u306f\u3058\u3081\u306b 2024\u5e7411\u6708\u672b\u3001\u751f\u6210AI\u30c1\u30e3\u30c3\u30c8Claude\u3067\u8457\u540d\u306aAnthropic\u304c\u3001Model Context Protocol\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77221\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"LangChain\u3067MCP (Model Context Protocol)\u3092\u4f7f\u3063\u3066\u307f\u3088\u3046 #langchain #mcp #python - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3\" \/>\n<meta property=\"og:description\" content=\"AI, Azure, ChatGPT\uff06AI, d-higuchi, LLM, Python |\u306f\u3058\u3081\u306b 2024\u5e7411\u6708\u672b\u3001\u751f\u6210AI\u30c1\u30e3\u30c3\u30c8Claude\u3067\u8457\u540d\u306aAnthropic\u304c\u3001Model Context Protocol\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77221\" \/>\n<meta property=\"og:site_name\" content=\"Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/creationline\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-25T03:20:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2025\/04\/langchain-mcp.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"675\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Daisuke Higuchi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@creationline\" \/>\n<meta name=\"twitter:site\" content=\"@creationline\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"Daisuke Higuchi\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"4\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\\\/higuchi\\\/77221#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\\\/higuchi\\\/77221\"},\"author\":{\"name\":\"Daisuke Higuchi\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/#\\\/schema\\\/person\\\/16f1373831fb6fd17387f16ae1195206\"},\"headline\":\"LangChain\u3067MCP (Model Context Protocol)\u3092\u4f7f\u3063\u3066\u307f\u3088\u3046 #langchain #mcp #python\",\"datePublished\":\"2025-04-25T03:20:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\\\/higuchi\\\/77221\"},\"wordCount\":113,\"image\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\\\/higuchi\\\/77221#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cms_x3GWkuX\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/langchain-mcp.png\",\"articleSection\":[\"AI\",\"Azure\",\"ChatGPT\uff06AI\",\"d-higuchi\",\"LLM\",\"Python\"],\"inLanguage\":\"ja\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\\\/higuchi\\\/77221\",\"url\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\\\/higuchi\\\/77221\",\"name\":\"LangChain\u3067MCP (Model Context Protocol)\u3092\u4f7f\u3063\u3066\u307f\u3088\u3046 #langchain #mcp #python - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\\\/higuchi\\\/77221#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\\\/higuchi\\\/77221#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cms_x3GWkuX\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/langchain-mcp.png\",\"datePublished\":\"2025-04-25T03:20:00+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/#\\\/schema\\\/person\\\/16f1373831fb6fd17387f16ae1195206\"},\"description\":\"AI, Azure, ChatGPT\uff06AI, d-higuchi, LLM, Python |\u306f\u3058\u3081\u306b 2024\u5e7411\u6708\u672b\u3001\u751f\u6210AI\u30c1\u30e3\u30c3\u30c8Claude\u3067\u8457\u540d\u306aAnthropic\u304c\u3001Model Context Protocol\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\\\/higuchi\\\/77221#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\\\/higuchi\\\/77221\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\\\/higuchi\\\/77221#primaryimage\",\"url\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cms_x3GWkuX\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/langchain-mcp.png\",\"contentUrl\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cms_x3GWkuX\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/langchain-mcp.png\",\"width\":1200,\"height\":675},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\\\/higuchi\\\/77221#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"HOME\",\"item\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ChatGPT\uff06AI\",\"item\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/chatgpt-ai\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"AI\",\"item\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/chatgpt-ai\\\/ai\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"LangChain\u3067MCP (Model Context Protocol)\u3092\u4f7f\u3063\u3066\u307f\u3088\u3046 #langchain #mcp #python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/#website\",\"url\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/\",\"name\":\"Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3\",\"description\":\"\u30a2\u30b8\u30e3\u30a4\u30eb\uff06DevOps\u3001\u30af\u30e9\u30a6\u30c9\u30cd\u30a4\u30c6\u30a3\u30d6\u3001AI\uff06LLM\u306e\u5148\u7aef\u6280\u8853\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/#\\\/schema\\\/person\\\/16f1373831fb6fd17387f16ae1195206\",\"name\":\"Daisuke Higuchi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cms_x3GWkuX\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/d-higuchi-wp-icon-230x230.png\",\"url\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cms_x3GWkuX\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/d-higuchi-wp-icon-230x230.png\",\"contentUrl\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cms_x3GWkuX\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/d-higuchi-wp-icon-230x230.png\",\"caption\":\"Daisuke Higuchi\"},\"description\":\"Chef\u30fbDocker\u30fbMirantis\u88fd\u54c1\u306a\u3069\u306e\u6280\u8853\u8981\u7d20\u306b\u52a0\u3048\u3066\u3001\u4f1a\u8b70\u306e\u9032\u3081\u65b9\u30fb\u6587\u7ae0\u306e\u66f8\u304d\u65b9\u306a\u3069\u306e\u696d\u52d9\u6539\u5584\u306b\u3082\u53d6\u308a\u7d44\u3093\u3067\u3044\u307e\u3059\u3002\u300cChef\u6d3b\u7528\u30ac\u30a4\u30c9\u300d\u5171\u8457\u306e\u307b\u304b\u3001Debian Official Developer\u3082\u3084\u3063\u3066\u3044\u307e\u3059\u3002\",\"url\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\\\/higuchi\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"LangChain\u3067MCP (Model Context Protocol)\u3092\u4f7f\u3063\u3066\u307f\u3088\u3046 #langchain #mcp #python - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3","description":"AI, Azure, ChatGPT\uff06AI, d-higuchi, LLM, Python |\u306f\u3058\u3081\u306b 2024\u5e7411\u6708\u672b\u3001\u751f\u6210AI\u30c1\u30e3\u30c3\u30c8Claude\u3067\u8457\u540d\u306aAnthropic\u304c\u3001Model Context Protocol","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77221","og_locale":"ja_JP","og_type":"article","og_title":"LangChain\u3067MCP (Model Context Protocol)\u3092\u4f7f\u3063\u3066\u307f\u3088\u3046 #langchain #mcp #python - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3","og_description":"AI, Azure, ChatGPT\uff06AI, d-higuchi, LLM, Python |\u306f\u3058\u3081\u306b 2024\u5e7411\u6708\u672b\u3001\u751f\u6210AI\u30c1\u30e3\u30c3\u30c8Claude\u3067\u8457\u540d\u306aAnthropic\u304c\u3001Model Context Protocol","og_url":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77221","og_site_name":"Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3","article_publisher":"https:\/\/www.facebook.com\/creationline","article_published_time":"2025-04-25T03:20:00+00:00","og_image":[{"width":1200,"height":675,"url":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2025\/04\/langchain-mcp.png","type":"image\/png"}],"author":"Daisuke Higuchi","twitter_card":"summary_large_image","twitter_creator":"@creationline","twitter_site":"@creationline","twitter_misc":{"\u57f7\u7b46\u8005":"Daisuke Higuchi","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"4\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77221#article","isPartOf":{"@id":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77221"},"author":{"name":"Daisuke Higuchi","@id":"https:\/\/www.creationline.com\/tech-blog\/#\/schema\/person\/16f1373831fb6fd17387f16ae1195206"},"headline":"LangChain\u3067MCP (Model Context Protocol)\u3092\u4f7f\u3063\u3066\u307f\u3088\u3046 #langchain #mcp #python","datePublished":"2025-04-25T03:20:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77221"},"wordCount":113,"image":{"@id":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77221#primaryimage"},"thumbnailUrl":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2025\/04\/langchain-mcp.png","articleSection":["AI","Azure","ChatGPT\uff06AI","d-higuchi","LLM","Python"],"inLanguage":"ja"},{"@type":"WebPage","@id":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77221","url":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77221","name":"LangChain\u3067MCP (Model Context Protocol)\u3092\u4f7f\u3063\u3066\u307f\u3088\u3046 #langchain #mcp #python - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3","isPartOf":{"@id":"https:\/\/www.creationline.com\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77221#primaryimage"},"image":{"@id":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77221#primaryimage"},"thumbnailUrl":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2025\/04\/langchain-mcp.png","datePublished":"2025-04-25T03:20:00+00:00","author":{"@id":"https:\/\/www.creationline.com\/tech-blog\/#\/schema\/person\/16f1373831fb6fd17387f16ae1195206"},"description":"AI, Azure, ChatGPT\uff06AI, d-higuchi, LLM, Python |\u306f\u3058\u3081\u306b 2024\u5e7411\u6708\u672b\u3001\u751f\u6210AI\u30c1\u30e3\u30c3\u30c8Claude\u3067\u8457\u540d\u306aAnthropic\u304c\u3001Model Context Protocol","breadcrumb":{"@id":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77221#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77221"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77221#primaryimage","url":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2025\/04\/langchain-mcp.png","contentUrl":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2025\/04\/langchain-mcp.png","width":1200,"height":675},{"@type":"BreadcrumbList","@id":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi\/77221#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"HOME","item":"https:\/\/www.creationline.com\/tech-blog"},{"@type":"ListItem","position":2,"name":"ChatGPT\uff06AI","item":"https:\/\/www.creationline.com\/tech-blog\/chatgpt-ai"},{"@type":"ListItem","position":3,"name":"AI","item":"https:\/\/www.creationline.com\/tech-blog\/chatgpt-ai\/ai"},{"@type":"ListItem","position":4,"name":"LangChain\u3067MCP (Model Context Protocol)\u3092\u4f7f\u3063\u3066\u307f\u3088\u3046 #langchain #mcp #python"}]},{"@type":"WebSite","@id":"https:\/\/www.creationline.com\/tech-blog\/#website","url":"https:\/\/www.creationline.com\/tech-blog\/","name":"Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3","description":"\u30a2\u30b8\u30e3\u30a4\u30eb\uff06DevOps\u3001\u30af\u30e9\u30a6\u30c9\u30cd\u30a4\u30c6\u30a3\u30d6\u3001AI\uff06LLM\u306e\u5148\u7aef\u6280\u8853","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.creationline.com\/tech-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.creationline.com\/tech-blog\/#\/schema\/person\/16f1373831fb6fd17387f16ae1195206","name":"Daisuke Higuchi","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2023\/08\/d-higuchi-wp-icon-230x230.png","url":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2023\/08\/d-higuchi-wp-icon-230x230.png","contentUrl":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2023\/08\/d-higuchi-wp-icon-230x230.png","caption":"Daisuke Higuchi"},"description":"Chef\u30fbDocker\u30fbMirantis\u88fd\u54c1\u306a\u3069\u306e\u6280\u8853\u8981\u7d20\u306b\u52a0\u3048\u3066\u3001\u4f1a\u8b70\u306e\u9032\u3081\u65b9\u30fb\u6587\u7ae0\u306e\u66f8\u304d\u65b9\u306a\u3069\u306e\u696d\u52d9\u6539\u5584\u306b\u3082\u53d6\u308a\u7d44\u3093\u3067\u3044\u307e\u3059\u3002\u300cChef\u6d3b\u7528\u30ac\u30a4\u30c9\u300d\u5171\u8457\u306e\u307b\u304b\u3001Debian Official Developer\u3082\u3084\u3063\u3066\u3044\u307e\u3059\u3002","url":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi"}]}},"_links":{"self":[{"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/posts\/77221","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/comments?post=77221"}],"version-history":[{"count":2,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/posts\/77221\/revisions"}],"predecessor-version":[{"id":77239,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/posts\/77221\/revisions\/77239"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/media\/77223"}],"wp:attachment":[{"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/media?parent=77221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/categories?post=77221"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/tags?post=77221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}