@get-technology-inc/jamf-docs-mcp-server 3.0.49 → 4.0.0
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/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 +10 -1
- package/dist/core/create-server.d.ts.map +1 -1
- package/dist/core/create-server.js +60 -6
- 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 +1 -1
- package/dist/core/resources/index.js.map +1 -1
- package/dist/core/schemas/index.d.ts +11 -11
- package/dist/core/schemas/index.js +1 -1
- package/dist/core/schemas/index.js.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/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 +4 -0
- 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 +4 -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/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 +4 -0
- package/dist/core/tools/search.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/http-server.d.ts +1 -1
- package/dist/platforms/node/http-server.d.ts.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 +14 -2
- package/dist/transport/http-handler.d.ts.map +1 -1
- package/dist/transport/http-handler.js +45 -23
- 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 +12 -4
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* native request/response types to/from Web Standard objects and
|
|
6
6
|
* call the `handler` function returned by `createHttpHandler`.
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
8
|
+
import { createMcpHandler } from '@modelcontextprotocol/server';
|
|
9
9
|
import { RateLimiter } from './rate-limiter.js';
|
|
10
10
|
import { LLMS_TXT, PayloadTooLargeError, } from './http-types.js';
|
|
11
11
|
// ============================================================================
|
|
@@ -20,6 +20,26 @@ const SECURITY_HEADERS = {
|
|
|
20
20
|
// ============================================================================
|
|
21
21
|
// CORS helper
|
|
22
22
|
// ============================================================================
|
|
23
|
+
/**
|
|
24
|
+
* Request headers a browser-based MCP client is allowed to send.
|
|
25
|
+
*
|
|
26
|
+
* `Mcp-Method` / `Mcp-Name` are mandatory on Streamable HTTP POSTs from
|
|
27
|
+
* protocol revision 2026-07-28 (SEP-2243) — omitting them from the preflight
|
|
28
|
+
* allowlist makes every cross-origin call from a conforming client fail before
|
|
29
|
+
* it reaches the handler. `MCP-Protocol-Version`, `Mcp-Session-Id` and
|
|
30
|
+
* `Last-Event-ID` are kept for the 2025-era clients this endpoint still serves.
|
|
31
|
+
*/
|
|
32
|
+
export const CORS_ALLOWED_HEADERS = [
|
|
33
|
+
'Content-Type',
|
|
34
|
+
'Authorization',
|
|
35
|
+
'Mcp-Method',
|
|
36
|
+
'Mcp-Name',
|
|
37
|
+
'MCP-Protocol-Version',
|
|
38
|
+
'Mcp-Session-Id',
|
|
39
|
+
'Last-Event-ID',
|
|
40
|
+
].join(', ');
|
|
41
|
+
/** Response headers a browser-based MCP client is allowed to read. */
|
|
42
|
+
export const CORS_EXPOSED_HEADERS = ['Mcp-Session-Id'].join(', ');
|
|
23
43
|
function getCorsHeaders(origin, allowedOrigins) {
|
|
24
44
|
const headers = { ...SECURITY_HEADERS };
|
|
25
45
|
if (allowedOrigins.length === 0) {
|
|
@@ -30,14 +50,16 @@ function getCorsHeaders(origin, allowedOrigins) {
|
|
|
30
50
|
if (allowedOrigins.includes('*')) {
|
|
31
51
|
headers['Access-Control-Allow-Origin'] = '*';
|
|
32
52
|
headers['Access-Control-Allow-Methods'] = 'GET, POST, OPTIONS';
|
|
33
|
-
headers['Access-Control-Allow-Headers'] =
|
|
53
|
+
headers['Access-Control-Allow-Headers'] = CORS_ALLOWED_HEADERS;
|
|
54
|
+
headers['Access-Control-Expose-Headers'] = CORS_EXPOSED_HEADERS;
|
|
34
55
|
return headers;
|
|
35
56
|
}
|
|
36
57
|
// Otherwise, check exact match against the allowed list
|
|
37
58
|
if (origin !== null && allowedOrigins.includes(origin)) {
|
|
38
59
|
headers['Access-Control-Allow-Origin'] = origin;
|
|
39
60
|
headers['Access-Control-Allow-Methods'] = 'GET, POST, OPTIONS';
|
|
40
|
-
headers['Access-Control-Allow-Headers'] =
|
|
61
|
+
headers['Access-Control-Allow-Headers'] = CORS_ALLOWED_HEADERS;
|
|
62
|
+
headers['Access-Control-Expose-Headers'] = CORS_EXPOSED_HEADERS;
|
|
41
63
|
headers['Access-Control-Max-Age'] = '86400';
|
|
42
64
|
headers.Vary = 'Origin';
|
|
43
65
|
}
|
|
@@ -90,7 +112,7 @@ function textResponse(status, body, contentType, extraHeaders = {}) {
|
|
|
90
112
|
*
|
|
91
113
|
* @param createServer - Factory that returns a fresh McpServer per request.
|
|
92
114
|
* The MCP SDK requires one Protocol/Server instance per connection, so each
|
|
93
|
-
* request gets its own server
|
|
115
|
+
* request gets its own server rather than sharing a singleton.
|
|
94
116
|
* Callers decide the server's lifecycle/state model (stateless, per-session, …).
|
|
95
117
|
* @param config - HTTP handler configuration
|
|
96
118
|
* @param getClientIp - Platform-specific function to extract client IP from a Request
|
|
@@ -102,6 +124,17 @@ function textResponse(status, body, contentType, extraHeaders = {}) {
|
|
|
102
124
|
export function createHttpHandler(createServer, config, getClientIp, logger) {
|
|
103
125
|
const rateLimiter = new RateLimiter(config.rateLimitRpm, 60_000);
|
|
104
126
|
const cleanupIntervalId = setInterval(() => { rateLimiter.cleanup(); }, 5 * 60_000);
|
|
127
|
+
// One entry serves both protocol eras from the same factory: 2026-07-28
|
|
128
|
+
// envelope traffic on the modern path, and 2025-era requests through the
|
|
129
|
+
// SDK's stateless legacy fallback. Legacy responses stream over SSE, which
|
|
130
|
+
// the 2025 Streamable HTTP binding already requires clients to accept.
|
|
131
|
+
const mcpHandler = createMcpHandler(() => createServer(), {
|
|
132
|
+
legacy: 'stateless',
|
|
133
|
+
responseMode: config.responseMode,
|
|
134
|
+
onerror: (err) => {
|
|
135
|
+
logger?.error(`MCP handler error: ${err.message}`);
|
|
136
|
+
},
|
|
137
|
+
});
|
|
105
138
|
// Prevent the interval from keeping the process alive (Node.js-specific,
|
|
106
139
|
// but calling .unref() is harmless on platforms that lack it).
|
|
107
140
|
if (typeof cleanupIntervalId === 'object' && 'unref' in cleanupIntervalId) {
|
|
@@ -109,6 +142,7 @@ export function createHttpHandler(createServer, config, getClientIp, logger) {
|
|
|
109
142
|
}
|
|
110
143
|
function cleanup() {
|
|
111
144
|
clearInterval(cleanupIntervalId);
|
|
145
|
+
void mcpHandler.close();
|
|
112
146
|
}
|
|
113
147
|
async function handler(request) {
|
|
114
148
|
// Use hardcoded base URL to prevent Host header injection
|
|
@@ -138,7 +172,7 @@ export function createHttpHandler(createServer, config, getClientIp, logger) {
|
|
|
138
172
|
}
|
|
139
173
|
// MCP endpoint
|
|
140
174
|
if (pathname === '/mcp') {
|
|
141
|
-
return await handleMcp(request,
|
|
175
|
+
return await handleMcp(request, mcpHandler, config, corsHeaders, logger);
|
|
142
176
|
}
|
|
143
177
|
// 404 fallback
|
|
144
178
|
return jsonResponse(404, { error: 'Not found' }, corsHeaders);
|
|
@@ -148,7 +182,7 @@ export function createHttpHandler(createServer, config, getClientIp, logger) {
|
|
|
148
182
|
// ============================================================================
|
|
149
183
|
// MCP endpoint handler
|
|
150
184
|
// ============================================================================
|
|
151
|
-
async function handleMcp(request,
|
|
185
|
+
async function handleMcp(request, mcpHandler, config, corsHeaders, logger) {
|
|
152
186
|
// Read body (with size enforcement)
|
|
153
187
|
let bodyText;
|
|
154
188
|
try {
|
|
@@ -160,19 +194,9 @@ async function handleMcp(request, createServer, config, corsHeaders, logger) {
|
|
|
160
194
|
}
|
|
161
195
|
throw err;
|
|
162
196
|
}
|
|
163
|
-
// Create a fresh MCP server + transport for this request. The MCP SDK
|
|
164
|
-
// assigns one transport per Protocol/Server instance ("use a separate
|
|
165
|
-
// Protocol instance per connection"); reusing a single server across
|
|
166
|
-
// concurrent requests makes the second connect() throw "Already connected"
|
|
167
|
-
// and shares mutable per-connection state (e.g. logging levels).
|
|
168
|
-
const mcpServer = createServer();
|
|
169
|
-
const transport = new WebStandardStreamableHTTPServerTransport({
|
|
170
|
-
enableJsonResponse: config.enableJsonResponse,
|
|
171
|
-
});
|
|
172
|
-
// Connect the per-request server to this transport
|
|
173
|
-
await mcpServer.connect(transport);
|
|
174
197
|
try {
|
|
175
|
-
// Parse body if present
|
|
198
|
+
// Parse body if present. Reading it above consumed the request stream, so
|
|
199
|
+
// the parsed value must be handed to the MCP handler explicitly.
|
|
176
200
|
let parsedBody;
|
|
177
201
|
if (bodyText.length > 0) {
|
|
178
202
|
try {
|
|
@@ -182,8 +206,9 @@ async function handleMcp(request, createServer, config, corsHeaders, logger) {
|
|
|
182
206
|
return jsonResponse(400, { error: 'Invalid JSON in request body' }, corsHeaders);
|
|
183
207
|
}
|
|
184
208
|
}
|
|
185
|
-
//
|
|
186
|
-
|
|
209
|
+
// The entry classifies the era itself and builds a fresh server per
|
|
210
|
+
// request from the factory it was given.
|
|
211
|
+
const webRes = await mcpHandler.fetch(request, { parsedBody });
|
|
187
212
|
// Add CORS + security headers to the response
|
|
188
213
|
for (const [key, value] of Object.entries(corsHeaders)) {
|
|
189
214
|
webRes.headers.set(key, value);
|
|
@@ -194,8 +219,5 @@ async function handleMcp(request, createServer, config, corsHeaders, logger) {
|
|
|
194
219
|
logger?.error(`MCP handler error: ${err instanceof Error ? err.message : String(err)}`);
|
|
195
220
|
return jsonResponse(500, { error: 'Internal server error' }, corsHeaders);
|
|
196
221
|
}
|
|
197
|
-
finally {
|
|
198
|
-
await transport.close();
|
|
199
|
-
}
|
|
200
222
|
}
|
|
201
223
|
//# sourceMappingURL=http-handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-handler.js","sourceRoot":"","sources":["../../src/transport/http-handler.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"http-handler.js","sourceRoot":"","sources":["../../src/transport/http-handler.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EACL,QAAQ,EACR,oBAAoB,GAIrB,MAAM,iBAAiB,CAAC;AAEzB,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA+E;AAE/E,mEAAmE;AACnE,MAAM,gBAAgB,GAA2B;IAC/C,wBAAwB,EAAE,SAAS;IACnC,iBAAiB,EAAE,MAAM;IACzB,eAAe,EAAE,UAAU;CAC5B,CAAC;AAEF,+EAA+E;AAC/E,cAAc;AACd,+EAA+E;AAE/E;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,cAAc;IACd,eAAe;IACf,YAAY;IACZ,UAAU;IACV,sBAAsB;IACtB,gBAAgB;IAChB,eAAe;CAChB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,sEAAsE;AACtE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAElE,SAAS,cAAc,CACrB,MAAqB,EACrB,cAAwB;IAExB,MAAM,OAAO,GAA2B,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAEhE,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChC,6CAA6C;QAC7C,O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EAAE,WAAW,CAAC,CAAC;QACxE,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;IAED,IAAI,CAAC;QACH,0EAA0E;QAC1E,iEAAiE;QACjE,IAAI,UAAmB,CAAC;QACxB,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxB,IAAI,CAAC;gBACH,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAY,CAAC;YAC/C,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,YAAY,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,8BAA8B,EAAE,EAAE,WAAW,CAAC,CAAC;YACnF,CAAC;QACH,CAAC;QAED,oEAAoE;QACpE,yCAAyC;QACzC,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;QAE/D,8CAA8C;QAC9C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;YACvD,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACjC,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,EAAE,KAAK,CAAC,sBAAsB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACxF,OAAO,YAAY,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,uBAAuB,EAAE,EAAE,WAAW,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC"}
|
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared types and constants for the HTTP transport layer.
|
|
3
3
|
*/
|
|
4
|
+
import type { PerRequestResponseMode } from '@modelcontextprotocol/server';
|
|
4
5
|
import type { Logger } from '../core/services/interfaces/index.js';
|
|
5
|
-
export type { Logger };
|
|
6
|
+
export type { Logger, PerRequestResponseMode };
|
|
6
7
|
export interface HttpHandlerConfig {
|
|
7
8
|
serverVersion: string;
|
|
8
9
|
corsAllowedOrigins: string[];
|
|
9
10
|
trustProxy: boolean;
|
|
10
11
|
rateLimitRpm: number;
|
|
11
12
|
maxBodySize: number;
|
|
12
|
-
|
|
13
|
+
/**
|
|
14
|
+
* How responses are shaped.
|
|
15
|
+
*
|
|
16
|
+
* - `'auto'` (default) — a single JSON body, upgrading to an SSE stream only
|
|
17
|
+
* when a handler emits something before its result. In practice that means
|
|
18
|
+
* progress notifications reach the client instead of being discarded.
|
|
19
|
+
* - `'sse'` — always stream.
|
|
20
|
+
* - `'json'` — never stream, which silently drops mid-call notifications.
|
|
21
|
+
* Choose it when a response cache in front of this handler stores a single
|
|
22
|
+
* JSON body.
|
|
23
|
+
*/
|
|
24
|
+
responseMode: PerRequestResponseMode;
|
|
13
25
|
shutdownTimeoutMs: number;
|
|
14
26
|
}
|
|
15
27
|
/** Platform-specific IP extraction -- Node reads socket, Workers reads CF header */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-types.d.ts","sourceRoot":"","sources":["../../src/transport/http-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAEnE,YAAY,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"http-types.d.ts","sourceRoot":"","sources":["../../src/transport/http-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAEnE,YAAY,EAAE,MAAM,EAAE,sBAAsB,EAAE,CAAC;AAM/C,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;;;;;;OAUG;IACH,YAAY,EAAE,sBAAsB,CAAC;IACrC,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,oFAAoF;AACpF,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAC;AAE7D,eAAO,MAAM,mBAAmB,EAAE,iBAQjC,CAAC;AAMF,eAAO,MAAM,QAAQ,+tDAuCpB,CAAC;AAMF,qBAAa,oBAAqB,SAAQ,KAAK;;CAK9C"}
|
|
@@ -7,7 +7,7 @@ export const DEFAULT_HTTP_CONFIG = {
|
|
|
7
7
|
trustProxy: false,
|
|
8
8
|
rateLimitRpm: 60,
|
|
9
9
|
maxBodySize: 1_048_576,
|
|
10
|
-
|
|
10
|
+
responseMode: 'auto',
|
|
11
11
|
shutdownTimeoutMs: 10_000,
|
|
12
12
|
};
|
|
13
13
|
// ============================================================================
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-types.js","sourceRoot":"","sources":["../../src/transport/http-types.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"http-types.js","sourceRoot":"","sources":["../../src/transport/http-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAmCH,MAAM,CAAC,MAAM,mBAAmB,GAAsB;IACpD,aAAa,EAAE,OAAO;IACtB,kBAAkB,EAAE,EAAE;IACtB,UAAU,EAAE,KAAK;IACjB,YAAY,EAAE,EAAE;IAChB,WAAW,EAAE,SAAS;IACtB,YAAY,EAAE,MAAM;IACpB,iBAAiB,EAAE,MAAM;CAC1B,CAAC;AAEF,+EAA+E;AAC/E,iBAAiB;AACjB,+EAA+E;AAE/E,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCvB,CAAC;AAEF,+EAA+E;AAC/E,gBAAgB;AAChB,+EAA+E;AAE/E,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7C;QACE,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@get-technology-inc/jamf-docs-mcp-server",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "MCP Server for accessing Jamf Documentation (learn.jamf.com)",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"jamf-docs-mcp-server": "./dist/index.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
|
-
"build": "tsc",
|
|
11
|
+
"build": "npm run build:app-ui && tsc",
|
|
12
12
|
"dev": "tsx watch src/index.ts",
|
|
13
13
|
"start": "node dist/index.js",
|
|
14
14
|
"start:http": "node dist/index.js --transport http",
|
|
@@ -23,7 +23,9 @@
|
|
|
23
23
|
"lint": "eslint src/**/*.ts",
|
|
24
24
|
"typecheck": "tsc --noEmit",
|
|
25
25
|
"clean": "rm -rf dist",
|
|
26
|
-
"prepublishOnly": "npm run build"
|
|
26
|
+
"prepublishOnly": "npm run build",
|
|
27
|
+
"build:app-ui": "node scripts/build-app-ui.mjs",
|
|
28
|
+
"typecheck:app-ui": "tsc --noEmit -p app-ui/tsconfig.json"
|
|
27
29
|
},
|
|
28
30
|
"keywords": [
|
|
29
31
|
"mcp",
|
|
@@ -40,7 +42,6 @@
|
|
|
40
42
|
"author": "GET Technology Inc.",
|
|
41
43
|
"license": "MIT",
|
|
42
44
|
"dependencies": {
|
|
43
|
-
"@modelcontextprotocol/sdk": "^1.28.0",
|
|
44
45
|
"cheerio": "^1.0.0",
|
|
45
46
|
"fuse.js": "^7.1.0",
|
|
46
47
|
"turndown": "^7.2.0",
|
|
@@ -48,12 +49,16 @@
|
|
|
48
49
|
},
|
|
49
50
|
"devDependencies": {
|
|
50
51
|
"@eslint/js": "^9.17.0",
|
|
52
|
+
"@modelcontextprotocol/client": "^2.0.0",
|
|
53
|
+
"@modelcontextprotocol/ext-apps": "^1.7.5",
|
|
54
|
+
"@modelcontextprotocol/server": "^2.0.0",
|
|
51
55
|
"@semantic-release/changelog": "^6.0.3",
|
|
52
56
|
"@semantic-release/git": "^10.0.1",
|
|
53
57
|
"@types/node": "^26.0.0",
|
|
54
58
|
"@types/turndown": "^5.0.5",
|
|
55
59
|
"@vitest/coverage-v8": "^4.0.17",
|
|
56
60
|
"conventional-changelog-conventionalcommits": "^9.3.0",
|
|
61
|
+
"esbuild": "^0.28.1",
|
|
57
62
|
"eslint": "^10.1.0",
|
|
58
63
|
"semantic-release": "^25.0.3",
|
|
59
64
|
"tsx": "^4.19.0",
|
|
@@ -94,5 +99,8 @@
|
|
|
94
99
|
"homepage": "https://github.com/GET-Technology-Inc/jamf-docs-mcp-server#readme",
|
|
95
100
|
"bugs": {
|
|
96
101
|
"url": "https://github.com/GET-Technology-Inc/jamf-docs-mcp-server/issues"
|
|
102
|
+
},
|
|
103
|
+
"peerDependencies": {
|
|
104
|
+
"@modelcontextprotocol/server": "^2.0.0"
|
|
97
105
|
}
|
|
98
106
|
}
|