{"type":"mcp_client","name":"mcp-client-langchain-py","description":"This repository provides a Python-based Model Context Protocol (MCP) client using LangChain, enabling interaction with MCP servers through LangChain ReAct Agent and supporting LLMs from Anthropic, OpenAI, and Groq.","category":"AI","language":"Python","stars":13,"forks":2,"owner":"hideya","github_url":"https://github.com/hideya/mcp-client-langchain-py","homepage":null,"setup":"## Setup\n\n1. Install dependencies:\n    ```bash\n    make install\n    ```\n\n2. Setup API keys:\n    ```bash\n    cp .env.template .env\n    ```\n    - Update `.env` as needed.\n    - `.gitignore` is configured to ignore `.env`\n      to prevent accidental commits of the credentials.\n\n3. Configure LLM and MCP Servers settings `llm_mcp_config.json5` as needed.\n\n    - [The configuration file format](https://github.com/hideya/mcp-client-langchain-ts/blob/main/llm_mcp_config.json5)\n      for MCP servers follows the same structure as\n      [Claude for Desktop](https://modelcontextprotocol.io/quickstart/user),\n      with one difference: the key name `mcpServers` has been changed\n      to `mcp_servers` to follow the snake_case convention\n      commonly used in JSON configuration files.\n    - The file format is [JSON5](https://json5.org/), where comments and trailing commas are allowed.\n    - The format is further extended to replace `${...}` notations with the values of corresponding environment variables.\n    - Keep all the credentials and private info in the `.env` file and refer to them with `${...}` notation as needed.","tools":"## Available Tools\n\n1.  `convert_mcp_to_langchain_tools()` (Utility function to handle parallel initialization of MCP servers and convert their tools into LangChain-compatible tools.)\n2.  LangChain ReAct Agent (Demonstrates the use of MCP server tools.)\n3.  Support for LLMs from Anthropic, OpenAI and Groq (Allows using different LLMs.)\n","faq":null,"created_at":"2025-01-12T18:28:40+00:00","updated_at":"2025-03-27T06:12:28+00:00","source_url":"https://model-context-protocol.com/clients/mcp-client-langchain-python-llm-interaction","related_articles":[]}