MCP Client
An MCP (Model Context Protocol) client that connects to an MCP server and uses LangChain to create an agent that can perform mathematical operations.
Overview
This client application:
- Connects to an MCP server running on http://localhost:8000/mcp
- Loads available tools from the server (math operations: add, sub, mul, div)
- Creates a LangChain agent powered by Claude Sonnet 4.5
- Executes natural language queries like "what's (3 + 5) x 12?"
Prerequisites
- Python 3.13+
- An MCP server running on
http://localhost:8000/mcp
Installation```bash
uv sync
## Running```bash
uv run main.py
Architecture
The client uses:
- MCP (Model Context Protocol): For server-client communication via HTTP
- LangChain: For agent creation and orchestration
- Claude Sonnet 4.5: As the language model backend
Dependencies
mcp: Model Context Protocol librarylangchain: LangChain frameworklangchain-mcp-adapters: Adapters for MCP integration with LangChain
