Skip to content

Commit 22ac5ed

Browse files
committed
Update package.json and add github workflow from apify-eslint-config
1 parent 19bb130 commit 22ac5ed

File tree

6 files changed

+287
-14
lines changed

6 files changed

+287
-14
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
const path = require('path');
2+
const fs = require('fs');
3+
const { execSync } = require('child_process');
4+
5+
const PKG_JSON_PATH = path.join(__dirname, '..', '..', 'package.json');
6+
7+
const pkgJson = require(PKG_JSON_PATH);
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}`);
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.`);
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+
}

.github/workflows/pre_release.yaml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
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/[email protected]
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 ]
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: [email protected]
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 ]
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 }}

.github/workflows/release.yaml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
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: [email protected]
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 }}

README.md

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

66
The server can be used in two ways:
7-
- **MCP Server Actor** - Actor runs an HTTP server that supports the MCP protocol via SSE (Server-Sent Events).
8-
- **MCP Server CLI** - Command-line interface that supports the MCP protocol via stdio.
7+
- **MCP Server Actor**, which runs an HTTP server supporting the MCP protocol via Server-Sent Events (SSE).
8+
- **MCP Server CLI** supports the MCP protocol via stdio.
99

1010
## 🎯 What does this MCP server do?
1111

1212
The MCP Server Actor allows an AI assistant to:
1313
- Use any [Apify Actor](https://apify.com/store) as a tool to perform a specific task.For example it can:
14-
- [Facebook Posts Scraper](https://apify.com/apify/facebook-posts-scraper) extract data from hundreds of Facebook posts from one or multiple Facebook pages and profiles
14+
- [Facebook Posts Scraper](https://apify.com/apify/facebook-posts-scraper) extract data from Facebook posts from one or multiple Facebook pages/profiles
1515
- [Google Maps Email Extractor](https://apify.com/lukaskrivka/google-maps-with-contact-details) Extract Google Maps contact details
1616
- [Google Search Results Scraper](https://apify.com/apify/google-search-scraper) Scrape Google Search Engine Results Pages (SERPs)
17-
- [Instagram Scraper](https://apify.com/apify/instagram-scraper) scrape and download Instagram posts, profiles, places, hashtags, photos, and comments
18-
- [RAG Web Browser](https://apify.com/apify/web-scraper) perform web search, scrape the top N URLs from the results, and return their cleaned content as Markdown
17+
- [Instagram Scraper](https://apify.com/apify/instagram-scraper) scrape Instagram posts, profiles, places, hashtags, photos, and comments
18+
- [RAG Web Browser](https://apify.com/apify/web-scraper) perform web search, scrape the top N URLs from the results, and return content
1919

20-
Once the server is started, you can use MCP clients, such as [Claude Desktop](
20+
Once the server is started, you can use MCP clients, such as [Claude Desktop](https://claude.ai/download) or
2121

2222

2323
## 🔄 What is model context protocol?

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,30 @@
11
{
2-
"name": "apify-mcp-server",
3-
"version": "0.0.1",
2+
"name": "@apify/mcp-server",
3+
"version": "0.1.0",
44
"type": "module",
55
"description": "Model Context Protocol Server for Apify Actors",
66
"engines": {
77
"node": ">=18.0.0"
88
},
9+
"main": "dist/index.js",
10+
"bin": {
11+
"apify-mcp-server": "dist/index.js"
12+
},
13+
"repository": {
14+
"type": "git",
15+
"url": "https://github.com/apify/actor-mcp-server.git"
16+
},
17+
"bugs": {
18+
"url": "https://github.com/apify/actor-mcp-server/issues"
19+
},
20+
"homepage": "https://apify.com/apify/mcp-server",
21+
"keywords": [
22+
"apify",
23+
"mcp",
24+
"server",
25+
"actors",
26+
"model context protocol"
27+
],
928
"dependencies": {
1029
"@modelcontextprotocol/sdk": "^1.1.0",
1130
"ajv": "^8.17.1",
@@ -38,6 +57,6 @@
3857
"test": "echo \"Error: oops, the actor has no tests yet, sad!\" && exit 1",
3958
"watch": "tsc --watch"
4059
},
41-
"author": "It's not you it's me",
42-
"license": "ISC"
60+
"author": "Apify",
61+
"license": "MIT"
4362
}

0 commit comments

Comments
 (0)