Trace and monitor your MCP agents with Langfuse, Laminar, and LangSmith
🔍 mcp_agent_run ├── 💬 LLM Call (gpt-4) │ ├── Input: "Help me analyze the sales data" │ └── Output: "I'll help you analyze the sales data..." ├── 🔧 Tool: read_file │ ├── Input: {"path": "sales_data.csv"} │ └── Output: "CSV content loaded..." ├── 🔧 Tool: analyze_data │ ├── Input: {"data": "...", "analysis_type": "summary"} │ └── Output: "Analysis complete..." └── 💬 Final Response └── "Based on the sales data analysis..."
pip install langfuse
export LANGFUSE_PUBLIC_KEY="pk-lf-..." export LANGFUSE_SECRET_KEY="sk-lf-..."
# Langfuse automatically initializes when mcp_use is imported import mcp_use from mcp_use import MCPAgent agent = MCPAgent(llm=your_llm, ...) result = await agent.run("Your query") # Automatically traced!
# Required LANGFUSE_PUBLIC_KEY="pk-lf-..." LANGFUSE_SECRET_KEY="sk-lf-..." # Optional - for self-hosted instances LANGFUSE_HOST="https://your-langfuse-instance.com" # Optional - disable Langfuse MCP_USE_LANGFUSE="false"
pip install lmnr
export LAMINAR_PROJECT_API_KEY="your-api-key-here"
# Laminar automatically initializes when mcp_use is imported import mcp_use from mcp_use import MCPAgent agent = MCPAgent(llm=your_llm, ...) result = await agent.run("Your query") # Automatically traced!
# Required LAMINAR_PROJECT_API_KEY="your-api-key-here" # Optional - disable Laminar MCP_USE_LAMINAR="false"
# Disable Langfuse export MCP_USE_LANGFUSE="false" # Disable Laminar export MCP_USE_LAMINAR="false"
# Install the required packages pip install langfuse # For Langfuse pip install lmnr # For Laminar
# Check your environment variables echo $LANGFUSE_PUBLIC_KEY echo $LANGFUSE_SECRET_KEY echo $LAMINAR_PROJECT_API_KEY
MCP_USE_LANGFUSE
MCP_USE_LAMINAR
logging.basicConfig(level=logging.DEBUG)
LANGFUSE_HOST
export LANGFUSE_HOST="https://your-langfuse-instance.com"
Sign Up
Get API Keys
.env
Visualize
Was this page helpful?