mcpField
M
mcp-langchain-ts-client

mcp-langchain-ts-client

Local
github.com/isaacwassermanAI & Agents35Updated 97w ago

About mcp-langchain-ts-client

mcp-langchain-ts-client is a LangChain.js client for Model Context Protocol, ported from rectalogic/langchain-mcp to the JS/TS LangChain and MCP APIs. It suits developers who want to connect MCP servers from TypeScript projects.

Key features

  1. 01LangChain.js-based MCP client
  2. 02Ported from rectalogic/langchain-mcp
  3. 03Installable via npm
  4. 04Server launch configuration using npx

Use cases

  1. 01Calling MCP server tools from TypeScript applications
  2. 02Connecting MCP servers within LangChain.js workflows

MCP support

The project acts as an MCP client, launching and connecting to MCP servers through command and args parameters, such as @modelcontextprotocol/server-everything.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

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 });

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.