
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
1
Import required modules
Import the necessary components for CrewAI and MCP integration:
2
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.3
Create your Membit-powered agent
Use the MCPServerAdapter to connect Membit tools to your CrewAI agent:
4
Define your analysis task
Create a task that leverages Membit’s real-time data:
5
Execute your crew
Create and run your CrewAI crew:
Your CrewAI agent is now powered by real-time social media context from Membit!
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