Issue with Langflow MCP Settings Disappearing
When using MCP (Model Context Protocol) with Langflow, you may encounter an issue where MCP settings suddenly disappear. This article explains in detail the causes of this problem and solutions.
Reasons MCP Settings Disappear
Langflow's MCP settings are usually saved to the local file system. However, the settings can be lost in the following situations.
Problems during Docker Image Redeployment
When operating Langflow in containers such as Docker, MCP configuration files are saved to the local storage inside the container, so when a new image is deployed, previous settings disappear.
Also, the same issue occurs during scale down/up.
This is because the container file system is ephemeral by nature.
Solution: Setting LANGFLOW_CONFIG_DIR
To solve this problem, you need to set the LANGFLOW_CONFIG_DIR environment variable to save MCP configuration files to persistent storage such as NAS.
How to Configure
When launching Langflow, set the environment variable as follows.
export LANGFLOW_CONFIG_DIR=/path/to/persistent/storage
Summary
The issue with Langflow MCP settings disappearing originates from the configuration file storage location. By properly setting the LANGFLOW_CONFIG_DIR environment variable, you can avoid this problem. Be sure to use persistent storage, especially in production environments or scalable deployments.
Note
This article was confirmed with Langflow 1.5.1.