Skip to content

Commit fe8d9c2

Browse files
MQ37jirispilka
andauthored
feat: Decouple Actor from mcp-server, add ability to call Actorized MCP and load tools (#59)
--------- Co-authored-by: Jiří Spilka <[email protected]>
1 parent 78ea177 commit fe8d9c2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+4098
-2350
lines changed

.actor/ACTOR.md

Lines changed: 506 additions & 0 deletions
Large diffs are not rendered by default.

.actor/actor.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"description": "Implementation of a Model Context Protocol (MCP) Server for Apify Actors that enables AI applications (and AI agents) to interact with Apify Actors",
66
"version": "0.1",
77
"input": "./input_schema.json",
8+
"readme": "./ACTOR.md",
89
"dockerfile": "./Dockerfile",
910
"webServerMcpPath": "/sse"
1011
}

.github/scripts/before-beta-release.cjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
const { execSync } = require('child_process');
2-
const fs = require('fs');
3-
const path = require('path');
1+
const { execSync } = require('node:child_process');
2+
const fs = require('node:fs');
3+
const path = require('node:path');
44

55
const PKG_JSON_PATH = path.join(__dirname, '..', '..', 'package.json');
66

.github/workflows/check.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ jobs:
3636

3737
- name: Test
3838
run: npm run test
39+
40+
- name: Type checks
41+
run: npm run type-check

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ storage/key_value_stores/default/*
1818
# Added by Apify CLI
1919
.venv
2020
.env
21+
.aider*

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22.13.1

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,4 +179,4 @@ All notable changes to this project will be documented in this file.
179179
### 🐛 Bug Fixes
180180

181181
- Update express routes to correctly handle GET and HEAD requests, fix CI ([#5](https://github.com/apify/actors-mcp-server/pull/5)) ([ec6e9b0](https://github.com/apify/actors-mcp-server/commit/ec6e9b0a4657f673b3650a5906fe00e66411d7f1)) by [@jirispilka](https://github.com/jirispilka)
182-
- Correct publishing of npm module ([#6](https://github.com/apify/actors-mcp-server/pull/6)) ([4c953e9](https://github.com/apify/actors-mcp-server/commit/4c953e9fe0c735f1690c8356884dd78d8608979f)) by [@jirispilka](https://github.com/jirispilka)
182+
- Correct publishing of npm module ([#6](https://github.com/apify/actors-mcp-server/pull/6)) ([4c953e9](https://github.com/apify/actors-mcp-server/commit/4c953e9fe0c735f1690c8356884dd78d8608979f)) by [@jirispilka](https://github.com/jirispilka)

README.md

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ The server can be used in two ways:
1010
- **🇦 [MCP Server Actor](https://apify.com/apify/actors-mcp-server)** – HTTP server accessible via Server-Sent Events (SSE), see [guide](#-mcp-server-actor)
1111
- **⾕ MCP Server Stdio** – Local server available via standard input/output (stdio), see [guide](#-mcp-server-at-a-local-host)
1212

13-
1413
You can also interact with the MCP server using a chat-like UI with 💬 [Tester MCP Client](https://apify.com/jiri.spilka/tester-mcp-client)
1514

1615
# 🎯 What does Apify MCP server do?
@@ -337,6 +336,63 @@ If you want to specify which Actors to load, you can add the `--actors` argument
337336
}
338337
```
339338

339+
#### VS Code
340+
341+
For one-click installation, click one of the install buttons below:
342+
343+
[![Install with NPX in VS Code](https://img.shields.io/badge/VS_Code-NPM-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=actors-mcp-server&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40apify%2Factors-mcp-server%22%5D%2C%22env%22%3A%7B%22APIFY_TOKEN%22%3A%22%24%7Binput%3Aapify_token%7D%22%7D%7D&inputs=%5B%7B%22type%22%3A%22promptString%22%2C%22id%22%3A%22apify_token%22%2C%22description%22%3A%22Apify+API+Token%22%2C%22password%22%3Atrue%7D%5D) [![Install with NPX in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-NPM-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=actors-mcp-server&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40apify%2Factors-mcp-server%22%5D%2C%22env%22%3A%7B%22APIFY_TOKEN%22%3A%22%24%7Binput%3Aapify_token%7D%22%7D%7D&inputs=%5B%7B%22type%22%3A%22promptString%22%2C%22id%22%3A%22apify_token%22%2C%22description%22%3A%22Apify+API+Token%22%2C%22password%22%3Atrue%7D%5D&quality=insiders)
344+
345+
##### Manual installation
346+
347+
You can manually install the Apify MCP Server in VS Code. First, click one of the install buttons at the top of this section for a one-click installation.
348+
349+
Alternatively, add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing `Ctrl + Shift + P` and typing `Preferences: Open User Settings (JSON)`.
350+
351+
```json
352+
{
353+
"mcp": {
354+
"inputs": [
355+
{
356+
"type": "promptString",
357+
"id": "apify_token",
358+
"description": "Apify API Token",
359+
"password": true
360+
}
361+
],
362+
"servers": {
363+
"actors-mcp-server": {
364+
"command": "npx",
365+
"args": ["-y", "@apify/actors-mcp-server"],
366+
"env": {
367+
"APIFY_TOKEN": "${input:apify_token}"
368+
}
369+
}
370+
}
371+
}
372+
}
373+
```
374+
375+
Optionally, you can add it to a file called `.vscode/mcp.json` in your workspace - just omit the top-level `mcp {}` key. This will allow you to share the configuration with others.
376+
377+
If you want to specify which Actors to load, you can add the `--actors` argument:
378+
379+
```json
380+
{
381+
"servers": {
382+
"actors-mcp-server": {
383+
"command": "npx",
384+
"args": [
385+
"-y", "@apify/actors-mcp-server",
386+
"--actors", "lukaskrivka/google-maps-with-contact-details,apify/instagram-scraper"
387+
],
388+
"env": {
389+
"APIFY_TOKEN": "${input:apify_token}"
390+
}
391+
}
392+
}
393+
}
394+
```
395+
340396
#### Debugging NPM package @apify/actors-mcp-server with @modelcontextprotocol/inspector
341397

342398
To debug the server, use the [MCP Inspector](https://github.com/modelcontextprotocol/inspector) tool:
@@ -408,7 +464,7 @@ You can launch the MCP Inspector via [`npm`](https://docs.npmjs.com/downloading-
408464

409465
```bash
410466
export APIFY_TOKEN=your-apify-token
411-
npx @modelcontextprotocol/inspector node ./dist/index.js
467+
npx @modelcontextprotocol/inspector node ./dist/stdio.js
412468
```
413469

414470
Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.

eslint.config.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import apify from '@apify/eslint-config';
1+
import apifyTypeScriptConfig from '@apify/eslint-config/ts.js';
22

33
// eslint-disable-next-line import/no-default-export
44
export default [
5-
{ ignores: ['**/dist', '**/.venv'] }, // Ignores need to happen first
6-
...apify,
5+
{ ignores: ['**/dist'] }, // Ignores need to happen first
6+
...apifyTypeScriptConfig,
77
{
88
languageOptions: {
99
sourceType: 'module',

0 commit comments

Comments
 (0)