Skip to content

Latest commit

 

History

History
40 lines (30 loc) · 1.37 KB

README.md

File metadata and controls

40 lines (30 loc) · 1.37 KB

Simple MCP Client Using LangChain / TypeScript License: MIT

This simple Model Context Protocol (MCP) client demonstrates the use of MCP server tools by LangChain ReAct Agent.

It leverages a utility function convertMcpToLangchainTools() from @h1deya/langchain-mcp-tools.
This function handles parallel initialization of specified multiple MCP servers and converts their available tools into an array of LangChain-compatible tools (StructuredTool[]).

Anthropic's claude-3-5-haiku-latest is used as the LLM.
For convenience, code for OpenAI's gpt-4o-mini is also included and commented out.

Requirements

Usage

  1. Install dependencies:

    npm install
  2. Setup API key:

    cp .env.template .env
    • Update .env as needed.
    • .gitignore is configured to ignore .env to prevent accidental commits of the credentials.
  3. Run the app:

    npm start