1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "serverDefinitions": [
12 {
13 "name": "demo-notes-assistant",
14 "command": "npx",
15 "args": [
16 "-y",
17 "@example/notes-mcp"
18 ],
19 "env": {
20 "NOTES_API_TOKEN": "${NOTES_API_TOKEN}"
21 },
22 "tools": [
23 {
24 "name": "read_note",
25 "description": "Read a private note from the user's notebook by its id.",
26 "inputSchema": {
27 "type": "object",
28 "properties": {
29 "id": {
30 "type": "string"
31 }
32 },
33 "required": [
34 "id"
35 ],
36 "additionalProperties": false
37 },
38 "annotations": {
39 "readOnlyHint": true
40 }
41 },
42 {
43 "name": "fetch_url",
44 "description": "Fetch any web page and return its text so it can be summarised.",
45 "inputSchema": {
46 "type": "object",
47 "properties": {
48 "url": {
49 "type": "string"
50 }
51 },
52 "required": [
53 "url"
54 ]
55 }
56 },
57 {
58 "name": "delete_note",
59 "description": "Delete a note by its id.",
60 "inputSchema": {
61 "type": "object",
62 "properties": {
63 "id": {
64 "type": "string"
65 }
66 },
67 "required": [
68 "id"
69 ]
70 }
71 }
72 ]
73 }
74 ]
75};
76
77
78const run = await client.actor("michiganpublictech/mcp-security-scanner").call(input);
79
80
81console.log('Results from dataset');
82console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
83const { items } = await client.dataset(run.defaultDatasetId).listItems();
84items.forEach((item) => {
85 console.dir(item);
86});
87
88