About Basics With Examples
Basics With Examples is an MCP server published by SantoshSanas in the Search category.
Six months or more without a commit doesn't mean the server is broken, but check the open issues before depending on it in production.
Install
git clone https://github.com/SantoshSanas/MCP_Basics_with_examplesThis 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 Basics With Examples
Powered by Claude · Grounded in docs
Security checks
- ✓README presentThe repository ships documentation.
5 checks have not been run yet.
README
MCP Demo
A demonstration of the Model Context Protocol (MCP) using LangChain and LangGraph. This project showcases how to create and connect to multiple MCP servers (Math and Weather) and use them with a ReAct agent powered by Groq.
Overview
This demo includes:
- Math Server: An MCP server that provides mathematical operations (add, subtract) using stdio transport
- Weather Server: An MCP server that provides weather information using streamable-http transport
- Client: A LangGraph ReAct agent that connects to both servers and can use their tools
Prerequisites
- Python 3.11 or higher
- Groq API key (get one from Groq)
Installation
- Clone or navigate to this directory:
cd MCP_Demo
- Install dependencies using pip:
pip install -r requirements.txt
Or if using uv:
uv sync
Setup
- Create a
.envfile in the project root:
GROQ_API_KEY=your_groq_api_key_here
- Make sure you have the required dependencies installed:
langchain-groqlangchain-mcp-adaptersmcplanggraphlangchainpython-dotenv
Running the Demo
Step 1: Start the Weather Server
In a separate terminal, start the weather server:
python weather.py
The weather server will run on http://localhost:8000/mcp using streamable-http transport.
Step 2: Run the Client
In another terminal, run the client:
python client.py
The client will:
- Connect to both the math server (via stdio) and weather server (via HTTP)
- Create a ReAct agent using Groq's Qwen model
- Execute two example queries:
- A math calculation: "What is (10 + 20) * 3?"
- A weather query: "What is the weather in Pune?"
Project Structure
MCP_Demo/
├── client.py # Main client that connects to MCP servers and runs the agent
├── mathserver.py # Math MCP server (stdio transport)
├── weather.py # Weather MCP server (streamable-http transport)
├── requirements.txt # Python dependencies
├── pyproject.toml # Project configuration
├── .env # Environment variables (create this)
└── README.md # This file
How It Works
-
MCP Servers: Both
mathserver.pyandweather.pyuse FastMCP to create MCP servers with different transport mechanisms:- Math server uses
stdiotransport (direct process communication) - Weather server uses
streamable-httptransport (HTTP-based)
- Math server uses
-
Client: The
client.pyusesMultiServerMCPClientfromlangchain-mcp-adaptersto:- Connect to multiple MCP servers simultaneously
- Expose their tools to a LangGraph ReAct agent
- Use Groq's Qwen model for reasoning and tool execution
-
Agent: The ReAct agent can autonomously:
- Understand user queries
- Decide which tools to use
- Execute tools from either server
- Provide natural language responses
Features
- Multi-server MCP integration
- Support for different transport mechanisms (stdio and HTTP)
- LangGraph ReAct agent for autonomous tool use
- Groq API integration for fast inference
- Example tools: Math operations and Weather queries
Troubleshooting
ModuleNotFoundError
If you encounter ModuleNotFoundError: No module named 'langchain', make sure you've installed all dependencies:
pip install -r requirements.txt
Weather Server Connection Issues
Make sure the weather server is running before starting the client. The client expects it at http://localhost:8000/mcp.
API Key Issues
Ensure your .env file contains a valid GROQ_API_KEY. You can get one from Groq Console.
License
This is a demo project for educational purposes.
README copy captured when this server was indexed; it may lag the repository. The original is authoritative.