Skip to content

Commit 95da6e6

Browse files
committed
Updating PR #29 with required changes
1 parent 9eb5937 commit 95da6e6

File tree

1 file changed

+73
-38
lines changed

1 file changed

+73
-38
lines changed

README.md

Lines changed: 73 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# Apify Model Context Protocol (MCP) Server
22

33
[![Actors MCP Server](https://apify.com/actor-badge?actor=apify/actors-mcp-server)](https://apify.com/apify/actors-mcp-server)
4-
[![smithery badge](https://smithery.ai/badge/@apify/actors-mcp-server)](https://smithery.ai/server/@apify/actors-mcp-server)
4+
[![Smithery badge](https://smithery.ai/badge/@apify/actors-mcp-server)](https://smithery.ai/server/@apify/actors-mcp-server)
55

66
Implementation of an MCP server for all [Apify Actors](https://apify.com/store).
77
This server enables interaction with one or more Apify Actors that can be defined in the MCP Server configuration.
88

9-
The server can be used in two ways:
10-
- 🇦 **Apify MCP Server Actor**: runs an HTTP server with MCP protocol via Server-Sent Events.
11-
-**Apify MCP Server Stdio**: provides support for the MCP protocol via standard input/output stdio.
9+
The server can be used in several ways:
10+
- **🇦 [MCP Server Actor](https://apify.com/apify/actors-mcp-server)** – HTTP server accessible via Server-Sent Events (SSE).
11+
- **⾕ MCP Server Stdio** – Local server available via standard input/output (stdio).
12+
- **💬 [Tester MCP Client](https://apify.com/jiri.spilka/tester-mcp-client)** – Chat-like UI for interacting with the MCP server.
1213

1314
# 🎯 What does Apify MCP server do?
1415

@@ -20,8 +21,15 @@ For example it can:
2021
- use [Instagram Scraper](https://apify.com/apify/instagram-scraper) to scrape Instagram posts, profiles, places, photos, and comments
2122
- use [RAG Web Browser](https://apify.com/apify/web-scraper) to search the web, scrape the top N URLs, and return their content
2223

24+
# MCP Clients
25+
26+
To interact with the Apify MCP server, you can use MCP clients such as:
27+
- [Claude Desktop](https://claude.ai/download) (only Stdio support)
28+
- [LibreChat](https://www.librechat.ai/) (stdio and SSE support (yeah without Authorization header))
29+
- [Apify Tester MCP Client](https://apify.com/jiri.spilka/tester-mcp-client) (SSE support with Authorization headers)
30+
- other clients at [https://modelcontextprotocol.io/clients](https://modelcontextprotocol.io/clients)
31+
- more clients at [https://glama.ai/mcp/clients](https://glama.ai/mcp/clients)
2332

24-
To interact with the Apify MCP server, you can use MCP clients such as [Claude Desktop](https://claude.ai/download), [LibreChat](https://www.librechat.ai/), or other [MCP clients](https://glama.ai/mcp/clients).
2533
Additionally, you can use simple example clients found in the [examples](https://github.com/apify/actor-mcp-server/tree/main/src/examples) directory.
2634

2735
When you have Actors integrated with the MCP server, you can ask:
@@ -36,25 +44,27 @@ The following image shows how the Apify MCP server interacts with the Apify plat
3644
![Actors-MCP-server](https://raw.githubusercontent.com/apify/actors-mcp-server/refs/heads/master/docs/actors-mcp-server.png)
3745

3846
In the future, we plan to load Actors dynamically and provide Apify's dataset and key-value store as resources.
39-
See the [Roadmap](#-roadmap-january-2025) for more details.
47+
See the [Roadmap](#-roadmap-march-2025) for more details.
4048

4149
# 🔄 What is the Model Context Protocol?
4250

4351
The Model Context Protocol (MCP) allows AI applications (and AI agents), such as Claude Desktop, to connect to external tools and data sources.
4452
MCP is an open protocol that enables secure, controlled interactions between AI applications, AI Agents, and local or remote resources.
4553

46-
For more information, see the [Model Context Protocol](https://modelcontextprotocol.org/) website.
54+
For more information, see the [Model Context Protocol](https://modelcontextprotocol.org/) website or blogpost [What is MCP and why does it matter?](https://blog.apify.com/what-is-model-context-protocol/).
4755

4856
# 🤖 How is Actors MCP Server related to AI Agents?
4957

5058
The Apify MCP Server exposes Apify's Actors through the MCP protocol, allowing AI Agents or frameworks that implement the MCP protocol to access all Apify Actors as tools for data extraction, web searching, and other tasks.
5159

52-
To learn more, check out the blog post: [What are AI Agents?](https://blog.apify.com/what-are-ai-agents/)
60+
To learn more, check out the blog post: [What are AI Agents?](https://blog.apify.com/what-are-ai-agents/) and Apify's [AI Agent collection](https://apify.com/store/collections/ai_agents).
5361

5462
# 🧱 Components
5563

5664
## Tools
5765

66+
### Actors
67+
5868
Any [Apify Actor](https://apify.com/store) can be used as a tool.
5969
By default, the server is pre-configured with the Actors specified below, but it can be overridden by providing Actor input.
6070

@@ -80,6 +90,20 @@ You don't need to specify the input parameters or which Actor to call, everythin
8090
When a tool is called, the arguments are automatically passed to the Actor by the LLM.
8191
You can refer to the specific Actor's documentation for a list of available arguments.
8292

93+
### Helper tools
94+
95+
The server provides a set of helper tools to discover available Actors and retrieve their details:
96+
- `get-actor-details`: Retrieves documentation, input schema, and other details about a specific Actor.
97+
- `discover-actors`: Searches for relevant Actors using keywords and returns their details.
98+
99+
There are also tools to manage the available tools list. However, dynamically adding and removing tools requires the MCP client to have the capability to manage the tools list, which is typically not supported.
100+
101+
You can try this functionality using the [Apify Tester MCP Client](https://apify.com/jiri.spilka/tester-mcp-client) Actor.
102+
To enable it, set the `enableActorAutoLoading` parameter.
103+
104+
- `add-actor-as-tool`: Adds an Actor by name to the available tools list without executing it, requiring user consent to run later.
105+
- `remove-actor-from-tool`: Removes an Actor by name from the available tools list when it's no longer needed.
106+
83107
## Prompt & Resources
84108

85109
The server does not provide any resources and prompts.
@@ -111,10 +135,13 @@ https://actors-mcp-server-task.apify.actor?token=<APIFY_TOKEN>
111135

112136
You can find a list of all available Actors in the [Apify Store](https://apify.com/store).
113137

114-
#### 💬 Interact with the MCP Server
138+
#### 💬 Interact with the MCP Server over SSE
115139

116140
Once the server is running, you can interact with Server-Sent Events (SSE) to send messages to the server and receive responses.
117-
You can use MCP clients such as [Superinference.ai](https://superinterface.ai/) or [LibreChat](https://www.librechat.ai/).
141+
The easiest way is to use [Tester MCP Client](https://apify.com/jiri.spilka/tester-mcp-client) on Apify.
142+
143+
Other clients do not support SSE yet, but this will likely change.
144+
Please verify if MCP clients such as [Superinference.ai](https://superinterface.ai/) or [LibreChat](https://www.librechat.ai/) support SSE with custom headers.
118145
([Claude Desktop](https://claude.ai/download) does not support SSE transport yet, see [Claude Desktop Configuration](#claude-desktop) section for more details).
119146

120147
In the client settings you need to provide server configuration:
@@ -137,7 +164,7 @@ Alternatively, you can use simple python [client_see.py](https://github.com/apif
137164
```
138165
curl https://actors-mcp-server.apify.actor/sse?token=<APIFY_TOKEN>
139166
```
140-
The server will respond with a `sessionId`, which you can use to send messages to the server:
167+
The server will respond with a `sessionId`, which you can use to send messages to the server:
141168
```shell
142169
event: endpoint
143170
data: /message?sessionId=a1b
@@ -155,15 +182,15 @@ Alternatively, you can use simple python [client_see.py](https://github.com/apif
155182
}
156183
}'
157184
```
158-
The MCP server will start the Actor `lukaskrivka/google-maps-with-contact-details` with the provided arguments as input parameters.
159-
For this POST request, the server will respond with:
185+
The MCP server will start the Actor `lukaskrivka/google-maps-with-contact-details` with the provided arguments as input parameters.
186+
For this POST request, the server will respond with:
160187
161188
```text
162189
Accepted
163190
```
164191
165192
3. Receive the response. The server will invoke the specified Actor as a tool using the provided query parameters and stream the response back to the client via SSE.
166-
The response will be returned as JSON text.
193+
The response will be returned as JSON text.
167194
168195
```text
169196
event: message
@@ -172,13 +199,8 @@ Alternatively, you can use simple python [client_see.py](https://github.com/apif
172199
173200
## ⾕ MCP Server at a local host
174201
175-
### Installing via Smithery
176-
177-
To install Apify Actors MCP Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@apify/actors-mcp-server):
178-
179-
```bash
180-
npx -y @smithery/cli install @apify/actors-mcp-server --client claude
181-
```
202+
You can run the Apify MCP Server on your local machine by configuring it with Claude Desktop or any other [MCP clients](https://modelcontextprotocol.io/clients).
203+
You can also use [Smithery](https://smithery.ai/server/@apify/actors-mcp-server) to install the server automatically.
182204
183205
### Prerequisites
184206
@@ -189,7 +211,6 @@ npx -y @smithery/cli install @apify/actors-mcp-server --client claude
189211
190212
### Install
191213
192-
Follow the steps below to set up and run the server on your local machine:
193214
First, clone the repository using the following command:
194215
195216
```bash
@@ -213,8 +234,8 @@ npm run build
213234
To configure Claude Desktop to work with the MCP server, follow these steps. For a detailed guide, refer to the [Claude Desktop Users Guide](https://modelcontextprotocol.io/quickstart/user).
214235

215236
1. Download Claude for desktop
216-
- Available for Windows and macOS.
217-
- For Linux users, you can build a Debian package using this [unofficial build script](https://github.com/aaddrick/claude-desktop-debian).
237+
- Available for Windows and macOS.
238+
- For Linux users, you can build a Debian package using this [unofficial build script](https://github.com/aaddrick/claude-desktop-debian).
218239
2. Open the Claude Desktop app and enable **Developer Mode** from the top-left menu bar.
219240
3. Once enabled, open **Settings** (also from the top-left menu bar) and navigate to the **Developer Option**, where you'll find the **Edit Config** button
220241
4. Open configuration file and edit the following file:
@@ -236,7 +257,7 @@ To configure Claude Desktop to work with the MCP server, follow these steps. For
236257
}
237258
}
238259
```
239-
Alternatively, you can use `actors` argument to select one or more Apify Actors:
260+
Alternatively, you can use `actors` argument to select one or more Apify Actors:
240261
```json
241262
{
242263
"mcpServers": {
@@ -272,6 +293,14 @@ To configure Claude Desktop to work with the MCP server, follow these steps. For
272293
Find and analyze instagram profile of the Rock.
273294
```
274295

296+
### Installing via Smithery
297+
298+
To install Apify Actors MCP Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@apify/actors-mcp-server):
299+
300+
```bash
301+
npx -y @smithery/cli install @apify/actors-mcp-server --client claude
302+
```
303+
275304
#### Stdio clients
276305

277306
Create environment file `.env` with the following content:
@@ -282,18 +311,19 @@ ANTHROPIC_API_KEY=your-anthropic-api-token
282311
```
283312
In the `examples` directory, you can find two clients that interact with the server via
284313
standard input/output (stdio):
314+
285315
1. [`clientStdio.ts`](https://github.com/apify/actor-mcp-server/tree/main/src/examples/clientStdio.ts)
286-
This client script starts the MCP server with two specified Actors.
287-
It then calls the `apify/rag-web-browser` tool with a query and prints the result.
288-
It demonstrates how to connect to the MCP server, list available tools, and call a specific tool using stdio transport.
316+
This client script starts the MCP server with two specified Actors.
317+
It then calls the `apify/rag-web-browser` tool with a query and prints the result.
318+
It demonstrates how to connect to the MCP server, list available tools, and call a specific tool using stdio transport.
289319
```bash
290320
node dist/examples/clientStdio.js
291321
```
292322

293323
2. [`clientStdioChat.ts`](https://github.com/apify/actor-mcp-server/tree/main/src/examples/clientStdioChat.ts)
294-
This client script also starts the MCP server but provides an interactive command-line chat interface.
295-
It prompts the user to interact with the server, allowing for dynamic tool calls and responses.
296-
This example is useful for testing and debugging interactions with the MCP server in conversational manner.
324+
This client script also starts the MCP server but provides an interactive command-line chat interface.
325+
It prompts the user to interact with the server, allowing for dynamic tool calls and responses.
326+
This example is useful for testing and debugging interactions with the MCP server in conversational manner.
297327

298328
```bash
299329
node dist/examples/clientStdioChat.js
@@ -314,12 +344,12 @@ ANTHROPIC_API_KEY=your-anthropic-api-key
314344
```
315345
## Local client (SSE)
316346

317-
To test the server with the SSE transport, you can use python script `examples/client_sse.py`:
347+
To test the server with the SSE transport, you can use python script `examples/clientSse.ts`:
318348
Currently, the node.js client does not support to establish a connection to remote server witch custom headers.
319349
You need to change URL to your local server URL in the script.
320350

321351
```bash
322-
python src/examples/client_sse.py
352+
node dist/examples/clientSse.js
323353
```
324354

325355
## Debugging
@@ -343,17 +373,22 @@ Upon launching, the Inspector will display a URL that you can access in your bro
343373

344374
## ⓘ Limitations and feedback
345375

346-
To limit the context size the properties in the `input schema` are pruned and description is truncated to 200 characters.
376+
To limit the context size the properties in the `input schema` are pruned and description is truncated to 500 characters.
347377
Enum fields and titles are truncated to max 50 options.
348378

349379
Memory for each Actor is limited to 4GB.
350380
Free users have an 8GB limit, 128MB needs to be allocated for running `Actors-MCP-Server`.
351381

352-
If you need other features or have any feedback, please [submit an issue](https://console.apify.com/actors/3ox4R101TgZz67sLr/issues) in Apify Console to let us know.
382+
If you need other features or have any feedback, please [submit an issue](https://console.apify.com/actors/1lSvMAaRcadrM1Vgv/issues) in Apify Console to let us know.
353383

354-
# 🚀 Roadmap (January 2025)
384+
# 🚀 Roadmap (March 2025)
355385

356-
- Document examples for [LibreChat](https://www.librechat.ai/).
357-
- Provide tools to search for Actors and load them as needed.
358386
- Add Apify's dataset and key-value store as resources.
359387
- Add tools such as Actor logs and Actor runs for debugging.
388+
389+
# References
390+
391+
- [Model Context Protocol](https://modelcontextprotocol.org/)
392+
- [What are AI Agents?](https://blog.apify.com/what-are-ai-agents/)
393+
- [What is MCP and why does it matter?](https://blog.apify.com/what-is-model-context-protocol/)
394+
- [Tester MCP Client](https://apify.com/jiri.spilka/tester-mcp-client)

0 commit comments

Comments
 (0)