MCP Tools Usage From LangChain / Example in TypeScript
@hideya
About MCP Tools Usage From LangChain / Example in TypeScript
MCP Tools Usage From LangChain ReAct Agent / Example in TypeScript
Overview
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.
Basic information
More Agent Frameworks MCP clients
🚀 MCPOmni Connect - Universal Gateway to MCP Servers
Abiorh001MCPOmni Connect is an agent execution runtime that connects to multiple MCP servers via stdio, SSE, or streamable HTTP. It supports chat, autonomous agents, and planner-based orchestration treating each MCP server as a tool agent to enable dynamic multi-agent workflows across LLM
MCP Tool Langgraph Integration
paulrobelloMCP Tools Langraph Integration
Smolagents
huggingface🤗 smolagents: a barebones library for agents that think in code.
Nerve
evilsocketThe Simple Agent Development Kit.
SSE-based Server and Client for
sidharthrajaramA working pattern for SSE-based MCP clients and servers
Comments