docs: langflow server supports streamable http (#10891)

* initial-updates

* check-params

* server-params

* peer-review

* update-release-note

* remove-delete-endpoint-for-legacy
This commit is contained in:
Mendon Kissling
2025-12-05 11:35:13 -05:00
committed by GitHub
parent 05f1a588d4
commit e1dbefc21d
6 changed files with 57 additions and 31 deletions

View File

@ -364,14 +364,22 @@ The following endpoints are most often used when contributing to the Langflow co
* MCP servers: The following endpoints are for managing Langflow MCP servers and MCP server connections.
They aren't typically called directly; instead, they are used to drive internal functionality in the Langflow frontend and when running flows that call MCP servers.
* HEAD `/v1/mcp/sse`: Health check for MCP SSE.
* GET `/v1/mcp/sse`: Open SSE stream for MCP server events.
* POST `/v1/mcp/`: Post messages to the MCP server.
Langflow MCP servers support both streamable HTTP and SSE protocols.
* HEAD `/v1/mcp/streamable`: Health check for streamable HTTP MCP.
* GET `/v1/mcp/streamable`: Open streamable HTTP connection for MCP server.
* POST `/v1/mcp/streamable`: Post messages to the MCP server via streamable HTTP.
* DELETE `/v1/mcp/streamable`: Close streamable HTTP connection.
* HEAD `/v1/mcp/sse` (LEGACY): Health check for MCP SSE.
* GET `/v1/mcp/sse` (LEGACY): Open SSE stream for MCP server events.
* POST `/v1/mcp/` (LEGACY): Post messages to the MCP server.
* GET `/v1/mcp/project/{project_id}`: List MCP-enabled tools and project auth settings.
* HEAD `/v1/mcp/project/{project_id}/sse`: Health check for project SSE.
* GET `/v1/mcp/project/{project_id}/sse`: Open project-scoped MCP SSE.
* POST `/v1/mcp/project/{project_id}`: Post messages to project MCP server.
* POST `/v1/mcp/project/{project_id}/` (trailing slash): Same as above.
* HEAD `/v1/mcp/project/{project_id}/streamable`: Health check for project streamable HTTP MCP.
* GET `/v1/mcp/project/{project_id}/streamable`: Open project-scoped streamable HTTP connection.
* POST `/v1/mcp/project/{project_id}/streamable`: Post messages to project MCP server via streamable HTTP.
* DELETE `/v1/mcp/project/{project_id}/streamable`: Close project streamable HTTP connection.
* HEAD `/v1/mcp/project/{project_id}/sse` (LEGACY): Health check for project SSE.
* GET `/v1/mcp/project/{project_id}/sse` (LEGACY): Open project-scoped MCP SSE.
* POST `/v1/mcp/project/{project_id}` (LEGACY): Post messages to project MCP server.
* PATCH `/v1/mcp/project/{project_id}`: Update MCP settings for flows and project auth settings.
* POST `/v1/mcp/project/{project_id}/install`: Install MCP client config for Cursor/Windsurf/Claude (local only).
* GET `/v1/mcp/project/{project_id}/installed`: Check which clients have MCP config installed.

View File

@ -19,8 +19,8 @@ The **MCP Tools** component connects to an MCP server so that a [Langflow agent]
This component has two modes, depending on the type of server you want to access:
* [Connect to a non-Langflow MCP server](#mcp-stdio-mode) with a JSON configuration file, a server start command (STDIO mode), or a Streamable HTTP/SSE URL to access tools provided by external, non-Langflow MCP servers.
* [Connect to a Langflow MCP server](#mcp-sse-mode) to use flows from your [Langflow projects](/concepts-flows#projects) as MCP tools. You must use SSE transport because Langflow MCP servers currently only support SSE.
* [Connect to a non-Langflow MCP server](#mcp-stdio-mode) with a JSON configuration file, server start command, or HTTP/SSE URL to access tools provided by external, non-Langflow MCP servers.
* [Connect to a Langflow MCP server](#mcp-http-mode) to use flows from your [Langflow projects](/concepts-flows#projects) as MCP tools.
### Connect to a non-Langflow MCP server {#mcp-stdio-mode}
@ -33,9 +33,8 @@ This component has two modes, depending on the type of server you want to access
* **JSON**: Paste the MCP server's JSON configuration object into the field, including required and optional parameters that you want to use, and then click **Add Server**.
* **STDIO**: Enter the MCP server's **Name**, **Command**, and any **Arguments** and **Environment Variables** the server uses, and then click **Add Server**.
For example, to start a [Fetch](https://github.com/modelcontextprotocol/servers/tree/main/src/fetch) server, the **Command** is `uvx mcp-server-fetch`.
* **Streamable HTTP/SSE**: Enter the MCP server's **Name**, **URL**, and any **Headers** and **Environment Variables** the server uses, and then click **Add Server**.
Langflow automatically tries Streamable HTTP transport first, and falls back to Server-Sent Events (SSE) transport if Streamable HTTP is not available.
The URL depends on the specific MCP server you're connecting to. For information about connecting to a Langflow MCP server, see [Connect a Langflow MCP server](#mcp-sse-mode).
* **HTTP/SSE**: Enter your MCP server's **Name**, **URL**, and any **Headers** and **Environment Variables** the server uses, and then click **Add Server**.
The default **URL** for Langflow MCP servers is `http://localhost:7860/api/v1/mcp/project/PROJECT_ID/streamable` or `http://localhost:7860/api/v1/mcp/streamable`. For more information, see [Connect to a Langflow MCP server](#mcp-http-mode).
<PartialMcpNodeTip />
@ -67,22 +66,27 @@ This component has two modes, depending on the type of server you want to access
8. If you want the agent to be able to use more tools, repeat these steps to add more tools components with different servers or tools.
### Connect a Langflow MCP server {#mcp-sse-mode}
### Connect a Langflow MCP server {#mcp-http-mode}
Every Langflow project runs a separate MCP server that exposes the project's flows as MCP tools.
For more information about your projects' MCP servers, including exposing flows as MCP tools, see [Use Langflow as an MCP server](/mcp-server).
To leverage flows-as-tools, use the **MCP Tools** component to connect to a project's MCP server endpoint.
Langflow MCP servers currently only support Server-Sent Events (SSE) transport, so you must use **Streamable HTTP/SSE** mode to connect to them.
Langflow MCP servers support both the **streamable HTTP** transport and **Server-Sent Events (SSE)** as a fallback.
1. Add an **MCP Tools** component to your flow, click <Icon name="Plus" aria-hidden="true"/> **Add MCP Server**, and then select **Streamable HTTP/SSE** mode.
2. In the **URL** field, modify the default address to point at your Langflow server's MCP endpoint. The default value for other Langflow installations is `http://localhost:7860/api/v1/mcp/sse`.
In SSE mode, all flows available from the targeted server are treated as tools.
To leverage flows-as-tools, use the **MCP Tools** component to connect to a project's MCP endpoint:
1. Add an **MCP Tools** component to your flow, click <Icon name="Plus" aria-hidden="true"/> **Add MCP Server**, and then select **HTTP/SSE** mode.
2. In the **MCP URL** field, enter your Langflow server's MCP endpoint.
- For project-specific servers: `http://localhost:7860/api/v1/mcp/project/PROJECT_ID/streamable`
- For global MCP server: `http://localhost:7860/api/v1/mcp/streamable`
- Default for Langflow Desktop: `http://localhost:7868/`
All flows available from the targeted server are treated as tools.
3. In the [component's header menu](/concepts-components#component-menus), enable **Tool Mode** so you can use the component with an agent.
4. Connect the **MCP Tools** component's **Toolset** port to an **Agent** component's **Tools** port.
5. If not already present in your flow, make sure you also attach **Chat Input** and **Chat Output** components to the **Agent** component.
![MCP component with SSE mode enabled](/img/component-mcp-sse-mode.png)
![MCP component with HTTP/SSE mode enabled](/img/component-mcp-sse-mode.png)
6. Test your flow to make sure the agent uses your flows to respond to queries. Open the **Playground**, and then enter a prompt that uses a flow that you connected through the **MCP Tools** component.

View File

@ -11,6 +11,8 @@ Langflow integrates with the [Model Context Protocol (MCP)](https://modelcontext
This page describes how to use Langflow as an MCP server that exposes your flows as [tools](https://modelcontextprotocol.io/docs/concepts/tools) that [MCP clients](https://modelcontextprotocol.io/clients) can use when generating responses.
Langflow MCP servers support both the **streamable HTTP** transport and **Server-Sent Events (SSE)** as a fallback.
For information about using Langflow as an MCP client and managing MCP server connections within flows, see [Use Langflow as an MCP client](/mcp-client).
## Prerequisites
@ -144,7 +146,7 @@ For example:
"command": "uvx",
"args": [
"mcp-proxy",
"http://LANGFLOW_SERVER_ADDRESS/api/v1/mcp/project/PROJECT_ID/sse"
"http://LANGFLOW_SERVER_ADDRESS/api/v1/mcp/project/PROJECT_ID/streamable"
]
}
}
@ -168,7 +170,7 @@ For example:
"command": "uvx",
"args": [
"mcp-proxy",
"http://LANGFLOW_SERVER_ADDRESS/api/v1/mcp/project/PROJECT_ID/sse"
"http://LANGFLOW_SERVER_ADDRESS/api/v1/mcp/project/PROJECT_ID/streamable"
],
"env": {
"KEY": "VALUE"
@ -334,7 +336,7 @@ The default address is `http://localhost:6274`.
- **Command**: `uvx`
- **Arguments**: Enter the following list of arguments, separated by spaces. Replace the values for `YOUR_API_KEY`, `LANGFLOW_SERVER_ADDRESS`, and `PROJECT_ID` with the values from your Langflow MCP server. For example:
```bash
mcp-proxy --headers x-api-key YOUR_API_KEY http://LANGFLOW_SERVER_ADDRESS/api/v1/mcp/project/PROJECT_ID/sse
mcp-proxy --headers x-api-key YOUR_API_KEY http://LANGFLOW_SERVER_ADDRESS/api/v1/mcp/project/PROJECT_ID/streamable
```
</TabItem>
@ -351,9 +353,9 @@ The default address is `http://localhost:6274`.
<TabItem value="None" label="None">
- **Transport Type**: Select **SSE**.
- **URL**: Enter the Langflow MCP server's `sse` endpoint. For example:
- **URL**: Enter the Langflow MCP server's endpoint. For example:
```bash
http://localhost:7860/api/v1/mcp/project/d359cbd4-6fa2-4002-9d53-fa05c645319c/sse
http://localhost:7860/api/v1/mcp/project/d359cbd4-6fa2-4002-9d53-fa05c645319c/streamable
```
</TabItem>

View File

@ -9,10 +9,20 @@ import PartialParams from '@site/docs/_partial-hidden-params.mdx';
The **MCP Tools** component connects to a Model Context Protocol (MCP) server and exposes the MCP server's functions as tools for Langflow agents to use to respond to input.
In addition to publicly available MCP servers and your own custom-built MCP servers, you can connect Langflow MCP servers, which allow your agent to use your Langflow flows as tools.
To do this, use the **MCP Tools** component's [SSE mode](/mcp-client#mcp-sse-mode) to connect to your Langflow project's MCP server at the `/api/v1/mcp/sse` endpoint.
To do this, use the **MCP Tools** component's [HTTP/SSE mode](/mcp-client#mcp-http-mode) to connect to your Langflow project's MCP server.
For more information, see [Use Langflow as an MCP client](/mcp-client) and [Use Langflow as an MCP server](/mcp-server).
## MCP Tools parameters
| Name | Type | Description |
|------|------|-------------|
| mcp_server | String | Input parameter. The MCP server to connect to. Select from previously configured servers or add a new one. |
| tool | String | Input parameter. The specific tool to execute from the connected MCP server. Leave blank to allow access to all tools. |
| use_cache | Boolean | Input parameter. Enable caching of MCP server and tools to improve performance. Default: `false`. |
| verify_ssl | Boolean | Input parameter. Enable SSL certificate verification for HTTPS connections. Default: `true`. |
| response | DataFrame | Output parameter. [`DataFrame`](/data-types#dataframe) containing the response from the executed tool. |
<details>
<summary>Earlier versions of the MCP Tools component</summary>

View File

@ -54,11 +54,12 @@ For all changes, see the [Changelog](https://github.com/langflow-ai/langflow/rel
### New features and enhancements
- Support for streamable HTTP protocol for MCP clients
- Support for streamable HTTP protocol for MCP clients and servers
When using Langflow as an MCP client, you can now connect to MCP servers with [streamable HTTP transport](https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#streamable-http).
Langflow now supports [streamable HTTP transport](https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#streamable-http) for both MCP clients and servers.
When using Langflow as an [MCP client](/mcp-client), you can connect to MCP servers with streamable HTTP transport.
When using Langflow as an [MCP server](/mcp-server), clients can connect using streamable HTTP transport.
SSE transport is still supported as a fallback for backwards compatibility.
Streamable HTTP transport support for Langflow as an MCP server is planned for a future release.
- Webhook authentication

View File

@ -231,7 +231,7 @@ If Claude for Desktop doesn't use your server's tools correctly, try explicitly
"command": "PATH_TO_UVX",
"args": [
"mcp-proxy",
"http://LANGFLOW_SERVER_ADDRESS/api/v1/mcp/project/PROJECT_ID/sse"
"http://LANGFLOW_SERVER_ADDRESS/api/v1/mcp/project/PROJECT_ID/streamable"
]
}
}
@ -250,7 +250,7 @@ If Claude for Desktop doesn't use your server's tools correctly, try explicitly
"-y",
"supergateway",
"--sse",
"http://LANGFLOW_SERVER_ADDRESS/api/v1/mcp/project/PROJECT_ID/sse"
"http://LANGFLOW_SERVER_ADDRESS/api/v1/mcp/project/PROJECT_ID/streamable"
]
}
}
@ -267,7 +267,8 @@ This is a known issue when using MCP Tools with browser navigation actions, such
This issue occurs because the MCP server runs from a Python process, which prevents it from opening browser windows in WSL or Windows.
To work around this issue, use the standalone MCP server approach documented in the [Playwright MCP repository](https://github.com/microsoft/playwright-mcp?tab=readme-ov-file#standalone-mcp-server).
After the server is up and running, you can add it as an SSE server in Langflow.
After the server is up and running, you can add it as an HTTP/SSE server in Langflow.
For other browser navigation tools, see the provider's documentation for specific troubleshooting guidance.
### "No tools or prompts connected" on MCP servers in mixed Windows/WSL environments