@apify/actors-mcp-server 0.1.21 → 0.1.22-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/actor/const.d.ts +15 -0
- package/dist/actor/const.d.ts.map +1 -0
- package/dist/actor/const.js +20 -0
- package/dist/actor/const.js.map +1 -0
- package/dist/{input.d.ts → actor/input.d.ts} +1 -1
- package/dist/actor/input.d.ts.map +1 -0
- package/dist/{input.js → actor/input.js} +5 -1
- package/dist/actor/input.js.map +1 -0
- package/dist/actor/server.d.ts +4 -0
- package/dist/actor/server.d.ts.map +1 -0
- package/dist/actor/server.js +81 -0
- package/dist/actor/server.js.map +1 -0
- package/dist/actor/types.d.ts +30 -0
- package/dist/actor/types.d.ts.map +1 -0
- package/dist/actor/types.js +2 -0
- package/dist/actor/types.js.map +1 -0
- package/dist/actor/utils.d.ts +11 -0
- package/dist/actor/utils.d.ts.map +1 -0
- package/dist/actor/utils.js +50 -0
- package/dist/actor/utils.js.map +1 -0
- package/dist/const.d.ts +10 -20
- package/dist/const.d.ts.map +1 -1
- package/dist/const.js +17 -27
- package/dist/const.js.map +1 -1
- package/dist/examples/clientSse.d.ts +10 -1
- package/dist/examples/clientSse.d.ts.map +1 -1
- package/dist/examples/clientSse.js +7 -4
- package/dist/examples/clientSse.js.map +1 -1
- package/dist/examples/clientStdio.js +2 -2
- package/dist/examples/clientStdio.js.map +1 -1
- package/dist/examples/clientStdioChat.js +1 -1
- package/dist/index.d.ts +2 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -42
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts +4 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +21 -118
- package/dist/main.js.map +1 -1
- package/dist/mcp-server.d.ts +39 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +155 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/stdio.d.ts +15 -0
- package/dist/stdio.d.ts.map +1 -0
- package/dist/stdio.js +46 -0
- package/dist/stdio.js.map +1 -0
- package/dist/tools/actor.d.ts +37 -0
- package/dist/tools/actor.d.ts.map +1 -0
- package/dist/tools/actor.js +89 -0
- package/dist/tools/actor.js.map +1 -0
- package/dist/tools/build.d.ts +12 -0
- package/dist/tools/build.d.ts.map +1 -0
- package/dist/tools/build.js +120 -0
- package/dist/tools/build.js.map +1 -0
- package/dist/tools/helpers.d.ts +19 -0
- package/dist/tools/helpers.d.ts.map +1 -0
- package/dist/tools/helpers.js +62 -0
- package/dist/tools/helpers.js.map +1 -0
- package/dist/tools/index.d.ts +6 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +8 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/mcp-apify-client.d.ts +6 -0
- package/dist/tools/mcp-apify-client.d.ts.map +1 -0
- package/dist/tools/mcp-apify-client.js +22 -0
- package/dist/tools/mcp-apify-client.js.map +1 -0
- package/dist/tools/store_collection.d.ts +21 -0
- package/dist/tools/store_collection.d.ts.map +1 -0
- package/dist/tools/store_collection.js +80 -0
- package/dist/tools/store_collection.js.map +1 -0
- package/dist/tools/utils.d.ts +77 -0
- package/dist/tools/utils.d.ts.map +1 -0
- package/dist/{actors.js → tools/utils.js} +112 -241
- package/dist/tools/utils.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +70 -9
- package/dist/types.d.ts.map +1 -1
- package/package.json +17 -14
- package/dist/actors.d.ts +0 -74
- package/dist/actors.d.ts.map +0 -1
- package/dist/actors.js.map +0 -1
- package/dist/input.d.ts.map +0 -1
- package/dist/input.js.map +0 -1
- package/dist/logger.d.ts +0 -3
- package/dist/logger.d.ts.map +0 -1
- package/dist/logger.js +0 -4
- package/dist/logger.js.map +0 -1
- package/dist/server.d.ts +0 -43
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js +0 -178
- package/dist/server.js.map +0 -1
- package/dist/tools.d.ts +0 -46
- package/dist/tools.d.ts.map +0 -1
- package/dist/tools.js +0 -128
- package/dist/tools.js.map +0 -1
package/dist/types.d.ts
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
|
+
import type { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
1
2
|
import type { ValidateFunction } from 'ajv';
|
|
2
3
|
import type { ActorDefaultRunOptions, ActorDefinition } from 'apify-client';
|
|
3
|
-
|
|
4
|
-
actors: string[] | string;
|
|
5
|
-
enableActorAutoLoading?: boolean;
|
|
6
|
-
maxActorMemoryBytes?: number;
|
|
7
|
-
debugActor?: string;
|
|
8
|
-
debugActorInput?: unknown;
|
|
9
|
-
};
|
|
4
|
+
import type { ActorsMcpServer } from './mcp-server.js';
|
|
10
5
|
export interface ISchemaProperties {
|
|
11
6
|
type: string;
|
|
12
7
|
title: string;
|
|
@@ -37,14 +32,68 @@ export type ActorDefinitionWithDesc = Omit<ActorDefinition, 'input'> & {
|
|
|
37
32
|
input?: IActorInputSchema;
|
|
38
33
|
};
|
|
39
34
|
export type ActorDefinitionPruned = Pick<ActorDefinitionWithDesc, 'id' | 'actorFullName' | 'buildTag' | 'readme' | 'input' | 'description' | 'defaultRunOptions'>;
|
|
40
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Base interface for all tools in the MCP server.
|
|
37
|
+
* Contains common properties shared by all tool types.
|
|
38
|
+
*/
|
|
39
|
+
export interface ToolBase {
|
|
40
|
+
/** Unique name/identifier for the tool */
|
|
41
41
|
name: string;
|
|
42
|
-
|
|
42
|
+
/** Description of what the tool does */
|
|
43
43
|
description: string;
|
|
44
|
+
/** JSON schema defining the tool's input parameters */
|
|
44
45
|
inputSchema: object;
|
|
46
|
+
/** AJV validation function for the input schema */
|
|
45
47
|
ajvValidate: ValidateFunction;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Interface for Actor-based tools - tools that wrap Apify Actors.
|
|
51
|
+
* Extends ToolBase with Actor-specific properties.
|
|
52
|
+
*/
|
|
53
|
+
export interface ActorTool extends ToolBase {
|
|
54
|
+
/** Full name of the Apify Actor (username/name) */
|
|
55
|
+
actorFullName: string;
|
|
56
|
+
/** Optional memory limit in MB for the Actor execution */
|
|
46
57
|
memoryMbytes?: number;
|
|
47
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Arguments passed to internal tool calls.
|
|
61
|
+
* Contains both the tool arguments and server references.
|
|
62
|
+
*/
|
|
63
|
+
export type InternalToolArgs = {
|
|
64
|
+
/** Arguments passed to the tool */
|
|
65
|
+
args: Record<string, unknown>;
|
|
66
|
+
/** Reference to the Apify MCP server instance */
|
|
67
|
+
apifyMcpServer: ActorsMcpServer;
|
|
68
|
+
/** Reference to the MCP server instance */
|
|
69
|
+
mcpServer: Server;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Interface for internal tools - tools implemented directly in the MCP server.
|
|
73
|
+
* Extends ToolBase with a call function implementation.
|
|
74
|
+
*/
|
|
75
|
+
export interface HelperTool extends ToolBase {
|
|
76
|
+
/**
|
|
77
|
+
* Executes the tool with the given arguments
|
|
78
|
+
* @param toolArgs - Arguments and server references
|
|
79
|
+
* @returns Promise resolving to the tool's output
|
|
80
|
+
*/
|
|
81
|
+
call: (toolArgs: InternalToolArgs) => Promise<object>;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Type discriminator for tools - indicates whether a tool is internal or Actor-based.
|
|
85
|
+
*/
|
|
86
|
+
export type ToolType = 'internal' | 'actor' | 'actor-mcp';
|
|
87
|
+
/**
|
|
88
|
+
* Wrapper interface that combines a tool with its type discriminator.
|
|
89
|
+
* Used to store and manage tools of different types uniformly.
|
|
90
|
+
*/
|
|
91
|
+
export interface ToolWrap {
|
|
92
|
+
/** Type of the tool (internal or actor) */
|
|
93
|
+
type: ToolType;
|
|
94
|
+
/** The tool instance */
|
|
95
|
+
tool: ActorTool | HelperTool;
|
|
96
|
+
}
|
|
48
97
|
export interface ActorStats {
|
|
49
98
|
totalRuns: number;
|
|
50
99
|
totalUsers30Days: number;
|
|
@@ -67,4 +116,16 @@ export interface ActorStorePruned {
|
|
|
67
116
|
url: string;
|
|
68
117
|
totalStars?: number | null;
|
|
69
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* Interface for internal tools - tools implemented directly in the MCP server.
|
|
121
|
+
* Extends ToolBase with a call function implementation.
|
|
122
|
+
*/
|
|
123
|
+
export interface InternalTool extends ToolBase {
|
|
124
|
+
/**
|
|
125
|
+
* Executes the tool with the given arguments
|
|
126
|
+
* @param toolArgs - Arguments and server references
|
|
127
|
+
* @returns Promise resolving to the tool's output
|
|
128
|
+
*/
|
|
129
|
+
call: (toolArgs: InternalToolArgs) => Promise<object>;
|
|
130
|
+
}
|
|
70
131
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,MAAM,CAAC;IAEb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IAEpB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,KAAK,CA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IACZ,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,YAAa,SAAQ,QAAQ;IAC1C;;;;OAIG;IACH,IAAI,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACzD"}
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apify/actors-mcp-server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.22-beta.0",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "Model Context Protocol Server for Apify
|
|
5
|
+
"description": "Model Context Protocol Server for Apify",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=18.0.0"
|
|
8
8
|
},
|
|
9
9
|
"main": "dist/index.js",
|
|
10
10
|
"bin": {
|
|
11
|
-
"actors-mcp-server": "./dist/
|
|
11
|
+
"actors-mcp-server": "./dist/stdio.js"
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
14
14
|
"dist",
|
|
@@ -30,10 +30,11 @@
|
|
|
30
30
|
"model context protocol"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@
|
|
33
|
+
"@apify/log": "^2.5.16",
|
|
34
|
+
"@modelcontextprotocol/sdk": "^1.9.0",
|
|
34
35
|
"ajv": "^8.17.1",
|
|
35
|
-
"apify": "^3.
|
|
36
|
-
"apify-client": "^2.
|
|
36
|
+
"apify": "^3.4.0",
|
|
37
|
+
"apify-client": "^2.12.1",
|
|
37
38
|
"express": "^4.21.2",
|
|
38
39
|
"minimist": "^1.2.8",
|
|
39
40
|
"zod": "^3.24.1",
|
|
@@ -42,28 +43,30 @@
|
|
|
42
43
|
"devDependencies": {
|
|
43
44
|
"@anthropic-ai/sdk": "^0.33.1",
|
|
44
45
|
"@anthropic-ai/tokenizer": "^0.0.4",
|
|
45
|
-
"@apify/eslint-config": "^0.
|
|
46
|
+
"@apify/eslint-config": "^1.0.0",
|
|
46
47
|
"@apify/tsconfig": "^0.1.0",
|
|
47
48
|
"@types/express": "^4.0.0",
|
|
48
49
|
"@types/minimist": "^1.2.5",
|
|
49
50
|
"dotenv": "^16.4.7",
|
|
50
|
-
"eslint": "^9.
|
|
51
|
+
"eslint": "^9.19.0",
|
|
51
52
|
"eventsource": "^3.0.2",
|
|
52
53
|
"tsx": "^4.6.2",
|
|
53
54
|
"typescript": "^5.3.3",
|
|
54
|
-
"typescript-eslint": "^8.
|
|
55
|
+
"typescript-eslint": "^8.23.0",
|
|
55
56
|
"vitest": "^3.0.8"
|
|
56
57
|
},
|
|
57
58
|
"scripts": {
|
|
58
59
|
"start": "npm run start:dev",
|
|
59
60
|
"start:prod": "node dist/main.js",
|
|
60
61
|
"start:dev": "tsx src/main.ts",
|
|
61
|
-
"lint": "eslint .",
|
|
62
|
-
"lint:fix": "eslint . --fix",
|
|
62
|
+
"lint": "./node_modules/.bin/eslint .",
|
|
63
|
+
"lint:fix": "./node_modules/.bin/eslint . --fix",
|
|
63
64
|
"build": "tsc",
|
|
64
|
-
"watch": "tsc
|
|
65
|
-
"inspector": "npx @modelcontextprotocol/inspector dist/
|
|
66
|
-
"test": "vitest run"
|
|
65
|
+
"build:watch": "tsc -w",
|
|
66
|
+
"inspector": "npx @modelcontextprotocol/inspector dist/stdio.js",
|
|
67
|
+
"test": "vitest run",
|
|
68
|
+
"type-check": "tsc --noEmit",
|
|
69
|
+
"clean": "tsc -b src --clean"
|
|
67
70
|
},
|
|
68
71
|
"author": "Apify",
|
|
69
72
|
"license": "MIT"
|
package/dist/actors.d.ts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import type { ActorDefinitionPruned, ISchemaProperties, Tool } from './types.js';
|
|
2
|
-
export declare function actorNameToToolName(actorName: string): string;
|
|
3
|
-
/**
|
|
4
|
-
* Get actor input schema by actor name.
|
|
5
|
-
* First, fetch the actor details to get the default build tag and buildId.
|
|
6
|
-
* Then, fetch the build details and return actorName, description, and input schema.
|
|
7
|
-
* @param {string} actorIdOrName - Actor ID or Actor full name.
|
|
8
|
-
* @param {number} limit - Truncate the README to this limit.
|
|
9
|
-
* @returns {Promise<ActorDefinitionWithDesc | null>} - The actor definition with description or null if not found.
|
|
10
|
-
*/
|
|
11
|
-
export declare function getActorDefinition(actorIdOrName: string, limit?: number): Promise<ActorDefinitionPruned | null>;
|
|
12
|
-
/**
|
|
13
|
-
* Helper function to shorten the enum list if it is too long.
|
|
14
|
-
*
|
|
15
|
-
* @param {string[]} enumList - The list of enum values to be shortened.
|
|
16
|
-
* @returns {string[] | undefined} - The shortened enum list or undefined if the list is too long.
|
|
17
|
-
*/
|
|
18
|
-
export declare function shortenEnum(enumList: string[]): string[] | undefined;
|
|
19
|
-
/**
|
|
20
|
-
* Shortens the description, enum, and items.enum properties of the schema properties.
|
|
21
|
-
* @param properties
|
|
22
|
-
*/
|
|
23
|
-
export declare function shortenProperties(properties: {
|
|
24
|
-
[key: string]: ISchemaProperties;
|
|
25
|
-
}): {
|
|
26
|
-
[key: string]: ISchemaProperties;
|
|
27
|
-
};
|
|
28
|
-
/** Prune Actor README if it is too long
|
|
29
|
-
* If the README is too long
|
|
30
|
-
* - We keep the README as it is up to the limit.
|
|
31
|
-
* - After the limit, we keep heading only
|
|
32
|
-
* - We add a note that the README was truncated because it was too long.
|
|
33
|
-
*/
|
|
34
|
-
export declare function truncateActorReadme(readme: string, limit?: number): string;
|
|
35
|
-
/**
|
|
36
|
-
* Helps determine the type of items in an array schema property.
|
|
37
|
-
* Priority order: explicit type in items > prefill type > default value type > editor type.
|
|
38
|
-
*
|
|
39
|
-
* Based on JSON schema, the array needs a type, and most of the time Actor input schema does not have this, so we need to infer that.
|
|
40
|
-
*
|
|
41
|
-
*/
|
|
42
|
-
export declare function inferArrayItemType(property: ISchemaProperties): string | null;
|
|
43
|
-
/**
|
|
44
|
-
* Filters schema properties to include only the necessary fields.
|
|
45
|
-
*
|
|
46
|
-
* This is done to reduce the size of the input schema and to make it more readable.
|
|
47
|
-
*
|
|
48
|
-
* @param properties
|
|
49
|
-
*/
|
|
50
|
-
export declare function filterSchemaProperties(properties: {
|
|
51
|
-
[key: string]: ISchemaProperties;
|
|
52
|
-
}): {
|
|
53
|
-
[key: string]: ISchemaProperties;
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* Fetches actor input schemas by Actor IDs or Actor full names and creates MCP tools.
|
|
57
|
-
*
|
|
58
|
-
* This function retrieves the input schemas for the specified actors and compiles them into MCP tools.
|
|
59
|
-
* It uses the AJV library to validate the input schemas.
|
|
60
|
-
*
|
|
61
|
-
* Tool name can't contain /, so it is replaced with _
|
|
62
|
-
*
|
|
63
|
-
* The input schema processing workflow:
|
|
64
|
-
* 1. Properties are marked as required using markInputPropertiesAsRequired() to add "REQUIRED" prefix to descriptions
|
|
65
|
-
* 2. Nested properties are built by analyzing editor type (proxy, requestListSources) using buildNestedProperties()
|
|
66
|
-
* 3. Properties are filtered using filterSchemaProperties()
|
|
67
|
-
* 4. Properties are shortened using shortenProperties()
|
|
68
|
-
* 5. Enums are added to descriptions with examples using addEnumsToDescriptionsWithExamples()
|
|
69
|
-
*
|
|
70
|
-
* @param {string[]} actors - An array of actor IDs or Actor full names.
|
|
71
|
-
* @returns {Promise<Tool[]>} - A promise that resolves to an array of MCP tools.
|
|
72
|
-
*/
|
|
73
|
-
export declare function getActorsAsTools(actors: string[]): Promise<Tool[]>;
|
|
74
|
-
//# sourceMappingURL=actors.d.ts.map
|
package/dist/actors.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"actors.d.ts","sourceRoot":"","sources":["../src/actors.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAA8C,iBAAiB,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAE7H,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAK7D;AAED;;;;;;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KAAK,CAAC,UAAU,CAAC,CAAC;YAC1F,CAAC;YACD,IAAI,CAAC;gBACD,MAAM,YAAY,GAAG,MAAM,CAAC,iBAAiB,EAAE,YAAY,IAAI,QAAQ,CAAC,eAAe,CAAC;gBACxF,KAAK,CAAC,IAAI,CAAC;oBACP,IAAI,EAAE,mBAAmB,CAAC,MAAM,CAAC,aAAa,CAAC;oBAC/C,aAAa,EAAE,MAAM,CAAC,aAAa;oBACnC,WAAW,EAAE,GAAG,MAAM,CAAC,WAAW,kBAAkB,6BAA6B,EAAE;oBACnF,WAAW,EAAE,MAAM,CAAC,KAAK,IAAI,EAAE;oBAC/B,WAAW,EAAE,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC;oBAC5C,YAAY,EAAE,YAAY,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,YAAY;iBAClG,CAAC,CAAC;YACP,CAAC;YAAC,OAAO,eAAe,EAAE,CAAC;gBACvB,GAAG,CAAC,KAAK,CAAC,2CAA2C,MAAM,CAAC,aAAa,YAAY,eAAe,EAAE,CAAC,CAAC;YAC5G,CAAC;QACL,CAAC;IACL,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC"}
|
package/dist/input.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../src/input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,aAAa,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAWhF"}
|
package/dist/input.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","sourceRoot":"","sources":["../src/input.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,aAA6B;IAC5D,MAAM,KAAK,GAAG,aAAsB,CAAC;IAErC,gDAAgD;IAChD,IAAI,KAAK,CAAC,MAAM,IAAI,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QACnD,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,MAAc,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,CAAa,CAAC;IAC9F,CAAC;IACD,IAAI,CAAC,KAAK,CAAC,sBAAsB,EAAE,CAAC;QAChC,KAAK,CAAC,sBAAsB,GAAG,KAAK,CAAC;IACzC,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC"}
|
package/dist/logger.d.ts
DELETED
package/dist/logger.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAI5B,OAAO,EAAE,GAAG,EAAE,CAAC"}
|
package/dist/logger.js
DELETED
package/dist/logger.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAE/B,OAAO,EAAE,GAAG,EAAE,CAAC"}
|
package/dist/server.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import type { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
|
|
3
|
-
import type { ActorCallOptions } from 'apify-client';
|
|
4
|
-
import type { Tool } from './types.js';
|
|
5
|
-
/**
|
|
6
|
-
* Create Apify MCP server
|
|
7
|
-
*/
|
|
8
|
-
export declare class ApifyMcpServer {
|
|
9
|
-
private server;
|
|
10
|
-
private tools;
|
|
11
|
-
constructor();
|
|
12
|
-
/**
|
|
13
|
-
* Adds a User-Agent header to the request config.
|
|
14
|
-
* @param config
|
|
15
|
-
* @private
|
|
16
|
-
*/
|
|
17
|
-
private addUserAgent;
|
|
18
|
-
/**
|
|
19
|
-
* Calls an Apify actor and retrieves the dataset items.
|
|
20
|
-
*
|
|
21
|
-
* It requires the `APIFY_TOKEN` environment variable to be set.
|
|
22
|
-
* If the `APIFY_IS_AT_HOME` the dataset items are pushed to the Apify dataset.
|
|
23
|
-
*
|
|
24
|
-
* @param {string} actorName - The name of the actor to call.
|
|
25
|
-
* @param {ActorCallOptions} callOptions - The options to pass to the actor.
|
|
26
|
-
* @param {unknown} input - The input to pass to the actor.
|
|
27
|
-
* @returns {Promise<object[]>} - A promise that resolves to an array of dataset items.
|
|
28
|
-
* @throws {Error} - Throws an error if the `APIFY_TOKEN` is not set
|
|
29
|
-
*/
|
|
30
|
-
callActorGetDataset(actorName: string, input: unknown, callOptions?: ActorCallOptions | undefined): Promise<object[]>;
|
|
31
|
-
addToolsFromActors(actors: string[]): Promise<Tool[]>;
|
|
32
|
-
addToolsFromDefaultActors(): Promise<void>;
|
|
33
|
-
updateTools(tools: Tool[]): void;
|
|
34
|
-
/**
|
|
35
|
-
* Returns an array of tool names.
|
|
36
|
-
* @returns {string[]} - An array of tool names.
|
|
37
|
-
*/
|
|
38
|
-
getToolNames(): string[];
|
|
39
|
-
private setupErrorHandling;
|
|
40
|
-
private setupToolHandlers;
|
|
41
|
-
connect(transport: Transport): Promise<void>;
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=server.d.ts.map
|
package/dist/server.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAI/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AA2BrD,OAAO,KAAK,EAAqB,IAAI,EAAE,MAAM,YAAY,CAAC;AAE1D;;GAEG;AACH,qBAAa,cAAc;IACvB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,KAAK,CAAoB;;IAmBjC;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAOpB;;;;;;;;;;;OAWG;IACU,mBAAmB,CAC5B,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,OAAO,EACd,WAAW,GAAE,gBAAgB,GAAG,SAAqB,GACtD,OAAO,CAAC,MAAM,EAAE,CAAC;IAwBP,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE;IAMnC,yBAAyB;IAI/B,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI;IAOvC;;;OAGG;IACI,YAAY,IAAI,MAAM,EAAE;IAI/B,OAAO,CAAC,kBAAkB;IAU1B,OAAO,CAAC,iBAAiB;IA2EnB,OAAO,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;CAGrD"}
|
package/dist/server.js
DELETED
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Model Context Protocol (MCP) server for Apify Actors
|
|
4
|
-
*/
|
|
5
|
-
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
6
|
-
import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
-
import { Actor } from 'apify';
|
|
8
|
-
import { ApifyClient } from 'apify-client';
|
|
9
|
-
import { filterSchemaProperties, getActorDefinition, getActorsAsTools, shortenProperties, } from './actors.js';
|
|
10
|
-
import { ACTOR_OUTPUT_MAX_CHARS_PER_ITEM, ACTOR_OUTPUT_TRUNCATED_MESSAGE, defaults, InternalTools, SERVER_NAME, SERVER_VERSION, USER_AGENT_ORIGIN, } from './const.js';
|
|
11
|
-
import { log } from './logger.js';
|
|
12
|
-
import { RemoveActorToolArgsSchema, AddActorToToolsArgsSchema, DiscoverActorsArgsSchema, searchActorsByKeywords, GetActorDefinition, } from './tools.js';
|
|
13
|
-
/**
|
|
14
|
-
* Create Apify MCP server
|
|
15
|
-
*/
|
|
16
|
-
export class ApifyMcpServer {
|
|
17
|
-
server;
|
|
18
|
-
tools;
|
|
19
|
-
constructor() {
|
|
20
|
-
this.server = new Server({
|
|
21
|
-
name: SERVER_NAME,
|
|
22
|
-
version: SERVER_VERSION,
|
|
23
|
-
}, {
|
|
24
|
-
capabilities: {
|
|
25
|
-
tools: { listChanged: true },
|
|
26
|
-
},
|
|
27
|
-
});
|
|
28
|
-
this.tools = new Map();
|
|
29
|
-
this.setupErrorHandling();
|
|
30
|
-
this.setupToolHandlers();
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Adds a User-Agent header to the request config.
|
|
34
|
-
* @param config
|
|
35
|
-
* @private
|
|
36
|
-
*/
|
|
37
|
-
addUserAgent(config) {
|
|
38
|
-
const updatedConfig = { ...config };
|
|
39
|
-
updatedConfig.headers = updatedConfig.headers ?? {};
|
|
40
|
-
updatedConfig.headers['User-Agent'] = `${updatedConfig.headers['User-Agent'] ?? ''}; ${USER_AGENT_ORIGIN}`;
|
|
41
|
-
return updatedConfig;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Calls an Apify actor and retrieves the dataset items.
|
|
45
|
-
*
|
|
46
|
-
* It requires the `APIFY_TOKEN` environment variable to be set.
|
|
47
|
-
* If the `APIFY_IS_AT_HOME` the dataset items are pushed to the Apify dataset.
|
|
48
|
-
*
|
|
49
|
-
* @param {string} actorName - The name of the actor to call.
|
|
50
|
-
* @param {ActorCallOptions} callOptions - The options to pass to the actor.
|
|
51
|
-
* @param {unknown} input - The input to pass to the actor.
|
|
52
|
-
* @returns {Promise<object[]>} - A promise that resolves to an array of dataset items.
|
|
53
|
-
* @throws {Error} - Throws an error if the `APIFY_TOKEN` is not set
|
|
54
|
-
*/
|
|
55
|
-
async callActorGetDataset(actorName, input, callOptions = undefined) {
|
|
56
|
-
const name = actorName;
|
|
57
|
-
try {
|
|
58
|
-
log.info(`Calling actor ${name} with input: ${JSON.stringify(input)}`);
|
|
59
|
-
const options = { requestInterceptors: [this.addUserAgent] };
|
|
60
|
-
const client = new ApifyClient({ ...options, token: process.env.APIFY_TOKEN });
|
|
61
|
-
const actorClient = client.actor(name);
|
|
62
|
-
const results = await actorClient.call(input, callOptions);
|
|
63
|
-
const dataset = await client.dataset(results.defaultDatasetId).listItems();
|
|
64
|
-
log.info(`Actor ${name} finished with ${dataset.items.length} items`);
|
|
65
|
-
if (process.env.APIFY_IS_AT_HOME) {
|
|
66
|
-
await Actor.pushData(dataset.items);
|
|
67
|
-
log.info(`Pushed ${dataset.items.length} items to the dataset`);
|
|
68
|
-
}
|
|
69
|
-
return dataset.items;
|
|
70
|
-
}
|
|
71
|
-
catch (error) {
|
|
72
|
-
log.error(`Error calling actor: ${error}. Actor: ${name}, input: ${JSON.stringify(input)}`);
|
|
73
|
-
throw new Error(`Error calling actor: ${error}`);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
async addToolsFromActors(actors) {
|
|
77
|
-
const tools = await getActorsAsTools(actors);
|
|
78
|
-
this.updateTools(tools);
|
|
79
|
-
return tools;
|
|
80
|
-
}
|
|
81
|
-
async addToolsFromDefaultActors() {
|
|
82
|
-
await this.addToolsFromActors(defaults.actors);
|
|
83
|
-
}
|
|
84
|
-
updateTools(tools) {
|
|
85
|
-
for (const tool of tools) {
|
|
86
|
-
this.tools.set(tool.name, tool);
|
|
87
|
-
log.info(`Added/Updated tool: ${tool.actorFullName} (tool: ${tool.name})`);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Returns an array of tool names.
|
|
92
|
-
* @returns {string[]} - An array of tool names.
|
|
93
|
-
*/
|
|
94
|
-
getToolNames() {
|
|
95
|
-
return Array.from(this.tools.keys());
|
|
96
|
-
}
|
|
97
|
-
setupErrorHandling() {
|
|
98
|
-
this.server.onerror = (error) => {
|
|
99
|
-
console.error('[MCP Error]', error); // eslint-disable-line no-console
|
|
100
|
-
};
|
|
101
|
-
process.on('SIGINT', async () => {
|
|
102
|
-
await this.server.close();
|
|
103
|
-
process.exit(0);
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
setupToolHandlers() {
|
|
107
|
-
this.server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
108
|
-
return { tools: Array.from(this.tools.values()) };
|
|
109
|
-
});
|
|
110
|
-
/**
|
|
111
|
-
* Handles the request to call a tool.
|
|
112
|
-
* @param {object} request - The request object containing tool name and arguments.
|
|
113
|
-
* @throws {Error} - Throws an error if the tool is unknown or arguments are invalid.
|
|
114
|
-
*/
|
|
115
|
-
this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
116
|
-
const { name, arguments: args } = request.params;
|
|
117
|
-
const tool = Array.from(this.tools.values()).find((t) => t.name === name || t.actorFullName === name);
|
|
118
|
-
if (!tool) {
|
|
119
|
-
throw new Error(`Unknown tool: ${name}`);
|
|
120
|
-
}
|
|
121
|
-
if (!args) {
|
|
122
|
-
throw new Error(`Missing arguments for tool: ${name}`);
|
|
123
|
-
}
|
|
124
|
-
log.info(`Validate arguments for tool: ${tool.name} with arguments: ${JSON.stringify(args)}`);
|
|
125
|
-
if (!tool.ajvValidate(args)) {
|
|
126
|
-
throw new Error(`Invalid arguments for tool ${tool.name}: args: ${JSON.stringify(args)} error: ${JSON.stringify(tool?.ajvValidate.errors)}`);
|
|
127
|
-
}
|
|
128
|
-
try {
|
|
129
|
-
switch (name) {
|
|
130
|
-
case InternalTools.ADD_ACTOR_TO_TOOLS: {
|
|
131
|
-
const parsed = AddActorToToolsArgsSchema.parse(args);
|
|
132
|
-
const toolsAdded = await this.addToolsFromActors([parsed.actorName]);
|
|
133
|
-
await this.server.notification({ method: 'notifications/tools/list_changed' });
|
|
134
|
-
return { content: [{ type: 'text', text: `Actor added: ${toolsAdded.map((t) => `${t.actorFullName} (tool name: ${t.name})`).join(', ')}` }] };
|
|
135
|
-
}
|
|
136
|
-
case InternalTools.REMOVE_ACTOR_FROM_TOOLS: {
|
|
137
|
-
const parsed = RemoveActorToolArgsSchema.parse(args);
|
|
138
|
-
this.tools.delete(parsed.toolName);
|
|
139
|
-
await this.server.notification({ method: 'notifications/tools/list_changed' });
|
|
140
|
-
return { content: [{ type: 'text', text: `Tool ${parsed.toolName} was removed` }] };
|
|
141
|
-
}
|
|
142
|
-
case InternalTools.DISCOVER_ACTORS: {
|
|
143
|
-
const parsed = DiscoverActorsArgsSchema.parse(args);
|
|
144
|
-
const actors = await searchActorsByKeywords(parsed.search, parsed.limit, parsed.offset);
|
|
145
|
-
return { content: actors?.map((item) => ({ type: 'text', text: JSON.stringify(item) })) };
|
|
146
|
-
}
|
|
147
|
-
case InternalTools.GET_ACTOR_DETAILS: {
|
|
148
|
-
const parsed = GetActorDefinition.parse(args);
|
|
149
|
-
const v = await getActorDefinition(parsed.actorName, parsed.limit);
|
|
150
|
-
if (v && v.input && 'properties' in v.input && v.input) {
|
|
151
|
-
const properties = filterSchemaProperties(v.input.properties);
|
|
152
|
-
v.input.properties = shortenProperties(properties);
|
|
153
|
-
}
|
|
154
|
-
return { content: [{ type: 'text', text: JSON.stringify(v) }] };
|
|
155
|
-
}
|
|
156
|
-
default: {
|
|
157
|
-
const items = await this.callActorGetDataset(tool.actorFullName, args, { memory: tool.memoryMbytes });
|
|
158
|
-
const content = items.map((item) => {
|
|
159
|
-
const text = JSON.stringify(item).slice(0, ACTOR_OUTPUT_MAX_CHARS_PER_ITEM);
|
|
160
|
-
return text.length === ACTOR_OUTPUT_MAX_CHARS_PER_ITEM
|
|
161
|
-
? { type: 'text', text: `${text} ... ${ACTOR_OUTPUT_TRUNCATED_MESSAGE}` }
|
|
162
|
-
: { type: 'text', text };
|
|
163
|
-
});
|
|
164
|
-
return { content };
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
catch (error) {
|
|
169
|
-
log.error(`Error calling tool: ${error}`);
|
|
170
|
-
throw new Error(`Error calling tool: ${error}`);
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
async connect(transport) {
|
|
175
|
-
await this.server.connect(transport);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
//# sourceMappingURL=server.js.map
|
package/dist/server.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AACA;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAEnE,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAEnG,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAE9B,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG3C,OAAO,EACH,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EACH,+BAA+B,EAC/B,8BAA8B,EAC9B,QAAQ,EACR,aAAa,EACb,WAAW,EACX,cAAc,EACd,iBAAiB,GACpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EACH,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,EACtB,kBAAkB,GACrB,MAAM,YAAY,CAAC;AAGpB;;GAEG;AACH,MAAM,OAAO,cAAc;IACf,MAAM,CAAS;IACf,KAAK,CAAoB;IAEjC;QACI,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CACpB;YACI,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE,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AAC,CAAC;IACzC,CAAC;CACJ"}
|
package/dist/tools.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import type { ActorStorePruned, Tool } from './types.js';
|
|
3
|
-
export declare const DiscoverActorsArgsSchema: z.ZodObject<{
|
|
4
|
-
limit: z.ZodDefault<z.ZodNumber>;
|
|
5
|
-
offset: z.ZodDefault<z.ZodNumber>;
|
|
6
|
-
search: z.ZodDefault<z.ZodString>;
|
|
7
|
-
category: z.ZodDefault<z.ZodString>;
|
|
8
|
-
}, "strip", z.ZodTypeAny, {
|
|
9
|
-
search: string;
|
|
10
|
-
limit: number;
|
|
11
|
-
offset: number;
|
|
12
|
-
category: string;
|
|
13
|
-
}, {
|
|
14
|
-
search?: string | undefined;
|
|
15
|
-
limit?: number | undefined;
|
|
16
|
-
offset?: number | undefined;
|
|
17
|
-
category?: string | undefined;
|
|
18
|
-
}>;
|
|
19
|
-
export declare const RemoveActorToolArgsSchema: z.ZodObject<{
|
|
20
|
-
toolName: z.ZodEffects<z.ZodString, string, string>;
|
|
21
|
-
}, "strip", z.ZodTypeAny, {
|
|
22
|
-
toolName: string;
|
|
23
|
-
}, {
|
|
24
|
-
toolName: string;
|
|
25
|
-
}>;
|
|
26
|
-
export declare const AddActorToToolsArgsSchema: z.ZodObject<{
|
|
27
|
-
actorName: z.ZodString;
|
|
28
|
-
}, "strip", z.ZodTypeAny, {
|
|
29
|
-
actorName: string;
|
|
30
|
-
}, {
|
|
31
|
-
actorName: string;
|
|
32
|
-
}>;
|
|
33
|
-
export declare const GetActorDefinition: z.ZodObject<{
|
|
34
|
-
actorName: z.ZodString;
|
|
35
|
-
limit: z.ZodDefault<z.ZodNumber>;
|
|
36
|
-
}, "strip", z.ZodTypeAny, {
|
|
37
|
-
limit: number;
|
|
38
|
-
actorName: string;
|
|
39
|
-
}, {
|
|
40
|
-
actorName: string;
|
|
41
|
-
limit?: number | undefined;
|
|
42
|
-
}>;
|
|
43
|
-
export declare function getActorAutoLoadingTools(): Tool[];
|
|
44
|
-
export declare function getActorDiscoveryTools(): Tool[];
|
|
45
|
-
export declare function searchActorsByKeywords(search: string, limit?: number | undefined, offset?: number | undefined): Promise<ActorStorePruned[] | null>;
|
|
46
|
-
//# sourceMappingURL=tools.d.ts.map
|
package/dist/tools.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,KAAK,EAAE,gBAAgB,EAAe,IAAI,EAAE,MAAM,YAAY,CAAC;AAEtE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;EAqBnC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;EAIpC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;EAIpC,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;EAQ7B,CAAC;AAEH,wBAAgB,wBAAwB,IAAI,IAAI,EAAE,CAsBjD;AAED,wBAAgB,sBAAsB,IAAI,IAAI,EAAE,CA0B/C;AA4BD,wBAAsB,sBAAsB,CACxC,MAAM,EAAE,MAAM,EACd,KAAK,GAAE,MAAM,GAAG,SAAqB,EACrC,MAAM,GAAE,MAAM,GAAG,SAAqB,GACvC,OAAO,CAAC,gBAAgB,EAAE,GAAG,IAAI,CAAC,CAIpC"}
|