About McpLangchain
McpLangchain is an MCP server in the Agents category: lang chain mcp servers.
Install
git clone https://github.com/arunatuoh/McpLangchainThis 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 McpLangchain
Powered by Claude · Grounded in docs
Security checks
- ✓README presentThe repository ships documentation.
5 checks have not been run yet.
README
MCP LangChain Integration Project
A Model Context Protocol (MCP) implementation with multiple servers and LangChain integration for AI agent interactions.
🚀 Project Overview
This project demonstrates how to create MCP servers and integrate them with LangChain agents using the GROQ API. It includes:
- Weather Server: A simple weather service that returns weather information
- Math Server: A mathematical operations service with add and multiply functions
- Client: A LangChain agent that can interact with both servers
📁 Project Structure
MCPLangchain/
├── weather.py # Weather MCP server
├── mathserver.py # Math MCP server
├── client.py # LangChain client with agent
├── requirements.txt # Python dependencies
├── .env # Environment variables (API keys)
└── README.md # This file
🛠️ Installation
- Clone and setup the environment:
cd MCPLangchain
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables:
Create a
.envfile with your GROQ API key:
GROQ_API_KEY="your_groq_api_key_here"
🏃♂️ Running the Project
1. Start the Weather Server
python weather.py
The weather server will start on port 8001 with streamable-http transport.
2. Start the Math Server (in a separate terminal)
python mathserver.py
The math server uses stdio transport for direct communication.
3. Run the Client
python client.py
This will:
- Connect to both MCP servers
- Create a LangChain agent with GROQ model
- Execute math and weather queries
🔧 Configuration
Weather Server (weather.py)
- Transport: streamable-http
- Port: 8000
- Function:
get_weather(location)- Returns weather info for any location
Math Server (mathserver.py)
- Transport: stdio
- Functions:
add(a, b)- Adds two integersmultiply(a, b)- Multiplies two integers
Client (client.py)
- Model: GROQ Qwen-QWQ-32B
- Agent Type: React Agent
- Capabilities: Can invoke tools from both servers
📋 Dependencies
mcp- Model Context Protocol implementationlangchain-mcp-adapters- LangChain MCP integrationlangchain-groq- GROQ API integrationlanggraph- LangGraph for agent creationuvicorn- ASGI server for HTTP transportpython-dotenv- Environment variable management
🎯 Example Usage
The client demonstrates two main interactions:
- Math Operations: "What is 100 + 200?"
- Weather Queries: "What's the weather in Noida?"
Import Errors
Ensure all dependencies are installed:
pip install -r requirements.txt
API Key Issues
Verify your .env file contains the correct GROQ API key:
GROQ_API_KEY="gsk_your_actual_key_here"
🚀 Next Steps
- Add more MCP servers (database, file system, etc.)
- Implement more complex agent workflows
- Add authentication and security features
- Create a web interface for the agent
📚 Resources
Note: This project demonstrates the power of MCP for creating modular, composable AI services that can be easily integrated with LangChain agents.
README copy captured when this server was indexed; it may lag the repository. The original is authoritative.