Skip to content

How-ToGPU

How to Use Langflow as an MCP Server for Local AI Tools

Langflow can turn the flows in a project into MCP tools that apps such as LM Studio and Cursor can call. We cover choosing which flows to expose, naming them so agents pick the right one, connecting a client with an API key, and setting timeouts.

By , Systems & Technical Editor

5 min read

How to Use Langflow as an MCP Server for Local AI Tools

Once you've built a Langflow flow, you can do more than chat with it in the Playground: Langflow can expose every flow in a project as a tool over the Model Context Protocol (MCP). An MCP client such as LM Studio or Cursor can then call those tools when it answers a question, which is a useful way to wrap work you designed visually (document search, a specialised agent, or a multi-step workflow) and use it from the apps you already talk to. If MCP itself is new, our MCP explained primer covers the protocol. This guide is about Langflow's MCP server. 13.x, checked on 2 December 2026.

What you need

  • A running Langflow instance, either Desktop or the Python package, as in our guide to using Langflow with Ollama.

  • At least one flow in a project that has a Chat Output component. Langflow's MCP docs say this component is required for a flow to be used as an MCP tool.

  • A Langflow API key, created under your user icon > Settings > Langflow API Keys. New projects in Langflow 1.13.2 use API key authentication by default, even if automatic login to the UI is switched on; signing in to the UI does not authenticate an external MCP client.

  • An MCP-compatible client, such as LM Studio 0.3.17 or later, or Cursor. Keeping it on the same PC as Langflow is simplest, and is required for Langflow's Auto install option.

Step 1: Choose which flows are tools

When you create a Langflow project, Langflow automatically adds it to the MCP server and makes its flows available as tools. You can change that:

  1. On the Projects page, click the MCP Server tab (or, while editing a flow, click Share, then MCP Server).

  2. The Flows/Tools section lists the flows currently served as tools.

  3. Click Edit Tools, then tick or clear the checkbox in the first column for each flow.

  4. Close the dialog to save.

You can stop automatic registration for new projects by setting LANGFLOW_ADD_PROJECTS_TO_MCP_SERVERS to false.

Step 2: Give tools clear names and descriptions

By default, a flow's tool name is its flow ID (a UUID such as adbbf8c7-0a34-493b-90ea-5e8b42f78b66), which tells an agent nothing about what the flow does. Langflow's docs treat names and descriptions as the agent's equivalent of function names and comments:

  • In the same Edit Tools dialog, click the Tool or Description field you want to change.

  • Use a name that states what the flow does, such as document_qa_for_resume.

  • Write a description that covers the specific action, including any limits. Langflow's example is "A flow for analyzing Emily's resume." In that example, an agent might use the tool for questions about Emily, and skip it for questions about someone else.

The MCP client treats one Langflow project as a single MCP server, with every enabled flow listed as a tool, so vague names can lead the agent to pick the wrong flow.

Step 3: Connect a client

Langflow fills in a JSON snippet for you. The default server address is http://localhost:7860. The default MCP transport is streamable HTTP at the /streamable path, with Server-Sent Events as a fallback.

  1. In Langflow, open the MCP Server tab and check the project's authentication settings (Edit Auth). For API key authentication, use a key belonging to the project owner. Click Generate API key if you want a new one inserted into the snippet, or replace YOUR_API_KEY with an existing key.

  2. Click the JSON tab and copy the snippet for your operating system.

  3. In your MCP client, add a new MCP server and paste the snippet. In Cursor, that's Cursor Settings > MCP > Add New Global MCP Server, which opens mcp.json. In LM Studio, starting with version 0.3.17, switch to the Program tab in the right-hand sidebar, then click Install > Edit mcp.json. LM Studio follows Cursor's mcp.json notation.

  4. Restart the client if it doesn't pick up the change, and confirm that the Langflow server appears in its list of MCP servers.

The generated snippet in Langflow's docs uses uvx to run mcp-proxy with streamable HTTP transport, passing the x-api-key header and a URL of the form:

http://LANGFLOW_SERVER_ADDRESS/api/v1/mcp/project/PROJECT_ID/streamable

