MCP Tools Usage From LangChain / Example in TypeScript
@hideya
关于 MCP Tools Usage From LangChain / Example in TypeScript
MCP Tools Usage From LangChain ReAct Agent / Example in TypeScript
概览
What is MCP Tools Usage From LangChain / Example in TypeScript?
This is a command-line Model Context Protocol (MCP) client built with TypeScript that demonstrates how to use MCP server tools via LangChain’s ReAct Agent. It runs on Node.js 16+ and is intended for developers integrating MCP with LangChain.
How to use MCP Tools Usage From LangChain / Example in TypeScript?
Clone the repository, install dependencies with npm install, copy .env.template to .env and add your Anthropic (or OpenAI) API key, then run npm start. Optionally install uv to support Python-based MCP servers.
Key features of MCP Tools Usage From LangChain / Example in TypeScript
- Demonstrates MCP tool usage with LangChain ReAct Agent
- Parallel initialization of multiple MCP servers
- Converts MCP tools to LangChain‑compatible
StructuredTool[] - Uses Anthropic Claude 3.5 Sonnet by default
- Includes commented‑out support for OpenAI GPT‑4o
- Provides sample OAuth authentication for SSE connections
Use cases of MCP Tools Usage From LangChain / Example in TypeScript
- Learn how to integrate MCP servers into LangChain‑based agents
- Prototype and test combinations of MCP tools in a TypeScript environment
- Explore OAuth authentication for MCP servers over SSE
- Serve as a foundation for building production MCP clients using LangChain
FAQ from MCP Tools Usage From LangChain / Example in TypeScript
What LLMs does it support?
It uses Anthropic’s claude-3-5-sonnet-latest by default. Code for OpenAI’s gpt-4o is included but commented out.
How do I add my own MCP servers?
You modify the server configuration in the source code; the convertMcpToLangchainTools utility handles parallel initialization and tool conversion.
Does it support Python‑based MCP servers?
Yes, if you have uv (or uvx) installed, you can run Python‑based MCP servers alongside Node‑based ones.
What license is it under?
This project is released under the MIT License.
Do I need a paid API key to run it?
Yes, you need an API key from either Anthropic or OpenAI. Usage of those APIs may incur costs depending on your plan.
智能体框架 分类下的更多 MCP 客户端
MCPHost 🤖
mark3labsA CLI host application that enables Large Language Models (LLMs) to interact with external tools through the Model Context Protocol (MCP).
Nerve
evilsocketThe Simple Agent Development Kit.
Unified MCP Client Library
mcp-usemcp-use is the easiest way to interact with mcp servers with custom agents
Tester Client for Model Context Protocol (MCP)
apifyModel Context Protocol (MCP) Client for Apify's Actors
评论