@apify/actors-mcp-server 0.15.4-beta.2 → 0.15.4-beta.4

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.
@@ -2,6 +2,6 @@ import type { Implementation } from '@modelcontextprotocol/sdk/types.js';
2
2
  import type { ServerCard } from './types.js';
3
3
  /** Returns the `serverInfo` (MCP `Implementation`) advertised in the initialize response. */
4
4
  export declare function getServerInfo(): Implementation;
5
- /** Returns the MCP server card object per SEP-1649. */
5
+ /** Returns the MCP server card object. See {@link ServerCard} for why it is a hybrid shape. */
6
6
  export declare function getServerCard(): ServerCard;
7
7
  //# sourceMappingURL=server_card.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server_card.d.ts","sourceRoot":"","sources":["../src/server_card.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAWzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAM7C,6FAA6F;AAC7F,wBAAgB,aAAa,IAAI,cAAc,CAe9C;AAED,uDAAuD;AACvD,wBAAgB,aAAa,IAAI,UAAU,CA0B1C"}
1
+ {"version":3,"file":"server_card.d.ts","sourceRoot":"","sources":["../src/server_card.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAYzE,OAAO,KAAK,EAAE,UAAU,EAA0D,MAAM,YAAY,CAAC;AAgCrG,6FAA6F;AAC7F,wBAAgB,aAAa,IAAI,cAAc,CAS9C;AAkBD,+FAA+F;AAC/F,wBAAgB,aAAa,IAAI,UAAU,CAoC1C"}
@@ -1,8 +1,27 @@
1
1
  import { LATEST_PROTOCOL_VERSION } from '@modelcontextprotocol/sdk/types.js';
2
- import { APIFY_DOCS_MCP_URL, APIFY_FAVICON_URL, APIFY_LOGO_URL, APIFY_MCP_URL, SERVER_NAME, SERVER_TITLE, } from './const.js';
2
+ import { APIFY_DOCS_MCP_URL, APIFY_FAVICON_URL, APIFY_LOGO_URL, APIFY_MCP_URL, HELPER_TOOLS, SERVER_NAME, SERVER_TITLE, } from './const.js';
3
+ import { SERVER_MODE } from './types.js';
3
4
  import { readJsonFile } from './utils/generic.js';
5
+ import { getToolsForServerMode } from './utils/tools_loader.js';
4
6
  import { getPackageVersion } from './utils/version.js';
7
+ /**
8
+ * The registry-shaped half of the server card lives in `server.json`, which is already the
9
+ * source of truth for registry publishing and is version-bumped by the release workflow.
10
+ * Reading it here keeps the card from drifting out of sync with what we publish.
11
+ */
5
12
  const serverJson = readJsonFile(import.meta.url, '../server.json');
13
+ /**
14
+ * Server icon, shared by the initialize response and the server card so the two cannot diverge.
15
+ * PNG rather than the `.ico` favicon: the registry schema restricts `icons[].mimeType` to
16
+ * png/jpeg/jpg/svg+xml/webp.
17
+ */
18
+ const SERVER_ICONS = [
19
+ {
20
+ src: APIFY_LOGO_URL,
21
+ mimeType: 'image/png',
22
+ sizes: ['180x180'],
23
+ },
24
+ ];
6
25
  /** Returns the `serverInfo` (MCP `Implementation`) advertised in the initialize response. */
7
26
  export function getServerInfo() {
8
27
  return {
@@ -10,28 +29,44 @@ export function getServerInfo() {
10
29
  title: SERVER_TITLE,
11
30
  version: getPackageVersion(),
12
31
  description: serverJson.description,
13
- websiteUrl: APIFY_MCP_URL,
14
- icons: [
15
- {
16
- src: APIFY_LOGO_URL,
17
- mimeType: 'image/png',
18
- sizes: ['180x180'],
19
- },
20
- ],
32
+ websiteUrl: APIFY_DOCS_MCP_URL,
33
+ icons: [...SERVER_ICONS],
21
34
  };
22
35
  }
23
- /** Returns the MCP server card object per SEP-1649. */
36
+ /**
37
+ * Summarises the tools a default session serves. `getDefaultTools()` under-reports — it omits
38
+ * what `call-actor` pulls in — and `report-problem` is client-gated at serve time, so a static
39
+ * card cannot carry it. Each tool's plain `description` is by contract the session-less render.
40
+ */
41
+ function getServerCardTools() {
42
+ return getToolsForServerMode({}, [], SERVER_MODE.DEFAULT)
43
+ .filter((tool) => tool.name !== HELPER_TOOLS.PROBLEM_REPORT)
44
+ .map((tool) => ({
45
+ name: tool.name,
46
+ title: tool.title,
47
+ description: tool.description,
48
+ annotations: tool.annotations,
49
+ }));
50
+ }
51
+ /** Returns the MCP server card object. See {@link ServerCard} for why it is a hybrid shape. */
24
52
  export function getServerCard() {
25
53
  return {
26
- $schema: 'https://static.modelcontextprotocol.io/schemas/mcp-server-card/v1.json',
27
- version: '1.0',
54
+ $schema: serverJson.$schema,
55
+ name: serverJson.name,
56
+ title: SERVER_TITLE,
57
+ description: serverJson.description,
58
+ version: getPackageVersion(),
59
+ websiteUrl: APIFY_DOCS_MCP_URL,
60
+ repository: serverJson.repository,
61
+ icons: [...SERVER_ICONS],
62
+ remotes: serverJson.remotes,
63
+ serverUrl: APIFY_MCP_URL,
28
64
  protocolVersion: LATEST_PROTOCOL_VERSION,
29
65
  serverInfo: {
30
66
  name: SERVER_NAME,
31
67
  title: SERVER_TITLE,
32
68
  version: getPackageVersion(),
33
69
  },
34
- description: serverJson.description,
35
70
  iconUrl: APIFY_FAVICON_URL,
36
71
  documentationUrl: APIFY_DOCS_MCP_URL,
37
72
  transport: {
@@ -45,7 +80,7 @@ export function getServerCard() {
45
80
  required: true,
46
81
  schemes: ['bearer', 'oauth2'],
47
82
  },
48
- tools: 'dynamic',
83
+ tools: getServerCardTools(),
49
84
  };
50
85
  }
51
86
  //# sourceMappingURL=server_card.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"server_card.js","sourceRoot":"","sources":["../src/server_card.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAE7E,OAAO,EACH,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,WAAW,EACX,YAAY,GACf,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,C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