Skip to content

Commit

Permalink
docs: Add usage guide for MCP stdio and SSE components (#6133)
Browse files Browse the repository at this point in the history
* docs: Add usage guide for MCP stdio and SSE components

* docs: Remove example URL for MCP SSE component
  • Loading branch information
mendonk authored Feb 5, 2025
1 parent 7e99dab commit 8ab74e0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion docs/docs/Components/components-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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 |
Expand All @@ -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.
Expand Down
Binary file added docs/static/img/mcp-stdio-component.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8ab74e0

Please sign in to comment.