@mapbox/mcp-server 0.8.3 → 0.9.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/README.md +39 -12
- package/dist/commonjs/index.js +19 -2
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/prompts/SearchAlongRoutePrompt.js +6 -6
- package/dist/commonjs/prompts/index.d.ts +41 -0
- package/dist/commonjs/prompts/index.d.ts.map +1 -0
- package/dist/commonjs/prompts/index.js +56 -0
- package/dist/commonjs/prompts/index.js.map +1 -0
- package/dist/commonjs/resources/index.d.ts +6 -0
- package/dist/commonjs/resources/index.d.ts.map +1 -0
- package/dist/commonjs/resources/index.js +43 -0
- package/dist/commonjs/resources/index.js.map +1 -0
- package/dist/commonjs/resources/resourceRegistry.d.ts +3 -1
- package/dist/commonjs/resources/resourceRegistry.d.ts.map +1 -1
- package/dist/commonjs/resources/resourceRegistry.js +5 -1
- package/dist/commonjs/resources/resourceRegistry.js.map +1 -1
- package/dist/commonjs/resources/temporary/TemporaryDataResource.d.ts +13 -0
- package/dist/commonjs/resources/temporary/TemporaryDataResource.d.ts.map +1 -0
- package/dist/commonjs/resources/temporary/TemporaryDataResource.js +41 -0
- package/dist/commonjs/resources/temporary/TemporaryDataResource.js.map +1 -0
- package/dist/commonjs/resources/ui-apps/StaticMapUIResource.d.ts +15 -0
- package/dist/commonjs/resources/ui-apps/StaticMapUIResource.d.ts.map +1 -0
- package/dist/commonjs/resources/ui-apps/StaticMapUIResource.js +262 -0
- package/dist/commonjs/resources/ui-apps/StaticMapUIResource.js.map +1 -0
- package/dist/commonjs/tools/BaseTool.d.ts +10 -0
- package/dist/commonjs/tools/BaseTool.d.ts.map +1 -1
- package/dist/commonjs/tools/BaseTool.js +9 -4
- package/dist/commonjs/tools/BaseTool.js.map +1 -1
- package/dist/commonjs/tools/category-search-tool/CategorySearchTool.d.ts.map +1 -1
- package/dist/commonjs/tools/category-search-tool/CategorySearchTool.input.schema.d.ts +2 -2
- package/dist/commonjs/tools/category-search-tool/CategorySearchTool.js +4 -0
- package/dist/commonjs/tools/category-search-tool/CategorySearchTool.js.map +1 -1
- package/dist/commonjs/tools/category-search-tool/CategorySearchTool.output.schema.d.ts +17846 -2030
- package/dist/commonjs/tools/category-search-tool/CategorySearchTool.output.schema.d.ts.map +1 -1
- package/dist/commonjs/tools/category-search-tool/CategorySearchTool.output.schema.js +73 -38
- package/dist/commonjs/tools/category-search-tool/CategorySearchTool.output.schema.js.map +1 -1
- package/dist/commonjs/tools/directions-tool/DirectionsTool.d.ts.map +1 -1
- package/dist/commonjs/tools/directions-tool/DirectionsTool.js +59 -2
- package/dist/commonjs/tools/directions-tool/DirectionsTool.js.map +1 -1
- package/dist/commonjs/tools/directions-tool/DirectionsTool.output.schema.d.ts +32 -32
- package/dist/commonjs/tools/index.d.ts +86 -0
- package/dist/commonjs/tools/index.d.ts.map +1 -0
- package/dist/commonjs/tools/index.js +146 -0
- package/dist/commonjs/tools/index.js.map +1 -0
- package/dist/commonjs/tools/place-details-tool/PlaceDetailsTool.d.ts +25 -0
- package/dist/commonjs/tools/place-details-tool/PlaceDetailsTool.d.ts.map +1 -0
- package/dist/commonjs/tools/place-details-tool/PlaceDetailsTool.input.schema.d.ts +25 -0
- package/dist/commonjs/tools/place-details-tool/PlaceDetailsTool.input.schema.d.ts.map +1 -0
- package/dist/commonjs/tools/place-details-tool/PlaceDetailsTool.input.schema.js +30 -0
- package/dist/commonjs/tools/place-details-tool/PlaceDetailsTool.input.schema.js.map +1 -0
- package/dist/commonjs/tools/place-details-tool/PlaceDetailsTool.js +193 -0
- package/dist/commonjs/tools/place-details-tool/PlaceDetailsTool.js.map +1 -0
- package/dist/commonjs/tools/place-details-tool/PlaceDetailsTool.output.schema.d.ts +296 -0
- package/dist/commonjs/tools/place-details-tool/PlaceDetailsTool.output.schema.d.ts.map +1 -0
- package/dist/commonjs/tools/place-details-tool/PlaceDetailsTool.output.schema.js +55 -0
- package/dist/commonjs/tools/place-details-tool/PlaceDetailsTool.output.schema.js.map +1 -0
- package/dist/commonjs/tools/reverse-geocode-tool/ReverseGeocodeTool.input.schema.d.ts +4 -4
- package/dist/commonjs/tools/reverse-geocode-tool/ReverseGeocodeTool.output.schema.d.ts +350 -350
- package/dist/commonjs/tools/search-and-geocode-tool/SearchAndGeocodeTool.d.ts.map +1 -1
- package/dist/commonjs/tools/search-and-geocode-tool/SearchAndGeocodeTool.input.schema.d.ts +4 -4
- package/dist/commonjs/tools/search-and-geocode-tool/SearchAndGeocodeTool.js +4 -0
- package/dist/commonjs/tools/search-and-geocode-tool/SearchAndGeocodeTool.js.map +1 -1
- package/dist/commonjs/tools/search-and-geocode-tool/SearchAndGeocodeTool.output.schema.d.ts +186 -186
- package/dist/commonjs/tools/static-map-image-tool/StaticMapImageTool.d.ts +9 -0
- package/dist/commonjs/tools/static-map-image-tool/StaticMapImageTool.d.ts.map +1 -1
- package/dist/commonjs/tools/static-map-image-tool/StaticMapImageTool.input.schema.d.ts +12 -12
- package/dist/commonjs/tools/static-map-image-tool/StaticMapImageTool.js +18 -30
- package/dist/commonjs/tools/static-map-image-tool/StaticMapImageTool.js.map +1 -1
- package/dist/commonjs/tools/toolRegistry.d.ts +3 -2
- package/dist/commonjs/tools/toolRegistry.d.ts.map +1 -1
- package/dist/commonjs/tools/toolRegistry.js +2 -0
- package/dist/commonjs/tools/toolRegistry.js.map +1 -1
- package/dist/commonjs/utils/index.d.ts +33 -0
- package/dist/commonjs/utils/index.d.ts.map +1 -0
- package/dist/commonjs/utils/index.js +45 -0
- package/dist/commonjs/utils/index.js.map +1 -0
- package/dist/commonjs/utils/temporaryResourceManager.d.ts +51 -0
- package/dist/commonjs/utils/temporaryResourceManager.d.ts.map +1 -0
- package/dist/commonjs/utils/temporaryResourceManager.js +92 -0
- package/dist/commonjs/utils/temporaryResourceManager.js.map +1 -0
- package/dist/commonjs/version.json +3 -3
- package/dist/esm/index.js +19 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/prompts/SearchAlongRoutePrompt.js +6 -6
- package/dist/esm/prompts/index.d.ts +41 -0
- package/dist/esm/prompts/index.d.ts.map +1 -0
- package/dist/esm/prompts/index.js +47 -0
- package/dist/esm/prompts/index.js.map +1 -0
- package/dist/esm/resources/index.d.ts +6 -0
- package/dist/esm/resources/index.d.ts.map +1 -0
- package/dist/esm/resources/index.js +37 -0
- package/dist/esm/resources/index.js.map +1 -0
- package/dist/esm/resources/resourceRegistry.d.ts +3 -1
- package/dist/esm/resources/resourceRegistry.d.ts.map +1 -1
- package/dist/esm/resources/resourceRegistry.js +5 -1
- package/dist/esm/resources/resourceRegistry.js.map +1 -1
- package/dist/esm/resources/temporary/TemporaryDataResource.d.ts +13 -0
- package/dist/esm/resources/temporary/TemporaryDataResource.d.ts.map +1 -0
- package/dist/esm/resources/temporary/TemporaryDataResource.js +37 -0
- package/dist/esm/resources/temporary/TemporaryDataResource.js.map +1 -0
- package/dist/esm/resources/ui-apps/StaticMapUIResource.d.ts +15 -0
- package/dist/esm/resources/ui-apps/StaticMapUIResource.d.ts.map +1 -0
- package/dist/esm/resources/ui-apps/StaticMapUIResource.js +258 -0
- package/dist/esm/resources/ui-apps/StaticMapUIResource.js.map +1 -0
- package/dist/esm/tools/BaseTool.d.ts +10 -0
- package/dist/esm/tools/BaseTool.d.ts.map +1 -1
- package/dist/esm/tools/BaseTool.js +9 -4
- package/dist/esm/tools/BaseTool.js.map +1 -1
- package/dist/esm/tools/category-search-tool/CategorySearchTool.d.ts.map +1 -1
- package/dist/esm/tools/category-search-tool/CategorySearchTool.input.schema.d.ts +2 -2
- package/dist/esm/tools/category-search-tool/CategorySearchTool.js +4 -0
- package/dist/esm/tools/category-search-tool/CategorySearchTool.js.map +1 -1
- package/dist/esm/tools/category-search-tool/CategorySearchTool.output.schema.d.ts +17846 -2030
- package/dist/esm/tools/category-search-tool/CategorySearchTool.output.schema.d.ts.map +1 -1
- package/dist/esm/tools/category-search-tool/CategorySearchTool.output.schema.js +73 -38
- package/dist/esm/tools/category-search-tool/CategorySearchTool.output.schema.js.map +1 -1
- package/dist/esm/tools/directions-tool/DirectionsTool.d.ts.map +1 -1
- package/dist/esm/tools/directions-tool/DirectionsTool.js +59 -2
- package/dist/esm/tools/directions-tool/DirectionsTool.js.map +1 -1
- package/dist/esm/tools/directions-tool/DirectionsTool.output.schema.d.ts +32 -32
- package/dist/esm/tools/index.d.ts +86 -0
- package/dist/esm/tools/index.d.ts.map +1 -0
- package/dist/esm/tools/index.js +118 -0
- package/dist/esm/tools/index.js.map +1 -0
- package/dist/esm/tools/place-details-tool/PlaceDetailsTool.d.ts +25 -0
- package/dist/esm/tools/place-details-tool/PlaceDetailsTool.d.ts.map +1 -0
- package/dist/esm/tools/place-details-tool/PlaceDetailsTool.input.schema.d.ts +25 -0
- package/dist/esm/tools/place-details-tool/PlaceDetailsTool.input.schema.d.ts.map +1 -0
- package/dist/esm/tools/place-details-tool/PlaceDetailsTool.input.schema.js +24 -0
- package/dist/esm/tools/place-details-tool/PlaceDetailsTool.input.schema.js.map +1 -0
- package/dist/esm/tools/place-details-tool/PlaceDetailsTool.js +189 -0
- package/dist/esm/tools/place-details-tool/PlaceDetailsTool.js.map +1 -0
- package/dist/esm/tools/place-details-tool/PlaceDetailsTool.output.schema.d.ts +296 -0
- package/dist/esm/tools/place-details-tool/PlaceDetailsTool.output.schema.d.ts.map +1 -0
- package/dist/esm/tools/place-details-tool/PlaceDetailsTool.output.schema.js +52 -0
- package/dist/esm/tools/place-details-tool/PlaceDetailsTool.output.schema.js.map +1 -0
- package/dist/esm/tools/reverse-geocode-tool/ReverseGeocodeTool.input.schema.d.ts +4 -4
- package/dist/esm/tools/reverse-geocode-tool/ReverseGeocodeTool.output.schema.d.ts +350 -350
- package/dist/esm/tools/search-and-geocode-tool/SearchAndGeocodeTool.d.ts.map +1 -1
- package/dist/esm/tools/search-and-geocode-tool/SearchAndGeocodeTool.input.schema.d.ts +4 -4
- package/dist/esm/tools/search-and-geocode-tool/SearchAndGeocodeTool.js +4 -0
- package/dist/esm/tools/search-and-geocode-tool/SearchAndGeocodeTool.js.map +1 -1
- package/dist/esm/tools/search-and-geocode-tool/SearchAndGeocodeTool.output.schema.d.ts +186 -186
- package/dist/esm/tools/static-map-image-tool/StaticMapImageTool.d.ts +9 -0
- package/dist/esm/tools/static-map-image-tool/StaticMapImageTool.d.ts.map +1 -1
- package/dist/esm/tools/static-map-image-tool/StaticMapImageTool.input.schema.d.ts +12 -12
- package/dist/esm/tools/static-map-image-tool/StaticMapImageTool.js +18 -30
- package/dist/esm/tools/static-map-image-tool/StaticMapImageTool.js.map +1 -1
- package/dist/esm/tools/toolRegistry.d.ts +3 -2
- package/dist/esm/tools/toolRegistry.d.ts.map +1 -1
- package/dist/esm/tools/toolRegistry.js +2 -0
- package/dist/esm/tools/toolRegistry.js.map +1 -1
- package/dist/esm/utils/index.d.ts +33 -0
- package/dist/esm/utils/index.d.ts.map +1 -0
- package/dist/esm/utils/index.js +36 -0
- package/dist/esm/utils/index.js.map +1 -0
- package/dist/esm/utils/temporaryResourceManager.d.ts +51 -0
- package/dist/esm/utils/temporaryResourceManager.d.ts.map +1 -0
- package/dist/esm/utils/temporaryResourceManager.js +88 -0
- package/dist/esm/utils/temporaryResourceManager.js.map +1 -0
- package/dist/esm/version.json +3 -3
- package/package.json +54 -8
- /package/patches/{@modelcontextprotocol+sdk+1.25.3.patch → @modelcontextprotocol+sdk+1.26.0.patch} +0 -0
|
@@ -13,6 +13,15 @@ export declare class StaticMapImageTool extends MapboxApiBasedTool<typeof Static
|
|
|
13
13
|
idempotentHint: boolean;
|
|
14
14
|
openWorldHint: boolean;
|
|
15
15
|
};
|
|
16
|
+
readonly meta: {
|
|
17
|
+
ui: {
|
|
18
|
+
resourceUri: string;
|
|
19
|
+
csp: {
|
|
20
|
+
connectDomains: string[];
|
|
21
|
+
resourceDomains: string[];
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
16
25
|
constructor(params: {
|
|
17
26
|
httpRequest: HttpRequest;
|
|
18
27
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StaticMapImageTool.d.ts","sourceRoot":"","sources":["../../../../src/tools/static-map-image-tool/StaticMapImageTool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StaticMapImageTool.d.ts","sourceRoot":"","sources":["../../../../src/tools/static-map-image-tool/StaticMapImageTool.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAEjF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAGzE,qBAAa,kBAAmB,SAAQ,kBAAkB,CACxD,OAAO,yBAAyB,CACjC;IACC,IAAI,SAA2B;IAC/B,WAAW,SAC8P;IACzQ,WAAW;;;;;;MAMT;IACF,QAAQ,CAAC,IAAI;;;;;;;;MAQX;gBAEU,MAAM,EAAE;QAAE,WAAW,EAAE,WAAW,CAAA;KAAE;IAOhD,OAAO,CAAC,aAAa;cAkDL,OAAO,CACrB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,EAChD,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,cAAc,CAAC;CA4D3B"}
|
|
@@ -17,8 +17,8 @@ export declare const MarkerOverlaySchema: z.ZodObject<{
|
|
|
17
17
|
type: "marker";
|
|
18
18
|
longitude: number;
|
|
19
19
|
latitude: number;
|
|
20
|
-
color?: string | undefined;
|
|
21
20
|
size?: "small" | "large" | undefined;
|
|
21
|
+
color?: string | undefined;
|
|
22
22
|
label?: string | undefined;
|
|
23
23
|
}>;
|
|
24
24
|
export declare const CustomMarkerOverlaySchema: z.ZodObject<{
|
|
@@ -27,13 +27,13 @@ export declare const CustomMarkerOverlaySchema: z.ZodObject<{
|
|
|
27
27
|
latitude: z.ZodNumber;
|
|
28
28
|
url: z.ZodString;
|
|
29
29
|
}, "strip", z.ZodTypeAny, {
|
|
30
|
-
url: string;
|
|
31
30
|
type: "custom-marker";
|
|
31
|
+
url: string;
|
|
32
32
|
longitude: number;
|
|
33
33
|
latitude: number;
|
|
34
34
|
}, {
|
|
35
|
-
url: string;
|
|
36
35
|
type: "custom-marker";
|
|
36
|
+
url: string;
|
|
37
37
|
longitude: number;
|
|
38
38
|
latitude: number;
|
|
39
39
|
}>;
|
|
@@ -90,8 +90,8 @@ export declare const OverlaySchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject
|
|
|
90
90
|
type: "marker";
|
|
91
91
|
longitude: number;
|
|
92
92
|
latitude: number;
|
|
93
|
-
color?: string | undefined;
|
|
94
93
|
size?: "small" | "large" | undefined;
|
|
94
|
+
color?: string | undefined;
|
|
95
95
|
label?: string | undefined;
|
|
96
96
|
}>, z.ZodObject<{
|
|
97
97
|
type: z.ZodLiteral<"custom-marker">;
|
|
@@ -99,13 +99,13 @@ export declare const OverlaySchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject
|
|
|
99
99
|
latitude: z.ZodNumber;
|
|
100
100
|
url: z.ZodString;
|
|
101
101
|
}, "strip", z.ZodTypeAny, {
|
|
102
|
-
url: string;
|
|
103
102
|
type: "custom-marker";
|
|
103
|
+
url: string;
|
|
104
104
|
longitude: number;
|
|
105
105
|
latitude: number;
|
|
106
106
|
}, {
|
|
107
|
-
url: string;
|
|
108
107
|
type: "custom-marker";
|
|
108
|
+
url: string;
|
|
109
109
|
longitude: number;
|
|
110
110
|
latitude: number;
|
|
111
111
|
}>, z.ZodObject<{
|
|
@@ -184,8 +184,8 @@ export declare const StaticMapImageInputSchema: z.ZodObject<{
|
|
|
184
184
|
type: "marker";
|
|
185
185
|
longitude: number;
|
|
186
186
|
latitude: number;
|
|
187
|
-
color?: string | undefined;
|
|
188
187
|
size?: "small" | "large" | undefined;
|
|
188
|
+
color?: string | undefined;
|
|
189
189
|
label?: string | undefined;
|
|
190
190
|
}>, z.ZodObject<{
|
|
191
191
|
type: z.ZodLiteral<"custom-marker">;
|
|
@@ -193,13 +193,13 @@ export declare const StaticMapImageInputSchema: z.ZodObject<{
|
|
|
193
193
|
latitude: z.ZodNumber;
|
|
194
194
|
url: z.ZodString;
|
|
195
195
|
}, "strip", z.ZodTypeAny, {
|
|
196
|
-
url: string;
|
|
197
196
|
type: "custom-marker";
|
|
197
|
+
url: string;
|
|
198
198
|
longitude: number;
|
|
199
199
|
latitude: number;
|
|
200
200
|
}, {
|
|
201
|
-
url: string;
|
|
202
201
|
type: "custom-marker";
|
|
202
|
+
url: string;
|
|
203
203
|
longitude: number;
|
|
204
204
|
latitude: number;
|
|
205
205
|
}>, z.ZodObject<{
|
|
@@ -256,8 +256,8 @@ export declare const StaticMapImageInputSchema: z.ZodObject<{
|
|
|
256
256
|
color?: string | undefined;
|
|
257
257
|
label?: string | undefined;
|
|
258
258
|
} | {
|
|
259
|
-
url: string;
|
|
260
259
|
type: "custom-marker";
|
|
260
|
+
url: string;
|
|
261
261
|
longitude: number;
|
|
262
262
|
latitude: number;
|
|
263
263
|
} | {
|
|
@@ -288,12 +288,12 @@ export declare const StaticMapImageInputSchema: z.ZodObject<{
|
|
|
288
288
|
type: "marker";
|
|
289
289
|
longitude: number;
|
|
290
290
|
latitude: number;
|
|
291
|
-
color?: string | undefined;
|
|
292
291
|
size?: "small" | "large" | undefined;
|
|
292
|
+
color?: string | undefined;
|
|
293
293
|
label?: string | undefined;
|
|
294
294
|
} | {
|
|
295
|
-
url: string;
|
|
296
295
|
type: "custom-marker";
|
|
296
|
+
url: string;
|
|
297
297
|
longitude: number;
|
|
298
298
|
latitude: number;
|
|
299
299
|
} | {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Copyright (c) Mapbox, Inc.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
+
import { randomUUID } from 'node:crypto';
|
|
3
4
|
import { createUIResource } from '@mcp-ui/server';
|
|
4
5
|
import { MapboxApiBasedTool } from '../MapboxApiBasedTool.js';
|
|
5
6
|
import { StaticMapImageInputSchema } from './StaticMapImageTool.input.schema.js';
|
|
@@ -14,6 +15,15 @@ export class StaticMapImageTool extends MapboxApiBasedTool {
|
|
|
14
15
|
idempotentHint: true,
|
|
15
16
|
openWorldHint: true
|
|
16
17
|
};
|
|
18
|
+
meta = {
|
|
19
|
+
ui: {
|
|
20
|
+
resourceUri: 'ui://mapbox/static-map/index.html',
|
|
21
|
+
csp: {
|
|
22
|
+
connectDomains: ['https://api.mapbox.com'],
|
|
23
|
+
resourceDomains: ['https://api.mapbox.com']
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
17
27
|
constructor(params) {
|
|
18
28
|
super({
|
|
19
29
|
inputSchema: StaticMapImageInputSchema,
|
|
@@ -73,42 +83,17 @@ export class StaticMapImageTool extends MapboxApiBasedTool {
|
|
|
73
83
|
}
|
|
74
84
|
const density = input.highDensity ? '@2x' : '';
|
|
75
85
|
const url = `${MapboxApiBasedTool.mapboxApiEndpoint}styles/v1/${input.style}/static/${overlayString}${lng},${lat},${input.zoom}/${width}x${height}${density}?access_token=${accessToken}`;
|
|
86
|
+
// Fetch and encode image as base64 for clients without MCP Apps support
|
|
76
87
|
const response = await this.httpRequest(url);
|
|
77
|
-
if (!response.ok) {
|
|
78
|
-
const errorMessage = await this.getErrorMessage(response);
|
|
79
|
-
return {
|
|
80
|
-
content: [
|
|
81
|
-
{
|
|
82
|
-
type: 'text',
|
|
83
|
-
text: `Static Map API error: ${errorMessage}`
|
|
84
|
-
}
|
|
85
|
-
],
|
|
86
|
-
isError: true
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
88
|
const buffer = await response.arrayBuffer();
|
|
90
89
|
const base64Data = Buffer.from(buffer).toString('base64');
|
|
91
|
-
// Determine MIME type based on style (raster-only styles return JPEG)
|
|
92
90
|
const isRasterStyle = input.style.includes('satellite');
|
|
93
91
|
const mimeType = isRasterStyle ? 'image/jpeg' : 'image/png';
|
|
94
|
-
//
|
|
95
|
-
// Text content provides additional context alongside the image
|
|
96
|
-
const textDescription = [
|
|
97
|
-
'Static map image generated successfully.',
|
|
98
|
-
`Center: ${lat}, ${lng}`,
|
|
99
|
-
`Zoom: ${input.zoom}`,
|
|
100
|
-
`Size: ${width}x${height}${input.highDensity ? ' @2x' : ''}`,
|
|
101
|
-
`Style: ${input.style}`,
|
|
102
|
-
input.overlays?.length ? `Overlays: ${input.overlays.length}` : null
|
|
103
|
-
]
|
|
104
|
-
.filter(Boolean)
|
|
105
|
-
.join('\n');
|
|
106
|
-
// Build content array with text first, then image
|
|
107
|
-
// Per MCP spec, content array can have multiple items of different types
|
|
92
|
+
// content[0] MUST be the URL text — MCP Apps UI finds it via content.find(c => c.type === 'text')
|
|
108
93
|
const content = [
|
|
109
94
|
{
|
|
110
95
|
type: 'text',
|
|
111
|
-
text:
|
|
96
|
+
text: url
|
|
112
97
|
},
|
|
113
98
|
{
|
|
114
99
|
type: 'image',
|
|
@@ -116,7 +101,7 @@ export class StaticMapImageTool extends MapboxApiBasedTool {
|
|
|
116
101
|
mimeType
|
|
117
102
|
}
|
|
118
103
|
];
|
|
119
|
-
// Conditionally add MCP-UI resource if enabled
|
|
104
|
+
// Conditionally add MCP-UI resource if enabled (backward compatibility)
|
|
120
105
|
if (isMcpUiEnabled()) {
|
|
121
106
|
const uiResource = createUIResource({
|
|
122
107
|
uri: `ui://mapbox/static-map/${input.style}/${lng},${lat},${input.zoom}`,
|
|
@@ -133,7 +118,10 @@ export class StaticMapImageTool extends MapboxApiBasedTool {
|
|
|
133
118
|
}
|
|
134
119
|
return {
|
|
135
120
|
content,
|
|
136
|
-
isError: false
|
|
121
|
+
isError: false,
|
|
122
|
+
_meta: {
|
|
123
|
+
viewUUID: randomUUID()
|
|
124
|
+
}
|
|
137
125
|
};
|
|
138
126
|
}
|
|
139
127
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StaticMapImageTool.js","sourceRoot":"","sources":["../../../../src/tools/static-map-image-tool/StaticMapImageTool.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,kCAAkC;
|
|
1
|
+
{"version":3,"file":"StaticMapImageTool.js","sourceRoot":"","sources":["../../../../src/tools/static-map-image-tool/StaticMapImageTool.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,kCAAkC;AAElC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAGjF,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,MAAM,OAAO,kBAAmB,SAAQ,kBAEvC;IACC,IAAI,GAAG,uBAAuB,CAAC;IAC/B,WAAW,GACT,sQAAsQ,CAAC;IACzQ,WAAW,GAAG;QACZ,KAAK,EAAE,uBAAuB;QAC9B,YAAY,EAAE,IAAI;QAClB,eAAe,EAAE,KAAK;QACtB,cAAc,EAAE,IAAI;QACpB,aAAa,EAAE,IAAI;KACpB,CAAC;IACO,IAAI,GAAG;QACd,EAAE,EAAE;YACF,WAAW,EAAE,mCAAmC;YAChD,GAAG,EAAE;gBACH,cAAc,EAAE,CAAC,wBAAwB,CAAC;gBAC1C,eAAe,EAAE,CAAC,wBAAwB,CAAC;aAC5C;SACF;KACF,CAAC;IAEF,YAAY,MAAoC;QAC9C,KAAK,CAAC;YACJ,WAAW,EAAE,yBAAyB;YACtC,WAAW,EAAE,MAAM,CAAC,WAAW;SAChC,CAAC,CAAC;IACL,CAAC;IAEO,aAAa,CAAC,OAAsC;QAC1D,QAAQ,OAAO,CAAC,IAAI,EAAE,CAAC;YACrB,K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,3 +1,4 @@
|
|
|
1
|
+
import { PlaceDetailsTool } from './place-details-tool/PlaceDetailsTool.js';
|
|
1
2
|
import { SimplifyTool } from './simplify-tool/SimplifyTool.js';
|
|
2
3
|
import { BoundingBoxTool } from './bounding-box-tool/BoundingBoxTool.js';
|
|
3
4
|
import { CentroidTool } from './centroid-tool/CentroidTool.js';
|
|
@@ -23,7 +24,7 @@ import { VersionTool } from './version-tool/VersionTool.js';
|
|
|
23
24
|
* Core tools that work in all MCP clients without requiring special capabilities
|
|
24
25
|
* These tools are registered immediately during server startup
|
|
25
26
|
*/
|
|
26
|
-
export declare const CORE_TOOLS: readonly [SimplifyTool, BoundingBoxTool, CentroidTool, MidpointTool, BearingTool, AreaTool, BufferTool, PointInPolygonTool, DistanceTool, VersionTool, CategorySearchTool, DirectionsTool, IsochroneTool, MapMatchingTool, MatrixTool, OptimizationTool, ReverseGeocodeTool, StaticMapImageTool, SearchAndGeocodeTool];
|
|
27
|
+
export declare const CORE_TOOLS: readonly [PlaceDetailsTool, SimplifyTool, BoundingBoxTool, CentroidTool, MidpointTool, BearingTool, AreaTool, BufferTool, PointInPolygonTool, DistanceTool, VersionTool, CategorySearchTool, DirectionsTool, IsochroneTool, MapMatchingTool, MatrixTool, OptimizationTool, ReverseGeocodeTool, StaticMapImageTool, SearchAndGeocodeTool];
|
|
27
28
|
/**
|
|
28
29
|
* Tools that require elicitation capability for optimal functionality
|
|
29
30
|
* These tools use elicitInput() for secure token management
|
|
@@ -53,7 +54,7 @@ export declare const RESOURCE_FALLBACK_TOOLS: readonly [ResourceReaderTool, Cate
|
|
|
53
54
|
/**
|
|
54
55
|
* All tools combined (for backward compatibility and testing)
|
|
55
56
|
*/
|
|
56
|
-
export declare const ALL_TOOLS: readonly [SimplifyTool, BoundingBoxTool, CentroidTool, MidpointTool, BearingTool, AreaTool, BufferTool, PointInPolygonTool, DistanceTool, VersionTool, CategorySearchTool, DirectionsTool, IsochroneTool, MapMatchingTool, MatrixTool, OptimizationTool, ReverseGeocodeTool, StaticMapImageTool, SearchAndGeocodeTool, ResourceReaderTool, CategoryListTool];
|
|
57
|
+
export declare const ALL_TOOLS: readonly [PlaceDetailsTool, SimplifyTool, BoundingBoxTool, CentroidTool, MidpointTool, BearingTool, AreaTool, BufferTool, PointInPolygonTool, DistanceTool, VersionTool, CategorySearchTool, DirectionsTool, IsochroneTool, MapMatchingTool, MatrixTool, OptimizationTool, ReverseGeocodeTool, StaticMapImageTool, SearchAndGeocodeTool, ResourceReaderTool, CategoryListTool];
|
|
57
58
|
export type ToolInstance = (typeof ALL_TOOLS)[number];
|
|
58
59
|
/**
|
|
59
60
|
* Get all tools (for backward compatibility)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolRegistry.d.ts","sourceRoot":"","sources":["../../../src/tools/toolRegistry.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAA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PlaceDetailsTool.js';
|
|
4
5
|
import { SimplifyTool } from './simplify-tool/SimplifyTool.js';
|
|
5
6
|
import { BoundingBoxTool } from './bounding-box-tool/BoundingBoxTool.js';
|
|
6
7
|
import { CentroidTool } from './centroid-tool/CentroidTool.js';
|
|
@@ -29,6 +30,7 @@ import { httpRequest } from '../utils/httpPipeline.js';
|
|
|
29
30
|
*/
|
|
30
31
|
export const CORE_TOOLS = [
|
|
31
32
|
// INSERT NEW TOOL INSTANCE HERE
|
|
33
|
+
new PlaceDetailsTool({ httpRequest }),
|
|
32
34
|
new SimplifyTool(),
|
|
33
35
|
new BoundingBoxTool(),
|
|
34
36
|
new CentroidTool(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolRegistry.js","sourceRoot":"","sources":["../../../src/tools/toolRegistry.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,kCAAkC;AAElC,8BAA8B;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,m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AE,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module utils
|
|
3
|
+
*
|
|
4
|
+
* Public API for Mapbox MCP utilities. This module exports the HTTP pipeline
|
|
5
|
+
* system for making requests to Mapbox APIs with built-in policies like
|
|
6
|
+
* User-Agent, Retry, and Tracing.
|
|
7
|
+
*
|
|
8
|
+
* @example Using the default pipeline
|
|
9
|
+
* ```typescript
|
|
10
|
+
* import { httpRequest } from '@mapbox/mcp-server/utils';
|
|
11
|
+
* import { DirectionsTool } from '@mapbox/mcp-server/tools';
|
|
12
|
+
*
|
|
13
|
+
* // Use the pre-configured default pipeline
|
|
14
|
+
* const tool = new DirectionsTool({ httpRequest });
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @example Creating a custom pipeline
|
|
18
|
+
* ```typescript
|
|
19
|
+
* import { HttpPipeline, UserAgentPolicy, RetryPolicy } from '@mapbox/mcp-server/utils';
|
|
20
|
+
* import { DirectionsTool } from '@mapbox/mcp-server/tools';
|
|
21
|
+
*
|
|
22
|
+
* // Create a custom pipeline with your own policies
|
|
23
|
+
* const pipeline = new HttpPipeline();
|
|
24
|
+
* pipeline.usePolicy(new UserAgentPolicy('MyApp/1.0.0'));
|
|
25
|
+
* pipeline.usePolicy(new RetryPolicy(5, 300, 3000)); // More aggressive retry
|
|
26
|
+
*
|
|
27
|
+
* const tool = new DirectionsTool({ httpRequest: pipeline.execute.bind(pipeline) });
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export { httpRequest, systemHttpPipeline } from './httpPipeline.js';
|
|
31
|
+
export { HttpPipeline, UserAgentPolicy, RetryPolicy, TracingPolicy, type HttpPolicy } from './httpPipeline.js';
|
|
32
|
+
export type { HttpRequest, TracedRequestInit } from './types.js';
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAGpE,OAAO,EACL,YAAY,EACZ,eAAe,EACf,WAAW,EACX,aAAa,EACb,KAAK,UAAU,EAChB,MAAM,mBAAmB,CAAC;AAG3B,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Copyright (c) Mapbox, Inc.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
/**
|
|
4
|
+
* @module utils
|
|
5
|
+
*
|
|
6
|
+
* Public API for Mapbox MCP utilities. This module exports the HTTP pipeline
|
|
7
|
+
* system for making requests to Mapbox APIs with built-in policies like
|
|
8
|
+
* User-Agent, Retry, and Tracing.
|
|
9
|
+
*
|
|
10
|
+
* @example Using the default pipeline
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import { httpRequest } from '@mapbox/mcp-server/utils';
|
|
13
|
+
* import { DirectionsTool } from '@mapbox/mcp-server/tools';
|
|
14
|
+
*
|
|
15
|
+
* // Use the pre-configured default pipeline
|
|
16
|
+
* const tool = new DirectionsTool({ httpRequest });
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @example Creating a custom pipeline
|
|
20
|
+
* ```typescript
|
|
21
|
+
* import { HttpPipeline, UserAgentPolicy, RetryPolicy } from '@mapbox/mcp-server/utils';
|
|
22
|
+
* import { DirectionsTool } from '@mapbox/mcp-server/tools';
|
|
23
|
+
*
|
|
24
|
+
* // Create a custom pipeline with your own policies
|
|
25
|
+
* const pipeline = new HttpPipeline();
|
|
26
|
+
* pipeline.usePolicy(new UserAgentPolicy('MyApp/1.0.0'));
|
|
27
|
+
* pipeline.usePolicy(new RetryPolicy(5, 300, 3000)); // More aggressive retry
|
|
28
|
+
*
|
|
29
|
+
* const tool = new DirectionsTool({ httpRequest: pipeline.execute.bind(pipeline) });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
// Export the pre-configured default HTTP pipeline
|
|
33
|
+
export { httpRequest, systemHttpPipeline } from './httpPipeline.js';
|
|
34
|
+
// Export HTTP pipeline classes and interfaces for custom pipelines
|
|
35
|
+
export { HttpPipeline, UserAgentPolicy, RetryPolicy, TracingPolicy } from './httpPipeline.js';
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,kCAAkC;AAElC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,kDAAkD;AAClD,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEpE,mEAAmE;AACnE,OAAO,EACL,YAAY,EACZ,eAAe,EACf,WAAW,EACX,aAAa,EAEd,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Manager for temporary resources created from large tool responses.
|
|
3
|
+
* Resources are stored in-memory with configurable TTL.
|
|
4
|
+
*/
|
|
5
|
+
export interface TemporaryResource {
|
|
6
|
+
id: string;
|
|
7
|
+
uri: string;
|
|
8
|
+
data: unknown;
|
|
9
|
+
created: number;
|
|
10
|
+
ttl: number;
|
|
11
|
+
metadata?: {
|
|
12
|
+
toolName?: string;
|
|
13
|
+
size?: number;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export declare class TemporaryResourceManager {
|
|
17
|
+
private defaultTTL;
|
|
18
|
+
private resources;
|
|
19
|
+
private cleanupInterval?;
|
|
20
|
+
constructor(defaultTTL?: number);
|
|
21
|
+
/**
|
|
22
|
+
* Create a temporary resource
|
|
23
|
+
*/
|
|
24
|
+
create(id: string, uri: string, data: unknown, metadata?: TemporaryResource['metadata'], ttl?: number): TemporaryResource;
|
|
25
|
+
/**
|
|
26
|
+
* Get a resource by URI
|
|
27
|
+
*/
|
|
28
|
+
get(uri: string): TemporaryResource | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Delete a resource
|
|
31
|
+
*/
|
|
32
|
+
delete(uri: string): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Clean up expired resources
|
|
35
|
+
*/
|
|
36
|
+
cleanup(): number;
|
|
37
|
+
/**
|
|
38
|
+
* Get count of active resources
|
|
39
|
+
*/
|
|
40
|
+
count(): number;
|
|
41
|
+
/**
|
|
42
|
+
* Clear all resources
|
|
43
|
+
*/
|
|
44
|
+
clear(): void;
|
|
45
|
+
/**
|
|
46
|
+
* Stop cleanup interval
|
|
47
|
+
*/
|
|
48
|
+
destroy(): void;
|
|
49
|
+
}
|
|
50
|
+
export declare const temporaryResourceManager: TemporaryResourceManager;
|
|
51
|
+
//# sourceMappingURL=temporaryResourceManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"temporaryResourceManager.d.ts","sourceRoot":"","sources":["../../../src/utils/temporaryResourceManager.ts"],"names":[],"mappings":"AAGA;;;GAGG;AAEH,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE;QACT,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH;AAED,qBAAa,wBAAwB;IAKjC,OAAO,CAAC,UAAU;IAJpB,OAAO,CAAC,SAAS,CAAwC;IACzD,OAAO,CAAC,eAAe,CAAC,CAAiB;gBAG/B,UAAU,GAAE,MAAuB;IAM7C;;OAEG;IACH,MAAM,CACJ,EAAE,EAAE,MAAM,EACV,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,OAAO,EACb,QAAQ,CAAC,EAAE,iBAAiB,CAAC,UAAU,CAAC,EACxC,GAAG,CAAC,EAAE,MAAM,GACX,iBAAiB;IAcpB;;OAEG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS;IAgB/C;;OAEG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAI5B;;OAEG;IACH,OAAO,IAAI,MAAM;IAcjB;;OAEG;IACH,KAAK,IAAI,MAAM;IAIf;;OAEG;IACH,KAAK,IAAI,IAAI;IAIb;;OAEG;IACH,OAAO,IAAI,IAAI;CAOhB;AAGD,eAAO,MAAM,wBAAwB,0BAAiC,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// Copyright (c) Mapbox, Inc.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
export class TemporaryResourceManager {
|
|
4
|
+
defaultTTL;
|
|
5
|
+
resources = new Map();
|
|
6
|
+
cleanupInterval;
|
|
7
|
+
constructor(defaultTTL = 30 * 60 * 1000 // 30 minutes
|
|
8
|
+
) {
|
|
9
|
+
this.defaultTTL = defaultTTL;
|
|
10
|
+
// Run cleanup every 5 minutes
|
|
11
|
+
this.cleanupInterval = setInterval(() => this.cleanup(), 5 * 60 * 1000);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Create a temporary resource
|
|
15
|
+
*/
|
|
16
|
+
create(id, uri, data, metadata, ttl) {
|
|
17
|
+
const resource = {
|
|
18
|
+
id,
|
|
19
|
+
uri,
|
|
20
|
+
data,
|
|
21
|
+
created: Date.now(),
|
|
22
|
+
ttl: ttl ?? this.defaultTTL,
|
|
23
|
+
metadata
|
|
24
|
+
};
|
|
25
|
+
this.resources.set(uri, resource);
|
|
26
|
+
return resource;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Get a resource by URI
|
|
30
|
+
*/
|
|
31
|
+
get(uri) {
|
|
32
|
+
const resource = this.resources.get(uri);
|
|
33
|
+
if (!resource) {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
// Check if expired
|
|
37
|
+
if (Date.now() - resource.created > resource.ttl) {
|
|
38
|
+
this.resources.delete(uri);
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
return resource;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Delete a resource
|
|
45
|
+
*/
|
|
46
|
+
delete(uri) {
|
|
47
|
+
return this.resources.delete(uri);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Clean up expired resources
|
|
51
|
+
*/
|
|
52
|
+
cleanup() {
|
|
53
|
+
const now = Date.now();
|
|
54
|
+
let cleaned = 0;
|
|
55
|
+
for (const [uri, resource] of this.resources.entries()) {
|
|
56
|
+
if (now - resource.created > resource.ttl) {
|
|
57
|
+
this.resources.delete(uri);
|
|
58
|
+
cleaned++;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return cleaned;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Get count of active resources
|
|
65
|
+
*/
|
|
66
|
+
count() {
|
|
67
|
+
return this.resources.size;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Clear all resources
|
|
71
|
+
*/
|
|
72
|
+
clear() {
|
|
73
|
+
this.resources.clear();
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Stop cleanup interval
|
|
77
|
+
*/
|
|
78
|
+
destroy() {
|
|
79
|
+
if (this.cleanupInterval) {
|
|
80
|
+
clearInterval(this.cleanupInterval);
|
|
81
|
+
this.cleanupInterval = undefined;
|
|
82
|
+
}
|
|
83
|
+
this.clear();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
// Singleton instance
|
|
87
|
+
export const temporaryResourceManager = new TemporaryResourceManager();
|
|
88
|
+
//# sourceMappingURL=temporaryResourceManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"temporaryResourceManager.js","sourceRoot":"","sources":["../../../src/utils/temporaryResourceManager.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,kCAAkC;AAmBlC,MAAM,OAAO,wBAAwB;IAKzB;IAJF,SAAS,GAAG,IAAI,GAAG,EAA6B,CAAC;IACjD,eAAe,CAAkB;IAEzC,YACU,aAAqB,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,aAAa;;QAAjD,eAAU,GAAV,UAAU,CAAyB;QAE3C,8BAA8B;QAC9B,IAAI,CAAC,eAAe,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;IAC1E,CAAC;IAED;;OAEG;IACH,MAAM,CACJ,EAAU,EACV,GAAW,EACX,IAAa,EACb,QAAwC,EACxC,GAAY;QAEZ,MAAM,QAAQ,GAAsB;YAClC,EAAE;YACF,GAAG;YACH,IAAI;YACJ,OAAO,EAAE,IAAI,CAAC,GAAG,EAAE;YACnB,GAAG,EAAE,GAAG,IAAI,IAAI,CAAC,UAAU;YAC3B,QAAQ;SACT,CAAC;QAEF,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QAClC,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,GAAW;QACb,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAEzC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,mBAAmB;QACnB,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC;YACjD,IAAI,CAAC,SAAS,CAAC,MAAM,CAA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-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Mapbox MCP server.",
|
|
5
5
|
"mcpName": "io.github.mapbox/mcp-server",
|
|
6
6
|
"main": "./dist/commonjs/index.js",
|
|
@@ -11,16 +11,17 @@
|
|
|
11
11
|
},
|
|
12
12
|
"scripts": {
|
|
13
13
|
"build": "npm run prepare && tshy && npm run generate-version && node scripts/add-shebang.cjs",
|
|
14
|
-
"
|
|
15
|
-
"format
|
|
14
|
+
"changelog:prepare-release": "node scripts/prepare-changelog-release.cjs",
|
|
15
|
+
"format": "prettier --check \"./src/**/*.{ts,tsx,js,json,md}\" \"./test/**/*.{ts,tsx,js,json,md}\" \"./examples/**/*.{ts,tsx,js,json,md}\"",
|
|
16
|
+
"format:fix": "prettier --write \"./src/**/*.{ts,tsx,js,json,md}\" \"./test/**/*.{ts,tsx,js,json,md}\" \"./examples/**/*.{ts,tsx,js,json,md}\"",
|
|
16
17
|
"generate-version": "node scripts/build-helpers.cjs generate-version",
|
|
17
18
|
"inspect:build": "npm run build && npx @modelcontextprotocol/inspector -e MAPBOX_ACCESS_TOKEN=\"$MAPBOX_ACCESS_TOKEN\" node dist/esm/index.js",
|
|
18
19
|
"inspect:dev": "npx @modelcontextprotocol/inspector -e MAPBOX_ACCESS_TOKEN=\"$MAPBOX_ACCESS_TOKEN\" npx -y tsx src/index.ts",
|
|
19
|
-
"lint": "eslint \"./src/**/*.{ts,tsx}\" \"./test/**/*.{ts,tsx}\"",
|
|
20
|
-
"lint:fix": "eslint \"./src/**/*.{ts,tsx}\" \"./test/**/*.{ts,tsx}\" --fix",
|
|
20
|
+
"lint": "eslint \"./src/**/*.{ts,tsx}\" \"./test/**/*.{ts,tsx}\" \"./examples/**/*.{ts,tsx}\"",
|
|
21
|
+
"lint:fix": "eslint \"./src/**/*.{ts,tsx}\" \"./test/**/*.{ts,tsx}\" \"./examples/**/*.{ts,tsx}\" --fix",
|
|
21
22
|
"postinstall": "patch-package || (cd ../../.. && node ./node_modules/patch-package/index.js --patch-dir ./node_modules/@mapbox/mcp-server/patches) || true",
|
|
22
23
|
"prepare": "node -e \"try { require('fs').accessSync('.husky/setup-hooks.js'); require('child_process').execSync('husky && node .husky/setup-hooks.js', {stdio:'inherit'}) } catch { }\"",
|
|
23
|
-
"spellcheck": "cspell \"*.md\" \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
24
|
+
"spellcheck": "cspell \"*.md\" \"src/**/*.ts\" \"test/**/*.ts\" \"examples/**/*.ts\"",
|
|
24
25
|
"sync-manifest": "node scripts/sync-manifest-version.cjs",
|
|
25
26
|
"test": "vitest",
|
|
26
27
|
"tracing:jaeger:start": "docker run --rm -d --name jaeger -p 16686:16686 -p 14250:14250 -p 4317:4317 -p 4318:4318 jaegertracing/all-in-one:latest",
|
|
@@ -76,7 +77,8 @@
|
|
|
76
77
|
],
|
|
77
78
|
"dependencies": {
|
|
78
79
|
"@mcp-ui/server": "^5.13.1",
|
|
79
|
-
"@modelcontextprotocol/
|
|
80
|
+
"@modelcontextprotocol/ext-apps": "^1.1.1",
|
|
81
|
+
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
80
82
|
"@opentelemetry/api": "^1.9.0",
|
|
81
83
|
"@opentelemetry/auto-instrumentations-node": "^0.56.0",
|
|
82
84
|
"@opentelemetry/exporter-trace-otlp-http": "^0.56.0",
|
|
@@ -92,7 +94,11 @@
|
|
|
92
94
|
"tshy": {
|
|
93
95
|
"project": "./tsconfig.src.json",
|
|
94
96
|
"exports": {
|
|
95
|
-
".": "./src/index.ts"
|
|
97
|
+
".": "./src/index.ts",
|
|
98
|
+
"./tools": "./src/tools/index.ts",
|
|
99
|
+
"./resources": "./src/resources/index.ts",
|
|
100
|
+
"./prompts": "./src/prompts/index.ts",
|
|
101
|
+
"./utils": "./src/utils/index.ts"
|
|
96
102
|
},
|
|
97
103
|
"dialects": [
|
|
98
104
|
"esm",
|
|
@@ -110,6 +116,46 @@
|
|
|
110
116
|
"types": "./dist/commonjs/index.d.ts",
|
|
111
117
|
"default": "./dist/commonjs/index.js"
|
|
112
118
|
}
|
|
119
|
+
},
|
|
120
|
+
"./tools": {
|
|
121
|
+
"import": {
|
|
122
|
+
"types": "./dist/esm/tools/index.d.ts",
|
|
123
|
+
"default": "./dist/esm/tools/index.js"
|
|
124
|
+
},
|
|
125
|
+
"require": {
|
|
126
|
+
"types": "./dist/commonjs/tools/index.d.ts",
|
|
127
|
+
"default": "./dist/commonjs/tools/index.js"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"./resources": {
|
|
131
|
+
"import": {
|
|
132
|
+
"types": "./dist/esm/resources/index.d.ts",
|
|
133
|
+
"default": "./dist/esm/resources/index.js"
|
|
134
|
+
},
|
|
135
|
+
"require": {
|
|
136
|
+
"types": "./dist/commonjs/resources/index.d.ts",
|
|
137
|
+
"default": "./dist/commonjs/resources/index.js"
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"./prompts": {
|
|
141
|
+
"import": {
|
|
142
|
+
"types": "./dist/esm/prompts/index.d.ts",
|
|
143
|
+
"default": "./dist/esm/prompts/index.js"
|
|
144
|
+
},
|
|
145
|
+
"require": {
|
|
146
|
+
"types": "./dist/commonjs/prompts/index.d.ts",
|
|
147
|
+
"default": "./dist/commonjs/prompts/index.js"
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"./utils": {
|
|
151
|
+
"import": {
|
|
152
|
+
"types": "./dist/esm/utils/index.d.ts",
|
|
153
|
+
"default": "./dist/esm/utils/index.js"
|
|
154
|
+
},
|
|
155
|
+
"require": {
|
|
156
|
+
"types": "./dist/commonjs/utils/index.d.ts",
|
|
157
|
+
"default": "./dist/commonjs/utils/index.js"
|
|
158
|
+
}
|
|
113
159
|
}
|
|
114
160
|
},
|
|
115
161
|
"types": "./dist/commonjs/index.d.ts"
|
/package/patches/{@modelcontextprotocol+sdk+1.25.3.patch → @modelcontextprotocol+sdk+1.26.0.patch}
RENAMED
|
File without changes
|