Skip to content
26 changes: 14 additions & 12 deletions sources/platform/integrations/ai/langflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ This guide will demonstrate two different ways to use Apify Actors with Langflow

### Prerequisites

- **Apify API token**: To use Apify Actors in Langflow, you need an Apify API token. If you don't have one, you can learn how to obtain it in the [Apify documentation](https://docs.apify.com/platform/integrations/api).
- **Apify API token**: To use Apify Actors in Langflow, you need an Apify API token. If you don't have one, you can learn how to get it in the [Apify documentation](https://docs.apify.com/platform/integrations/api).

- **OpenAI API key**: In order to work with agents in Langflow, you need an OpenAI API key. If you don't have one, you can get it from the [OpenAI platform](https://platform.openai.com/account/api-keys).
- **OpenAI API key**: To work with agents in Langflow, you need an OpenAI API key. If you don't have one, you can get it from the [OpenAI platform](https://platform.openai.com/account/api-keys).

#### Langflow

Expand All @@ -41,13 +41,13 @@ Langflow can either be installed locally or used in the cloud. The cloud version

:::

First, we need to install the Langflow platform using python package and project manager [uv](https://docs.astral.sh/uv/):
First, install the Langflow platform using Python package and project manager [uv](https://docs.astral.sh/uv/):

```bash
uv pip install langflow
```

After successfully installing Langflow, we can start the platform:
After installing Langflow, you can start the platform:

```bash
uv run langflow run
Expand All @@ -62,24 +62,26 @@ When the platform is started, open the Langflow UI using `http://127.0.0.1:7860`
On the Langflow welcome screen, click the **New Flow** button and then create **Blank Flow**:
![New Flow screen - Blank Flow](../images/langflow/new_blank_flow.png)

Now, we can start building our flow.
Now, you can start building your flow.

### Calling Apify Actors in Langflow

To call Apify Actors in Langflow, we need to add the **Apify Actors** component to the flow.
To call Apify Actors in Langflow, you need to add the **Apify Actors** component to the flow.
From the bundle menu, add **Apify Actors** component:
![Flow - Add Apify Actors](../images/langflow/bundles_apify.png)

Next, we need to configure the Apify Actors components. First, input your API token (learn how to get it [here](https://docs.apify.com/platform/integrations/api)). Then, set the Actor ID of the component to `apify/rag-web-browser` to use the [RAG Web Browser](https://apify.com/apify/rag-web-browser). Set the **Run input** field to pass arguments to the Actor run, allowing it to search Google with the query `"what is monero?"` (full Actor input schema can be found [here](https://apify.com/apify/rag-web-browser/input-schema)):
Next, configure the Apify Actors components. First, input your API token (learn how to get it at [Integrations](https://docs.apify.com/platform/integrations/api)).
Then, set the Actor ID of the component to `apify/rag-web-browser` to use the [RAG Web Browser](https://apify.com/apify/rag-web-browser).
Set the **Run input** field to pass arguments to the Actor run, allowing it to search Google with the query `"what is monero?"` (full Actor input schema can be found in the [RAG Web Browser input schema](https://apify.com/apify/rag-web-browser/input-schema)):

```json
{"query": "what is monero?", "maxResults": 3}
```

Now, we can run the component by clicking the **Run** button.
Click **Run**.
![Flow - Apify Actors Run](../images/langflow/apify_actors_run.png)

Once the run is finished, we can view the output by clicking the **Output** button.
After the run finishes, click **Output** to view the results.
![Flow - Apify Actors Output](../images/langflow/apify_actors_output.png)

The output should look similar to this:
Expand All @@ -94,16 +96,16 @@ When you run the component again, the output contains only the `markdown` and fl

![Flow - Apify Actors Output Filtered](../images/langflow/apify_actors_output_data_filtered.png)

Now that we understand how to call Apify Actors, let's build a practical example where we search for a company's social media profiles and extract data from them.
Now that you understand how to call Apify Actors, let's build a practical example where you search for a company's social media profiles and extract data from them.

### Building a flow to search for a company's social media profiles

Create a new flow and add two **Apify Actors** components from the menu.

Input your API token (learn how to get it [here](https://docs.apify.com/platform/integrations/api)) and set the Actor ID of the first component to `apify/google-search-scraper` and the second one to `clockworks/free-tiktok-scraper`:
Input your API token (learn how to get it in the [Integrations documentation](https://docs.apify.com/platform/integrations/api)) and set the Actor ID of the first component to `apify/google-search-scraper` and the second one to `clockworks/free-tiktok-scraper`:
![Flow - Actors configuration](../images/langflow/apify_actors_configuration.png)

Add the **Agent** component from the menu and set your OpenAI API key (get it [here](https://platform.openai.com/account/api-keys)):
Add the **Agent** component from the menu and set your OpenAI API key (get it from the [OpenAI API keys page](https://platform.openai.com/account/api-keys)):

:::tip Optimize Agent results

Expand Down
62 changes: 48 additions & 14 deletions sources/platform/integrations/ai/mcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,27 +152,60 @@ By default, the main Actors MCP Server starts with a single default [RAG Web Bro

In summary, you can start with a broad set (everything open and discoverable) or a narrow set (just what you need) and even expand tools on the fly, giving your agent a lot of flexibility without overwhelming it initially.

## Dynamic Actor tooling
## Configure tools for the MCP server

One of the powerful features of MCP with Apify is **dynamic Actor tooling** – the ability for an AI agent to find new tools (Actors) as needed and incorporate them. Here are some special MCP operations and how Apify MCP Server supports them:
You can customize the MCP server’s available tools by adding query parameters to the server URL or by passing arguments to the CLI.
This allows you to enable or disable specific tool categories and control which tools are available.

- _Actor discovery and management:_ Search for [Actors](https://docs.apify.com/platform/actors) (`search-actors`), view details (`get-actor-details`), and dynamically add them (`add-actor`).
- _Apify documentation:_ Search Apify documentation (`search-apify-docs`) and fetch specific documents (`fetch-apify-docs`).
- _Actor runs (*):_ Get a list of your [Actor runs](https://docs.apify.com/platform/actors/running/runs-and-builds#runs) (`get-actor-run-list`), specific run details (`get-actor-run`), and logs from a specific Actor run (`get-actor-log`).
- _Apify storage (*):_ Access [datasets](https://docs.apify.com/platform/storage/dataset)(`get-dataset`, `get-dataset-items`, `get-dataset-list`), [key-value stores](https://docs.apify.com/platform/storage/key-value-store) (`get-key-value-store`, `get-key-value-store-keys`, `get-key-value-store-record`, `get-key-value-store-records`), and their records.
The following tool categories are available:

:::note Optional tools
- _Actor discovery and management_ (default, always enabled): Search for [Actors](https://docs.apify.com/platform/actors) (`search-actors`), view details (`get-actor-details`), and dynamically add them (`add-actor`).
- _docs_ (default, can be disabled): Search Apify documentation (`search-apify-docs`) and fetch specific documents (`fetch-apify-docs`).
- _runs_ (optional): Get a list of your [Actor runs](https://docs.apify.com/platform/actors/running/runs-and-builds#runs) (`get-actor-run-list`), specific run details (`get-actor-run`), and logs from a specific Actor run (`get-actor-log`).
- _storage_ (optional): Access [datasets](https://docs.apify.com/platform/storage/dataset) and [key-value stores](https://docs.apify.com/platform/storage/key-value-store), including their records (`get-dataset`, `get-dataset-items`, `get-dataset-list`, `get-key-value-store`, `get-key-value-store-keys`, `get-key-value-store-record`, `get-key-value-store-records`).
- _preview_ (optional): Experimental tools in preview mode. Call any Actor using API (`call-actor`).

Helper tool categories marked with (*) are not enabled by default in the MCP server and must be explicitly enabled using the `tools` argument (either the `--tools` command line argument for the stdio server or the `?tools` URL query parameter for the remote MCP server). The `tools` argument is a comma-separated list of categories with the following possible values:
The _Actor discovery and management_ tools are always present and cannot be disabled.
The _docs_ tools are enabled by default but can be switched off using the `tools` parameter.

- `docs`: Search and fetch Apify documentation.
- `runs`: Get Actor runs list, run details, and logs from a specific Actor run.
- `storage`: Access datasets, key-value stores, and their records.
- `preview`: Experimental tools in preview mode.
### Configure mcp.apify.com using query parameters

:::
Use the `tools` query parameter to enable or disable specific tool categories.

For example, to enable only the `runs` and `storage` tools, you can use:

```text
https://mcp.apify.com/?tools=runs,storage
```

The server will expose all _Actor discovery and management tools_, as well as `runs` and `storage`.
The list of tools you can enable/disable is as follows: `docs`, `runs`, `storage`, and `preview`.


### Configure stdio server using CLI arguments

When running the MCP server via the command line, you can specify the tools using the `--tools` parameter.
For example, to enable only the `runs` and `storage` tools, you can run:

```bash
npx @apify/actors-mcp-server --tools runs,storage
```

## Dynamic discovery of Actors

One of the powerful features of MCP with Apify is **dynamic Actor tooling** – the ability for an AI agent to find new tools (Actors) as needed and incorporate them.

Supported dynamic tool operations (enabled by default):

- `search-actors`: Find available Actors by keyword or category.
- `get-actor-details`: View details and usage information for a specific Actor.
- `add-actor`: Dynamically add an Actor as a tool for the current session, making it available for use.

These operations allow your agent to expand its toolset on demand, without requiring a server restart or manual configuration.

For example, to enable all tools, use `npx @apify/actors-mcp-server --tools docs,runs,storage,preview` or `https://mcp.apify.com/?tools=docs,runs,storage,preview`.
Dynamic tool addition can be disabled using the `?enableAddingActors=false`.
Not all MCP clients support dynamic tool addition.
Check your client’s documentation or settings to confirm this feature is available.

## Rate limits

Expand All @@ -191,3 +224,4 @@ The Apify MCP server has a rate limit of _30 requests per second_ per user. If y
- [Apify Actors MCP Server](https://apify.com/apify/actors-mcp-server): The README for the Apify MCP Server actor (available on Apify Store as `apify/actors-mcp-server`) provides technical details on implementation and advanced usage.
- [Apify Tester MCP Client](https://apify.com/jiri.spilka/tester-mcp-client): A specialized client actor (`jiri.spilka/tester-mcp-client`) that you can run to simulate an AI agent in your browser. Useful for testing your setup with a chat UI.
- [How to use MCP with Apify Actors](https://blog.apify.com/how-to-use-mcp/): Learn how to expose over 5,000 Apify Actors to AI agents with Claude and LangGraph, and configure MCP clients and servers.
- [Apify MCP Server Tutorial](https://www.youtube.com/watch?v=BKu8H91uCTg): Integrate thousands of Apify Actors and Agents with Claude.