@apify/actors-mcp-server 0.1.0 → 0.1.1-beta.1

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/LICENSE.md ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "{}"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2024 Apify Technologies s.r.o.
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Apify Model Context Protocol (MCP) Server
2
2
 
3
+ [![Actors MCP Server](https://apify.com/actor-badge?actor=apify/actors-mcp-server)](https://apify.com/apify/actors-mcp-server)
4
+
3
5
  Implementation of an MCP server for all [Apify Actors](https://apify.com/store).
4
6
  This server enables interaction with one or more Apify Actors that can be defined in the MCP Server configuration.
5
7
 
@@ -99,7 +101,7 @@ You can find a list of all available Actors in the [Apify Store](https://apify.c
99
101
 
100
102
  Once the server is running, you can interact with Server-Sent Events (SSE) to send messages to the server and receive responses.
101
103
  You can use MCP clients such as [Superinference.ai](https://superinterface.ai/) or [LibreChat](https://www.librechat.ai/).
102
- ([Claude Desktop](https://claude.ai/download) does not support SSE transport yet)
104
+ ([Claude Desktop](https://claude.ai/download) does not support SSE transport yet, see [Claude Desktop Configuration](#claude-desktop) section for more details).
103
105
 
104
106
  In the client settings you need to provide server configuration:
105
107
  ```json
@@ -129,7 +131,7 @@ Alternatively, you can use simple python [client_see.py](https://github.com/apif
129
131
 
130
132
  2. Send a message to the server by making a POST request with the `sessionId`:
131
133
  ```shell
132
- curl -X POST "https://actors-mcp-server.apify.actor?token=<APIFY_TOKEN>&session_id=a1b" -H "Content-Type: application/json" -d '{
134
+ curl -X POST "https://actors-mcp-server.apify.actor/message?token=<APIFY_TOKEN>&session_id=a1b" -H "Content-Type: application/json" -d '{
133
135
  "jsonrpc": "2.0",
134
136
  "id": 1,
135
137
  "method": "tools/call",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apify/actors-mcp-server",
3
- "version": "0.1.0",
3
+ "version": "0.1.1-beta.1",
4
4
  "type": "module",
5
5
  "description": "Model Context Protocol Server for Apify Actors",
6
6
  "engines": {
@@ -10,6 +10,11 @@
10
10
  "bin": {
11
11
  "actors-mcp-server": "dist/index.js"
12
12
  },
13
+ "files": [
14
+ "dist/**",
15
+ "src/**",
16
+ "LICENSE"
17
+ ],
13
18
  "repository": {
14
19
  "type": "git",
15
20
  "url": "https://github.com/apify/actors-mcp-server.git"
@@ -55,7 +60,8 @@
55
60
  "lint:fix": "eslint . --fix",
56
61
  "build": "tsc",
57
62
  "test": "echo \"Error: oops, the actor has no tests yet, sad!\" && exit 1",
58
- "watch": "tsc --watch"
63
+ "watch": "tsc --watch",
64
+ "inspector": "npx @modelcontextprotocol/inspector dist/index.js"
59
65
  },
60
66
  "author": "Apify",
61
67
  "license": "MIT"
package/src/main.ts CHANGED
@@ -24,7 +24,7 @@ const mcpServer = new ApifyMcpServer();
24
24
  let transport: SSEServerTransport;
25
25
 
26
26
  const HELP_MESSAGE = `Connect to the server with GET request to ${HOST}/sse?token=YOUR-APIFY-TOKEN`
27
- + ` and then send POST requests to ${HOST}/message?token=YOUR-APIFY-TOKEN.`;
27
+ + ` and then send POST requests to ${HOST}/message?token=YOUR-APIFY-TOKEN`;
28
28
 
29
29
  /**
30
30
  * Process input parameters and update tools
@@ -44,42 +44,51 @@ async function processParamsAndUpdateTools(url: string) {
44
44
  }
45
45
  }
46
46
 
47
- app.get(Routes.ROOT, async (req: Request, res: Response) => {
48
- try {
49
- log.info(`Received GET message at: ${req.url}`);
50
- await processParamsAndUpdateTools(req.url);
51
- res.status(200).json({ message: `Actor is using Model Context Protocol. ${HELP_MESSAGE}` }).end();
52
- } catch (error) {
53
- log.error(`Error in GET ${Routes.ROOT} ${error}`);
54
- res.status(500).json({ message: 'Internal Server Error' }).end();
55
- }
56
- });
57
-
58
- app.head(Routes.ROOT, (_req: Request, res: Response) => {
59
- res.status(200).end();
60
- });
47
+ app.route(Routes.ROOT)
48
+ .get(async (req: Request, res: Response) => {
49
+ try {
50
+ log.info(`Received GET message at: ${req.url}`);
51
+ await processParamsAndUpdateTools(req.url);
52
+ res.status(200).json({ message: `Actor is using Model Context Protocol. ${HELP_MESSAGE}` }).end();
53
+ } catch (error) {
54
+ log.error(`Error in GET ${Routes.ROOT} ${error}`);
55
+ res.status(500).json({ message: 'Internal Server Error' }).end();
56
+ }
57
+ })
58
+ .head((_req: Request, res: Response) => {
59
+ res.status(200).end();
60
+ });
61
61
 
62
- app.get(Routes.SSE, async (req: Request, res: Response) => {
63
- try {
64
- log.info(`Received GET message at: ${req.url}`);
65
- await processParamsAndUpdateTools(req.url);
66
- transport = new SSEServerTransport(Routes.MESSAGE, res);
67
- await mcpServer.connect(transport);
68
- } catch (error) {
69
- log.error(`Error in GET ${Routes.SSE}: ${error}`);
70
- res.status(500).json({ message: 'Internal Server Error' }).end();
71
- }
72
- });
62
+ app.route(Routes.SSE)
63
+ .get(async (req: Request, res: Response) => {
64
+ try {
65
+ log.info(`Received GET message at: ${req.url}`);
66
+ await processParamsAndUpdateTools(req.url);
67
+ transport = new SSEServerTransport(Routes.MESSAGE, res);
68
+ await mcpServer.connect(transport);
69
+ } catch (error) {
70
+ log.error(`Error in GET ${Routes.SSE}: ${error}`);
71
+ res.status(500).json({ message: 'Internal Server Error' }).end();
72
+ }
73
+ });
73
74
 
74
- app.post(Routes.MESSAGE, async (req: Request, res: Response) => {
75
- try {
76
- log.info(`Received POST message at: ${req.url}`);
77
- await transport.handlePostMessage(req, res);
78
- } catch (error) {
79
- log.error(`Error in POST ${Routes.MESSAGE}: ${error}`);
80
- res.status(500).json({ message: 'Internal Server Error' }).end();
81
- }
82
- });
75
+ app.route(Routes.MESSAGE)
76
+ .post(async (req: Request, res: Response) => {
77
+ try {
78
+ log.info(`Received POST message at: ${req.url}`);
79
+ if (transport) {
80
+ await transport.handlePostMessage(req, res);
81
+ } else {
82
+ res.status(400).json({
83
+ message: 'Server is not connected to the client. '
84
+ + 'Connect to the server with GET request to /sse endpoint',
85
+ });
86
+ }
87
+ } catch (error) {
88
+ log.error(`Error in POST ${Routes.MESSAGE}: ${error}`);
89
+ res.status(500).json({ message: 'Internal Server Error' }).end();
90
+ }
91
+ });
83
92
 
84
93
  // Catch-all for undefined routes
85
94
  app.use((req: Request, res: Response) => {
@@ -93,13 +102,13 @@ if (STANDBY_MODE) {
93
102
  log.info('Actor is running in the STANDBY mode.');
94
103
  await mcpServer.addToolsFromDefaultActors();
95
104
  app.listen(PORT, () => {
96
- log.info(`The Actor web server is listening for user requests at ${HOST}.`);
105
+ log.info(`The Actor web server is listening for user requests at ${HOST}`);
97
106
  });
98
107
  } else {
99
108
  log.info('Actor is not designed to run in the NORMAL model (use this mode only for debugging purposes)');
100
109
 
101
110
  if (input && !input.debugActor && !input.debugActorInput) {
102
- await Actor.fail('If you need to debug a specific actor, please provide the debugActor and debugActorInput fields in the input.');
111
+ await Actor.fail('If you need to debug a specific actor, please provide the debugActor and debugActorInput fields in the input');
103
112
  }
104
113
  await mcpServer.callActorGetDataset(input.debugActor!, input.debugActorInput!);
105
114
  await Actor.exit();
package/.actor/Dockerfile DELETED
@@ -1,57 +0,0 @@
1
- # Specify the base Docker image. You can read more about
2
- # the available images at https://docs.apify.com/sdk/js/docs/guides/docker-images
3
- # You can also use any other image from Docker Hub.
4
- FROM apify/actor-node:20 AS builder
5
-
6
- # Check preinstalled packages
7
- RUN npm ls crawlee apify puppeteer playwright
8
-
9
- # Copy just package.json and package-lock.json
10
- # to speed up the build using Docker layer cache.
11
- COPY package*.json ./
12
-
13
- # Install all dependencies. Don't audit to speed up the installation.
14
- RUN npm install --include=dev --audit=false
15
-
16
- # Next, copy the source files using the user set
17
- # in the base image.
18
- COPY . ./
19
-
20
- # Install all dependencies and build the project.
21
- # Don't audit to speed up the installation.
22
- RUN npm run build
23
-
24
- # Create final image
25
- FROM apify/actor-node:20
26
-
27
- # Check preinstalled packages
28
- RUN npm ls crawlee apify puppeteer playwright
29
-
30
- # Copy just package.json and package-lock.json
31
- # to speed up the build using Docker layer cache.
32
- COPY package*.json ./
33
-
34
- # Install NPM packages, skip optional and development dependencies to
35
- # keep the image small. Avoid logging too much and print the dependency
36
- # tree for debugging
37
- RUN npm --quiet set progress=false \
38
- && npm install --omit=dev --omit=optional \
39
- && echo "Installed NPM packages:" \
40
- && (npm list --omit=dev --all || true) \
41
- && echo "Node.js version:" \
42
- && node --version \
43
- && echo "NPM version:" \
44
- && npm --version \
45
- && rm -r ~/.npm
46
-
47
- # Copy built JS files from builder image
48
- COPY --from=builder /usr/src/app/dist ./dist
49
-
50
- # Next, copy the remaining files and directories with the source code.
51
- # Since we do this after NPM install, quick build will be really fast
52
- # for most source file changes.
53
- COPY . ./
54
-
55
-
56
- # Run the image.
57
- CMD npm run start:prod --silent
package/.actor/actor.json DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "actorSpecification": 1,
3
- "name": "apify-mcp-server",
4
- "title": "Model Context Protocol Server for Apify Actors",
5
- "description": "Implementation of a Model Context Protocol (MCP) Server for Apify Actors that enables AI applications (and AI agents) to interact with Apify Actors",
6
- "version": "0.1",
7
- "input": "./input_schema.json",
8
- "dockerfile": "./Dockerfile"
9
- }
@@ -1,35 +0,0 @@
1
- {
2
- "title": "Apify MCP Server",
3
- "type": "object",
4
- "schemaVersion": 1,
5
- "properties": {
6
- "actors": {
7
- "title": "Actors to be exposed for an AI application (AI agent)",
8
- "type": "array",
9
- "description": "List Actors to be exposed to an AI application (AI agent) for communication via the MCP protocol. \n\n Ensure the Actor definitions fit within the LLM context by limiting the number of used Actors.",
10
- "editor": "stringList",
11
- "prefill": [
12
- "apify/instagram-scraper",
13
- "apify/rag-web-browser",
14
- "lukaskrivka/google-maps-with-contact-details"
15
- ]
16
- },
17
- "debugActor": {
18
- "title": "Debug Actor",
19
- "type": "string",
20
- "description": "Specify the name of the Actor that will be used for debugging in normal mode",
21
- "editor": "textfield",
22
- "prefill": "apify/rag-web-browser",
23
- "sectionCaption": "Debugging settings (normal mode)"
24
- },
25
- "debugActorInput": {
26
- "title": "Debug Actor input",
27
- "type": "object",
28
- "description": "Specify the input for the Actor that will be used for debugging in normal mode",
29
- "editor": "json",
30
- "prefill": {
31
- "query": "hello world"
32
- }
33
- }
34
- }
35
- }
package/.dockerignore DELETED
@@ -1,19 +0,0 @@
1
- # configurations
2
- .idea
3
-
4
- # crawlee and apify storage folders
5
- apify_storage
6
- crawlee_storage
7
- storage
8
-
9
- # installed files
10
- node_modules
11
-
12
- # git folder
13
- .git
14
-
15
- # data
16
- data
17
- src/storage
18
- dist
19
- .env
package/.editorconfig DELETED
@@ -1,9 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- indent_style = space
5
- indent_size = 4
6
- charset = utf-8
7
- trim_trailing_whitespace = true
8
- insert_final_newline = true
9
- end_of_line = lf
package/.env.example DELETED
@@ -1,3 +0,0 @@
1
- APIFY_TOKEN=
2
- # ANTHROPIC_API_KEY is only required when you want to run examples/clientStdioChat.js
3
- ANTHROPIC_API_KEY=
@@ -1,32 +0,0 @@
1
- const { execSync } = require('child_process');
2
- const fs = require('fs');
3
- const path = require('path');
4
-
5
- const PKG_JSON_PATH = path.join(__dirname, '..', '..', 'package.json');
6
-
7
- const pkgJson = require(PKG_JSON_PATH); // eslint-disable-line import/no-dynamic-require
8
-
9
- const PACKAGE_NAME = pkgJson.name;
10
- const VERSION = pkgJson.version;
11
-
12
- const nextVersion = getNextVersion(VERSION);
13
- console.log(`before-deploy: Setting version to ${nextVersion}`); // eslint-disable-line no-console
14
- pkgJson.version = nextVersion;
15
-
16
- fs.writeFileSync(PKG_JSON_PATH, `${JSON.stringify(pkgJson, null, 2)}\n`);
17
-
18
- function getNextVersion(version) {
19
- const versionString = execSync(`npm show ${PACKAGE_NAME} versions --json`, { encoding: 'utf8' });
20
- const versions = JSON.parse(versionString);
21
-
22
- if (versions.some((v) => v === VERSION)) {
23
- console.error(`before-deploy: A release with version ${VERSION} already exists. Please increment version accordingly.`); // eslint-disable-line no-console
24
- process.exit(1);
25
- }
26
-
27
- const prereleaseNumbers = versions
28
- .filter((v) => (v.startsWith(VERSION) && v.includes('-')))
29
- .map((v) => Number(v.match(/\.(\d+)$/)[1]));
30
- const lastPrereleaseNumber = Math.max(-1, ...prereleaseNumbers);
31
- return `${version}-beta.${lastPrereleaseNumber + 1}`;
32
- }
@@ -1,31 +0,0 @@
1
- # This workflow runs for every pull request to lint and test the proposed changes.
2
-
3
- name: Check
4
-
5
- on:
6
- pull_request:
7
-
8
- # Push to master will trigger code checks
9
- push:
10
- branches:
11
- - master
12
- - 'fix/ci' # TODO remove this branch after CI is fixed
13
- tags-ignore:
14
- - "**" # Ignore all tags to prevent duplicate builds when tags are pushed.
15
-
16
- jobs:
17
- lint:
18
- name: Lint
19
- runs-on: ubuntu-latest
20
-
21
- steps:
22
- - uses: actions/checkout@v4
23
- - name: Use Node.js 22
24
- uses: actions/setup-node@v4
25
- with:
26
- node-version: 22
27
- cache: 'npm'
28
- cache-dependency-path: 'package-lock.json'
29
- - name: Install Dependencies
30
- run: npm ci
31
- - run: npm run lint
@@ -1,103 +0,0 @@
1
- name: Create a pre-release
2
-
3
- on:
4
- # Push to master will deploy a beta version
5
- push:
6
- branches:
7
- - master
8
- tags-ignore:
9
- - "**" # Ignore all tags to prevent duplicate builds when tags are pushed.
10
-
11
- concurrency:
12
- group: release
13
- cancel-in-progress: false
14
-
15
- jobs:
16
- release_metadata:
17
- if: "!startsWith(github.event.head_commit.message, 'docs') && !startsWith(github.event.head_commit.message, 'ci') && startsWith(github.repository, 'apify/')"
18
- name: Prepare release metadata
19
- runs-on: ubuntu-latest
20
- outputs:
21
- version_number: ${{ steps.release_metadata.outputs.version_number }}
22
- changelog: ${{ steps.release_metadata.outputs.changelog }}
23
- steps:
24
- - uses: apify/workflows/git-cliff-release@main
25
- name: Prepare release metadata
26
- id: release_metadata
27
- with:
28
- release_type: prerelease
29
- existing_changelog_path: CHANGELOG.md
30
-
31
- wait_for_checks:
32
- name: Wait for code checks to pass
33
- runs-on: ubuntu-latest
34
- steps:
35
- - uses: lewagon/wait-on-check-action@v1.3.4
36
- with:
37
- ref: ${{ github.ref }}
38
- repo-token: ${{ secrets.GITHUB_TOKEN }}
39
- check-name: 'Lint'
40
- wait-interval: 5
41
-
42
- update_changelog:
43
- needs: [ release_metadata, wait_for_checks ]
44
- name: Update changelog
45
- runs-on: ubuntu-latest
46
- outputs:
47
- changelog_commitish: ${{ steps.commit.outputs.commit_long_sha || github.sha }}
48
-
49
- steps:
50
- - name: Checkout repository
51
- uses: actions/checkout@v4
52
- with:
53
- token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
54
-
55
- - name: Use Node.js 22
56
- uses: actions/setup-node@v4
57
- with:
58
- node-version: 22
59
-
60
- - name: Update package version in package.json
61
- run: npm version --no-git-tag-version --allow-same-version ${{ needs.release_metadata.outputs.version_number }}
62
-
63
- - name: Update CHANGELOG.md
64
- uses: DamianReeves/write-file-action@master
65
- with:
66
- path: CHANGELOG.md
67
- write-mode: overwrite
68
- contents: ${{ needs.release_metadata.outputs.changelog }}
69
-
70
- - name: Commit changes
71
- id: commit
72
- uses: EndBug/add-and-commit@v9
73
- with:
74
- author_name: Apify Release Bot
75
- author_email: noreply@apify.com
76
- message: "chore(release): Update changelog and package version [skip ci]"
77
-
78
- publish_to_npm:
79
- name: Publish to NPM
80
- needs: [ release_metadata, wait_for_checks ]
81
- runs-on: ubuntu-latest
82
- steps:
83
- - uses: actions/checkout@v4
84
- with:
85
- ref: ${{ needs.update_changelog.changelog_commitish }}
86
- - name: Use Node.js 22
87
- uses: actions/setup-node@v4
88
- with:
89
- node-version: 22
90
- - name: Install dependencies
91
- run: |
92
- echo "access=public" >> .npmrc
93
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
94
- npm install
95
- - # Check version consistency and increment pre-release version number for beta only.
96
- name: Bump pre-release version
97
- run: node ./.github/scripts/before-beta-release.js
98
- - name: Publish to NPM
99
- run: npm publish --tag beta
100
-
101
- env:
102
- NODE_AUTH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_NPM_TOKEN }}
103
- NPM_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_NPM_TOKEN }}
@@ -1,101 +0,0 @@
1
- name: Create a pre-release (CI-test)
2
-
3
- on:
4
- # Push to master will deploy a beta version
5
- push:
6
- branches:
7
- - master
8
- - 'fix/ci'
9
- tags-ignore:
10
- - "**" # Ignore all tags to prevent duplicate builds when tags are pushed.
11
-
12
- concurrency:
13
- group: release
14
- cancel-in-progress: false
15
-
16
- jobs:
17
- release_metadata:
18
- if: "!startsWith(github.event.head_commit.message, 'docs') && !startsWith(github.event.head_commit.message, 'ci') && startsWith(github.repository, 'apify/')"
19
- name: Prepare release metadata
20
- runs-on: ubuntu-latest
21
- outputs:
22
- version_number: ${{ steps.release_metadata.outputs.version_number }}
23
- changelog: ${{ steps.release_metadata.outputs.changelog }}
24
- steps:
25
- - uses: apify/workflows/git-cliff-release@main
26
- name: Prepare release metadata
27
- id: release_metadata
28
- with:
29
- release_type: prerelease
30
- existing_changelog_path: CHANGELOG.md
31
-
32
- wait_for_checks:
33
- name: Wait for code checks to pass
34
- runs-on: ubuntu-latest
35
- steps:
36
- - uses: lewagon/wait-on-check-action@v1.3.4
37
- with:
38
- ref: ${{ github.ref }}
39
- repo-token: ${{ secrets.GITHUB_TOKEN }}
40
- check-name: 'Lint'
41
- wait-interval: 5
42
-
43
- update_changelog:
44
- needs: [ release_metadata, wait_for_checks ]
45
- name: Update changelog
46
- runs-on: ubuntu-latest
47
- outputs:
48
- changelog_commitish: ${{ steps.commit.outputs.commit_long_sha || github.sha }}
49
-
50
- steps:
51
- - name: Checkout repository
52
- uses: actions/checkout@v4
53
- with:
54
- token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
55
-
56
- - name: Use Node.js 22
57
- uses: actions/setup-node@v4
58
- with:
59
- node-version: 22
60
-
61
- - name: Update package version in package.json
62
- run: npm version --no-git-tag-version --allow-same-version ${{ needs.release_metadata.outputs.version_number }}
63
-
64
- - name: Update CHANGELOG.md
65
- uses: DamianReeves/write-file-action@master
66
- with:
67
- path: CHANGELOG.md
68
- write-mode: overwrite
69
- contents: ${{ needs.release_metadata.outputs.changelog }}
70
-
71
- - name: Commit changes
72
- id: commit
73
- uses: EndBug/add-and-commit@v9
74
- with:
75
- author_name: Apify Release Bot
76
- author_email: noreply@apify.com
77
- message: "chore(release): Update changelog and package version [skip ci]"
78
-
79
- publish_to_npm:
80
- name: Publish to NPM
81
- needs: [ release_metadata, wait_for_checks ]
82
- runs-on: ubuntu-latest
83
- steps:
84
- - uses: actions/checkout@v4
85
- with:
86
- ref: ${{ needs.update_changelog.changelog_commitish }}
87
- - name: Use Node.js 22
88
- uses: actions/setup-node@v4
89
- with:
90
- node-version: 22
91
- - name: Install dependencies
92
- run: |
93
- echo "access=public" >> .npmrc
94
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
95
- npm install
96
- - name: Publish to NPM
97
- run: npm publish --access public
98
-
99
- env:
100
- NODE_AUTH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_NPM_TOKEN }}
101
- NPM_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_NPM_TOKEN }}
@@ -1,119 +0,0 @@
1
- name: Create a release
2
-
3
- on:
4
- # Trigger a stable version release via GitHub's UI, with the ability to specify the type of release.
5
- workflow_dispatch:
6
- inputs:
7
- release_type:
8
- description: Release type
9
- required: true
10
- type: choice
11
- default: auto
12
- options:
13
- - auto
14
- - custom
15
- - patch
16
- - minor
17
- - major
18
- custom_version:
19
- description: The custom version to bump to (only for "custom" type)
20
- required: false
21
- type: string
22
- default: ""
23
-
24
- concurrency:
25
- group: release
26
- cancel-in-progress: false
27
-
28
- jobs:
29
- release_metadata:
30
- name: Prepare release metadata
31
- runs-on: ubuntu-latest
32
- outputs:
33
- version_number: ${{ steps.release_metadata.outputs.version_number }}
34
- tag_name: ${{ steps.release_metadata.outputs.tag_name }}
35
- changelog: ${{ steps.release_metadata.outputs.changelog }}
36
- release_notes: ${{ steps.release_metadata.outputs.release_notes }}
37
- steps:
38
- - uses: apify/workflows/git-cliff-release@main
39
- name: Prepare release metadata
40
- id: release_metadata
41
- with:
42
- release_type: ${{ inputs.release_type }}
43
- custom_version: ${{ inputs.custom_version }}
44
- existing_changelog_path: CHANGELOG.md
45
-
46
- update_changelog:
47
- needs: [ release_metadata ]
48
- name: Update changelog
49
- runs-on: ubuntu-latest
50
- outputs:
51
- changelog_commitish: ${{ steps.commit.outputs.commit_long_sha || github.sha }}
52
-
53
- steps:
54
- - name: Checkout repository
55
- uses: actions/checkout@v4
56
- with:
57
- token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
58
-
59
- - name: Use Node.js 22
60
- uses: actions/setup-node@v4
61
- with:
62
- node-version: 22
63
-
64
- - name: Update package version in package.json
65
- run: npm version --no-git-tag-version --allow-same-version ${{ needs.release_metadata.outputs.version_number }}
66
-
67
- - name: Update CHANGELOG.md
68
- uses: DamianReeves/write-file-action@master
69
- with:
70
- path: CHANGELOG.md
71
- write-mode: overwrite
72
- contents: ${{ needs.release_metadata.outputs.changelog }}
73
-
74
- - name: Commit changes
75
- id: commit
76
- uses: EndBug/add-and-commit@v9
77
- with:
78
- author_name: Apify Release Bot
79
- author_email: noreply@apify.com
80
- message: "chore(release): Update changelog and package version [skip ci]"
81
-
82
- create_github_release:
83
- name: Create github release
84
- needs: [release_metadata, update_changelog]
85
- runs-on: ubuntu-latest
86
- env:
87
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88
- steps:
89
- - name: Create release
90
- uses: softprops/action-gh-release@v2
91
- with:
92
- tag_name: ${{ needs.release_metadata.outputs.tag_name }}
93
- name: ${{ needs.release_metadata.outputs.version_number }}
94
- target_commitish: ${{ needs.update_changelog.outputs.changelog_commitish }}
95
- body: ${{ needs.release_metadata.outputs.release_notes }}
96
-
97
- publish_to_npm:
98
- name: Publish to NPM
99
- needs: [ update_changelog ]
100
- runs-on: ubuntu-latest
101
- steps:
102
- - uses: actions/checkout@v4
103
- with:
104
- ref: ${{ needs.update_changelog.changelog_commitish }}
105
- - name: Use Node.js 22
106
- uses: actions/setup-node@v4
107
- with:
108
- node-version: 22
109
- - name: Install dependencies
110
- run: |
111
- echo "access=public" >> .npmrc
112
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
113
- npm install
114
- - name: Publish to NPM
115
- run: npm publish --tag latest
116
-
117
- env:
118
- NODE_AUTH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_NPM_TOKEN }}
119
- NPM_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_NPM_TOKEN }}
package/CHANGELOG.md DELETED
@@ -1,19 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- <!-- git-cliff-unreleased-start -->
6
- ## 0.1.0 - **not yet released**
7
-
8
- ### 🚀 Features
9
-
10
- - MCP server implementation ([#1](https://github.com/apify/actors-mcp-server/pull/1)) ([5e2c9f0](https://github.com/apify/actors-mcp-server/commit/5e2c9f06008304257c887dc3c67eb9ddfd32d6cd)) by [@jirispilka](https://github.com/jirispilka)
11
-
12
-
13
- <!-- git-cliff-unreleased-end -->
14
- This changelog summarizes all changes of the Apify Model Context Protocol Server
15
-
16
- ### 0.0.1 (2025-01-xx)
17
-
18
- 🚀 Features
19
- - Add functionality to call Apify Actors via Model Context Protocol
package/eslint.config.mjs DELETED
@@ -1,16 +0,0 @@
1
- import apify from '@apify/eslint-config';
2
-
3
- // eslint-disable-next-line import/no-default-export
4
- export default [
5
- { ignores: ['**/dist'] }, // Ignores need to happen first
6
- ...apify,
7
- {
8
- languageOptions: {
9
- sourceType: 'module',
10
-
11
- parserOptions: {
12
- project: 'tsconfig.eslint.json',
13
- },
14
- },
15
- },
16
- ];
@@ -1,4 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "include": ["./src/**/*"]
4
- }
package/tsconfig.json DELETED
@@ -1,16 +0,0 @@
1
- {
2
- "extends": "@apify/tsconfig",
3
- "compilerOptions": {
4
- "module": "ESNext",
5
- "target": "ESNext",
6
- "outDir": "dist",
7
- "moduleResolution": "node",
8
- "noUnusedLocals": false,
9
- "lib": ["ES2022"],
10
- "skipLibCheck": true,
11
- "typeRoots": ["./types", "./node_modules/@types"],
12
- "strict": true
13
- },
14
- "include": ["./src/**/*"],
15
- "exclude": ["node_modules"]
16
- }