MCP ExplorerExplorer

Mcp Langchain Ts Client

@isaacwassermanon 9 months ago
34 MIT
FreeCommunity
AI Systems
LangChain.js client for the Model Context Protocol.

Overview

What is Mcp Langchain Ts Client

mcp-langchain-ts-client is a JavaScript/TypeScript client for the Model Context Protocol, designed to facilitate the integration of LangChain.js with MCP APIs.

Use cases

Use cases include building conversational agents, enhancing user interactions in applications, and developing intelligent systems that require contextual understanding.

How to use

To use mcp-langchain-ts-client, install it via npm with ‘npm install mcp-langchain-ts-client’. Then, initialize the toolkit with server parameters and extract LangChain.js compatible tools for further use.

Key features

Key features include easy integration with LangChain.js, support for various tools, and the ability to create agents using prebuilt components like ChatAnthropic.

Where to use

mcp-langchain-ts-client can be used in applications that require natural language processing, chatbots, or any context-aware AI solutions leveraging the Model Context Protocol.

Content

mcp-langchain-ts-client

A LangChain.js client for Model Context Protocol.

This is a port of rectalogic/langchain-mcp to the JS/TS LangChain and MCP APIs.

Installation

npm install mcp-langchain-ts-client

Usage

const serverParams = {
  command: "npx",
  args: [
    "-y",
    "@modelcontextprotocol/server-everything"
  ]
}

// Initialize the toolkit
const toolkit = new MCPToolkit(serverParams);
await toolkit.initialize();

// Extract LangChain.js compatible tools
const tools = toolkit.tools;

// Use the tools
import { createReactAgent } from "@langchain/langgraph/prebuilt";
import { ChatAnthropic } from "@langchain/anthropic";

const llm = new ChatAnthropic({ model: 'claude-3-5-sonnet-20241022' });
const agent = createReactAgent({ llm, tools });

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers