Skip to content

Commit c9c1a9d

Browse files
committed
Move client to a separate repository. Update README.md
1 parent 4219393 commit c9c1a9d

File tree

14 files changed

+66
-714
lines changed

14 files changed

+66
-714
lines changed

.actor/input_schema.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
"lukaskrivka/google-maps-with-contact-details"
1515
]
1616
},
17-
"enableActorDiscovery": {
18-
"title": "Enable Actor discovery based on your use-case (experimental)",
17+
"enableActorAutoLoading": {
18+
"title": "Enable automatic loading of Actors based on context and use-case (experimental, check if it supported by your client)",
1919
"type": "boolean",
20-
"description": "If enabled, the server will automatically discover available Actors for your use case.\n\nThis feature is experimental and may not work as expected.",
20+
"description": "When enabled, the server can dynamically add Actors as tools based on user requests and context. \n\nNote: Not all MCP clients support this feature. To try it, you can use the [Tester MCP Client](https://apify.com/jiri.spilka/tester-mcp-client). This is an experimental feature and may require client-specific support.",
2121
"default": false
2222
},
2323
"maxActorMemoryBytes": {
@@ -42,7 +42,7 @@
4242
"description": "Specify the input for the Actor that will be used for debugging in normal mode",
4343
"editor": "json",
4444
"prefill": {
45-
"query": "hello world"
45+
"query": "hello world"
4646
}
4747
}
4848
}

README.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Implementation of an MCP server for all [Apify Actors](https://apify.com/store).
66
This server enables interaction with one or more Apify Actors that can be defined in the MCP Server configuration.
77

88
The server can be used in two ways:
9-
- 🇦 **Apify MCP Server Actor**: runs an HTTP server with MCP protocol via Server-Sent Events.
10-
-**Apify MCP Server Stdio**: provides support for the MCP protocol via standard input/output stdio.
9+
- 🇦 **Apify MCP Server Actor**: runs an HTTP server with MCP and can be accessed via Server-Sent Events (SSE).
10+
-**Apify MCP Server Stdio**: runs the server locally with MCP via standard input/output (stdio).
1111

1212
# 🎯 What does Apify MCP server do?
1313

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

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

23-
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).
2431
Additionally, you can use simple example clients found in the [examples](https://github.com/apify/actor-mcp-server/tree/main/src/examples) directory.
2532

2633
When you have Actors integrated with the MCP server, you can ask:
@@ -54,6 +61,8 @@ To learn more, check out the blog post: [What are AI Agents?](https://blog.apify
5461

5562
## Tools
5663

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

@@ -79,6 +88,19 @@ You don't need to specify the input parameters or which Actor to call, everythin
7988
When a tool is called, the arguments are automatically passed to the Actor by the LLM.
8089
You can refer to the specific Actor's documentation for a list of available arguments.
8190

91+
### Helper tools
92+
93+
The server provides a set of helper tools to discover available Actors and retrieve their details:
94+
- `get-actor-details`: Retrieves documentation, input schema, and other details about a specific Actor.
95+
- `discover-actors`: Searches for relevant Actors using keywords and returns their details.
96+
97+
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.
98+
99+
You can try this functionality using the [Apify Tester MCP Client](https://apify.com/jiri.spilka/tester-mcp-client) Actor. To enable it, set the `enableActorAutoLoading` parameter.
100+
101+
- `add-actor-as-tool`: Adds an Actor by name to the available tools list without executing it, requiring user consent to run later.
102+
- `remove-actor-from-tool`: Removes an Actor by name from the available tools list when it's no longer needed.
103+
82104
## Prompt & Resources
83105

84106
The server does not provide any resources and prompts.

docs/actors-mcp-server.png

79.9 KB
Loading

src/actorDefinition.ts renamed to src/actors.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Ajv } from 'ajv';
22
import { ApifyClient } from 'apify-client';
33

4-
import { defaults, MAX_DESCRIPTION_LENGTH } from './const.js';
4+
import { ACTOR_ADDITIONAL_INSTRUCTIONS, defaults, MAX_DESCRIPTION_LENGTH } from './const.js';
55
import { log } from './logger.js';
66
import type { ActorDefinitionWithDesc, SchemaProperties, Tool } from './types.js';
77

@@ -106,7 +106,7 @@ export async function getActorsAsTools(actors: string[]): Promise<Tool[]> {
106106
tools.push({
107107
name: result.name.replace('/', '_'),
108108
actorName: result.name,
109-
description: result.description,
109+
description: `${result.description} Instructions: ${ACTOR_ADDITIONAL_INSTRUCTIONS}`,
110110
inputSchema: result.input || {},
111111
ajvValidate: ajv.compile(result.input || {}),
112112
memoryMbytes: memoryMbytes > defaults.maxMemoryMbytes ? defaults.maxMemoryMbytes : memoryMbytes,

src/const.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ export const SERVER_NAME = 'apify-mcp-server';
22
export const SERVER_VERSION = '0.1.0';
33

44
export const HEADER_READINESS_PROBE = 'x-apify-container-server-readiness-probe';
5-
65
export const MAX_DESCRIPTION_LENGTH = 500;
7-
export const MAX_TOOL_CALL_COUNT = 10;
8-
96
export const USER_AGENT_ORIGIN = 'Origin/mcp-server';
107

118
export const defaults = {
@@ -14,12 +11,15 @@ export const defaults = {
1411
'apify/rag-web-browser',
1512
'lukaskrivka/google-maps-with-contact-details',
1613
],
17-
maxMemoryMbytes: 4098,
14+
enableActorAutoLoading: false,
15+
maxMemoryMbytes: 4096,
1816
};
1917

2018
export const ACTOR_OUTPUT_MAX_CHARS_PER_ITEM = 5_000;
2119
export const ACTOR_OUTPUT_TRUNCATED_MESSAGE = `Output was truncated because it will not fit into context.`
22-
+ ` There is no reason to call this tool again!`;
20+
+ `There is no reason to call this tool again!`;
21+
export const ACTOR_ADDITIONAL_INSTRUCTIONS = 'Never call/execute tool/Actor unless confirmed by the user. '
22+
+ 'Always limit the number of results in the call arguments.';
2323

2424
export enum InternalTools {
2525
DISCOVER_ACTORS = 'discover-actors',

src/frontend/mcpClient.ts

Lines changed: 0 additions & 226 deletions
This file was deleted.

0 commit comments

Comments
 (0)