> ## Documentation Index
> Fetch the complete documentation index at: https://docs.membit.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Langflow

> Integrate real-time context to your LangFlow AI workflows via Membit MCP.

![Cover Image](https://mintcdn.com/membit/4JB7OCBLDkpjkRT-/images/cover/langflow.png?fit=max\&auto=format\&n=4JB7OCBLDkpjkRT-\&q=85\&s=07a84f60c7d0c59a8717ecabfa797a8e)

Langflow is a visual framework for building multi-agent and RAG applications using a drag-and-drop interface. By integrating Membit with Langflow, you can enhance your AI agents with real-time social context, enabling them to access current trends, breaking news, and live conversations from across the web through a node-based visual workflow.

## Prerequisites

Before you begin, make sure you have:

* Langflow application installed ([download here](https://langflow.org))
* A Membit account with an API key [get your API key](https://docs.membit.ai/access-and-auth.md)
* Basic familiarity with Langflow's visual workflow builder
* A Google AI Studio API key for the chat model (optional)

## Setting Up Membit MCP Tools

Follow these steps to integrate Membit with your Langflow workflows:

**1. Create New Flow**

Open the Langflow application and click **Add New Flow** to start building a new workflow.

![Langflow main interface with add new flow button](https://mintcdn.com/membit/X3g2jASQcla7cFkX/images/langflow/new-flow.png?fit=max\&auto=format\&n=X3g2jASQcla7cFkX\&q=85\&s=c7a2c52aecee8b272fbf738abccede9d)

**2. Select Blank Flow**

Choose **Blank Flow** to start with a clean workspace where you can build your custom workflow.

![Langflow template selection showing blank flow option](https://mintcdn.com/membit/X3g2jASQcla7cFkX/images/langflow/blank-flow.png?fit=max\&auto=format\&n=X3g2jASQcla7cFkX\&q=85\&s=30a96bcfc223e5f9f1fb0c9cb50f3755)

**3. Search for MCP Tools**

In the component search bar, type "MCP tools" to find the Model Context Protocol integration component.

![Searching for MCP tools in Langflow component library](https://mintcdn.com/membit/X3g2jASQcla7cFkX/images/langflow/search-mcp-tools.png?fit=max\&auto=format\&n=X3g2jASQcla7cFkX\&q=85\&s=3cc7bb9dd4f7b3ae29d04c0fc7176117)

> [!TIP]
>
> The MCP Tools component enables Langflow to connect with external MCP servers like Membit, providing real-time context to your workflows.

**4. Configure MCP Server**

Configure the MCP Tools component by adding a new MCP server:

1. Click **Add MCP Server**
2. Select **STDIO** as the connection type

![MCP server configuration interface showing STDIO option](https://mintcdn.com/membit/X3g2jASQcla7cFkX/images/langflow/stdio.png?fit=max\&auto=format\&n=X3g2jASQcla7cFkX\&q=85\&s=7db4ac4fb168aaf7063c2c895cae0771)

**STDIO Configuration:**

* **Name**: `membit-mcp`
* **Command**: `npx -y mcp-remote https://mcp.membit.ai/mcp`
* **Argument 1**: `--header`
* **Argument 2**: `X-Membit-Api-Key:${MEMBIT_API_KEY}`
* **Environment Variables**: `MEMBIT_API_KEY <your-api-key>`

> [!WARNING]
>
> Replace `<your-api-key>` with your actual Membit API key. Keep this credential secure and don't share it with unauthorized users.

3. Click **Add Server** to save the configuration
4. Click **Toggle Tool Mode** to enable the MCP tools

![MCP tools configuration showing toggle tool mode option](https://mintcdn.com/membit/X3g2jASQcla7cFkX/images/langflow/tool-mode.png?fit=max\&auto=format\&n=X3g2jASQcla7cFkX\&q=85\&s=e325900fd886c6a6333dee3b031838a6)

## Building Your First Workflow

Now let's create a complete workflow that uses Membit's real-time context:

**1. Add Agent Component**

Search for "agent" in the component library and click **Add** to add an Agent component to your workflow.

![Agent component in Langflow component library](https://mintcdn.com/membit/X3g2jASQcla7cFkX/images/langflow/agent.png?fit=max\&auto=format\&n=X3g2jASQcla7cFkX\&q=85\&s=51559a98c60b2abd94b763a2ff7e30b9)

> [!TIP]
>
> The Agent component acts as the orchestrator, managing how your workflow processes requests and coordinates responses.

**2. Configure Agent Model**

Configure the Agent component with your preferred language model:

![Config agent component](https://mintcdn.com/membit/X3g2jASQcla7cFkX/images/langflow/config-agent.png?fit=max\&auto=format\&n=X3g2jASQcla7cFkX\&q=85\&s=90e660bcd921d8b7200eaa36b991024e)

* **Model Provider**: Select "Gemini 2.5 Flash" (or your preferred model)
* **API Key**: Set your Google AI Studio API key

> [!TIP]
>
> You can use other model providers like OpenAI, Anthropic, or local models depending on your preference and requirements.

**3. Connect MCP Tools**

Connect the **Membit MCP** component to the **Agent Tools** input to provide real-time context capabilities.

> [!TIP]
>
> This connection enables your agent to access Membit's real-time social media context when processing user queries.

**4. Add Chat Components**

Add Chat Input and Chat Output components to create an interactive interface:

1. **Chat Input** - To receive user messages
2. **Chat Output** - To display agent responses

![Chat components in Langflow showing input and output nodes](https://mintcdn.com/membit/X3g2jASQcla7cFkX/images/langflow/chat.png?fit=max\&auto=format\&n=X3g2jASQcla7cFkX\&q=85\&s=e29630d4a41ed2d2b93414befee9735d)

**Connection Pattern:**

* **Chat Input** → **Agent Input**
* **Agent Response** → **Chat Output**

![Complete Langflow workflow showing connected components](https://mintcdn.com/membit/X3g2jASQcla7cFkX/images/langflow/chat-with-agent.png?fit=max\&auto=format\&n=X3g2jASQcla7cFkX\&q=85\&s=9353a0a092eecfde2f2c9243780937eb)

**5. Test Your Workflow**

Click **Playground** to test your workflow with real-time context from Membit.

![Langflow playground interface for testing workflows](https://mintcdn.com/membit/X3g2jASQcla7cFkX/images/langflow/playground.png?fit=max\&auto=format\&n=X3g2jASQcla7cFkX\&q=85\&s=9fc4a0fe96a08dc8e023ca6151346cc3)

Try asking questions like:

* "Tell me about crypto trends"
* "What's happening in AI today?"
* "Give me the latest tech news"

![Langflow chat interface showing conversation with real-time context](https://mintcdn.com/membit/X3g2jASQcla7cFkX/images/langflow/talk-with-chat.png?fit=max\&auto=format\&n=X3g2jASQcla7cFkX\&q=85\&s=c61bab880a59163b313138bc104a5199)

Testing the workflow with real-time context from Membit

> [!TIP]
>
> If successful, your agent will respond with current information about your query topic, powered by Membit's real-time data feed.

## Troubleshooting

> [accordion] MCP Server STDIO Connection Issues
>
> **Problem**: Cannot establish STDIO connection to Membit MCP server
>
> **Solutions**:
>
> Verify `mcp-remote` is available: run `npx mcp-remote --version` in terminal
>
> Check the command format: `npx -y mcp-remote https://mcp.membit.ai/mcp`
>
> Ensure Node.js is properly installed and accessible to Langflow
>
> Verify environment variable `MEMBIT_API_KEY` is set correctly
>
> Try restarting Langflow after configuration changes

> [accordion] Tool Mode Not Working
>
> **Problem**: MCP tools don't appear or aren't accessible
>
> **Solutions**:
>
> Ensure "Toggle Tool Mode" is enabled after server configuration
>
> Verify the MCP server status shows as "Connected"
>
> Check server logs for connection errors or authentication failures
>
> Try removing and re-adding the MCP server configuration
>
> Confirm all arguments are in correct order: `--header` then `X-Membit-Api-Key:${MEMBIT_API_KEY}`

> [accordion] Agent Not Using Tools
>
> **Problem**: Agent doesn't utilize Membit tools in responses
>
> **Solutions**:
>
> Ensure MCP Tools component is properly connected to Agent Tools input
>
> Try more explicit prompts: "Use the available tools to search for..."
>
> Verify the chat model supports tool/function calling (Gemini 2.5 Flash recommended)
>
> Check if the agent has proper system instructions about tool usage
>
> Test with simpler, more direct questions about current events

> [accordion] Workflow Component Connection Errors
>
> **Problem**: Components won't connect or show connection errors
>
> **Solutions**:
>
> Verify component types match: Agent expects Tools input, not generic components
>
> Check that all required inputs are connected (Chat Input → Agent, Model → Agent)
>
> Ensure MCP Tools output is properly mapped to Agent Tools input
>
> Try reconnecting components in the correct order
>
> Restart the workflow and test connections step by step


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.