Integrate Langflow with MCP
Langflow integrates with the Model Context Protocol (MCP). This allows you to use your Langflow flows as tools in client applications that support the MCP, or extend Langflow with the MCP server component to access MCP servers.
You can use Langflow as an MCP server with any MCP client.
For configuring interactions between Langflow flows and MCP tools, see Name and describe your flows for agentic use.
To connect MCP Inspector to Langflow for testing and debugging flows, see Install MCP Inspector to test and debug flows.
Access all of your flows as tools
Tool names must contain only letters, numbers, underscores, and dashes. Tool names cannot contain spaces. To re-name flows in the Langflow UI, click Flow Name > Edit Details.
Connect an MCP client to Langflow to use your flows as tools.
- Install Cursor or Claude for Desktop.
- Install uv to run
uvx
commands.uvx
is included withuv
in the Langflow package. - Optional: Install an LTS release of Node.js to run
npx
commands. For an examplenpx
server, see Connect an Astra DB MCP server to Langflow. - Create at least one flow, and note your host. For example,
http://127.0.0.1:7860
.
- Cursor
- Claude for Desktop
In Cursor, you can configure a Langflow server in the same way as other MCP servers. For more information, see the Cursor MCP documentation.
- Open Cursor, and then go to Cursor Settings.
- Click MCP, and then click Add New Global MCP Server. Cursor's MCP servers are listed as JSON objects.
- To add a Langflow server, add an entry for your Langflow server's
/v1/mcp/sse
endpoint. This example assumes the default Langflow server address ofhttp://127.0.0.1:7860
.
_10{_10 "mcpServers": {_10 "langflow": {_10 "url": "http://127.0.0.1:7860/api/v1/mcp/sse"_10 }_10 }_10}
- Save the
mcp.json
file, and then click the Reload icon. - Your Langflow server is now available to Cursor as an MCP server, and all of its flows are registered as tools. You can now use your flows as tools in Cursor. Cursor determines when to use tools based on your queries, and requests permissions when necessary.
In Claude for Desktop, you can configure a Langflow server in the same way as other MCP servers. For more information, see the Claude for Desktop MCP documentation.
- Open Claude for Desktop, and then go to the program settings. For example, on the MacOS menu bar, click Claude, and then select Settings.
- In the Settings dialog, click Developer, and then click Edit Config.
This creates a
claude_desktop_config.json
file if you don't already have one. - Add the following code to
claude_desktop_config.json
.
Your args
may differ for your uvx
and Python
installations. To find your system paths, do the following:
- To find the
uvx
path, runwhich uvx
in your terminal. ReplacePATH/TO/UVX
with theuvx
path from your system. - To find the
python
path, runwhich python
in your terminal. ReplacePATH/TO/PYTHON
with the Python path from your system.
This command assumes the default Langflow server address of http://127.0.0.1:7860
.
_12{_12 "mcpServers": {_12 "langflow": {_12 "command": "/bin/sh",_12 "args": ["-c", "PATH/TO/UVX --python PATH/TO/PYTHON mcp-sse-shim@latest"],_12 "env": {_12 "MCP_HOST": "http://127.0.0.1:7860",_12 "DEBUG": "true"_12 }_12 }_12 }_12}
This code adds a new MCP server called langflow
and starts the mcp-sse-shim package using the specified Python interpreter and uvx.
- Restart Claude for Desktop. Your new tools are available in your chat window, and Langflow is available as an MCP server.
- To view your tools, click the icon.
- To view a list of connected MCP servers, which includes langflow-mcp-server, click the icon.
You can now use your flows as tools in Claude for Desktop.
Claude determines when to use tools based on your queries, and will request permissions when necessary.
For more information, see Debugging in Claude for Desktop.
Name and describe your flows for agentic use
MCP clients like Claude for Desktop and Cursor "see" Langflow as a single MCP server, with all of your flows listed as tools.
This can confuse agents, who don't know that flow adbbf8c7-0a34-493b-90ea-5e8b42f78b66
is a Document Q&A flow for a specific text file.
To prevent this behavior, name and describe your flows clearly for agentic use. Imagine your names and descriptions as function names and code comments, with a clear statement of what problem they solve.
For example, you have created a Document Q&A flow that loads a sample resume for an LLM to chat with, and you want Cursor to use the tool.
- Click Flow name, and then select Edit Details.
- The Name field should make it clear what the flow does, both to a user and to the agent. For example, name it
Document QA for Resume
. - The Description field should include a description of what the flow does. For example, describe the flow as
OpenAI LLM Chat with Alex's resume.
The Endpoint Name field does not affect the agent's behavior. - To see how an MCP client understands your flow, in Cursor, examine the MCP Servers. The tool is listed as:
_10document_qa_for_resume_10e967f47d-6783-4bab-b1ea-0aaa554194a3: OpenAI LLM Chat with Alex's resume.
Your flow name and description provided the agent with a clear purpose for the tool.
- Ask Cursor a question specifically about the resume, such as
What job experience does Alex have?
_10I'll help you explore a resume using the Document QA for Resume flow, which is specifically designed for analyzing resumes._10Let me call this tool.
- Click Run tool to continue. The agent requests permissions when necessary.
_10Based on the resume, here's a comprehensive breakdown of the experience:
- Ask about a different resume. You've provided enough information in the description for the agent to make the correct decision:
_10I notice you're asking about Emily's job experience._10Based on the available tools, I can see there is a Document QA for Resume flow that's designed for analyzing resumes._10However, the description mentions it's for "Alex's resume" not Emily's. I don't have access to Emily's resume or job experience information.
Install MCP Inspector to test and debug flows
MCP inspector is the standard tool for testing and debugging MCP servers.
Use MCP Inspector to monitor your Langflow server's flows, and understand how they are being consumed by the MCP.
To install and run MCP inspector, follow these steps:
- Install an LTS release of Node.js.
- To install and start MCP inspector, in a terminal window, run the following command:
_10npx @modelcontextprotocol/inspector
MCP inspector starts by default at http://localhost:5173
.
Optionally, specify a proxy port when starting MCP Inspector:
_10SERVER_PORT=9000 npx -y @modelcontextprotocol/inspector
- In the browser, navigate to MCP Inspector.
- To inspect the Langflow server, enter the values for the Langflow server.
- In the Transport Type field, select SSE.
- In the URL field, enter the Langflow server's
/mcp/sse
endpoint. For a default deployment, the URL ishttp://127.0.0.1:7860/api/v1/mcp/sse
.
- Click Connect. MCP Inspector connects to the Langflow server.
- To confirm the connection, click the Tools tab. The Langflow server's flows are listed as tools, which confirms MCP Inspector is connected. In the Tools tab, you can monitor how your flows are being registered as tools by MCP, and run flows with input values.
To quit MCP Inspector, in the terminal where it's running, enter Ctrl+C
.