Skip to content

Commit c841446

Browse files
committed
Update docs
1 parent b632763 commit c841446

File tree

2 files changed

+46
-20
lines changed

2 files changed

+46
-20
lines changed

README.md

Lines changed: 43 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -83,22 +83,56 @@ or as a **local server** running on your machine.
8383

8484
The Actor runs in [**Standby mode**](https://docs.apify.com/platform/actors/running/standby) with an HTTP web server that receives and processes requests.
8585

86-
1. **Start server with default Actors**. To use the Apify MCP Server with set of default Actors,
87-
send an HTTP GET request with your [Apify API token](https://console.apify.com/settings/integrations) to the following URL.
88-
```
89-
https://mcp-server.apify.actor?token=<APIFY_API_TOKEN>&actors=junglee/free-amazon-product-scraper,junglee/free-amazon-product-scraper
90-
```
91-
2. **Initiate Server-Sent-Events (SSE)** by sending a GET request to the following URL:
86+
Start server with default Actors. To use the Apify MCP Server with set of default Actors,
87+
send an HTTP GET request with your [Apify API token](https://console.apify.com/settings/integrations) to the following URL.
88+
```
89+
https://mcp-server.apify.actor?token=<APIFY_API_TOKEN>
90+
```
91+
It is also possible to start MCP server with a different set of tools by providing a list of Actor names in the `actors` query parameter.
92+
Provide a comma-separated list of Actors in the `actors` query parameter:
93+
```
94+
https://mcp-server.apify.actor?token=<APIFY_API_TOKEN>&actors=junglee/free-amazon-product-scraper,lukaskrivka/google-maps-with-contact-details
95+
```
96+
Find list of all available Actors in the [Apify Store](https://apify.com/store).
97+
98+
##### Interact with the MCP Server
99+
100+
Once the server is running, you can interact with Server-Sent Events (SSE) to send messages to the server and receive responses.
101+
102+
You can use MCP clients such as [Superinference.ai](https://superinterface.ai/) or [LibreChat](https://www.librechat.ai/).
103+
([Claude Desktop](https://claude.ai/download) does not support SSE transport yet)
104+
105+
In the client settings you need to provide server configuration:
106+
```json
107+
{
108+
"mcpServers": {
109+
"apify": {
110+
"type": "sse",
111+
"url": "https://mcp-server.apify.actor/sse",
112+
"env": {
113+
"APIFY-API-TOKEN": "your-apify-api-token"
114+
}
115+
}
116+
}
117+
}
118+
```
119+
Alternatively, you can use simple python [client_see.py](https://github.com/apify/actor-mcp-server/tree/main/src/examples/client_sse.py).
120+
121+
##### Test the server using curl
122+
123+
You can test the server using `curl`:
124+
125+
1. Initiate Server-Sent-Events (SSE) by sending a GET request to the following URL:
92126
```
93-
https://mcp-server.apify.actor/sse?token=<APIFY_API_TOKEN>
127+
curl https://mcp-server.apify.actor/sse?token=<APIFY_API_TOKEN>
94128
```
95129
The server will respond with a `sessionId`, which you can use to send messages to the server:
96130
```shell
97131
event: endpoint
98132
data: /message?sessionId=a1b
99133
```
100134
101-
3. **Send a message to the server** by making a POST request with the `sessionId`:
135+
2. Send a message to the server by making a POST request with the `sessionId`:
102136
```shell
103137
curl -X POST "https://mcp-server.apify.actor?token=<APIFY_API_TOKEN>&session_id=a1b" -H "Content-Type: application/json" -d '{
104138
"jsonrpc": "2.0",
@@ -117,21 +151,14 @@ The Actor runs in [**Standby mode**](https://docs.apify.com/platform/actors/runn
117151
Accepted
118152
```
119153
120-
4. **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.
154+
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.
121155
The response will be returned as JSON text.
122156
123157
```text
124158
event: message
125159
data: {"result":{"content":[{"type":"text","text":"{\"searchString\":\"restaurants in San Francisco\",\"rank\":1,\"title\":\"Gary Danko\",\"description\":\"Renowned chef Gary Danko's fixed-price menus of American cuisine ... \",\"price\":\"$100+\"...}}]}}
126160
```
127161
128-
You can also start MCP server with a different set of tools by providing a list of Actor names in the `actors` query parameter.
129-
Provide a comma-separated list of Actors in the `actors` query parameter:
130-
```
131-
https://mcp-server.apify.actor?token=<APIFY_API_TOKEN>&actors=junglee/free-amazon-product-scraper,junglee/free-amazon-product-scraper
132-
```
133-
You can find list of all available Actors in the [Apify Store](https://apify.com/store).
134-
135162
### MCP Server at local host
136163
137164
#### Prerequisites

src/examples/client_sse.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
"""
2-
Test MCP Server with Actors using SSE client
2+
Test Apify MCP Server using SSE client
33
4-
This script demonstrates how to test the MCP Server with Actors using the SSE client.
54
It is using python client as the typescript one does not support custom headers when connecting to the SSE server.
65
7-
Install dependencies:
8-
pip install requests python-dotenv mcp
6+
Install python dependencies (assumes you have python installed):
7+
> pip install requests python-dotenv mcp
98
"""
109

1110
import asyncio

0 commit comments

Comments
 (0)