docs: Add usage guide for MCP stdio and SSE components (#6133)

* docs: Add usage guide for MCP stdio and SSE components

* docs: Remove example URL for MCP SSE component
This commit is contained in:
Mendon Kissling 2025-02-05 13:24:52 -05:00 committed by GitHub
commit 8ab74e037a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 23 additions and 1 deletions

View file

@ -260,6 +260,22 @@ This component allows you to call the Serper.dev Google Search API.
This component connects to a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) server over `stdio` and exposes its tools as Langflow tools to be used by an Agent component.
To use the MCP stdio component, follow these steps:
1. Add the [MCP stdio](/components-tools#mcp-stdio) component to your workflow, and connect it to an agent. The flow looks like this:
![MCP stdio component](/img/mcp-stdio-component.png)
2. In the MCP stdio component, in the **mcp command** field, enter the command to start your MCP server. For a [Fetch](https://github.com/modelcontextprotocol/servers/tree/main/src/fetch) server, the command is:
```bash
uvx mcp-server-fetch
```
3. Open the **Playground**.
Ask the agent to summarize recent tech news. The agent calls the MCP server function `fetch` and returns the summary.
This confirms the MCP server is connected and working.
### Inputs
| Name | Type | Description |
@ -276,6 +292,13 @@ This component connects to a [Model Context Protocol (MCP)](https://modelcontext
This component connects to a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) server over [SSE (Server-Sent Events)](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events) and exposes its tools as Langflow tools to be used by an Agent component.
To use the MCP SSE component, follow these steps:
1. Add the [MCP SSE](/components-tools#mcp-sse) component to your workflow, and connect it to an agent. The flow looks similar to the MCP stdio component flow.
2. In the MCP SSE component, in the **url** field, enter the URL of your current Langflow server's `mcp/sse` endpoint.
This will fetch all currently available tools from the Langflow server.
### Inputs
| Name | Type | Description |
@ -288,7 +311,6 @@ This component connects to a [Model Context Protocol (MCP)](https://modelcontext
|-------|-----------|-------------------------------------------|
| tools | List[Tool]| List of tools exposed by the MCP server |
## Python Code Structured Tool
This component creates a structured tool from Python code using a dataclass.

BIN
docs/static/img/mcp-stdio-component.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 KiB