Overview
This guide shows you how to add Agentflare observability to your existing MCP implementation. In most cases, you only need to change the server URL your agent connects to - that’s it!Migration Scenarios
1. Standard MCP Client Migration
Before: Direct MCP Connection
After: Through Agentflare Proxy
- ✅ Changed transport from
StdioServerTransport
toHTTPTransport
- ✅ Updated URL to Agentflare proxy
- ✅ Added authorization header
- ✅ Optionally added reasoning metadata
- ✅ Same import package (
@modelcontextprotocol/sdk
) - ✅ Same
Client
class - ✅ Same
callTool
method - ✅ Same tool arguments and responses
2. HTTP Transport Migration
Before: Direct HTTP Connection
After: Proxy-Enhanced with Full Observability
- Add your MCP server to Agentflare dashboard
- Get the proxy URL for your server
- Update
baseUrl
to proxy URL - Update
Authorization
header to use Agentflare API key
3. Multi-Server Setup Migration
Before: Manual Multi-Server Management
After: Centralized Observability
Migration Checklist
1
Create Agentflare Account
Sign up at app.agentflare.com
2
Add Your MCP Servers
- Navigate to Dashboard → Tool Servers → Add Server
- Add each of your MCP servers
- Get proxy URLs for each server
3
Get API Credentials
- Navigate to Dashboard → Settings → API Keys
- Create an API key
- Add to environment variables:
4
Update Client URLs
Replace direct server URLs with Agentflare proxy URLs
5
Update Authentication
Replace server authentication with Agentflare API key
6
Test Migration
- Run your existing tool calls
- Verify they work as expected
- Check Agentflare dashboard for observability data
7
Add Reasoning (Optional)
Enhance observability by adding reasoning metadata:
Environment Variables Setup
Before Migration
After Migration
Framework-Specific Migrations
LangChain
- Before
- After
Python
- Before
- After
Migration Benefits
Minimal Code Changes
Usually just URL and auth header changes
Instant Observability
Immediately see tool calls, performance, and costs
Enhanced Debugging
Rich error context and reasoning capture
Zero Downtime
Migrate without interrupting service
Rollback Plan
If you need to rollback, simply change the URL back:Troubleshooting Migration
Authentication Errors
Authentication Errors
Issue: Getting 401 unauthorized errors after migrationSolution:
- Verify AGENTFLARE_API_KEY is set correctly
- Check API key hasn’t expired
- Ensure Authorization header format is
Bearer YOUR_KEY
Tool Calls Not Appearing
Tool Calls Not Appearing
Issue: Tool calls work but don’t appear in Agentflare dashboardSolution:
- Verify you’re using the proxy URL, not direct server URL
- Check network connectivity to Agentflare
- Look for errors in console logs
- Wait a few seconds for data buffering
Performance Degradation
Performance Degradation
Issue: Tool calls seem slower after migrationSolution:
- Check network latency to Agentflare proxy
- Verify tool server is responding quickly
- Contact Agentflare support for performance optimization
- Agentflare adds < 1ms overhead typically
Server Connection Issues
Server Connection Issues
Issue: Cannot connect to tool servers through proxySolution:
- Verify tool server configuration in Agentflare dashboard
- Check tool server is running and accessible
- Test direct connection before debugging proxy
- Review server logs in Agentflare dashboard
Next Steps
Features Overview
Explore all observability features
Best Practices
Optimization techniques
MCP Proxy
Advanced proxy configuration
Tool Reasoning
Add reasoning to tool calls
Most migrations can be completed in under 15 minutes with zero downtime. The proxy is designed to be a transparent layer that adds observability without changing your application logic.