Enhance your CrewAI applications with real-time social media context from Membit. This integration allows your AI agents to access up-to-the-minute discussions, trends, and insights from platforms like X (Twitter), Farcaster, and more.
Prerequisites
Before you begin, ensure you have:- Python 3.10 or higher installed
- A Membit account with API access
- Basic familiarity with CrewAI agents and crews
- Node.js installed (for MCP remote client)
Installation
Install the required packages for CrewAI and MCP integration:Quick Start
Configure MCP server parameters
Set up the connection to Membit’s MCP server:
Make sure you have
mcp-remote installed globally via npm for this to work.Create your Membit-powered agent
Use the MCPServerAdapter to connect Membit tools to your CrewAI agent:
Complete Example
Here’s a full working example that demonstrates the integration:Troubleshooting
MCP Connection Issues
MCP Connection Issues
Problem: Cannot connect to Membit MCP serverSolutions:
- Verify
mcp-remoteis installed:npm list -g mcp-remote - Check your API key
- Ensure Node.js is properly installed and accessible
- Test connectivity with
npx mcp-remotedirectly
Tool Loading Failures
Tool Loading Failures
Problem: MCPServerAdapter fails to load toolsSolutions:
- Ensure the MCP server parameters are correct
- Check network connectivity and firewall settings
- Verify your Membit API credentials are valid
- Try running the MCP server manually to test connection
Agent Execution Issues
Agent Execution Issues
Problem: Agents fail to use Membit tools effectivelySolutions:
- Be explicit in task descriptions about which tools to use
- Set
allow_code_execution=Falseunless specifically needed - Use verbose mode to see tool usage during execution
- Ensure agents have clear, specific roles and goals