Langflow MCP Server
Langflow MCP Server
MCP Server for interacting with the Langflow API via a natural language interface.
Overview
This server exposes Langflow functionalities as "tools" that can be understood and invoked by a Large Language Model (LLM) through an MCP Client. It allows for programmatic interaction with flows, projects, components, and more.
Project Structure
src/langflowmcp_server/app.py: The main FastMCP application entry point. Manages server lifecycle and session handling.src/langflowmcp_server/langflow_api_client.py: A dedicated client for all communication with the Langflow REST API.src/langflowmcp_server/langflow_models.py: Pydantic models for all Langflow API data structures.src/langflowmcp_server/tools/: Directory containing the tool implementations, organized by functionality (e.g.,flows.py,execution.py).
Setup
Clone the repository.
Ensure Python 3.10+ and
uvare installed.Create a virtual environment:
uv venv source .venv/bin/activateInstall dependencies:
uv pip install -e .Set up your Langflow connection details in a
.envfile (see.env.example). You will need your Langflow URL and an API key.
Running the Server
You can run the server directly for stdio-based communication:
python -m src.langflowmcp_server.app