Overview
LangGraph is a framework for building stateful, multi-actor applications with LLMs. Connect your Pylar MCP tools to LangGraph to give your agents access to your data through governed views.Prerequisites
- ✅ Python environment with LangGraph installed
- ✅ Pylar project with published MCP tools
- ✅ MCP HTTP Stream URL and Bearer Token from Pylar
Installation
Install the MCP Python client:Step 1: Get Your Pylar Credentials
- In Pylar, navigate to your project
- Click “Publish” in the right sidebar
- Copy both:
- MCP HTTP Stream URL:
https://mcp.publish.pylar.ai/mcp - Authorization Bearer Token: Your unique token
- MCP HTTP Stream URL:
Step 2: Connect to Pylar in LangGraph
Create an MCP client connection:Step 3: Integrate with LangGraph Agent
Add Pylar tools to your LangGraph agent:Step 4: Use in Your Workflow
Your LangGraph agent can now use Pylar tools:Benefits
- ✅ Stateful Workflows: Build complex agent workflows with data access
- ✅ Type Safety: Use typed tools in your Python code
- ✅ Centralized Control: Update views in Pylar, agents get updates
- ✅ Full Visibility: Monitor agent usage through Pylar Evals
- ✅ No SQL in Code: Keep SQL in Pylar, not in your agent code
Best Practices
Error Handling
Caching
Cache tool results when appropriate:Type Validation
Validate tool arguments:Troubleshooting
Issue: Connection errors
Solutions:- Verify Bearer Token is correct
- Check network connectivity
- Ensure MCP URL is correct
- Test connection with curl first
Issue: Tool not found
Solutions:- Verify tool name matches exactly
- Check tools are published in Pylar
- List available tools first
Next Steps
- Publishing Tools - Publish your tools
- Evals - Monitor LangGraph agent usage
- Other Builders - Connect to other platforms