Description:
When serving a flow that contains an MCP Tools component using lfx (the lightweight standalone flow server), the
The component always fails because it unconditionally attempts to fetch the MCP server configuration from the database via
the full Langflow API.
Root cause:
In update_tool_list(), the code tries to import langflow.api.v2.mcp.get_server and open a database session via
session_scope(). In a standalone LFX environment, neither the full Langflow package nor a database is available, so an
ImportError or connection error is raised before execution can reach the existing fallback logic.
The fallback to server_config_from_value (the config embedded in the flow JSON) already exists in
resolve_mcp_config(), but it is never reached because the failure happens upstream.
Expected behavior:
When running in LFX standalone mode, the MCP Tools component should gracefully fall back to the server configuration
embedded in the flow JSON (server_config_from_value) instead of failing with an import or database error.
Actual behavior:
The component raises an ImportError ("Langflow MCP server functionality is not available. This feature requires the
full Langflow installation."), and the flow cannot run.
Steps to reproduce:
- Create a flow with an MCP Tools component configured with a server
- Export/save the flow JSON
- Serve the flow using lfx
- Trigger the MCP Tools component
Impact: MCP Tools components are completely unusable in lfx standalone mode, even when the server config is already
embedded in the flow JSON.
Description:
When serving a flow that contains an MCP Tools component using lfx (the lightweight standalone flow server), the
The component always fails because it unconditionally attempts to fetch the MCP server configuration from the database via
the full Langflow API.
Root cause:
In update_tool_list(), the code tries to import langflow.api.v2.mcp.get_server and open a database session via
session_scope(). In a standalone LFX environment, neither the full Langflow package nor a database is available, so an
ImportError or connection error is raised before execution can reach the existing fallback logic.
The fallback to server_config_from_value (the config embedded in the flow JSON) already exists in
resolve_mcp_config(), but it is never reached because the failure happens upstream.
Expected behavior:
When running in LFX standalone mode, the MCP Tools component should gracefully fall back to the server configuration
embedded in the flow JSON (server_config_from_value) instead of failing with an import or database error.
Actual behavior:
The component raises an ImportError ("Langflow MCP server functionality is not available. This feature requires the
full Langflow installation."), and the flow cannot run.
Steps to reproduce:
Impact: MCP Tools components are completely unusable in lfx standalone mode, even when the server config is already
embedded in the flow JSON.