Skip to content
,

Langflow Guide (2026): Install, Build AI Agents, Use Ollama and Serve Flows as MCP

9–13 minutes
Woman in a living room holding a tablet with a LANGFLOW card, hook Langflow agents no code

Langflow is a free, open source visual builder for AI agents and workflows.

You drag components such as a chat input, a language model, a vector store and a few tools onto a canvas, wire them together, test them in a built-in playground and then call the finished flow from your own app through an API or as an MCP server.

It runs on your own PC, in Docker or on a server, and it works with cloud models such as OpenAI, Anthropic and Gemini as well as local models through Ollama. Every component is Python code you can open and edit, so it suits both beginners who want a canvas and developers who want control.

This guide shows how to install Langflow (Desktop, Python package or Docker), sign in with the new default login, build your first agent, connect Ollama, serve a flow as an API, expose a project as an MCP server for Cursor or Claude, and fix the most common problems.

It follows the official README and documentation as of November 2026 (Langflow 1.13.4 on PyPI).

TL;DR

  • What: a visual, open source (MIT) builder for AI agents, RAG apps and multi-step workflows.
  • Easiest install: Langflow Desktop for Windows or macOS 13+.
  • Python install: uv pip install langflow (Python 3.10 to 3.14), then uv run langflow run.
  • Open: http://127.0.0.1:7860 and sign in as langflow with your LANGFLOW_SUPERUSER_PASSWORD.
  • Use it from apps: each flow has a /api/v1/run/FLOW_ID endpoint and each project can be an MCP server.
  • Local models: point the Ollama component at http://127.0.0.1:11434.

What Langflow Does

Langflow gives you a canvas where each box is a component and each line passes data from one component to the next. A simple chatbot is three boxes: Chat Input, a language model and Chat Output.

A research agent adds tools such as a URL fetcher, a calculator or an MCP server. A document assistant adds a file loader, a text splitter, an embeddings model and a vector store.

  • Visual builder to start quickly and change flows without rewriting code.
  • Source code access, so you can open any component and customise it in Python.
  • Interactive Playground that shows the agent’s reasoning and tool calls step by step.
  • Multi-agent orchestration with conversation memory and retrieval.
  • Deploy as an API or export a flow as JSON for a Python app.
  • Deploy as an MCP server, so tools like Cursor and Claude can call your flows.
  • Observability through LangSmith, Langfuse and similar tools.

Langflow is MIT licensed, so you can use it commercially. If you prefer a more app-centred platform with built-in knowledge bases and a hosted cloud, read our Dify guide too.

Install Langflow

There are four official ways to run Langflow. Pick one.

Option Best for Notes
Langflow Desktop Beginners on Windows or macOS All dependencies included; no Shareable Playground or Voice Mode
Python package Full control and the newest features Python 3.10 to 3.14 with uv
Docker Isolation and servers Image langflowai/langflow:latest
From source Contributors make run_cli in a clone

Option 1: Langflow Desktop

  1. Open the download page at langflow.org/desktop and click Download Langflow. It asks for contact details before the download starts.
  2. macOS (13 or later): mount the disk image and drag Langflow into Applications.
  3. Windows: double-click the .msi file in Downloads and follow the wizard.
  4. If Windows shows “C++ Build Tools Required!”, follow the prompt to install Microsoft C++ Build Tools, then open Langflow again.
  5. Open the app and create your first flow.

Option 2: Python package (recommended for developers)

You need Python 3.10 to 3.14 and uv. The docs list a dual-core CPU and 2 GB RAM as the minimum, and a multi-core CPU with 4 GB or more as recommended.

  1. Create a virtual environment: uv venv langflow-env
  2. Activate it: source langflow-env/bin/activate on Linux or macOS, or langflow-env\Scripts\activate on Windows.
  3. Install Langflow: uv pip install langflow. Use uv pip install langflow-base if you want the same UI and API without the bundled provider extensions.
  4. Create a .env file with a strong password (see the next section).
  5. Start it: uv run langflow run --env-file .env. The first start can take a few minutes.
  6. Open http://127.0.0.1:7860 in your browser.
uv venv langflow-env
source langflow-env/bin/activate
uv pip install langflow
uv run langflow run --env-file .env

Option 3: Docker

docker run -p 7860:7860 \
  -e LANGFLOW_AUTO_LOGIN=false \
  -e LANGFLOW_SUPERUSER_PASSWORD=YOUR_STRONG_PASSWORD \
  langflowai/langflow:latest

