@get-technology-inc/jamf-docs-mcp-server 3.0.50 → 4.0.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/README.md +58 -0
- package/dist/core/apps/generated/app-html.d.ts +9 -0
- package/dist/core/apps/generated/app-html.d.ts.map +1 -0
- package/dist/core/apps/generated/app-html.js +9 -0
- package/dist/core/apps/generated/app-html.js.map +1 -0
- package/dist/core/apps/index.d.ts +38 -0
- package/dist/core/apps/index.d.ts.map +1 -0
- package/dist/core/apps/index.js +59 -0
- package/dist/core/apps/index.js.map +1 -0
- package/dist/core/create-server.d.ts +12 -1
- package/dist/core/create-server.d.ts.map +1 -1
- package/dist/core/create-server.js +74 -7
- package/dist/core/create-server.js.map +1 -1
- package/dist/core/prompts/compare-versions.d.ts +1 -1
- package/dist/core/prompts/compare-versions.d.ts.map +1 -1
- package/dist/core/prompts/compare-versions.js +1 -1
- package/dist/core/prompts/compare-versions.js.map +1 -1
- package/dist/core/prompts/index.d.ts +1 -1
- package/dist/core/prompts/index.d.ts.map +1 -1
- package/dist/core/prompts/setup-guide.d.ts +1 -1
- package/dist/core/prompts/setup-guide.d.ts.map +1 -1
- package/dist/core/prompts/setup-guide.js +1 -1
- package/dist/core/prompts/setup-guide.js.map +1 -1
- package/dist/core/prompts/troubleshoot.d.ts +1 -1
- package/dist/core/prompts/troubleshoot.d.ts.map +1 -1
- package/dist/core/prompts/troubleshoot.js +1 -1
- package/dist/core/prompts/troubleshoot.js.map +1 -1
- package/dist/core/resources/index.d.ts +1 -1
- package/dist/core/resources/index.d.ts.map +1 -1
- package/dist/core/resources/index.js +30 -5
- package/dist/core/resources/index.js.map +1 -1
- package/dist/core/schemas/index.d.ts +11 -11
- package/dist/core/schemas/index.js +3 -3
- package/dist/core/schemas/index.js.map +1 -1
- package/dist/core/schemas/output.d.ts +9 -0
- package/dist/core/schemas/output.d.ts.map +1 -1
- package/dist/core/schemas/output.js +29 -0
- package/dist/core/schemas/output.js.map +1 -1
- package/dist/core/services/article-service.d.ts +9 -1
- package/dist/core/services/article-service.d.ts.map +1 -1
- package/dist/core/services/article-service.js +4 -5
- package/dist/core/services/article-service.js.map +1 -1
- package/dist/core/services/ft-client.d.ts.map +1 -1
- package/dist/core/services/ft-client.js +2 -1
- package/dist/core/services/ft-client.js.map +1 -1
- package/dist/core/services/glossary.js +2 -2
- package/dist/core/services/glossary.js.map +1 -1
- package/dist/core/services/interfaces/cache.d.ts +1 -1
- package/dist/core/services/interfaces/cache.d.ts.map +1 -1
- package/dist/core/services/interfaces/logger.d.ts +0 -2
- package/dist/core/services/interfaces/logger.d.ts.map +1 -1
- package/dist/core/services/logging.d.ts +7 -15
- package/dist/core/services/logging.d.ts.map +1 -1
- package/dist/core/services/logging.js +7 -25
- package/dist/core/services/logging.js.map +1 -1
- package/dist/core/services/maps-registry.d.ts +0 -1
- package/dist/core/services/maps-registry.d.ts.map +1 -1
- package/dist/core/services/maps-registry.js +16 -15
- package/dist/core/services/maps-registry.js.map +1 -1
- package/dist/core/services/metadata.d.ts +27 -3
- package/dist/core/services/metadata.d.ts.map +1 -1
- package/dist/core/services/metadata.js +66 -26
- package/dist/core/services/metadata.js.map +1 -1
- package/dist/core/services/search-service.js.map +1 -1
- package/dist/core/services/toc-service.js.map +1 -1
- package/dist/core/services/topic-resolver.d.ts.map +1 -1
- package/dist/core/services/topic-resolver.js +62 -19
- package/dist/core/services/topic-resolver.js.map +1 -1
- package/dist/core/tools/batch-get-articles.d.ts +1 -1
- package/dist/core/tools/batch-get-articles.d.ts.map +1 -1
- package/dist/core/tools/get-article.d.ts +1 -1
- package/dist/core/tools/get-article.d.ts.map +1 -1
- package/dist/core/tools/get-article.js +34 -18
- package/dist/core/tools/get-article.js.map +1 -1
- package/dist/core/tools/get-toc.d.ts +1 -1
- package/dist/core/tools/get-toc.d.ts.map +1 -1
- package/dist/core/tools/get-toc.js +8 -0
- package/dist/core/tools/get-toc.js.map +1 -1
- package/dist/core/tools/glossary-lookup.d.ts +1 -1
- package/dist/core/tools/glossary-lookup.d.ts.map +1 -1
- package/dist/core/tools/glossary-lookup.js +2 -1
- package/dist/core/tools/glossary-lookup.js.map +1 -1
- package/dist/core/tools/list-products.d.ts +1 -1
- package/dist/core/tools/list-products.d.ts.map +1 -1
- package/dist/core/tools/search.d.ts +1 -1
- package/dist/core/tools/search.d.ts.map +1 -1
- package/dist/core/tools/search.js +28 -7
- package/dist/core/tools/search.js.map +1 -1
- package/dist/core/types.d.ts +10 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/core/utils/progress.d.ts +13 -5
- package/dist/core/utils/progress.d.ts.map +1 -1
- package/dist/core/utils/progress.js +6 -2
- package/dist/core/utils/progress.js.map +1 -1
- package/dist/index.js +8 -5
- package/dist/index.js.map +1 -1
- package/dist/platforms/node/cache.d.ts +1 -1
- package/dist/platforms/node/cache.d.ts.map +1 -1
- package/dist/platforms/node/cache.js.map +1 -1
- package/dist/platforms/node/config.d.ts.map +1 -1
- package/dist/platforms/node/config.js +3 -5
- package/dist/platforms/node/config.js.map +1 -1
- package/dist/platforms/node/http-server.d.ts +1 -1
- package/dist/platforms/node/http-server.d.ts.map +1 -1
- package/dist/platforms/node/http-server.js +21 -7
- package/dist/platforms/node/http-server.js.map +1 -1
- package/dist/platforms/node/logger.d.ts +0 -2
- package/dist/platforms/node/logger.d.ts.map +1 -1
- package/dist/platforms/node/logger.js +0 -3
- package/dist/platforms/node/logger.js.map +1 -1
- package/dist/transport/http-handler.d.ts +51 -9
- package/dist/transport/http-handler.d.ts.map +1 -1
- package/dist/transport/http-handler.js +213 -32
- package/dist/transport/http-handler.js.map +1 -1
- package/dist/transport/http-types.d.ts +14 -2
- package/dist/transport/http-types.d.ts.map +1 -1
- package/dist/transport/http-types.js +1 -1
- package/dist/transport/http-types.js.map +1 -1
- package/package.json +14 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-html.js","sourceRoot":"","sources":["../../../../src/core/apps/generated/app-html.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAG,mtkaAAmtka,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Apps extension (`io.modelcontextprotocol/ui`).
|
|
3
|
+
*
|
|
4
|
+
* Tools that return a browsable result — search hits, a table of contents, an
|
|
5
|
+
* article — reference a `ui://` HTML resource, and hosts that support the
|
|
6
|
+
* extension render it inline in the conversation instead of printing the
|
|
7
|
+
* markdown. Hosts that do not support it ignore the metadata entirely and get
|
|
8
|
+
* the same text they always did, so this is purely additive.
|
|
9
|
+
*
|
|
10
|
+
* All three tools point at the *same* resource. The app decides which view to
|
|
11
|
+
* show from the shape of the structured content it is handed, which keeps one
|
|
12
|
+
* bundle on the wire instead of three near-identical copies.
|
|
13
|
+
*/
|
|
14
|
+
import type { McpServer } from '@modelcontextprotocol/server';
|
|
15
|
+
/** Extension identifier used for capability negotiation. */
|
|
16
|
+
export declare const UI_EXTENSION_ID = "io.modelcontextprotocol/ui";
|
|
17
|
+
/** MIME type identifying an MCP Apps HTML resource. */
|
|
18
|
+
export declare const APP_MIME_TYPE = "text/html;profile=mcp-app";
|
|
19
|
+
/** URI of the shared app resource. */
|
|
20
|
+
export declare const APP_RESOURCE_URI = "ui://jamf-docs/app.html";
|
|
21
|
+
/**
|
|
22
|
+
* `_meta` to attach to a tool whose result the app can render.
|
|
23
|
+
*
|
|
24
|
+
* Both spellings are emitted: `_meta.ui.resourceUri` is the current form, and
|
|
25
|
+
* `_meta['ui/resourceUri']` is what older hosts read. They must agree.
|
|
26
|
+
*/
|
|
27
|
+
export declare function appToolMeta(): Record<string, unknown>;
|
|
28
|
+
/**
|
|
29
|
+
* Register the shared `ui://` resource.
|
|
30
|
+
*
|
|
31
|
+
* The document is fully self-contained — script and styles inlined — because
|
|
32
|
+
* hosts render it in a sandboxed iframe under a deny-by-default CSP where no
|
|
33
|
+
* external asset would load. It is embedded at build time rather than read
|
|
34
|
+
* from disk so the same code path works on Cloudflare Workers, which has no
|
|
35
|
+
* filesystem.
|
|
36
|
+
*/
|
|
37
|
+
export declare function registerApps(server: McpServer): void;
|
|
38
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/apps/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAG9D,4DAA4D;AAC5D,eAAO,MAAM,eAAe,+BAA+B,CAAC;AAE5D,uDAAuD;AACvD,eAAO,MAAM,aAAa,8BAA8B,CAAC;AAEzD,sCAAsC;AACtC,eAAO,MAAM,gBAAgB,4BAA4B,CAAC;AAE1D;;;;;GAKG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAKrD;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAsBpD"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Apps extension (`io.modelcontextprotocol/ui`).
|
|
3
|
+
*
|
|
4
|
+
* Tools that return a browsable result — search hits, a table of contents, an
|
|
5
|
+
* article — reference a `ui://` HTML resource, and hosts that support the
|
|
6
|
+
* extension render it inline in the conversation instead of printing the
|
|
7
|
+
* markdown. Hosts that do not support it ignore the metadata entirely and get
|
|
8
|
+
* the same text they always did, so this is purely additive.
|
|
9
|
+
*
|
|
10
|
+
* All three tools point at the *same* resource. The app decides which view to
|
|
11
|
+
* show from the shape of the structured content it is handed, which keeps one
|
|
12
|
+
* bundle on the wire instead of three near-identical copies.
|
|
13
|
+
*/
|
|
14
|
+
import { APP_HTML } from './generated/app-html.js';
|
|
15
|
+
/** Extension identifier used for capability negotiation. */
|
|
16
|
+
export const UI_EXTENSION_ID = 'io.modelcontextprotocol/ui';
|
|
17
|
+
/** MIME type identifying an MCP Apps HTML resource. */
|
|
18
|
+
export const APP_MIME_TYPE = 'text/html;profile=mcp-app';
|
|
19
|
+
/** URI of the shared app resource. */
|
|
20
|
+
export const APP_RESOURCE_URI = 'ui://jamf-docs/app.html';
|
|
21
|
+
/**
|
|
22
|
+
* `_meta` to attach to a tool whose result the app can render.
|
|
23
|
+
*
|
|
24
|
+
* Both spellings are emitted: `_meta.ui.resourceUri` is the current form, and
|
|
25
|
+
* `_meta['ui/resourceUri']` is what older hosts read. They must agree.
|
|
26
|
+
*/
|
|
27
|
+
export function appToolMeta() {
|
|
28
|
+
return {
|
|
29
|
+
ui: { resourceUri: APP_RESOURCE_URI },
|
|
30
|
+
'ui/resourceUri': APP_RESOURCE_URI,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Register the shared `ui://` resource.
|
|
35
|
+
*
|
|
36
|
+
* The document is fully self-contained — script and styles inlined — because
|
|
37
|
+
* hosts render it in a sandboxed iframe under a deny-by-default CSP where no
|
|
38
|
+
* external asset would load. It is embedded at build time rather than read
|
|
39
|
+
* from disk so the same code path works on Cloudflare Workers, which has no
|
|
40
|
+
* filesystem.
|
|
41
|
+
*/
|
|
42
|
+
export function registerApps(server) {
|
|
43
|
+
server.registerResource('jamf-docs-app', APP_RESOURCE_URI, {
|
|
44
|
+
title: 'Jamf Documentation Viewer',
|
|
45
|
+
description: 'Interactive viewer for Jamf documentation search results, tables of contents, and articles.',
|
|
46
|
+
mimeType: APP_MIME_TYPE,
|
|
47
|
+
// The bundle is inert between releases, so hosts may hold it for a day.
|
|
48
|
+
cacheHint: { ttlMs: 86_400_000, cacheScope: 'public' },
|
|
49
|
+
}, () => ({
|
|
50
|
+
contents: [
|
|
51
|
+
{
|
|
52
|
+
uri: APP_RESOURCE_URI,
|
|
53
|
+
mimeType: APP_MIME_TYPE,
|
|
54
|
+
text: APP_HTML,
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/apps/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnD,4DAA4D;AAC5D,MAAM,CAAC,MAAM,eAAe,GAAG,4BAA4B,CAAC;AAE5D,uDAAuD;AACvD,MAAM,CAAC,MAAM,aAAa,GAAG,2BAA2B,CAAC;AAEzD,sCAAsC;AACtC,MAAM,CAAC,MAAM,gBAAgB,GAAG,yBAAyB,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO;QACL,EAAE,EAAE,EAAE,WAAW,EAAE,gBAAgB,EAAE;QACrC,gBAAgB,EAAE,gBAAgB;KACnC,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,MAAiB;IAC5C,MAAM,CAAC,gBAAgB,CACrB,eAAe,EACf,gBAAgB,EAChB;QACE,KAAK,EAAE,2BAA2B;QAClC,WAAW,EACT,6FAA6F;QAC/F,QAAQ,EAAE,aAAa;QACvB,wEAAwE;QACxE,SAAS,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE;KACvD,EACD,GAAG,EAAE,CAAC,CAAC;QACL,QAAQ,EAAE;YACR;gBACE,GAAG,EAAE,gBAAgB;gBACrB,QAAQ,EAAE,aAAa;gBACvB,IAAI,EAAE,QAAQ;aACf;SACF;KACF,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* platform-specific cache, logger, and metadata implementations) and
|
|
6
6
|
* returns a ready-to-connect McpServer.
|
|
7
7
|
*/
|
|
8
|
-
import { McpServer } from '@modelcontextprotocol/
|
|
8
|
+
import { McpServer } from '@modelcontextprotocol/server';
|
|
9
9
|
import type { ServerContext } from './types/context.js';
|
|
10
10
|
/**
|
|
11
11
|
* Options for createMcpServer
|
|
@@ -14,6 +14,17 @@ export interface CreateServerOptions {
|
|
|
14
14
|
/** Tool name whitelist. When provided, only listed tools are registered. */
|
|
15
15
|
tools?: string[];
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Tool registration order.
|
|
19
|
+
*
|
|
20
|
+
* `tools/list` results are emitted in registration order, and protocol
|
|
21
|
+
* revision 2026-07-28 asks servers to keep that order deterministic so clients
|
|
22
|
+
* can cache the list and LLM prompt caches keep hitting. An ordered array (not
|
|
23
|
+
* an object literal) makes the guarantee explicit and testable.
|
|
24
|
+
*/
|
|
25
|
+
export declare const TOOL_ORDER: readonly ["jamf_docs_list_products", "jamf_docs_search", "jamf_docs_get_article", "jamf_docs_get_toc", "jamf_docs_glossary_lookup", "jamf_docs_batch_get_articles"];
|
|
26
|
+
/** A tool this server knows how to register. */
|
|
27
|
+
export type ToolName = (typeof TOOL_ORDER)[number];
|
|
17
28
|
/**
|
|
18
29
|
* Create a fully-configured MCP server with all tools, resources, and prompts.
|
|
19
30
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-server.d.ts","sourceRoot":"","sources":["../../src/core/create-server.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"create-server.d.ts","sourceRoot":"","sources":["../../src/core/create-server.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAaxD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,qKAOb,CAAC;AAEX,gDAAgD;AAChD,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AA8EnD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,SAAS,CA4C5F"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* platform-specific cache, logger, and metadata implementations) and
|
|
6
6
|
* returns a ready-to-connect McpServer.
|
|
7
7
|
*/
|
|
8
|
-
import { McpServer } from '@modelcontextprotocol/
|
|
8
|
+
import { McpServer } from '@modelcontextprotocol/server';
|
|
9
9
|
import { SERVER_ICON } from './constants.js';
|
|
10
10
|
import { registerListProductsTool } from './tools/list-products.js';
|
|
11
11
|
import { registerSearchTool } from './tools/search.js';
|
|
@@ -14,8 +14,33 @@ import { registerGetTocTool } from './tools/get-toc.js';
|
|
|
14
14
|
import { registerGlossaryLookupTool } from './tools/glossary-lookup.js';
|
|
15
15
|
import { registerBatchGetArticlesTool } from './tools/batch-get-articles.js';
|
|
16
16
|
import { registerResources } from './resources/index.js';
|
|
17
|
+
import { registerApps, UI_EXTENSION_ID, APP_MIME_TYPE } from './apps/index.js';
|
|
17
18
|
import { registerPrompts } from './prompts/index.js';
|
|
18
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Tool registration order.
|
|
21
|
+
*
|
|
22
|
+
* `tools/list` results are emitted in registration order, and protocol
|
|
23
|
+
* revision 2026-07-28 asks servers to keep that order deterministic so clients
|
|
24
|
+
* can cache the list and LLM prompt caches keep hitting. An ordered array (not
|
|
25
|
+
* an object literal) makes the guarantee explicit and testable.
|
|
26
|
+
*/
|
|
27
|
+
export const TOOL_ORDER = [
|
|
28
|
+
'jamf_docs_list_products',
|
|
29
|
+
'jamf_docs_search',
|
|
30
|
+
'jamf_docs_get_article',
|
|
31
|
+
'jamf_docs_get_toc',
|
|
32
|
+
'jamf_docs_glossary_lookup',
|
|
33
|
+
'jamf_docs_batch_get_articles',
|
|
34
|
+
];
|
|
35
|
+
/**
|
|
36
|
+
* Tool name → registration function mapping.
|
|
37
|
+
*
|
|
38
|
+
* Keyed by {@link ToolName} rather than `string` so the two structures cannot
|
|
39
|
+
* drift: registration walks `TOOL_ORDER`, so an entry that exists only here
|
|
40
|
+
* would never be registered and nothing would say so. With this type, omitting
|
|
41
|
+
* a name is a missing-property error and adding an unlisted one is an excess-
|
|
42
|
+
* property error — both at compile time.
|
|
43
|
+
*/
|
|
19
44
|
const TOOL_REGISTRY = {
|
|
20
45
|
jamf_docs_list_products: registerListProductsTool,
|
|
21
46
|
jamf_docs_search: registerSearchTool,
|
|
@@ -24,6 +49,37 @@ const TOOL_REGISTRY = {
|
|
|
24
49
|
jamf_docs_glossary_lookup: registerGlossaryLookupTool,
|
|
25
50
|
jamf_docs_batch_get_articles: registerBatchGetArticlesTool,
|
|
26
51
|
};
|
|
52
|
+
/**
|
|
53
|
+
* Cache hints emitted on the `CacheableResult` operations of protocol
|
|
54
|
+
* revision 2026-07-28 (`ttlMs` / `cacheScope`).
|
|
55
|
+
*
|
|
56
|
+
* Everything this server returns is public Jamf documentation — there is no
|
|
57
|
+
* per-user or per-tenant content — so `public` is correct throughout and lets
|
|
58
|
+
* shared intermediaries cache alongside the client.
|
|
59
|
+
*
|
|
60
|
+
* The listing surfaces (tools, prompts, resources) only change when a new
|
|
61
|
+
* version of this package is deployed, so they get the full hour. Resource
|
|
62
|
+
* reads track upstream documentation and get the same hour, which is well
|
|
63
|
+
* inside the cadence at which Jamf publishes changes.
|
|
64
|
+
*
|
|
65
|
+
* These are the *healthy-path* defaults. A handler that answers with something
|
|
66
|
+
* it would not want frozen in a shared cache for an hour — an error body, or
|
|
67
|
+
* data it had to fall back to static constants for — returns its own
|
|
68
|
+
* `ttlMs` / `cacheScope` on the result, which the SDK prefers over anything
|
|
69
|
+
* configured here.
|
|
70
|
+
*
|
|
71
|
+
* Without these the SDK emits the conservative default (`ttlMs: 0`,
|
|
72
|
+
* `cacheScope: 'private'`), i.e. no caching at all.
|
|
73
|
+
*/
|
|
74
|
+
const ONE_HOUR_MS = 3_600_000;
|
|
75
|
+
const CACHE_HINTS = {
|
|
76
|
+
'tools/list': { ttlMs: ONE_HOUR_MS, cacheScope: 'public' },
|
|
77
|
+
'prompts/list': { ttlMs: ONE_HOUR_MS, cacheScope: 'public' },
|
|
78
|
+
'resources/list': { ttlMs: ONE_HOUR_MS, cacheScope: 'public' },
|
|
79
|
+
'resources/templates/list': { ttlMs: ONE_HOUR_MS, cacheScope: 'public' },
|
|
80
|
+
'resources/read': { ttlMs: ONE_HOUR_MS, cacheScope: 'public' },
|
|
81
|
+
'server/discover': { ttlMs: ONE_HOUR_MS, cacheScope: 'public' },
|
|
82
|
+
};
|
|
27
83
|
const SERVER_INSTRUCTIONS = `This server provides access to Jamf official documentation (learn.jamf.com) for Jamf Pro, Jamf School, Jamf Connect, and Jamf Protect.
|
|
28
84
|
|
|
29
85
|
## Tool Usage Order
|
|
@@ -59,20 +115,31 @@ export function createMcpServer(ctx, options) {
|
|
|
59
115
|
icons: [{ src: SERVER_ICON, mimeType: 'image/png', sizes: ['32x32'] }],
|
|
60
116
|
}, {
|
|
61
117
|
instructions: SERVER_INSTRUCTIONS,
|
|
118
|
+
cacheHints: CACHE_HINTS,
|
|
62
119
|
capabilities: {
|
|
63
|
-
|
|
120
|
+
// MCP Apps (SEP-2133 extensions framework). Hosts that negotiate this
|
|
121
|
+
// render search results, tables of contents and articles in the
|
|
122
|
+
// `ui://` viewer; hosts that do not simply get the markdown.
|
|
123
|
+
extensions: {
|
|
124
|
+
[UI_EXTENSION_ID]: { mimeTypes: [APP_MIME_TYPE] },
|
|
125
|
+
},
|
|
64
126
|
},
|
|
65
127
|
});
|
|
66
|
-
|
|
67
|
-
//
|
|
128
|
+
// The `logging` capability is deliberately not declared: SEP-2577 deprecated
|
|
129
|
+
// the Logging feature in protocol revision 2026-07-28. Logs go to stderr on
|
|
130
|
+
// Node and to the platform log sink on Workers; request-scoped progress
|
|
131
|
+
// notifications are unaffected and still flow on the response stream.
|
|
132
|
+
// Register tools in a fixed order (all by default, or filtered by whitelist)
|
|
68
133
|
const toolWhitelist = options?.tools;
|
|
69
|
-
for (const
|
|
134
|
+
for (const name of TOOL_ORDER) {
|
|
70
135
|
if (toolWhitelist === undefined || toolWhitelist.includes(name)) {
|
|
71
|
-
|
|
136
|
+
TOOL_REGISTRY[name](server, ctx);
|
|
72
137
|
}
|
|
73
138
|
}
|
|
74
139
|
// Register resources
|
|
75
140
|
registerResources(server, ctx);
|
|
141
|
+
// Register the MCP Apps viewer the tools above reference
|
|
142
|
+
registerApps(server);
|
|
76
143
|
// Register prompts
|
|
77
144
|
registerPrompts(server);
|
|
78
145
|
return server;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-server.js","sourceRoot":"","sources":["../../src/core/create-server.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"create-server.js","sourceRoot":"","sources":["../../src/core/create-server.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAA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AC/E,MAAM,MAAM,GAAG,IAAI,SAAS,CAC1B;QACE,IAAI,EAAE,sBAAsB;QAC5B,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,OAAO;QAC3B,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;KACvE,EACD;QACE,YAAY,EAAE,mBAAmB;QACjC,UAAU,EAAE,WAAW;QACvB,YAAY,EAAE;YACZ,sEAAsE;YACtE,gEAAgE;YAChE,6DAA6D;YAC7D,UAAU,EAAE;gBACV,CAAC,eAAe,CAAC,EAAE,EAAE,SAAS,EAAE,CAAC,aAAa,CAAC,EAAE;aAClD;SACF;KACF,CACF,CAAC;IAEF,6EAA6E;IAC7E,4EAA4E;IAC5E,wEAAwE;IACxE,sEAAsE;IAEtE,6EAA6E;IAC7E,MAAM,aAAa,GAAG,OAAO,EAAE,KAAK,CAAC;IACrC,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE,CAAC;QAC9B,IAAI,aAAa,KAAK,SAAS,IAAI,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAChE,aAAa,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;IAED,qBAAqB;IACrB,iBAAiB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE/B,yDAAyD;IACzD,YAAY,CAAC,MAAM,CAAC,CAAC;IAErB,mBAAmB;IACnB,eAAe,CAAC,MAAM,CAAC,CAAC;IAExB,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* jamf_compare_versions prompt
|
|
3
3
|
* Guides AI through comparing documentation between two versions.
|
|
4
4
|
*/
|
|
5
|
-
import type { McpServer } from '@modelcontextprotocol/
|
|
5
|
+
import type { McpServer } from '@modelcontextprotocol/server';
|
|
6
6
|
export declare function registerCompareVersionsPrompt(server: McpServer): void;
|
|
7
7
|
//# sourceMappingURL=compare-versions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compare-versions.d.ts","sourceRoot":"","sources":["../../../src/core/prompts/compare-versions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"compare-versions.d.ts","sourceRoot":"","sources":["../../../src/core/prompts/compare-versions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAK9D,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAyDrE"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Guides AI through comparing documentation between two versions.
|
|
4
4
|
*/
|
|
5
5
|
import { z } from 'zod';
|
|
6
|
-
import { completable } from '@modelcontextprotocol/
|
|
6
|
+
import { completable } from '@modelcontextprotocol/server';
|
|
7
7
|
import { completeProduct } from '../completions.js';
|
|
8
8
|
export function registerCompareVersionsPrompt(server) {
|
|
9
9
|
server.registerPrompt('jamf_compare_versions', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compare-versions.js","sourceRoot":"","sources":["../../../src/core/prompts/compare-versions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"compare-versions.js","sourceRoot":"","sources":["../../../src/core/prompts/compare-versions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,UAAU,6BAA6B,CAAC,MAAiB;IAC7D,MAAM,CAAC,cAAc,CACnB,uBAAuB,EACvB;QACE,KAAK,EAAE,uBAAuB;QAC9B,WAAW,EACT,kFAAkF;QACpF,UAAU,EAAE;YACV,OAAO,EAAE,WAAW,CAClB,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAC1B,qEAAqE,CACtE,EACD,eAAe,CAChB;YACD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,2CAA2C,CAAC;YACnF,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,6CAA6C,CAAC;SACtF;KACF,EACD,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE;QACxD,OAAO;YACL,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,MAAe;oBACrB,OAAO,EAAE;wBACP,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,kDAAkD,QAAQ,QAAQ,QAAQ,OAAO,OAAO;;;;;6CAK/D,OAAO,kBAAkB,QAAQ,+BAA+B,QAAQ;;;;6BAIxF,QAAQ;6BACR,QAAQ;;;;;;;;oCAQD,QAAQ;;;;;WAKjC,OAAO;aACL,QAAQ;aACR,QAAQ,EAAE;qBACV;iBACF;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* MCP Prompt registration
|
|
3
3
|
*/
|
|
4
|
-
import type { McpServer } from '@modelcontextprotocol/
|
|
4
|
+
import type { McpServer } from '@modelcontextprotocol/server';
|
|
5
5
|
export declare function registerPrompts(server: McpServer): void;
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/prompts/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/prompts/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAK9D,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAIvD"}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* jamf_setup_guide prompt
|
|
3
3
|
* Guides AI through creating a setup guide from Jamf documentation.
|
|
4
4
|
*/
|
|
5
|
-
import type { McpServer } from '@modelcontextprotocol/
|
|
5
|
+
import type { McpServer } from '@modelcontextprotocol/server';
|
|
6
6
|
export declare function registerSetupGuidePrompt(server: McpServer): void;
|
|
7
7
|
//# sourceMappingURL=setup-guide.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-guide.d.ts","sourceRoot":"","sources":["../../../src/core/prompts/setup-guide.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"setup-guide.d.ts","sourceRoot":"","sources":["../../../src/core/prompts/setup-guide.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAK9D,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAsDhE"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Guides AI through creating a setup guide from Jamf documentation.
|
|
4
4
|
*/
|
|
5
5
|
import { z } from 'zod';
|
|
6
|
-
import { completable } from '@modelcontextprotocol/
|
|
6
|
+
import { completable } from '@modelcontextprotocol/server';
|
|
7
7
|
import { completeProduct } from '../completions.js';
|
|
8
8
|
export function registerSetupGuidePrompt(server) {
|
|
9
9
|
server.registerPrompt('jamf_setup_guide', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-guide.js","sourceRoot":"","sources":["../../../src/core/prompts/setup-guide.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"setup-guide.js","sourceRoot":"","sources":["../../../src/core/prompts/setup-guide.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,UAAU,wBAAwB,CAAC,MAAiB;IACxD,MAAM,CAAC,cAAc,CACnB,kBAAkB,EAClB;QACE,KAAK,EAAE,kBAAkB;QACzB,WAAW,EACT,qFAAqF;QACvF,UAAU,EAAE;YACV,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,qCAAqC,CAAC;YAC7E,OAAO,EAAE,WAAW,CAClB,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAC5B,qEAAqE,CACtE,EACD,eAAe,CAChB;SACF;KACF,EACD,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE;QACvB,MAAM,aAAa,GAAG,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,EAAE;YAC3D,CAAC,CAAC,eAAe,OAAO,GAAG;YAC3B,CAAC,CAAC,EAAE,CAAC;QACP,OAAO;YACL,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,MAAe;oBACrB,OAAO,EAAE;wBACP,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,2CAA2C,OAAO;;;;;qDAKjB,OAAO,wBAAwB,aAAa,KAAK,EAAE,CAAC,CAAC,CAAC,kBAAkB,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE;;;;;;;;;;;;;;;WAetI,OAAO,GAAG,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,cAAc,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE;qBAChF;iBACF;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* jamf_troubleshoot prompt
|
|
3
3
|
* Guides AI through a troubleshooting workflow using Jamf documentation.
|
|
4
4
|
*/
|
|
5
|
-
import type { McpServer } from '@modelcontextprotocol/
|
|
5
|
+
import type { McpServer } from '@modelcontextprotocol/server';
|
|
6
6
|
export declare function registerTroubleshootPrompt(server: McpServer): void;
|
|
7
7
|
//# sourceMappingURL=troubleshoot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"troubleshoot.d.ts","sourceRoot":"","sources":["../../../src/core/prompts/troubleshoot.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"troubleshoot.d.ts","sourceRoot":"","sources":["../../../src/core/prompts/troubleshoot.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAK9D,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAoDlE"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Guides AI through a troubleshooting workflow using Jamf documentation.
|
|
4
4
|
*/
|
|
5
5
|
import { z } from 'zod';
|
|
6
|
-
import { completable } from '@modelcontextprotocol/
|
|
6
|
+
import { completable } from '@modelcontextprotocol/server';
|
|
7
7
|
import { completeProduct } from '../completions.js';
|
|
8
8
|
export function registerTroubleshootPrompt(server) {
|
|
9
9
|
server.registerPrompt('jamf_troubleshoot', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"troubleshoot.js","sourceRoot":"","sources":["../../../src/core/prompts/troubleshoot.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"troubleshoot.js","sourceRoot":"","sources":["../../../src/core/prompts/troubleshoot.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,UAAU,0BAA0B,CAAC,MAAiB;IAC1D,MAAM,CAAC,cAAc,CACnB,mBAAmB,EACnB;QACE,KAAK,EAAE,yBAAyB;QAChC,WAAW,EAAE,yEAAyE;QACtF,UAAU,EAAE;YACV,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,0CAA0C,CAAC;YAClF,OAAO,EAAE,WAAW,CAClB,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAC5B,qEAAqE,CACtE,EACD,eAAe,CAChB;SACF;KACF,EACD,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE;QACvB,MAAM,aAAa,GAAG,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,EAAE;YAC3D,CAAC,CAAC,eAAe,OAAO,GAAG;YAC3B,CAAC,CAAC,EAAE,CAAC;QACP,OAAO;YACL,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,MAAe;oBACrB,OAAO,EAAE;wBACP,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,8CAA8C,OAAO;;;;;yEAKA,aAAa,KAAK,EAAE,CAAC,CAAC,CAAC,kBAAkB,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE;;;;;;;;;;;;;;WAc3H,OAAO,GAAG,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,cAAc,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE;qBAChF;iBACF;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* without needing to call tools. Data is fetched from the API
|
|
6
6
|
* with fallback to static constants.
|
|
7
7
|
*/
|
|
8
|
-
import type { McpServer } from '@modelcontextprotocol/
|
|
8
|
+
import type { McpServer } from '@modelcontextprotocol/server';
|
|
9
9
|
import type { ServerContext } from '../types/context.js';
|
|
10
10
|
/**
|
|
11
11
|
* Register all MCP resources
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/resources/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/resources/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAqDzD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,aAAa,GAAG,IAAI,CA+H7E"}
|
|
@@ -5,11 +5,22 @@
|
|
|
5
5
|
* without needing to call tools. Data is fetched from the API
|
|
6
6
|
* with fallback to static constants.
|
|
7
7
|
*/
|
|
8
|
-
import { ResourceTemplate } from '@modelcontextprotocol/
|
|
8
|
+
import { ResourceTemplate } from '@modelcontextprotocol/server';
|
|
9
9
|
import { JAMF_PRODUCTS } from '../constants.js';
|
|
10
10
|
import { getProductsResourceData, getTopicsResourceData, getAvailableVersions } from '../services/metadata.js';
|
|
11
11
|
import { fetchTableOfContents } from '../services/toc-service.js';
|
|
12
12
|
import { completeProduct } from '../completions.js';
|
|
13
|
+
/**
|
|
14
|
+
* Cache fields for a `resources/read` result that must not be reused.
|
|
15
|
+
*
|
|
16
|
+
* The server configures `resources/read` with a one-hour public hint, which is
|
|
17
|
+
* right for real documentation and wrong for an error body or for data that
|
|
18
|
+
* only exists because the upstream registry was unreachable. A handler-supplied
|
|
19
|
+
* `ttlMs` / `cacheScope` wins over the configured hint, so returning these
|
|
20
|
+
* keeps a transient failure out of shared caches instead of freezing it there
|
|
21
|
+
* for an hour.
|
|
22
|
+
*/
|
|
23
|
+
const NO_CACHE = { ttlMs: 0, cacheScope: 'private' };
|
|
13
24
|
function validateProductId(productId, uri) {
|
|
14
25
|
const productIdStr = String(productId);
|
|
15
26
|
if (productIdStr in JAMF_PRODUCTS) {
|
|
@@ -24,6 +35,7 @@ function validateProductId(productId, uri) {
|
|
|
24
35
|
mimeType: 'text/plain',
|
|
25
36
|
text: `Invalid product ID: "${productIdStr}". Valid products: ${validIds}`,
|
|
26
37
|
}],
|
|
38
|
+
...NO_CACHE,
|
|
27
39
|
},
|
|
28
40
|
};
|
|
29
41
|
}
|
|
@@ -38,13 +50,18 @@ export function registerResources(server, ctx) {
|
|
|
38
50
|
description: 'List of all available Jamf products (Jamf Pro, Jamf School, Jamf Connect, Jamf Protect) with their IDs and latest versions. Data is fetched dynamically from the API.',
|
|
39
51
|
mimeType: 'application/json'
|
|
40
52
|
}, async () => {
|
|
41
|
-
const
|
|
53
|
+
const status = { degraded: false };
|
|
54
|
+
const data = await getProductsResourceData(ctx, status);
|
|
42
55
|
return {
|
|
43
56
|
contents: [{
|
|
44
57
|
uri: 'jamf://products',
|
|
45
58
|
mimeType: 'application/json',
|
|
46
59
|
text: JSON.stringify(data, null, 2)
|
|
47
|
-
}]
|
|
60
|
+
}],
|
|
61
|
+
// MapsRegistry was unreachable and this is the compiled-in catalogue
|
|
62
|
+
// standing in for it. Let the next read try again rather than freezing
|
|
63
|
+
// the outage into shared caches for an hour.
|
|
64
|
+
...(status.degraded ? NO_CACHE : {})
|
|
48
65
|
};
|
|
49
66
|
});
|
|
50
67
|
// Topics resource - dynamic with fallback
|
|
@@ -52,7 +69,11 @@ export function registerResources(server, ctx) {
|
|
|
52
69
|
title: 'Jamf Documentation Topics',
|
|
53
70
|
description: 'Topic categories for filtering documentation searches. Combines official TOC structure with curated categories.',
|
|
54
71
|
mimeType: 'application/json'
|
|
55
|
-
},
|
|
72
|
+
},
|
|
73
|
+
// No degradation sink: the topic list is built from compiled-in constants
|
|
74
|
+
// with no upstream call behind it, so it has no fallback to report. The
|
|
75
|
+
// configured one-hour public hint is always the right answer here.
|
|
76
|
+
async () => {
|
|
56
77
|
const data = await getTopicsResourceData(ctx);
|
|
57
78
|
return {
|
|
58
79
|
contents: [{
|
|
@@ -103,7 +124,8 @@ export function registerResources(server, ctx) {
|
|
|
103
124
|
if (!validation.valid) {
|
|
104
125
|
return validation.errorResponse;
|
|
105
126
|
}
|
|
106
|
-
const
|
|
127
|
+
const status = { degraded: false };
|
|
128
|
+
const versions = await getAvailableVersions(ctx, validation.id, status);
|
|
107
129
|
return {
|
|
108
130
|
contents: [{
|
|
109
131
|
uri: uri.href,
|
|
@@ -115,6 +137,9 @@ export function registerResources(server, ctx) {
|
|
|
115
137
|
latestVersion: JAMF_PRODUCTS[validation.id].latestVersion,
|
|
116
138
|
}, null, 2),
|
|
117
139
|
}],
|
|
140
|
+
// The registry was unreachable and this is the compiled-in fallback,
|
|
141
|
+
// not the real version list. Let the next read try again.
|
|
142
|
+
...(status.degraded ? NO_CACHE : {}),
|
|
118
143
|
};
|
|
119
144
|
});
|
|
120
145
|
log.info('Registered resources: jamf://products, jamf://topics, jamf://products/{productId}/toc, jamf://products/{productId}/versions');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/resources/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/resources/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,EAAE,aAAa,EAAkB,MAAM,iBAAiB,CAAC;AAChE,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;;GASG;AACH,MAAM,QAAQ,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,UAAU,EAAE,SAAS,EAAW,CAAC;AAW9D,SAAS,iBAAiB,CACxB,SAAiD,EACjD,GAAQ;IAER,MAAM,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IACvC,IAAI,YAAY,IAAI,aAAa,EAAE,CAAC;QAClC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,YAAyB,EAAE,CAAC;IACxD,CAAC;IACD,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvD,OAAO;QACL,KAAK,EAAE,KAAK;QACZ,aAAa,EAAE;YACb,QAAQ,EAAE,CAAC;oBACT,GAAG,EAAE,GAAG,CAAC,IAAI;oBACb,QAAQ,EAAE,YAAY;oBACtB,IAAI,EAAE,wBAAwB,YAAY,sBAAsB,QAAQ,EAAE;iBAC3E,CAA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eof ListProductsInputSchema>;
|
|
|
17
17
|
*/
|
|
18
18
|
export declare const SearchInputSchema: z.ZodObject<{
|
|
19
19
|
query: z.ZodString;
|
|
20
|
-
product: import("@modelcontextprotocol/
|
|
20
|
+
product: import("@modelcontextprotocol/server").CompletableSchema<z.ZodOptional<z.ZodEnum<{
|
|
21
21
|
[x: string]: string;
|
|
22
22
|
}>>>;
|
|
23
|
-
topic: import("@modelcontextprotocol/
|
|
23
|
+
topic: import("@modelcontextprotocol/server").CompletableSchema<z.ZodOptional<z.ZodEnum<{
|
|
24
24
|
[x: string]: string;
|
|
25
25
|
}>>>;
|
|
26
|
-
version: import("@modelcontextprotocol/
|
|
27
|
-
language: import("@modelcontextprotocol/
|
|
26
|
+
version: import("@modelcontextprotocol/server").CompletableSchema<z.ZodOptional<z.ZodString>>;
|
|
27
|
+
language: import("@modelcontextprotocol/server").CompletableSchema<z.ZodOptional<z.ZodEnum<{
|
|
28
28
|
[x: string]: string;
|
|
29
29
|
}>>>;
|
|
30
30
|
docType: z.ZodOptional<z.ZodEnum<{
|
|
@@ -44,7 +44,7 @@ export declare const GetArticleInputSchema: z.ZodObject<{
|
|
|
44
44
|
url: z.ZodOptional<z.ZodString>;
|
|
45
45
|
mapId: z.ZodOptional<z.ZodString>;
|
|
46
46
|
contentId: z.ZodOptional<z.ZodString>;
|
|
47
|
-
language: import("@modelcontextprotocol/
|
|
47
|
+
language: import("@modelcontextprotocol/server").CompletableSchema<z.ZodOptional<z.ZodEnum<{
|
|
48
48
|
[x: string]: string;
|
|
49
49
|
}>>>;
|
|
50
50
|
section: z.ZodOptional<z.ZodString>;
|
|
@@ -59,13 +59,13 @@ export type GetArticleInput = z.infer<typeof GetArticleInputSchema>;
|
|
|
59
59
|
* Schema for jamf_docs_get_toc
|
|
60
60
|
*/
|
|
61
61
|
export declare const GetTocInputSchema: z.ZodObject<{
|
|
62
|
-
product: import("@modelcontextprotocol/
|
|
62
|
+
product: import("@modelcontextprotocol/server").CompletableSchema<z.ZodEnum<{
|
|
63
63
|
[x: string]: string;
|
|
64
64
|
}>>;
|
|
65
|
-
language: import("@modelcontextprotocol/
|
|
65
|
+
language: import("@modelcontextprotocol/server").CompletableSchema<z.ZodOptional<z.ZodEnum<{
|
|
66
66
|
[x: string]: string;
|
|
67
67
|
}>>>;
|
|
68
|
-
version: import("@modelcontextprotocol/
|
|
68
|
+
version: import("@modelcontextprotocol/server").CompletableSchema<z.ZodOptional<z.ZodString>>;
|
|
69
69
|
page: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
70
70
|
maxTokens: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
71
71
|
outputMode: z.ZodDefault<z.ZodEnum<typeof OutputMode>>;
|
|
@@ -77,10 +77,10 @@ export type GetTocInput = z.infer<typeof GetTocInputSchema>;
|
|
|
77
77
|
*/
|
|
78
78
|
export declare const GlossaryLookupInputSchema: z.ZodObject<{
|
|
79
79
|
term: z.ZodString;
|
|
80
|
-
product: import("@modelcontextprotocol/
|
|
80
|
+
product: import("@modelcontextprotocol/server").CompletableSchema<z.ZodOptional<z.ZodEnum<{
|
|
81
81
|
[x: string]: string;
|
|
82
82
|
}>>>;
|
|
83
|
-
language: import("@modelcontextprotocol/
|
|
83
|
+
language: import("@modelcontextprotocol/server").CompletableSchema<z.ZodOptional<z.ZodEnum<{
|
|
84
84
|
[x: string]: string;
|
|
85
85
|
}>>>;
|
|
86
86
|
maxTokens: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
@@ -94,7 +94,7 @@ export type GlossaryLookupInput = z.infer<typeof GlossaryLookupInputSchema>;
|
|
|
94
94
|
export declare const GetBatchArticlesInputSchema: z.ZodObject<{
|
|
95
95
|
urls: z.ZodArray<z.ZodString>;
|
|
96
96
|
concurrency: z.ZodDefault<z.ZodNumber>;
|
|
97
|
-
language: import("@modelcontextprotocol/
|
|
97
|
+
language: import("@modelcontextprotocol/server").CompletableSchema<z.ZodOptional<z.ZodEnum<{
|
|
98
98
|
[x: string]: string;
|
|
99
99
|
}>>>;
|
|
100
100
|
maxTokens: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Zod schemas for input validation
|
|
3
3
|
*/
|
|
4
4
|
import { z } from 'zod';
|
|
5
|
-
import { completable } from '@modelcontextprotocol/
|
|
5
|
+
import { completable } from '@modelcontextprotocol/server';
|
|
6
6
|
import { ResponseFormat, OutputMode, CONTENT_LIMITS, TOKEN_CONFIG, PAGINATION_CONFIG, PRODUCT_IDS, TOPIC_IDS, COMMON_TOPIC_IDS, DOC_TYPE_IDS, SUPPORTED_LOCALE_IDS, DEFAULT_LOCALE } from '../constants.js';
|
|
7
7
|
import { completeProduct, completeTopic, completeVersion, completeLanguage } from '../completions.js';
|
|
8
8
|
import { isAllowedHostname } from '../utils/url.js';
|
|
@@ -95,12 +95,12 @@ export const GetArticleInputSchema = z.object({
|
|
|
95
95
|
.describe('Full URL of the Jamf documentation article. Alternative: use mapId + contentId for direct fetch.'),
|
|
96
96
|
mapId: z.string()
|
|
97
97
|
.max(200)
|
|
98
|
-
.regex(/^[a-zA-Z0-9_
|
|
98
|
+
.regex(/^[a-zA-Z0-9_~-]+$/, 'Invalid mapId format')
|
|
99
99
|
.optional()
|
|
100
100
|
.describe('Fluid Topics map ID (from search results or TOC). Use with contentId for direct fetch.'),
|
|
101
101
|
contentId: z.string()
|
|
102
102
|
.max(200)
|
|
103
|
-
.regex(/^[a-zA-Z0-9_
|
|
103
|
+
.regex(/^[a-zA-Z0-9_~-]+$/, 'Invalid contentId format')
|
|
104
104
|
.optional()
|
|
105
105
|
.describe('Fluid Topics content ID (from search results or TOC). Use with mapId for direct fetch.'),
|
|
106
106
|
language: completable(z.enum(SUPPORTED_LOCALE_IDS).optional().describe(LANGUAGE_DESCRIPTION), completeLanguage),
|