About Tool Calling Langchain
Tool Calling Langchain is an MCP server published by wassupjay in the AI category: mCP with langchain. It has been installed 0 times through Conduid.
The repository has 2 stars and 0 forks, with the last commit 11 months ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues (0) before depending on it in production.
Install
npx mcp-server-tool-calling-langchainThis server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.
Ask AI
Ask AI about Tool Calling Langchain
Powered by Claude · Grounded in docs
Security checks
- ·README presentNot checked yet.
- ·License declaredNot checked yet.
- ·Tests presentNot checked yet.
- ·Dependencies pinnedNot checked yet.
- ·No dynamic code executionNot checked yet.
- !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.
README
MCP Server Tool Calling with LangChain
A demonstration of using MCP (Model Control Protocol) servers with LangChain to create and manage custom tools for language models.
This project consists of three main components:
- Client (
client.py): The main application that uses LangChain and a Groq model to answer questions. It connects to the MCP servers to get a list of available tools. - Math Server (
mathserver.py): An MCP server that provides basic arithmetic operations (addandmultiply). It communicates over standard input/output. - Weather Server (
weather.py): An MCP server that provides a simple weather lookup service. It communicates over HTTP.
Project Structure
client.py: Main client application that connects to MCP servers and uses LangChain for tool calling.mathserver.py: MCP server providing math operations (add, multiply).weather.py: MCP server providing weather information.main.py: Simple entry point for the application..env: For storing environment variables (e.g.,GROQ_API_KEY).requirment.txt: Python dependencies.
Features
- Math Server: Provides two basic arithmetic tools:
add(a, b): Adds two numbers.multiply(a, b): Multiplies two numbers.
- Weather Server: Provides a tool to get weather information:
get_weather(location): Returns a mock weather forecast for a given location.
- LangChain Integration: The client uses LangChain to create a ReAct agent that can intelligently use the tools provided by the MCP servers to answer questions.
- Multi-Protocol Communication: Demonstrates two different MCP transport protocols:
stdiofor the math server andstreamable_httpfor the weather server.
Prerequisites
- Python 3.8+
- A Groq API key.
Setup and Running the Application
-
Clone the repository:
git clone <repository-url> cd MCP-server-tool-calling-langChain -
Install dependencies:
pip install -r requirment.txt -
Set up environment variables: Create a file named
.envin the project root and add your Groq API key:GROQ_API_KEY="your-groq-api-key" -
Run the Weather Server: In a terminal, run the weather server:
python weather.pyThis will start an HTTP server on
localhost:8000. -
Run the Client: In a separate terminal, run the client application:
python client.pyThe client will automatically start the
mathserver.pyas a subprocess and then connect to both the math and weather servers. It will then proceed to ask two questions to the LangChain agent to demonstrate the tool-calling capabilities. You should see output in the client's terminal showing the available tools, the response to the math question, and the response to the weather question.
README mirrored from the source repository 3 months ago. The original is authoritative.