docs/versioned_docs/version-1.11.0/Lfx/lfx-mcp.mdx
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import Icon from "@site/src/components/icon";
Use lfx-mcp to connect a coding agent to a running Langflow instance, and then build, validate, and run flows from your terminal.
Your MCP client starts lfx-mcp as a local standard stdio subprocess.
The server calls the Langflow REST API, so flows that the agent creates appear in the Langflow UI.
lfx-mcp differs from these other MCP options:
For Bob (IBM) and Claude Code, you can also use the guided setup in Langflow under Settings → <Icon name="Terminal" aria-hidden="true" /> Langflow MCP Client. For more information, see Langflow MCP Client for coding agents.
uv, or lfx installed with uv pip install lfxTo connect an agent and create a flow on your Langflow server, follow these steps:
Add lfx-mcp to your MCP client.
Use uvx --from lfx lfx-mcp.
There is no standalone lfx-mcp package on PyPI; the binary ships inside the lfx package.
To add the server in Claude Code, run:
claude mcp add langflow \
-e LANGFLOW_SERVER_URL=http://localhost:7860 \
-e LANGFLOW_API_KEY=<YOUR_LANGFLOW_API_KEY> \
-- uvx --from lfx lfx-mcp
To add the server in Claude Desktop or another stdio client, create an MCP server entry that runs lfx-mcp and sets the same environment variables:
{
"mcpServers": {
"langflow": {
"command": "uvx",
"args": ["--from", "lfx", "lfx-mcp"],
"env": {
"LANGFLOW_SERVER_URL": "http://localhost:7860",
"LANGFLOW_API_KEY": "<YOUR_LANGFLOW_API_KEY>"
}
}
}
}
{
"mcpServers": {
"langflow": {
"command": "lfx-mcp",
"env": {
"LANGFLOW_SERVER_URL": "http://localhost:7860",
"LANGFLOW_API_KEY": "<YOUR_LANGFLOW_API_KEY>"
}
}
}
}
On macOS, Claude Desktop stores this configuration in ~/Library/Application Support/Claude/claude_desktop_config.json.
| Variable | Description | Default |
|---|---|---|
LANGFLOW_SERVER_URL | URL of your Langflow instance | http://localhost:7860 |
LANGFLOW_API_KEY | Langflow API key | None |
If you omit LANGFLOW_API_KEY, the agent can call the login tool with your Langflow username and password.
Confirm that the server is registered.
claude mcp list
The output includes an entry similar to the following:
langflow: uvx --from lfx lfx-mcp
Start the agent, and then ask it to build a flow.
claude
Enter a prompt such as the following:
Create a simple agent chatbot flow in Langflow using OpenAI, validate the flow,
and then run it with the message "What is Langflow?"
The agent usually does the following:
search_component_types or describe_component_typecreate_flow_from_specvalidate_flowrun_flow, and then returns the responseThe new flow appears in the Langflow UI at your server URL.
The create_flow_from_spec tool accepts a compact text specification for nodes, edges, and configuration:
name: My Chatbot
description: A simple chatbot
nodes:
A: ChatInput
B: OpenAIModel
C: ChatOutput
edges:
A.message -> B.input_value
B.text_output -> C.input_value
config:
B.model_name: gpt-4o-mini
To confirm type names and input and output names before you write edges, use describe_component_type.
Connecting through component_as_tool enables tool mode for agent tool wiring.
The MCP client discovers the full tool list from the server. In addition to building and running flows, agents can do the following:
$N.field references between stepsnotify_done when edits are finished so that the Langflow UI refreshes