Skip to main content
Cover Image Enhance your VoltAgent 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:
  • Node.js 20 or higher installed
  • A Membit account with API access
  • Basic familiarity with VoltAgent agents and workflows
  • TypeScript knowledge (recommended)
You’ll need valid Membit API credentials and the MCP remote URL. If you don’t have access yet, get your API key to get started.

Installation

Install the required packages for VoltAgent and MCP integration:
VoltAgent works best with TypeScript and structured logging. Make sure your project is configured accordingly.

Quick Start

1

Import required modules

Import the necessary components for VoltAgent and MCP integration:
2

Configure MCP connection

Set up the MCP configuration to connect to Membit’s tools:
VoltAgent supports streamable HTTP transport for efficient MCP connections.
Replace <your-api-key> with your actual Membit API key. Keep this credential secure and don’t share it with unauthorized users.
3

Create your Membit-powered agent

Create a VoltAgent agent with Membit tools:
4

Initialize VoltAgent system

Create the VoltAgent system with your agent:
Your VoltAgent is now powered by real-time social media context from Membit!

Complete Example

Here’s a full working example that demonstrates the integration:

Troubleshooting

Problem: Cannot connect to Membit MCP serverSolutions:
  • Verify your API key
  • Check network connectivity and firewall settings
  • Ensure the streamable HTTP endpoint is accessible
  • Try increasing the timeout value in MCPConfiguration
Problem: mcpConfig.getTools() returns empty or failsSolutions:
  • Ensure MCP configuration is correct with proper server settings
  • Check that the Membit API key is valid
  • Verify the MCP server URL is accessible
  • Try initializing the MCP config in a try-catch block
Problem: Workflows fail or don’t execute properlySolutions:
  • Check agent dependencies and execution order
  • Verify all required agents are properly registered
  • Use structured logging to debug workflow steps
  • Ensure agents have access to required tools