Skip to main content

Integrate Langflow with MCP (Model context protocol)

Langflow integrates with the Model Context Protocol (MCP). This allows you to use your Langflow flows as tools in other applications that support the MCP, or extend Langflow with the MCP stdio component to access MCP servers.

You can use Langflow as an MCP server with any MCP client. For example purposes, this guide presents two ways to interact with the MCP:

Access all of your flows as tools from Claude for Desktop

  1. Install Claude for Desktop.

  2. Install uv so that you can run uvx commands.

  3. Create at least one flow, and note your host. For example, http://127.0.0.1:7863.

  4. Open Claude for Desktop, and then go to the program settings. For example, on the MacOS menu bar, click Claude, and then select Settings.

  5. 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.

  6. Add the following code to claude_desktop_config.json. Your args may differ for your uvx and Python installations. To find the correct paths:

    • For uvx: Run which uvx in your terminal
    • For Python: Run which python in your terminal

Replace /path/to/uvx and /path/to/python with the paths from your system:


_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:7864",
_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.

  1. Restart Claude for Desktop. Your new tools are available in your chat window. Click the tools icon to see a list of your flows.

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.

Connect an Astra DB MCP server to Langflow

Use the MCP stdio component to connect Langflow to a Datastax Astra DB MCP server.

  1. Install an LTS release of Node.js.
  2. Create an OpenAI API key.
  3. Create an Astra DB Serverless (Vector) database, if you don't already have one.
  4. Get your database's Astra DB API endpoint and an Astra DB application token with the Database Administrator role. For more information, see Generate an application token for a database.
  5. Add your Astra DB application token and Astra API endpoint to Langflow as global variables.
  6. Create a Simple agent starter project.
  7. Remove the URL tool and replace it with an MCP stdio component component. The flow should look like this: MCP stdio component
  8. In the MCP stdio component, in the MCP command field, add the following code:

_10
npx -y @datastax/astra-db-mcp

  1. In the Agent component, add your OpenAI API key.
  2. Open the Playground. Langflow is now connected to your Astra DB database through the MCP. You can use the MCP to create, read, update, and delete data from your database.
Search