Then open http://localhost:7860/. Official Docker images require a sign-in by default.

Sign In: the New Default Login

Older tutorials say Langflow opens straight to the canvas. That changed. Since Langflow 1.13, official release packages and Docker images turn off automatic login, so you must set a superuser password before the first start.

Put this in a .env file next to where you run Langflow:

LANGFLOW_AUTO_LOGIN=false
LANGFLOW_SUPERUSER_PASSWORD=YOUR_STRONG_PASSWORD
  • Username: langflow, unless you set LANGFLOW_SUPERUSER.
  • Password: the value of LANGFLOW_SUPERUSER_PASSWORD.
  • Already exported the variable? Then plain uv run langflow run works without --env-file.
  • Development branches still keep automatic login on, which is why some videos look different.

If you are upgrading an older install that used automatic login, follow the upgrade steps in the authentication docs before switching, so you don’t lose access to existing flows.

Build Your First Agent Flow

The fastest way to learn the canvas is the built-in Simple Agent template. It connects an Agent component to Chat Input, Chat Output and a URL tool, and the Agent has a Calculator tool turned on.

  1. Click New Flow and pick the Simple Agent template.
  2. Click Setup Provider in the Agent component and add your model provider (for example an OpenAI, Anthropic or Gemini API key, or Ollama).
  3. Pick your model from the Agent’s Language Model dropdown.
  4. Click Playground to run the flow.
  5. Test the Calculator: ask “I want to add 4 and 4.” The Playground shows the agent choosing the Calculator and an action such as evaluate_expression.
  6. Test the URL tool: ask about current news. The agent calls the URL tool’s fetch_content action and summarises the page.
  7. Close the Playground and try adding another tool or component.

Any component can become a tool for an agent, including MCP servers. The agent decides which tool to call based on the question, so give tools clear names and descriptions.

Useful components to know

Component What it does
Chat Input / Chat Output Text in and out; Chat Output is required for MCP tools
Agent An LLM that plans and calls tools
Language model components OpenAI, Anthropic, Gemini, Ollama and more
URL, Calculator, MCP Tools Tools the agent can call
File, Split Text Load and chunk documents
Embeddings + vector store Store chunks for retrieval (RAG)

Use Local Models With Ollama

To keep everything on your own machine, use the Ollama bundle. Install Ollama first with our Ollama commands cheat sheet and pull a model such as ollama pull llama3.2.

  1. Add the Ollama component to your flow.
  2. Set Base URL to http://127.0.0.1:11434 (the default Ollama address).
  3. Pick a model in Model Name, for example llama3.2:latest. Click Refresh if the list is empty.
  4. Use the Language Model output (not Model Response) when you want the Ollama model to drive an Agent.
  5. For RAG, add Ollama Embeddings with an embedding model such as all-minilm:latest and connect it to your vector store.

If you see “model requires more system memory than is available”, the model is too big for your RAM. Choose a smaller model; our Open WebUI + Ollama setup guide lists sizes that fit common GPUs.

Docker tip: inside a container, 127.0.0.1 means the container itself. Use http://host.docker.internal:11434 on Docker Desktop, or put Ollama and Langflow on the same Docker network.

Run a Flow From Your App (API)

Langflow is also a runtime. Every flow can be called through the /run endpoint.

  1. Create a Langflow API key: click your user icon, then Settings, Langflow API Keys, Add New, name it and click Create API Key.
  2. Store it in an environment variable: export LANGFLOW_API_KEY="sk..."
  3. Open the flow, click Share and then API access for ready-made Python, JavaScript and curl snippets with your flow ID filled in.
  4. Send a request with the x-api-key header.
curl --request POST \
  --url "http://localhost:7860/api/v1/run/FLOW_ID" \
  --header "Content-Type: application/json" \
  --header "x-api-key: $LANGFLOW_API_KEY" \
  --data '{"output_type": "chat", "input_type": "chat", "input_value": "Hello"}'

For production, run a stable Langflow instance on a server rather than your laptop, and keep the API key secret.

Turn a Project Into an MCP Server

