@get-technology-inc/jamf-docs-mcp-server 3.0.6 → 3.0.8
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 +37 -2
- package/dist/core/constants/doc-types.d.ts +48 -0
- package/dist/core/constants/doc-types.d.ts.map +1 -0
- package/dist/core/constants/doc-types.js +58 -0
- package/dist/core/constants/doc-types.js.map +1 -0
- package/dist/core/constants/index.d.ts +16 -0
- package/dist/core/constants/index.d.ts.map +1 -0
- package/dist/core/constants/index.js +12 -0
- package/dist/core/constants/index.js.map +1 -0
- package/dist/core/constants/limits.d.ts +39 -0
- package/dist/core/constants/limits.d.ts.map +1 -0
- package/dist/core/constants/limits.js +51 -0
- package/dist/core/constants/limits.js.map +1 -0
- package/dist/core/constants/locales.d.ts +34 -0
- package/dist/core/constants/locales.d.ts.map +1 -0
- package/dist/core/constants/locales.js +20 -0
- package/dist/core/constants/locales.js.map +1 -0
- package/dist/core/constants/products.d.ts +127 -0
- package/dist/core/constants/products.d.ts.map +1 -0
- package/dist/core/constants/products.js +135 -0
- package/dist/core/constants/products.js.map +1 -0
- package/dist/core/constants/topics.d.ts +168 -0
- package/dist/core/constants/topics.d.ts.map +1 -0
- package/dist/core/constants/topics.js +186 -0
- package/dist/core/constants/topics.js.map +1 -0
- package/dist/core/constants.d.ts +7 -404
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.js +16 -427
- package/dist/core/constants.js.map +1 -1
- package/dist/core/http-client.d.ts +14 -2
- package/dist/core/http-client.d.ts.map +1 -1
- package/dist/core/http-client.js +148 -17
- package/dist/core/http-client.js.map +1 -1
- package/dist/core/index.d.ts +12 -12
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +12 -13
- package/dist/core/index.js.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 +3 -1
- package/dist/core/schemas/index.d.ts.map +1 -1
- package/dist/core/schemas/index.js +13 -3
- package/dist/core/schemas/index.js.map +1 -1
- package/dist/core/schemas/output.d.ts +7 -0
- package/dist/core/schemas/output.d.ts.map +1 -1
- package/dist/core/schemas/output.js +7 -0
- package/dist/core/schemas/output.js.map +1 -1
- package/dist/core/services/article-service.d.ts +24 -0
- package/dist/core/services/article-service.d.ts.map +1 -0
- package/dist/core/services/article-service.js +140 -0
- package/dist/core/services/article-service.js.map +1 -0
- package/dist/core/services/content-parser.d.ts +38 -0
- package/dist/core/services/content-parser.d.ts.map +1 -0
- package/dist/core/services/content-parser.js +148 -0
- package/dist/core/services/content-parser.js.map +1 -0
- package/dist/core/services/ft-client.d.ts +52 -0
- package/dist/core/services/ft-client.d.ts.map +1 -0
- package/dist/core/services/ft-client.js +87 -0
- package/dist/core/services/ft-client.js.map +1 -0
- package/dist/core/services/glossary.d.ts +9 -5
- package/dist/core/services/glossary.d.ts.map +1 -1
- package/dist/core/services/glossary.js +175 -108
- package/dist/core/services/glossary.js.map +1 -1
- package/dist/core/services/interfaces/cache.d.ts +6 -6
- package/dist/core/services/interfaces/cache.d.ts.map +1 -1
- package/dist/core/services/interfaces/index.d.ts +3 -3
- package/dist/core/services/interfaces/index.d.ts.map +1 -1
- package/dist/core/services/interfaces/logger.d.ts +17 -10
- package/dist/core/services/interfaces/logger.d.ts.map +1 -1
- package/dist/core/services/interfaces/metadata.d.ts +0 -10
- package/dist/core/services/interfaces/metadata.d.ts.map +1 -1
- package/dist/core/services/interfaces/providers.d.ts +23 -10
- package/dist/core/services/interfaces/providers.d.ts.map +1 -1
- package/dist/core/services/logging.d.ts +38 -18
- package/dist/core/services/logging.d.ts.map +1 -1
- package/dist/core/services/logging.js +78 -29
- package/dist/core/services/logging.js.map +1 -1
- package/dist/core/services/maps-registry.d.ts +82 -0
- package/dist/core/services/maps-registry.d.ts.map +1 -0
- package/dist/core/services/maps-registry.js +232 -0
- package/dist/core/services/maps-registry.js.map +1 -0
- package/dist/core/services/metadata.d.ts +18 -9
- package/dist/core/services/metadata.d.ts.map +1 -1
- package/dist/core/services/metadata.js +113 -254
- package/dist/core/services/metadata.js.map +1 -1
- package/dist/core/services/search-service.d.ts +31 -0
- package/dist/core/services/search-service.d.ts.map +1 -0
- package/dist/core/services/search-service.js +462 -0
- package/dist/core/services/search-service.js.map +1 -0
- package/dist/core/services/toc-service.d.ts +30 -0
- package/dist/core/services/toc-service.d.ts.map +1 -0
- package/dist/core/services/toc-service.js +107 -0
- package/dist/core/services/toc-service.js.map +1 -0
- package/dist/core/services/tokenizer.d.ts +20 -1
- package/dist/core/services/tokenizer.d.ts.map +1 -1
- package/dist/core/services/tokenizer.js +32 -4
- package/dist/core/services/tokenizer.js.map +1 -1
- package/dist/core/services/topic-resolver.d.ts +74 -0
- package/dist/core/services/topic-resolver.d.ts.map +1 -0
- package/dist/core/services/topic-resolver.js +191 -0
- package/dist/core/services/topic-resolver.js.map +1 -0
- package/dist/core/tools/batch-get-articles.d.ts +0 -2
- package/dist/core/tools/batch-get-articles.d.ts.map +1 -1
- package/dist/core/tools/batch-get-articles.js +18 -46
- package/dist/core/tools/batch-get-articles.js.map +1 -1
- package/dist/core/tools/get-article.d.ts.map +1 -1
- package/dist/core/tools/get-article.js +29 -112
- package/dist/core/tools/get-article.js.map +1 -1
- package/dist/core/tools/get-toc.js +1 -1
- package/dist/core/tools/get-toc.js.map +1 -1
- package/dist/core/tools/glossary-lookup.d.ts.map +1 -1
- package/dist/core/tools/glossary-lookup.js +26 -7
- package/dist/core/tools/glossary-lookup.js.map +1 -1
- package/dist/core/tools/list-products.d.ts.map +1 -1
- package/dist/core/tools/list-products.js +5 -3
- package/dist/core/tools/list-products.js.map +1 -1
- package/dist/core/tools/search.js +5 -5
- package/dist/core/tools/search.js.map +1 -1
- package/dist/core/types/context.d.ts +5 -2
- package/dist/core/types/context.d.ts.map +1 -1
- package/dist/core/types.d.ts +141 -31
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/core/utils/bundle.d.ts +14 -1
- package/dist/core/utils/bundle.d.ts.map +1 -1
- package/dist/core/utils/bundle.js +19 -2
- package/dist/core/utils/bundle.js.map +1 -1
- package/dist/core/utils/format-article.d.ts +49 -0
- package/dist/core/utils/format-article.d.ts.map +1 -0
- package/dist/core/utils/format-article.js +188 -0
- package/dist/core/utils/format-article.js.map +1 -0
- package/dist/core/utils/ft-metadata.d.ts +22 -0
- package/dist/core/utils/ft-metadata.d.ts.map +1 -0
- package/dist/core/utils/ft-metadata.js +30 -0
- package/dist/core/utils/ft-metadata.js.map +1 -0
- package/dist/core/utils/sanitize.d.ts.map +1 -1
- package/dist/core/utils/sanitize.js +0 -2
- package/dist/core/utils/sanitize.js.map +1 -1
- package/dist/core/utils/url.d.ts.map +1 -1
- package/dist/core/utils/url.js +0 -1
- package/dist/core/utils/url.js.map +1 -1
- package/dist/index.js +10 -6
- package/dist/index.js.map +1 -1
- package/dist/platforms/node/http-server.d.ts +13 -0
- package/dist/platforms/node/http-server.d.ts.map +1 -0
- package/dist/platforms/node/http-server.js +231 -0
- package/dist/platforms/node/http-server.js.map +1 -0
- package/dist/platforms/node/index.d.ts +1 -1
- package/dist/platforms/node/index.d.ts.map +1 -1
- package/dist/platforms/node/index.js +1 -1
- package/dist/platforms/node/index.js.map +1 -1
- package/dist/platforms/node/logger.d.ts +13 -2
- package/dist/platforms/node/logger.d.ts.map +1 -1
- package/dist/platforms/node/logger.js +17 -4
- package/dist/platforms/node/logger.js.map +1 -1
- package/dist/transport/http-handler.d.ts +25 -0
- package/dist/transport/http-handler.d.ts.map +1 -0
- package/dist/transport/http-handler.js +193 -0
- package/dist/transport/http-handler.js.map +1 -0
- package/dist/transport/http-types.d.ts +22 -0
- package/dist/transport/http-types.d.ts.map +1 -0
- package/dist/transport/http-types.js +65 -0
- package/dist/transport/http-types.js.map +1 -0
- package/dist/transport/http.d.ts +4 -8
- package/dist/transport/http.d.ts.map +1 -1
- package/dist/transport/http.js +4 -376
- package/dist/transport/http.js.map +1 -1
- package/dist/transport/index.js +2 -2
- package/dist/transport/index.js.map +1 -1
- package/dist/transport/rate-limiter.d.ts +16 -0
- package/dist/transport/rate-limiter.d.ts.map +1 -0
- package/dist/transport/rate-limiter.js +55 -0
- package/dist/transport/rate-limiter.js.map +1 -0
- package/package.json +3 -3
- package/dist/core/services/interfaces.d.ts +0 -94
- package/dist/core/services/interfaces.d.ts.map +0 -1
- package/dist/core/services/interfaces.js +0 -8
- package/dist/core/services/interfaces.js.map +0 -1
- package/dist/core/services/scraper.d.ts +0 -90
- package/dist/core/services/scraper.d.ts.map +0 -1
- package/dist/core/services/scraper.js +0 -990
- package/dist/core/services/scraper.js.map +0 -1
- package/dist/core/utils/doc-type.d.ts +0 -12
- package/dist/core/utils/doc-type.d.ts.map +0 -1
- package/dist/core/utils/doc-type.js +0 -24
- package/dist/core/utils/doc-type.js.map +0 -1
- package/dist/platforms/node/metadata.d.ts +0 -18
- package/dist/platforms/node/metadata.d.ts.map +0 -1
- package/dist/platforms/node/metadata.js +0 -35
- package/dist/platforms/node/metadata.js.map +0 -1
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform-agnostic HTTP handler for the MCP server.
|
|
3
|
+
*
|
|
4
|
+
* Platform adapters (Node.js, Cloudflare Workers) convert their
|
|
5
|
+
* native request/response types to/from Web Standard objects and
|
|
6
|
+
* call the `handler` function returned by `createHttpHandler`.
|
|
7
|
+
*/
|
|
8
|
+
import { WebStandardStreamableHTTPServerTransport, } from '@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js';
|
|
9
|
+
import { RateLimiter } from './rate-limiter.js';
|
|
10
|
+
import { LLMS_TXT, PayloadTooLargeError, } from './http-types.js';
|
|
11
|
+
// ============================================================================
|
|
12
|
+
// Security headers
|
|
13
|
+
// ============================================================================
|
|
14
|
+
/** Security headers applied to all responses (defense-in-depth) */
|
|
15
|
+
const SECURITY_HEADERS = {
|
|
16
|
+
'X-Content-Type-Options': 'nosniff',
|
|
17
|
+
'X-Frame-Options': 'DENY',
|
|
18
|
+
'Cache-Control': 'no-store',
|
|
19
|
+
};
|
|
20
|
+
// ============================================================================
|
|
21
|
+
// CORS helper
|
|
22
|
+
// ============================================================================
|
|
23
|
+
function getCorsHeaders(origin, allowedOrigins) {
|
|
24
|
+
const headers = { ...SECURITY_HEADERS };
|
|
25
|
+
if (allowedOrigins.length === 0) {
|
|
26
|
+
// No origins configured -- deny cross-origin
|
|
27
|
+
return headers;
|
|
28
|
+
}
|
|
29
|
+
// If wildcard is in the list, allow all origins
|
|
30
|
+
if (allowedOrigins.includes('*')) {
|
|
31
|
+
headers['Access-Control-Allow-Origin'] = '*';
|
|
32
|
+
headers['Access-Control-Allow-Methods'] = 'GET, POST, OPTIONS';
|
|
33
|
+
headers['Access-Control-Allow-Headers'] = 'Content-Type';
|
|
34
|
+
return headers;
|
|
35
|
+
}
|
|
36
|
+
// Otherwise, check exact match against the allowed list
|
|
37
|
+
if (origin !== null && allowedOrigins.includes(origin)) {
|
|
38
|
+
headers['Access-Control-Allow-Origin'] = origin;
|
|
39
|
+
headers['Access-Control-Allow-Methods'] = 'GET, POST, OPTIONS';
|
|
40
|
+
headers['Access-Control-Allow-Headers'] = 'Content-Type';
|
|
41
|
+
headers['Access-Control-Max-Age'] = '86400';
|
|
42
|
+
headers.Vary = 'Origin';
|
|
43
|
+
}
|
|
44
|
+
return headers;
|
|
45
|
+
}
|
|
46
|
+
// ============================================================================
|
|
47
|
+
// Body reading helper (Web Standard)
|
|
48
|
+
// ============================================================================
|
|
49
|
+
async function readBodyText(request, maxBodySize) {
|
|
50
|
+
// Fast reject via Content-Length header when available
|
|
51
|
+
const contentLength = request.headers.get('content-length');
|
|
52
|
+
if (contentLength !== null) {
|
|
53
|
+
const length = parseInt(contentLength, 10);
|
|
54
|
+
if (!isNaN(length) && length > maxBodySize) {
|
|
55
|
+
throw new PayloadTooLargeError();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const text = await request.text();
|
|
59
|
+
if (text.length > maxBodySize) {
|
|
60
|
+
throw new PayloadTooLargeError();
|
|
61
|
+
}
|
|
62
|
+
return text;
|
|
63
|
+
}
|
|
64
|
+
// ============================================================================
|
|
65
|
+
// Response builder helpers
|
|
66
|
+
// ============================================================================
|
|
67
|
+
function jsonResponse(status, body, extraHeaders = {}) {
|
|
68
|
+
return new Response(JSON.stringify(body), {
|
|
69
|
+
status,
|
|
70
|
+
headers: {
|
|
71
|
+
'Content-Type': 'application/json',
|
|
72
|
+
...extraHeaders,
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function textResponse(status, body, contentType, extraHeaders = {}) {
|
|
77
|
+
return new Response(body, {
|
|
78
|
+
status,
|
|
79
|
+
headers: {
|
|
80
|
+
'Content-Type': contentType,
|
|
81
|
+
...extraHeaders,
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
// ============================================================================
|
|
86
|
+
// Factory
|
|
87
|
+
// ============================================================================
|
|
88
|
+
/**
|
|
89
|
+
* Create a platform-agnostic HTTP handler for the MCP server.
|
|
90
|
+
*
|
|
91
|
+
* @param mcpServer - The MCP server instance to connect per-request transports to
|
|
92
|
+
* @param config - HTTP handler configuration
|
|
93
|
+
* @param getClientIp - Platform-specific function to extract client IP from a Request
|
|
94
|
+
* @param logger - Optional logger instance
|
|
95
|
+
* @returns An object with:
|
|
96
|
+
* - `handler`: async function that takes a Web Standard Request and returns a Response
|
|
97
|
+
* - `cleanup`: function to stop the rate limiter cleanup interval
|
|
98
|
+
*/
|
|
99
|
+
export function createHttpHandler(mcpServer, config, getClientIp, logger) {
|
|
100
|
+
const rateLimiter = new RateLimiter(config.rateLimitRpm, 60_000);
|
|
101
|
+
const cleanupIntervalId = setInterval(() => { rateLimiter.cleanup(); }, 5 * 60_000);
|
|
102
|
+
// Prevent the interval from keeping the process alive (Node.js-specific,
|
|
103
|
+
// but calling .unref() is harmless on platforms that lack it).
|
|
104
|
+
if (typeof cleanupIntervalId === 'object' && 'unref' in cleanupIntervalId) {
|
|
105
|
+
cleanupIntervalId.unref();
|
|
106
|
+
}
|
|
107
|
+
function cleanup() {
|
|
108
|
+
clearInterval(cleanupIntervalId);
|
|
109
|
+
}
|
|
110
|
+
async function handler(request) {
|
|
111
|
+
// Use hardcoded base URL to prevent Host header injection
|
|
112
|
+
const url = new URL(request.url, 'http://localhost');
|
|
113
|
+
const { pathname } = url;
|
|
114
|
+
const origin = request.headers.get('origin');
|
|
115
|
+
const corsHeaders = getCorsHeaders(origin, config.corsAllowedOrigins);
|
|
116
|
+
// CORS preflight
|
|
117
|
+
if (request.method === 'OPTIONS') {
|
|
118
|
+
return new Response(null, {
|
|
119
|
+
status: 204,
|
|
120
|
+
headers: { ...corsHeaders, 'Content-Length': '0' },
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
// Rate limiting
|
|
124
|
+
const clientIp = getClientIp(request);
|
|
125
|
+
if (!rateLimiter.isAllowed(clientIp)) {
|
|
126
|
+
return jsonResponse(429, { error: 'Too many requests' }, corsHeaders);
|
|
127
|
+
}
|
|
128
|
+
// Health check
|
|
129
|
+
if (pathname === '/health' && request.method === 'GET') {
|
|
130
|
+
return jsonResponse(200, { status: 'ok', version: config.serverVersion }, corsHeaders);
|
|
131
|
+
}
|
|
132
|
+
// llms.txt
|
|
133
|
+
if (pathname === '/llms.txt' && request.method === 'GET') {
|
|
134
|
+
return textResponse(200, LLMS_TXT, 'text/plain; charset=utf-8', corsHeaders);
|
|
135
|
+
}
|
|
136
|
+
// MCP endpoint
|
|
137
|
+
if (pathname === '/mcp') {
|
|
138
|
+
return await handleMcp(request, mcpServer, config, corsHeaders, logger);
|
|
139
|
+
}
|
|
140
|
+
// 404 fallback
|
|
141
|
+
return jsonResponse(404, { error: 'Not found' }, corsHeaders);
|
|
142
|
+
}
|
|
143
|
+
return { handler, cleanup };
|
|
144
|
+
}
|
|
145
|
+
// ============================================================================
|
|
146
|
+
// MCP endpoint handler
|
|
147
|
+
// ============================================================================
|
|
148
|
+
async function handleMcp(request, mcpServer, config, corsHeaders, logger) {
|
|
149
|
+
// Read body (with size enforcement)
|
|
150
|
+
let bodyText;
|
|
151
|
+
try {
|
|
152
|
+
bodyText = await readBodyText(request, config.maxBodySize);
|
|
153
|
+
}
|
|
154
|
+
catch (err) {
|
|
155
|
+
if (err instanceof PayloadTooLargeError) {
|
|
156
|
+
return jsonResponse(413, { error: 'Payload too large' }, corsHeaders);
|
|
157
|
+
}
|
|
158
|
+
throw err;
|
|
159
|
+
}
|
|
160
|
+
// Create a per-request transport (stateless mode)
|
|
161
|
+
const transport = new WebStandardStreamableHTTPServerTransport({
|
|
162
|
+
enableJsonResponse: config.enableJsonResponse,
|
|
163
|
+
});
|
|
164
|
+
// Connect the MCP server to this transport
|
|
165
|
+
await mcpServer.connect(transport);
|
|
166
|
+
try {
|
|
167
|
+
// Parse body if present
|
|
168
|
+
let parsedBody;
|
|
169
|
+
if (bodyText.length > 0) {
|
|
170
|
+
try {
|
|
171
|
+
parsedBody = JSON.parse(bodyText);
|
|
172
|
+
}
|
|
173
|
+
catch {
|
|
174
|
+
return jsonResponse(400, { error: 'Invalid JSON in request body' }, corsHeaders);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
// Handle the request via the MCP transport
|
|
178
|
+
const webRes = await transport.handleRequest(request, { parsedBody });
|
|
179
|
+
// Add CORS + security headers to the response
|
|
180
|
+
for (const [key, value] of Object.entries(corsHeaders)) {
|
|
181
|
+
webRes.headers.set(key, value);
|
|
182
|
+
}
|
|
183
|
+
return webRes;
|
|
184
|
+
}
|
|
185
|
+
catch (err) {
|
|
186
|
+
logger?.error(`MCP handler error: ${err instanceof Error ? err.message : String(err)}`);
|
|
187
|
+
return jsonResponse(500, { error: 'Internal server error' }, corsHeaders);
|
|
188
|
+
}
|
|
189
|
+
finally {
|
|
190
|
+
await transport.close();
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
//# sourceMappingURL=http-handler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,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;YAAS,CAAC;QACT,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC;IAC1B,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types and constants for the HTTP transport layer.
|
|
3
|
+
*/
|
|
4
|
+
import type { Logger } from '../core/services/interfaces/index.js';
|
|
5
|
+
export type { Logger };
|
|
6
|
+
export interface HttpHandlerConfig {
|
|
7
|
+
serverVersion: string;
|
|
8
|
+
corsAllowedOrigins: string[];
|
|
9
|
+
trustProxy: boolean;
|
|
10
|
+
rateLimitRpm: number;
|
|
11
|
+
maxBodySize: number;
|
|
12
|
+
enableJsonResponse: boolean;
|
|
13
|
+
shutdownTimeoutMs: number;
|
|
14
|
+
}
|
|
15
|
+
/** Platform-specific IP extraction -- Node reads socket, Workers reads CF header */
|
|
16
|
+
export type ClientIpExtractor = (request: Request) => string;
|
|
17
|
+
export declare const DEFAULT_HTTP_CONFIG: HttpHandlerConfig;
|
|
18
|
+
export declare const LLMS_TXT = "# Jamf Docs MCP Server\n\n> MCP server providing access to official Jamf documentation from learn.jamf.com\n\n## Products\n- Jamf Pro \u2014 Apple device management for enterprise\n- Jamf School \u2014 Apple device management for education\n- Jamf Connect \u2014 identity and access management\n- Jamf Protect \u2014 endpoint security for Apple\n- Jamf Now \u2014 simple device management for small businesses\n- Jamf Safe Internet \u2014 content filtering and web security\n- Jamf Insights \u2014 analytics and reporting for Apple fleet\n- RapidIdentity \u2014 identity and access management platform\n\n## Tools\n- jamf_docs_list_products: discover available products and versions\n- jamf_docs_search: search documentation by keyword with product/topic filters\n- jamf_docs_get_article: retrieve full article content in markdown\n- jamf_docs_get_toc: browse table of contents for a product\n- jamf_docs_glossary_lookup: look up glossary terms with fuzzy matching\n- jamf_docs_batch_get_articles: retrieve multiple articles in a single request\n\n## Resources\n- jamf://products \u2014 product list with metadata and versions\n- jamf://topics \u2014 topic categories per product\n- jamf://products/{productId}/toc \u2014 table of contents for a specific product\n- jamf://products/{productId}/versions \u2014 available documentation versions\n\n## Prompts\n- jamf_troubleshoot: guided troubleshooting workflow\n- jamf_setup_guide: step-by-step setup instructions\n- jamf_compare_versions: compare features across versions\n\n## Supported Locales\nen-US, ja-JP, zh-TW, de-DE, es-ES, fr-FR, nl-NL, th-TH\n\n## Limitations\n- Documentation content only \u2014 no Jamf REST API reference\n- Content is sourced from learn.jamf.com and cached; not real-time\n";
|
|
19
|
+
export declare class PayloadTooLargeError extends Error {
|
|
20
|
+
constructor();
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=http-types.d.ts.map
|
|
@@ -0,0 +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;AAMvB,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,kBAAkB,EAAE,OAAO,CAAC;IAC5B,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"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types and constants for the HTTP transport layer.
|
|
3
|
+
*/
|
|
4
|
+
export const DEFAULT_HTTP_CONFIG = {
|
|
5
|
+
serverVersion: '3.0.6',
|
|
6
|
+
corsAllowedOrigins: [],
|
|
7
|
+
trustProxy: false,
|
|
8
|
+
rateLimitRpm: 60,
|
|
9
|
+
maxBodySize: 1_048_576,
|
|
10
|
+
enableJsonResponse: true,
|
|
11
|
+
shutdownTimeoutMs: 10_000,
|
|
12
|
+
};
|
|
13
|
+
// ============================================================================
|
|
14
|
+
// Static content
|
|
15
|
+
// ============================================================================
|
|
16
|
+
export const LLMS_TXT = `# Jamf Docs MCP Server
|
|
17
|
+
|
|
18
|
+
> MCP server providing access to official Jamf documentation from learn.jamf.com
|
|
19
|
+
|
|
20
|
+
## Products
|
|
21
|
+
- Jamf Pro — Apple device management for enterprise
|
|
22
|
+
- Jamf School — Apple device management for education
|
|
23
|
+
- Jamf Connect — identity and access management
|
|
24
|
+
- Jamf Protect — endpoint security for Apple
|
|
25
|
+
- Jamf Now — simple device management for small businesses
|
|
26
|
+
- Jamf Safe Internet — content filtering and web security
|
|
27
|
+
- Jamf Insights — analytics and reporting for Apple fleet
|
|
28
|
+
- RapidIdentity — identity and access management platform
|
|
29
|
+
|
|
30
|
+
## Tools
|
|
31
|
+
- jamf_docs_list_products: discover available products and versions
|
|
32
|
+
- jamf_docs_search: search documentation by keyword with product/topic filters
|
|
33
|
+
- jamf_docs_get_article: retrieve full article content in markdown
|
|
34
|
+
- jamf_docs_get_toc: browse table of contents for a product
|
|
35
|
+
- jamf_docs_glossary_lookup: look up glossary terms with fuzzy matching
|
|
36
|
+
- jamf_docs_batch_get_articles: retrieve multiple articles in a single request
|
|
37
|
+
|
|
38
|
+
## Resources
|
|
39
|
+
- jamf://products — product list with metadata and versions
|
|
40
|
+
- jamf://topics — topic categories per product
|
|
41
|
+
- jamf://products/{productId}/toc — table of contents for a specific product
|
|
42
|
+
- jamf://products/{productId}/versions — available documentation versions
|
|
43
|
+
|
|
44
|
+
## Prompts
|
|
45
|
+
- jamf_troubleshoot: guided troubleshooting workflow
|
|
46
|
+
- jamf_setup_guide: step-by-step setup instructions
|
|
47
|
+
- jamf_compare_versions: compare features across versions
|
|
48
|
+
|
|
49
|
+
## Supported Locales
|
|
50
|
+
en-US, ja-JP, zh-TW, de-DE, es-ES, fr-FR, nl-NL, th-TH
|
|
51
|
+
|
|
52
|
+
## Limitations
|
|
53
|
+
- Documentation content only — no Jamf REST API reference
|
|
54
|
+
- Content is sourced from learn.jamf.com and cached; not real-time
|
|
55
|
+
`;
|
|
56
|
+
// ============================================================================
|
|
57
|
+
// Error classes
|
|
58
|
+
// ============================================================================
|
|
59
|
+
export class PayloadTooLargeError extends Error {
|
|
60
|
+
constructor() {
|
|
61
|
+
super('Payload too large');
|
|
62
|
+
this.name = 'PayloadTooLargeError';
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=http-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-types.js","sourceRoot":"","sources":["../../src/transport/http-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAuBH,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,kBAAkB,EAAE,IAAI;IACxB,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/dist/transport/http.d.ts
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Backward-compatible re-export.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* The real implementation lives in `platforms/node/http-server.ts`.
|
|
5
|
+
* This shim preserves the dynamic import path used in `src/index.ts`.
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Create and start an HTTP server for the MCP server
|
|
10
|
-
*/
|
|
11
|
-
export declare function startHttpServer(mcpServer: McpServer, port: number, host: string): Promise<void>;
|
|
7
|
+
export { startHttpServer } from '../platforms/node/http-server.js';
|
|
12
8
|
//# sourceMappingURL=http.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/transport/http.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/transport/http.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC"}
|