# MCP Client Examples
Ready-to-use client examples for connecting to your MCP server with different frameworks.
## π **Client Examples**
- `fastmcp_client.py` - Direct FastMCP client connection
- `langgraph_client.py` - LangGraph integration with tool orchestration
## π **Quick Start**
### **1. FastMCP Client (Simple)**
```bash
# Install dependencies
pip install fastmcp httpx
# Run the example
python examples/fastmcp_client.py
```
**Use case**: Direct tool testing, simple integrations, debugging
### **2. LangGraph Client (Advanced)**
```bash
# Install dependencies
pip install langgraph httpx
# Run the example
python examples/langgraph_client.py
```
**Use case**: Complex workflows, agent orchestration, production systems
## π§ **Configuration**
**Update connection settings for your deployment:**
```python
# Both files - update these URLs
server_url = "http://localhost:3000" # Local development
# server_url = "http://0.0.0.0:4001" # Custom port
# server_url = "https://your-mcp.apps.cluster.com" # Production OpenShift
```
## π **What Each Example Shows**
### **FastMCP Client:**
- β
Basic server connection
- β
Tool discovery and listing
- β
Direct tool execution
- β
Error handling
- β
Response parsing
### **LangGraph Client:**
- β
Agent workflow orchestration
- β
Multi-tool coordination
- β
State management
- β
Complex business logic
- β
Production-ready patterns
## π― **Customization for Your Domain**
**Update the examples with your tools:**
```python
# Replace template tool calls with your domain tools
# Instead of:
result = await client.call_tool("multiply_numbers", {"a": 5, "b": 3})
# Use your domain tools:
result = await client.call_tool("execute_domain_query", {
"query_type": "performance_analysis",
"parameters": {"quarter": "Q3", "region": "EMEA"}
})
```
## π **Testing Your Server**
```bash
# Test server health first
curl http://localhost:3000/health
# Run client examples to verify tool integration
python examples/fastmcp_client.py
python examples/langgraph_client.py
```
## π **Learn More**
- **FastMCP**: Simple, direct MCP connections
- **LangGraph**: Advanced agent workflows and orchestration
- **MCP Protocol**: https://modelcontextprotocol.io/