Langflow can act as both an MCP client (use MCP servers as tools inside flows) and an MCP server (expose your flows as tools to other apps). Each project gets its own MCP server automatically, and its flows become tools.

  1. Make sure each flow has a Chat Output component. It is required for a flow to work as an MCP tool.
  2. Open the MCP Server tab on the Projects page, or click Share and then MCP Server inside a flow.
  3. Click Edit Tools and tick the flows you want to expose.
  4. Rename each tool and write a clear description. The default tool name is the flow ID, which tells an agent nothing.
  5. Open the JSON tab, copy the snippet for your OS and paste it into your client’s MCP config (for example Cursor’s mcp.json).
{
  "mcpServers": {
    "PROJECT_NAME": {
      "command": "uvx",
      "args": ["mcp-proxy", "--transport", "streamablehttp",
        "--headers", "x-api-key", "YOUR_API_KEY",
        "http://localhost:7860/api/v1/mcp/project/PROJECT_ID/streamable"]
    }
  }
}

New projects use API key authentication by default. The server uses streamable HTTP at /streamable, with SSE as a fallback. Tool calls time out after 180 seconds unless you raise LANGFLOW_MCP_TOOL_EXECUTION_TIMEOUT.

To stop new projects being added automatically, set LANGFLOW_ADD_PROJECTS_TO_MCP_SERVERS=false. For more servers to plug in, see our best MCP servers list.

Docker Compose With PostgreSQL

The default database is SQLite. For a server, the repo ships a Compose file with PostgreSQL and persistent volumes.

  1. Clone the repo: git clone https://github.com/langflow-ai/langflow.git
  2. Go to the example: cd langflow/docker_example
  3. Create .env with two different strong passwords:
    LANGFLOW_SUPERUSER_PASSWORD='SUPERUSER_PASSWORD'
    POSTGRES_PASSWORD='POSTGRES_PASSWORD'
  4. Start it: docker compose up
  5. Open http://localhost:7860/ and sign in as langflow.

Keep the single quotes in .env so characters such as $ survive. PostgreSQL stays on the private Compose network and is not published to your host.

Langflow vs Dify vs Other Agent Builders

Tool Style Best for
Langflow Python-first canvas, MIT Developers who want editable components, API and MCP output
Dify App platform with knowledge bases Teams shipping chat apps with a hosted option
Goose / OpenHands Terminal and coding agents Agents that edit code, not visual flows
LocalAI Local OpenAI-compatible server Serving models that Langflow then calls

Langflow pairs well with a local model server such as LocalAI or Ollama. For coding agents rather than flows, see our Goose guide.

Troubleshooting

Problem Fix
Login screen, no password known Set LANGFLOW_SUPERUSER_PASSWORD and restart; user is langflow
“An API key must be passed as query or header” Create a Langflow API key and send it as x-api-key; see the Troubleshooting docs page
“C++ Build Tools Required!” (Windows Desktop) Install Microsoft C++ Build Tools or Visual Studio
Install fails on Python version Use Python 3.10 to 3.14; check with python --version
Ollama models list is empty Check Ollama is running and the Base URL; click Refresh
Ollama unreachable from Docker Use host.docker.internal:11434 instead of 127.0.0.1
MCP client sees tools named like UUIDs Rename tools and add descriptions in Edit Tools
MCP tool call times out Raise LANGFLOW_MCP_TOOL_EXECUTION_TIMEOUT above 180
Slow first start Normal; the first launch can take a few minutes

FAQ

Is Langflow free?

Yes. Langflow is open source under the MIT license, so you can self-host it and use it commercially. You still pay for any cloud model APIs you connect.

Does Langflow work offline with local models?

Yes. Use the Ollama components for chat and embeddings, and all model calls stay on your machine.

What is the default Langflow username and password?

The username is langflow. There is no default password in official releases; you set it with LANGFLOW_SUPERUSER_PASSWORD.

Which port does Langflow use?

Port 7860, at http://127.0.0.1:7860.

What is the difference between langflow and langflow-base?

langflow includes curated provider extensions. langflow-base has the same UI and API without them. Both use the langflow command.

Can I use Langflow with Cursor or Claude?

Yes. Each project is an MCP server; copy the JSON snippet from the MCP Server tab into your client’s config.

Does Langflow Desktop have every feature?

Almost. The Shareable Playground and Voice Mode are not available in Desktop.

Is Langflow the same as LangChain?

No. Langflow is a separate visual builder and runtime. It is often used with LangChain-style components but has its own app, API and MCP server.

Sources

Free weekly email

Get new AI guides every week

One short weekly email with our newest local AI, ComfyUI and AI tool guides. No spam, no pop-ups, just the good stuff.

Free. Unsubscribe anytime in one click. We only use your email to send this newsletter. See our privacy policy.

Woman in a living room holding a tablet with a LANGFLOW card, hook Langflow agents no code