> ## 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.

<img src="https://mintcdn.com/membit/4JB7OCBLDkpjkRT-/images/cover/langflow.png?fit=max&auto=format&n=4JB7OCBLDkpjkRT-&q=85&s=07a84f60c7d0c59a8717ecabfa797a8e" alt="Cover Image" className="rounded-lg" noZoom width="1402" height="463" data-path="images/cover/langflow.png" />

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](/access-and-auth)
* 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:

<Steps>
  <Step title="Create New Flow">
    Open the Langflow application and click **Add New Flow** to start building a new workflow.

    <Frame>
      <img src="https://mintcdn.com/membit/X3g2jASQcla7cFkX/images/langflow/new-flow.png?fit=max&auto=format&n=X3g2jASQcla7cFkX&q=85&s=c7a2c52aecee8b272fbf738abccede9d" alt="Langflow main interface with add new flow button" width="1362" height="704" data-path="images/langflow/new-flow.png" />
    </Frame>
  </Step>

  <Step title="Select Blank Flow">
    Choose **Blank Flow** to start with a clean workspace where you can build your custom workflow.

    <Frame>
      <img src="https://mintcdn.com/membit/X3g2jASQcla7cFkX/images/langflow/blank-flow.png?fit=max&auto=format&n=X3g2jASQcla7cFkX&q=85&s=30a96bcfc223e5f9f1fb0c9cb50f3755" alt="Langflow template selection showing blank flow option" width="2550" height="1606" data-path="images/langflow/blank-flow.png" />
    </Frame>
  </Step>

  <Step title="Search for MCP Tools">
    In the component search bar, type "MCP tools" to find the Model Context Protocol integration component.

    <Frame>
      <img src="https://mintcdn.com/membit/X3g2jASQcla7cFkX/images/langflow/search-mcp-tools.png?fit=max&auto=format&n=X3g2jASQcla7cFkX&q=85&s=3cc7bb9dd4f7b3ae29d04c0fc7176117" alt="Searching for MCP tools in Langflow component library" width="1562" height="862" data-path="images/langflow/search-mcp-tools.png" />
    </Frame>

    <Check>
      The MCP Tools component enables Langflow to connect with external MCP servers like Membit, providing real-time context to your workflows.
    </Check>
  </Step>

  <Step title="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

    <Frame>
      <img src="https://mintcdn.com/membit/X3g2jASQcla7cFkX/images/langflow/stdio.png?fit=max&auto=format&n=X3g2jASQcla7cFkX&q=85&s=7db4ac4fb168aaf7063c2c895cae0771" alt="MCP server configuration interface showing STDIO option" width="1364" height="1134" data-path="images/langflow/stdio.png" />
    </Frame>

    **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.
    </Warning>

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

    <Frame>
      <img src="https://mintcdn.com/membit/X3g2jASQcla7cFkX/images/langflow/tool-mode.png?fit=max&auto=format&n=X3g2jASQcla7cFkX&q=85&s=e325900fd886c6a6333dee3b031838a6" alt="MCP tools configuration showing toggle tool mode option" width="982" height="924" data-path="images/langflow/tool-mode.png" />
    </Frame>
  </Step>
</Steps>

## Building Your First Workflow

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

<Steps>
  <Step title="Add Agent Component">
    Search for "agent" in the component library and click **Add** to add an Agent component to your workflow.

    <Frame>
      <img src="https://mintcdn.com/membit/X3g2jASQcla7cFkX/images/langflow/agent.png?fit=max&auto=format&n=X3g2jASQcla7cFkX&q=85&s=51559a98c60b2abd94b763a2ff7e30b9" alt="Agent component in Langflow component library" width="1338" height="618" data-path="images/langflow/agent.png" />
    </Frame>

    <Check>
      The Agent component acts as the orchestrator, managing how your workflow processes requests and coordinates responses.
    </Check>
  </Step>

  <Step title="Configure Agent Model">
    Configure the Agent component with your preferred language model:

    <Frame>
      <img src="https://mintcdn.com/membit/X3g2jASQcla7cFkX/images/langflow/config-agent.png?fit=max&auto=format&n=X3g2jASQcla7cFkX&q=85&s=90e660bcd921d8b7200eaa36b991024e" alt="Config agent component" width="562" height="1004" data-path="images/langflow/config-agent.png" />
    </Frame>

    * **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.
    </Tip>
  </Step>

  <Step title="Connect MCP Tools">
    Connect the **Membit MCP** component to the **Agent Tools** input to provide real-time context capabilities.

    <Check>
      This connection enables your agent to access Membit's real-time social media context when processing user queries.
    </Check>
  </Step>

  <Step title="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

    <Frame>
      <img src="https://mintcdn.com/membit/X3g2jASQcla7cFkX/images/langflow/chat.png?fit=max&auto=format&n=X3g2jASQcla7cFkX&q=85&s=e29630d4a41ed2d2b93414befee9735d" alt="Chat components in Langflow showing input and output nodes" width="884" height="604" data-path="images/langflow/chat.png" />
    </Frame>

    **Connection Pattern:**

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

    <Frame>
      <img src="https://mintcdn.com/membit/X3g2jASQcla7cFkX/images/langflow/chat-with-agent.png?fit=max&auto=format&n=X3g2jASQcla7cFkX&q=85&s=9353a0a092eecfde2f2c9243780937eb" alt="Complete Langflow workflow showing connected components" width="1774" height="1320" data-path="images/langflow/chat-with-agent.png" />
    </Frame>
  </Step>

  <Step title="Test Your Workflow">
    Click **Playground** to test your workflow with real-time context from Membit.

    <Frame>
      <img src="https://mintcdn.com/membit/X3g2jASQcla7cFkX/images/langflow/playground.png?fit=max&auto=format&n=X3g2jASQcla7cFkX&q=85&s=9fc4a0fe96a08dc8e023ca6151346cc3" alt="Langflow playground interface for testing workflows" width="984" height="556" data-path="images/langflow/playground.png" />
    </Frame>

    Try asking questions like:

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

    <Frame caption="Testing the workflow with real-time context from Membit">
      <img src="https://mintcdn.com/membit/X3g2jASQcla7cFkX/images/langflow/talk-with-chat.png?fit=max&auto=format&n=X3g2jASQcla7cFkX&q=85&s=c61bab880a59163b313138bc104a5199" alt="Langflow chat interface showing conversation with real-time context" width="1610" height="1532" data-path="images/langflow/talk-with-chat.png" />
    </Frame>

    <Check>
      If successful, your agent will respond with current information about your query topic, powered by Membit's real-time data feed.
    </Check>
  </Step>
</Steps>

## Troubleshooting

<AccordionGroup>
  <Accordion title="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>

  <Accordion title="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>

  <Accordion title="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>

  <Accordion title="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
  </Accordion>
</AccordionGroup>