Langflow fills in the server address and project ID automatically. Keep the authentication arguments from the generated snippet. If you need extra environment variables for the mcp-proxy process, add an env object of key-value pairs, but don't put API keys there; those belong under args.

For Cursor, Claude or Windsurf installed on the same computer as Langflow, the Auto install tab can write the configuration for you: find the client and click Add. Auto install only works for those local clients; if the client is remote or needs extra variables, use the JSON snippet.

Timeouts and long-running tools

Langflow's default tool-execution timeout is 180 seconds. The limit is decided in this order: a per-component Tool Execution Timeout (seconds) field on an MCP Tools component in a flow (a value of 0 disables that override and falls back to the global setting); then the LANGFLOW_MCP_TOOL_EXECUTION_TIMEOUT environment variable (default 180); then, if that and LANGFLOW_MCP_SERVER_TIMEOUT are both unset, 180 seconds. To allow longer tool calls, raise the global variable or the per-component field above 180. If LANGFLOW_MCP_SERVER_TIMEOUT is set higher than the tool-execution timeout, the server timeout becomes the actual limit.

A note on safety

MCP servers can run code, read files and use the network. LM Studio's MCP documentation warns you never to install MCP servers from untrusted sources, and that some servers written for large cloud models can use so many tokens that a local model struggles. Langflow's MCP page also points out that an agent may ask your permission before it uses a flow tool, depending on the client. Expose only the flows you actually want a client to be able to run, and turn the rest off in Edit Tools.

If you want another local agent that already talks to Ollama without a visual canvas, our Hermes Agent with Ollama guide is the command-line alternative. For a comparison of Langflow with the archived Flowise project, see Flowise vs Langflow.

The bottom line

To use Langflow as an MCP server, build at least one flow that includes a Chat Output component, open the project's MCP Server tab, enable the flows you want as tools, and give each a clear name and description instead of the default UUID. Then copy the JSON snippet (it already includes your API key and the streamable HTTP URL) into an MCP client such as LM Studio or Cursor. New projects in Langflow 1.13.2 require API key authentication for MCP clients even if the UI signs you in automatically.

Sources

  1. 01Langflow documentation, Use Langflow as an MCP server
  2. 02Langflow documentation, Quickstart
  3. 03Langflow documentation, Environment variables
  4. 04LM Studio documentation, Use MCP Servers

About the author

Marcus Thorne

Systems & Technical Editor

Marcus writes Forge PC's step-by-step build, troubleshooting and system optimisation guides. His background spans Windows kernel and power-state diagnostics, UEFI/BIOS configuration, NVMe storage arrays, ATX 3.1 power delivery and running local AI and LLM workloads on consumer graphics cards.

More from Marcus Thorne

Read next

How to Use Langflow With Ollama to Build Local AI Agents on Your PC

How-To

How to Use Langflow With Ollama to Build Local AI Agents on Your PC

Langflow lets you build AI agents and workflows by wiring components together on a canvas. We show how to install it, connect it to a local Ollama model, build a simple agent with tools, call the flow from your own scripts and fix common problems.

Marcus Thorne6 min

How to Update Your Wi-Fi Driver in Windows 11

How-To

How to Update Your Wi-Fi Driver in Windows 11

Updating your Wi-Fi driver can fix dropouts and missing 6GHz or Wi-Fi 7 features. Using Microsoft's and Intel's own pages, we show how to find your adapter, use Windows Update, install Intel's latest Wi-Fi package, find drivers for older or non-Intel cards, and roll back a driver that makes things worse.

Marcus Thorne5 min

GSmartControl vs GNOME Disks: Which Linux Drive-Health Tool Should You Use?

Versus

GSmartControl vs GNOME Disks: Which Linux Drive-Health Tool Should You Use?

GSmartControl and GNOME Disks are the two free graphical ways to check drive health on Linux, but they're built for different jobs. Using the developers' own pages and GNOME's help, we compare SMART detail, self-tests, benchmarking, partitioning, NVMe notes, platforms and which one to reach for when a drive looks unwell.

Callum Reid4 min