@mapbox/mcp-server 0.8.2 → 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 +65 -12
- package/dist/commonjs/index.js +98 -7
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/prompts/SearchAlongRoutePrompt.d.ts +26 -0
- package/dist/commonjs/prompts/SearchAlongRoutePrompt.d.ts.map +1 -0
- package/dist/commonjs/prompts/SearchAlongRoutePrompt.js +164 -0
- package/dist/commonjs/prompts/SearchAlongRoutePrompt.js.map +1 -0
- 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/prompts/promptRegistry.d.ts +2 -1
- package/dist/commonjs/prompts/promptRegistry.d.ts.map +1 -1
- package/dist/commonjs/prompts/promptRegistry.js +2 -0
- package/dist/commonjs/prompts/promptRegistry.js.map +1 -1
- 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 +52 -1
- package/dist/commonjs/tools/toolRegistry.d.ts.map +1 -1
- package/dist/commonjs/tools/toolRegistry.js +70 -5
- 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 +99 -8
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/prompts/SearchAlongRoutePrompt.d.ts +26 -0
- package/dist/esm/prompts/SearchAlongRoutePrompt.d.ts.map +1 -0
- package/dist/esm/prompts/SearchAlongRoutePrompt.js +160 -0
- package/dist/esm/prompts/SearchAlongRoutePrompt.js.map +1 -0
- 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/prompts/promptRegistry.d.ts +2 -1
- package/dist/esm/prompts/promptRegistry.d.ts.map +1 -1
- package/dist/esm/prompts/promptRegistry.js +2 -0
- package/dist/esm/prompts/promptRegistry.js.map +1 -1
- 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 +52 -1
- package/dist/esm/tools/toolRegistry.d.ts.map +1 -1
- package/dist/esm/tools/toolRegistry.js +66 -4
- 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.2.patch → @modelcontextprotocol+sdk+1.26.0.patch} +0 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Mapbox, Inc.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.temporaryResourceManager = exports.TemporaryResourceManager = void 0;
|
|
6
|
+
class TemporaryResourceManager {
|
|
7
|
+
defaultTTL;
|
|
8
|
+
resources = new Map();
|
|
9
|
+
cleanupInterval;
|
|
10
|
+
constructor(defaultTTL = 30 * 60 * 1000 // 30 minutes
|
|
11
|
+
) {
|
|
12
|
+
this.defaultTTL = defaultTTL;
|
|
13
|
+
// Run cleanup every 5 minutes
|
|
14
|
+
this.cleanupInterval = setInterval(() => this.cleanup(), 5 * 60 * 1000);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Create a temporary resource
|
|
18
|
+
*/
|
|
19
|
+
create(id, uri, data, metadata, ttl) {
|
|
20
|
+
const resource = {
|
|
21
|
+
id,
|
|
22
|
+
uri,
|
|
23
|
+
data,
|
|
24
|
+
created: Date.now(),
|
|
25
|
+
ttl: ttl ?? this.defaultTTL,
|
|
26
|
+
metadata
|
|
27
|
+
};
|
|
28
|
+
this.resources.set(uri, resource);
|
|
29
|
+
return resource;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Get a resource by URI
|
|
33
|
+
*/
|
|
34
|
+
get(uri) {
|
|
35
|
+
const resource = this.resources.get(uri);
|
|
36
|
+
if (!resource) {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
// Check if expired
|
|
40
|
+
if (Date.now() - resource.created > resource.ttl) {
|
|
41
|
+
this.resources.delete(uri);
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
return resource;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Delete a resource
|
|
48
|
+
*/
|
|
49
|
+
delete(uri) {
|
|
50
|
+
return this.resources.delete(uri);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Clean up expired resources
|
|
54
|
+
*/
|
|
55
|
+
cleanup() {
|
|
56
|
+
const now = Date.now();
|
|
57
|
+
let cleaned = 0;
|
|
58
|
+
for (const [uri, resource] of this.resources.entries()) {
|
|
59
|
+
if (now - resource.created > resource.ttl) {
|
|
60
|
+
this.resources.delete(uri);
|
|
61
|
+
cleaned++;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return cleaned;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Get count of active resources
|
|
68
|
+
*/
|
|
69
|
+
count() {
|
|
70
|
+
return this.resources.size;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Clear all resources
|
|
74
|
+
*/
|
|
75
|
+
clear() {
|
|
76
|
+
this.resources.clear();
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Stop cleanup interval
|
|
80
|
+
*/
|
|
81
|
+
destroy() {
|
|
82
|
+
if (this.cleanupInterval) {
|
|
83
|
+
clearInterval(this.cleanupInterval);
|
|
84
|
+
this.cleanupInterval = undefined;
|
|
85
|
+
}
|
|
86
|
+
this.clear();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
exports.TemporaryResourceManager = TemporaryResourceManager;
|
|
90
|
+
// Singleton instance
|
|
91
|
+
exports.temporaryResourceManager = new TemporaryResourceManager();
|
|
92
|
+
//# sourceMappingURL=temporaryResourceManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"temporaryResourceManager.js","sourceRoot":"","sources":["../../../src/utils/temporary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AAC,GAAW;QAChB,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC;IAED;;OAEG;IACH,OAAO;QACL,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACvB,IAAI,OAAO,GAAG,CAAC,CAAC;QAEhB,KAAK,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,CAAC;YACvD,IAAI,GAAG,GAAG,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC;gBAC1C,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBAC3B,OAAO,EAAE,CAAC;YACZ,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;OAEG;IACH,KAAK;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,KAAK;QACH,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,OAAO;QACL,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACzB,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACpC,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;QACnC,CAAC;QACD,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;CACF;AArGD,4DAqGC;AAED,qBAAqB;AACR,QAAA,wBAAwB,GAAG,IAAI,wBAAwB,EAAE,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -10,9 +10,10 @@ import { existsSync } from 'node:fs';
|
|
|
10
10
|
import { SpanStatusCode } from '@opentelemetry/api';
|
|
11
11
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
12
12
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
13
|
+
import { registerAppResource, RESOURCE_MIME_TYPE } from '@modelcontextprotocol/ext-apps/server';
|
|
13
14
|
import { ListPromptsRequestSchema, GetPromptRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
14
15
|
import { parseToolConfigFromArgs, filterTools } from './config/toolConfig.js';
|
|
15
|
-
import {
|
|
16
|
+
import { getCoreTools, getElicitationTools, getResourceFallbackTools } from './tools/toolRegistry.js';
|
|
16
17
|
import { getAllResources } from './resources/resourceRegistry.js';
|
|
17
18
|
import { getAllPrompts, getPromptByName } from './prompts/promptRegistry.js';
|
|
18
19
|
import { getVersionInfo } from './utils/versionUtils.js';
|
|
@@ -42,8 +43,13 @@ const versionInfo = getVersionInfo();
|
|
|
42
43
|
// Parse configuration from command-line arguments
|
|
43
44
|
const config = parseToolConfigFromArgs();
|
|
44
45
|
// Get and filter tools based on configuration
|
|
45
|
-
|
|
46
|
-
const
|
|
46
|
+
// Split into categories for capability-aware registration
|
|
47
|
+
const coreTools = getCoreTools();
|
|
48
|
+
const elicitationTools = getElicitationTools();
|
|
49
|
+
const resourceFallbackTools = getResourceFallbackTools();
|
|
50
|
+
const enabledCoreTools = filterTools(coreTools, config);
|
|
51
|
+
const enabledElicitationTools = filterTools(elicitationTools, config);
|
|
52
|
+
const enabledResourceFallbackTools = filterTools(resourceFallbackTools, config);
|
|
47
53
|
// Get all resources
|
|
48
54
|
const allResources = getAllResources();
|
|
49
55
|
// Create an MCP server
|
|
@@ -66,17 +72,36 @@ const server = new McpServer({
|
|
|
66
72
|
]
|
|
67
73
|
}, {
|
|
68
74
|
capabilities: {
|
|
69
|
-
tools: {
|
|
75
|
+
tools: {
|
|
76
|
+
listChanged: true // Advertise support for dynamic tool registration (ready for future capability-dependent tools)
|
|
77
|
+
},
|
|
70
78
|
resources: {},
|
|
71
79
|
prompts: {}
|
|
72
80
|
}
|
|
73
81
|
});
|
|
74
|
-
// Register
|
|
75
|
-
|
|
82
|
+
// Register only core tools before connection
|
|
83
|
+
// Capability-dependent tools will be registered dynamically after connection
|
|
84
|
+
enabledCoreTools.forEach((tool) => {
|
|
76
85
|
tool.installTo(server);
|
|
77
86
|
});
|
|
78
|
-
//
|
|
79
|
-
allResources.
|
|
87
|
+
// Separate MCP Apps UI resources from regular resources
|
|
88
|
+
const uiResources = allResources.filter((r) => r.uri.startsWith('ui://'));
|
|
89
|
+
const regularResources = allResources.filter((r) => !r.uri.startsWith('ui://'));
|
|
90
|
+
// Register MCP Apps UI resources using registerAppResource
|
|
91
|
+
// IMPORTANT: Use RESOURCE_MIME_TYPE which is "text/html;profile=mcp-app"
|
|
92
|
+
// This tells clients (like Claude Desktop) that this is an MCP App
|
|
93
|
+
uiResources.forEach((resource) => {
|
|
94
|
+
registerAppResource(
|
|
95
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
96
|
+
server, resource.name, resource.uri,
|
|
97
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
98
|
+
{ mimeType: RESOURCE_MIME_TYPE, description: resource.description }, async () => {
|
|
99
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
100
|
+
return await resource.read(resource.uri, {});
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
// Register regular resources using standard registration
|
|
104
|
+
regularResources.forEach((resource) => {
|
|
80
105
|
resource.installTo(server);
|
|
81
106
|
});
|
|
82
107
|
// Register prompt handlers
|
|
@@ -202,6 +227,72 @@ async function main() {
|
|
|
202
227
|
// Start receiving messages on stdin and sending messages on stdout
|
|
203
228
|
const transport = new StdioServerTransport();
|
|
204
229
|
await server.connect(transport);
|
|
230
|
+
// After connection, dynamically register capability-dependent tools
|
|
231
|
+
const clientCapabilities = server.server.getClientCapabilities();
|
|
232
|
+
// Debug: Log what capabilities we detected
|
|
233
|
+
server.server.sendLoggingMessage({
|
|
234
|
+
level: 'info',
|
|
235
|
+
data: `Client capabilities detected: ${JSON.stringify(clientCapabilities, null, 2)}`
|
|
236
|
+
});
|
|
237
|
+
let toolsAdded = false;
|
|
238
|
+
// Register elicitation tools if client supports elicitation
|
|
239
|
+
if (clientCapabilities?.elicitation && enabledElicitationTools.length > 0) {
|
|
240
|
+
server.server.sendLoggingMessage({
|
|
241
|
+
level: 'info',
|
|
242
|
+
data: `Client supports elicitation. Registering ${enabledElicitationTools.length} elicitation-dependent tools`
|
|
243
|
+
});
|
|
244
|
+
enabledElicitationTools.forEach((tool) => {
|
|
245
|
+
tool.installTo(server);
|
|
246
|
+
});
|
|
247
|
+
toolsAdded = true;
|
|
248
|
+
}
|
|
249
|
+
else if (enabledElicitationTools.length > 0) {
|
|
250
|
+
server.server.sendLoggingMessage({
|
|
251
|
+
level: 'debug',
|
|
252
|
+
data: `Client does not support elicitation. Skipping ${enabledElicitationTools.length} elicitation-dependent tools`
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
// Register resource fallback tools for clients that don't support resources
|
|
256
|
+
// Note: Resources are a core MCP feature supported by most clients.
|
|
257
|
+
// However, some clients (like smolagents) don't support resources at all.
|
|
258
|
+
// These fallback tools provide the same content as resources but via tool calls instead.
|
|
259
|
+
//
|
|
260
|
+
// Configuration via CLIENT_NEEDS_RESOURCE_FALLBACK environment variable:
|
|
261
|
+
// - unset (default) = Skip fallback tools (assume client supports resources)
|
|
262
|
+
// - "true" = Provide fallback tools (client does NOT support resources)
|
|
263
|
+
const clientNeedsResourceFallback = process.env.CLIENT_NEEDS_RESOURCE_FALLBACK?.toLowerCase() === 'true';
|
|
264
|
+
if (clientNeedsResourceFallback && enabledResourceFallbackTools.length > 0) {
|
|
265
|
+
server.server.sendLoggingMessage({
|
|
266
|
+
level: 'info',
|
|
267
|
+
data: `CLIENT_NEEDS_RESOURCE_FALLBACK=true. Registering ${enabledResourceFallbackTools.length} resource fallback tools`
|
|
268
|
+
});
|
|
269
|
+
enabledResourceFallbackTools.forEach((tool) => {
|
|
270
|
+
tool.installTo(server);
|
|
271
|
+
});
|
|
272
|
+
toolsAdded = true;
|
|
273
|
+
}
|
|
274
|
+
else if (enabledResourceFallbackTools.length > 0) {
|
|
275
|
+
server.server.sendLoggingMessage({
|
|
276
|
+
level: 'debug',
|
|
277
|
+
data: `CLIENT_NEEDS_RESOURCE_FALLBACK not set or false. Skipping ${enabledResourceFallbackTools.length} resource fallback tools (client supports resources)`
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
// Notify client about tool list changes if any tools were added
|
|
281
|
+
if (toolsAdded) {
|
|
282
|
+
try {
|
|
283
|
+
server.sendToolListChanged();
|
|
284
|
+
server.server.sendLoggingMessage({
|
|
285
|
+
level: 'debug',
|
|
286
|
+
data: 'Sent notifications/tools/list_changed to client'
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
catch (error) {
|
|
290
|
+
server.server.sendLoggingMessage({
|
|
291
|
+
level: 'warning',
|
|
292
|
+
data: `Failed to send tool list change notification: ${error instanceof Error ? error.message : String(error)}`
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
}
|
|
205
296
|
}
|
|
206
297
|
// Ensure cleanup interval is cleared when the process exits
|
|
207
298
|
async function shutdown() {
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,kCAAkC;AAElC,uDAAuD;AACvD,oFAAoF;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,wBAAwB,EACxB,sBAAsB,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**
|
|
4
|
+
* Prompt for finding places along a route between two locations.
|
|
5
|
+
*
|
|
6
|
+
* This prompt guides the agent through:
|
|
7
|
+
* 1. Geocoding start and end locations (if needed)
|
|
8
|
+
* 2. Getting the route geometry
|
|
9
|
+
* 3. Creating a buffer corridor around the route
|
|
10
|
+
* 4. Searching for places within that corridor
|
|
11
|
+
* 5. Filtering and ordering results by distance from route
|
|
12
|
+
* 6. Visualizing on a map
|
|
13
|
+
*
|
|
14
|
+
* Example queries:
|
|
15
|
+
* - "I want to go from Seattle to Portland, is there a Starbucks along the way?"
|
|
16
|
+
* - "Find gas stations along my route from LA to San Francisco"
|
|
17
|
+
* - "Show me rest stops between Denver and Salt Lake City"
|
|
18
|
+
* - "What restaurants are along the drive from Boston to NYC?"
|
|
19
|
+
*/
|
|
20
|
+
export declare class SearchAlongRoutePrompt extends BasePrompt {
|
|
21
|
+
readonly name = "search-along-route";
|
|
22
|
+
readonly description = "Finds specific types of places along a route between two locations, using buffer analysis and POI search";
|
|
23
|
+
readonly arguments: PromptArgument[];
|
|
24
|
+
getMessages(args: Record<string, string>): PromptMessage[];
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=SearchAlongRoutePrompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchAlongRoutePrompt.d.ts","sourceRoot":"","sources":["../../../src/prompts/SearchAlongRoutePrompt.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACd,MAAM,oCAAoC,CAAC;AAE5C;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,sBAAuB,SAAQ,UAAU;IACpD,QAAQ,CAAC,IAAI,wBAAwB;IACrC,QAAQ,CAAC,WAAW,8GACyF;IAE7G,QAAQ,CAAC,SAAS,EAAE,cAAc,EAAE,CA6BlC;IAEF,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,aAAa,EAAE;CAkH3D"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
// Copyright (c) Mapbox, Inc.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { BasePrompt } from './BasePrompt.js';
|
|
4
|
+
/**
|
|
5
|
+
* Prompt for finding places along a route between two locations.
|
|
6
|
+
*
|
|
7
|
+
* This prompt guides the agent through:
|
|
8
|
+
* 1. Geocoding start and end locations (if needed)
|
|
9
|
+
* 2. Getting the route geometry
|
|
10
|
+
* 3. Creating a buffer corridor around the route
|
|
11
|
+
* 4. Searching for places within that corridor
|
|
12
|
+
* 5. Filtering and ordering results by distance from route
|
|
13
|
+
* 6. Visualizing on a map
|
|
14
|
+
*
|
|
15
|
+
* Example queries:
|
|
16
|
+
* - "I want to go from Seattle to Portland, is there a Starbucks along the way?"
|
|
17
|
+
* - "Find gas stations along my route from LA to San Francisco"
|
|
18
|
+
* - "Show me rest stops between Denver and Salt Lake City"
|
|
19
|
+
* - "What restaurants are along the drive from Boston to NYC?"
|
|
20
|
+
*/
|
|
21
|
+
export class SearchAlongRoutePrompt extends BasePrompt {
|
|
22
|
+
name = 'search-along-route';
|
|
23
|
+
description = 'Finds specific types of places along a route between two locations, using buffer analysis and POI search';
|
|
24
|
+
arguments = [
|
|
25
|
+
{
|
|
26
|
+
name: 'from',
|
|
27
|
+
description: 'Starting location (address, place name, or coordinates)',
|
|
28
|
+
required: true
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'to',
|
|
32
|
+
description: 'Destination location (address, place name, or coordinates)',
|
|
33
|
+
required: true
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'search_for',
|
|
37
|
+
description: 'Type of place to search for (e.g., "Starbucks", "gas stations", "rest stops", "restaurants")',
|
|
38
|
+
required: true
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'mode',
|
|
42
|
+
description: 'Travel mode: driving, walking, or cycling (default: driving)',
|
|
43
|
+
required: false
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'buffer_meters',
|
|
47
|
+
description: 'Search corridor width on each side of route in meters (default: 1000)',
|
|
48
|
+
required: false
|
|
49
|
+
}
|
|
50
|
+
];
|
|
51
|
+
getMessages(args) {
|
|
52
|
+
this.validateArguments(args);
|
|
53
|
+
const { from, to, search_for, mode = 'driving'
|
|
54
|
+
// buffer_meters parameter is kept for API compatibility but not used
|
|
55
|
+
// in the simplified proximity-sampling approach
|
|
56
|
+
} = args;
|
|
57
|
+
return [
|
|
58
|
+
{
|
|
59
|
+
role: 'user',
|
|
60
|
+
content: {
|
|
61
|
+
type: 'text',
|
|
62
|
+
text: `Find ${search_for} along the ${mode} route from ${from} to ${to}.
|
|
63
|
+
|
|
64
|
+
Please follow these steps:
|
|
65
|
+
|
|
66
|
+
1. **Geocode locations** (if needed):
|
|
67
|
+
- Use search_and_geocode_tool to convert ${from} and ${to} to coordinates if they're not already in coordinate format
|
|
68
|
+
|
|
69
|
+
2. **Get the route**:
|
|
70
|
+
- Use directions_tool with profile=${mode} and geometries="none" to get route metadata (distance, duration)
|
|
71
|
+
- This returns a compact response with route summary WITHOUT large geometry data
|
|
72
|
+
- Note the total route distance to determine sampling strategy
|
|
73
|
+
|
|
74
|
+
3. **Search along the route using point sampling** (works for all route lengths):
|
|
75
|
+
|
|
76
|
+
**Determine sample strategy based on route length:**
|
|
77
|
+
- SHORT routes (< 50km): Sample 5-7 evenly spaced points between start and end
|
|
78
|
+
- MEDIUM routes (50-150km): Sample 5-7 evenly spaced points between start and end
|
|
79
|
+
- VERY LONG routes (> 150km): Sample 5-7 evenly spaced points (start, end, and middle points)
|
|
80
|
+
|
|
81
|
+
**For each sample point:**
|
|
82
|
+
- Calculate coordinates by interpolating linearly between start and end coordinates
|
|
83
|
+
- Choose the appropriate search tool:
|
|
84
|
+
* If "${search_for}" is a specific place/brand (e.g., "Starbucks", "McDonald's", "Whole Foods"):
|
|
85
|
+
Use search_and_geocode_tool with proximity="lon,lat" and q="${search_for}"
|
|
86
|
+
* If "${search_for}" is a category (e.g., "coffee shops", "gas stations", "restaurants"):
|
|
87
|
+
Use category_search_tool with types="${search_for}" and proximity="lon,lat"
|
|
88
|
+
- Limit results per point (10-20 for short routes, 5-10 for long routes)
|
|
89
|
+
|
|
90
|
+
**IMPORTANT - Execute searches in parallel:**
|
|
91
|
+
- All sample point searches are INDEPENDENT and can run concurrently
|
|
92
|
+
- Make ALL search tool calls in a single message (parallel execution)
|
|
93
|
+
- Example: If you have 5 sample points, make 5 search_and_geocode_tool calls in one turn
|
|
94
|
+
- This dramatically speeds up the workflow vs sequential searches
|
|
95
|
+
|
|
96
|
+
**Combine and deduplicate:**
|
|
97
|
+
- Collect all results from sample points
|
|
98
|
+
- Remove duplicates (same place found from multiple sample points)
|
|
99
|
+
- Calculate distances from start point using distance_tool:
|
|
100
|
+
* These calculations are INDEPENDENT and can run in parallel
|
|
101
|
+
* Make ALL distance_tool calls in a single message for all results
|
|
102
|
+
* Example: If you have 10 unique results, make 10 distance_tool calls in one turn
|
|
103
|
+
- Order results by distance from start (approximate route progress)
|
|
104
|
+
|
|
105
|
+
**Why this approach works:**
|
|
106
|
+
- Simple and reliable - just directions + proximity searches
|
|
107
|
+
- No buffer/bbox/polygon complexity
|
|
108
|
+
- Works consistently for all route lengths
|
|
109
|
+
- Fast execution, no token issues
|
|
110
|
+
- Covers the route corridor naturally through proximity searches
|
|
111
|
+
|
|
112
|
+
4. **Present results**:
|
|
113
|
+
- Results are already ordered by distance from start
|
|
114
|
+
- Limit to top 15 results if many were found
|
|
115
|
+
- Note: Results are biased to the route corridor through proximity searches at sample points
|
|
116
|
+
|
|
117
|
+
5. **Present results**:
|
|
118
|
+
|
|
119
|
+
**Skip map generation by default** (static_map_image_tool encoding is slow):
|
|
120
|
+
- Note to user: "Map visualization can be generated separately if needed"
|
|
121
|
+
- The client (Claude Desktop, etc.) may have its own map display capabilities
|
|
122
|
+
- Focus on providing excellent text results instead
|
|
123
|
+
|
|
124
|
+
**Results list (always provide):**
|
|
125
|
+
- Summary: "Found X results along the route from ${from} to ${to}"
|
|
126
|
+
- Route details: Total distance and estimated travel time
|
|
127
|
+
- For each result:
|
|
128
|
+
* Name and address
|
|
129
|
+
* Approximate distance from start (e.g., "45 miles into your trip")
|
|
130
|
+
* Coordinates (so user could map them separately if desired)
|
|
131
|
+
- Total results found
|
|
132
|
+
- Note which sampling strategy was used
|
|
133
|
+
|
|
134
|
+
**If user explicitly asks for a map:**
|
|
135
|
+
- Only then use static_map_image_tool with route and top 8-10 results
|
|
136
|
+
- Warn that encoding may take time for longer routes
|
|
137
|
+
|
|
138
|
+
6. **Additional context**:
|
|
139
|
+
- Mention the total route distance and estimated travel time
|
|
140
|
+
- Note which sampling strategy was used:
|
|
141
|
+
* Short route: "Searched every 5-10 points along the route for comprehensive coverage"
|
|
142
|
+
* Medium route: "Sampled key points along the route"
|
|
143
|
+
* Very long route: "Sampled major points along the route"
|
|
144
|
+
- If no results were found, suggest trying a different search term or checking a specific segment
|
|
145
|
+
- If many results (>15), show top 15 and mention there are more
|
|
146
|
+
|
|
147
|
+
**Important notes:**
|
|
148
|
+
- This approach uses simple proximity searches at sampled route points
|
|
149
|
+
- No buffer/bbox/polygon operations needed - much more reliable
|
|
150
|
+
- Works consistently for all route lengths
|
|
151
|
+
- Fast and avoids token/timeout issues
|
|
152
|
+
- Results naturally cover the route corridor through proximity biasing
|
|
153
|
+
|
|
154
|
+
Make the output clear, actionable, and well-formatted.`
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
];
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
//# sourceMappingURL=SearchAlongRoutePrompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchAlongRoutePrompt.js","sourceRoot":"","sources":["../../../src/prompts/SearchAlongRoutePrompt.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,kCAAkC;A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ACF;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module prompts
|
|
3
|
+
*
|
|
4
|
+
* Public API for Mapbox MCP prompts. This module exports:
|
|
5
|
+
* - Prompt classes for custom instantiation
|
|
6
|
+
* - Pre-configured prompt instances ready to use
|
|
7
|
+
* - Registry functions for batch access
|
|
8
|
+
*
|
|
9
|
+
* @example Simple usage with pre-configured instances
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import { getDirections } from '@mapbox/mcp-server/prompts';
|
|
12
|
+
*
|
|
13
|
+
* // Use directly
|
|
14
|
+
* const result = await getDirections.execute({ ... });
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @example Advanced usage with custom instantiation
|
|
18
|
+
* ```typescript
|
|
19
|
+
* import { GetDirectionsPrompt } from '@mapbox/mcp-server/prompts';
|
|
20
|
+
*
|
|
21
|
+
* const customPrompt = new GetDirectionsPrompt();
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export { FindPlacesNearbyPrompt } from './FindPlacesNearbyPrompt.js';
|
|
25
|
+
export { GetDirectionsPrompt } from './GetDirectionsPrompt.js';
|
|
26
|
+
export { SearchAlongRoutePrompt } from './SearchAlongRoutePrompt.js';
|
|
27
|
+
export { ShowReachableAreasPrompt } from './ShowReachableAreasPrompt.js';
|
|
28
|
+
import { FindPlacesNearbyPrompt } from './FindPlacesNearbyPrompt.js';
|
|
29
|
+
import { GetDirectionsPrompt } from './GetDirectionsPrompt.js';
|
|
30
|
+
import { SearchAlongRoutePrompt } from './SearchAlongRoutePrompt.js';
|
|
31
|
+
import { ShowReachableAreasPrompt } from './ShowReachableAreasPrompt.js';
|
|
32
|
+
/** Find places near a location */
|
|
33
|
+
export declare const findPlacesNearby: FindPlacesNearbyPrompt;
|
|
34
|
+
/** Get directions between locations */
|
|
35
|
+
export declare const getDirections: GetDirectionsPrompt;
|
|
36
|
+
/** Search for points of interest along a route */
|
|
37
|
+
export declare const searchAlongRoute: SearchAlongRoutePrompt;
|
|
38
|
+
/** Show areas reachable within a time limit */
|
|
39
|
+
export declare const showReachableAreas: ShowReachableAreasPrompt;
|
|
40
|
+
export { getAllPrompts, getPromptByName, type PromptInstance } from './promptRegistry.js';
|
|
41
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/prompts/index.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAGzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAGzE,kCAAkC;AAClC,eAAO,MAAM,gBAAgB,wBAA+B,CAAC;AAE7D,uCAAuC;AACvC,eAAO,MAAM,aAAa,qBAA4B,CAAC;AAEvD,kDAAkD;AAClD,eAAO,MAAM,gBAAgB,wBAA+B,CAAC;AAE7D,+CAA+C;AAC/C,eAAO,MAAM,kBAAkB,0BAAiC,CAAC;AAGjE,OAAO,EACL,aAAa,EACb,eAAe,EACf,KAAK,cAAc,EACpB,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// Copyright (c) Mapbox, Inc.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
/**
|
|
4
|
+
* @module prompts
|
|
5
|
+
*
|
|
6
|
+
* Public API for Mapbox MCP prompts. This module exports:
|
|
7
|
+
* - Prompt classes for custom instantiation
|
|
8
|
+
* - Pre-configured prompt instances ready to use
|
|
9
|
+
* - Registry functions for batch access
|
|
10
|
+
*
|
|
11
|
+
* @example Simple usage with pre-configured instances
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import { getDirections } from '@mapbox/mcp-server/prompts';
|
|
14
|
+
*
|
|
15
|
+
* // Use directly
|
|
16
|
+
* const result = await getDirections.execute({ ... });
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @example Advanced usage with custom instantiation
|
|
20
|
+
* ```typescript
|
|
21
|
+
* import { GetDirectionsPrompt } from '@mapbox/mcp-server/prompts';
|
|
22
|
+
*
|
|
23
|
+
* const customPrompt = new GetDirectionsPrompt();
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
// Export all prompt classes
|
|
27
|
+
export { FindPlacesNearbyPrompt } from './FindPlacesNearbyPrompt.js';
|
|
28
|
+
export { GetDirectionsPrompt } from './GetDirectionsPrompt.js';
|
|
29
|
+
export { SearchAlongRoutePrompt } from './SearchAlongRoutePrompt.js';
|
|
30
|
+
export { ShowReachableAreasPrompt } from './ShowReachableAreasPrompt.js';
|
|
31
|
+
// Import prompt classes for instantiation
|
|
32
|
+
import { FindPlacesNearbyPrompt } from './FindPlacesNearbyPrompt.js';
|
|
33
|
+
import { GetDirectionsPrompt } from './GetDirectionsPrompt.js';
|
|
34
|
+
import { SearchAlongRoutePrompt } from './SearchAlongRoutePrompt.js';
|
|
35
|
+
import { ShowReachableAreasPrompt } from './ShowReachableAreasPrompt.js';
|
|
36
|
+
// Export pre-configured prompt instances with short, clean names
|
|
37
|
+
/** Find places near a location */
|
|
38
|
+
export const findPlacesNearby = new FindPlacesNearbyPrompt();
|
|
39
|
+
/** Get directions between locations */
|
|
40
|
+
export const getDirections = new GetDirectionsPrompt();
|
|
41
|
+
/** Search for points of interest along a route */
|
|
42
|
+
export const searchAlongRoute = new SearchAlongRoutePrompt();
|
|
43
|
+
/** Show areas reachable within a time limit */
|
|
44
|
+
export const showReachableAreas = new ShowReachableAreasPrompt();
|
|
45
|
+
// Export registry functions for batch access
|
|
46
|
+
export { getAllPrompts, getPromptByName } from './promptRegistry.js';
|
|
47
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/prompts/index.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,kCAAkC;AAElC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,4BAA4B;AAC5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,0CAA0C;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,iEAAiE;AACjE,kCAAkC;AAClC,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,sBAAsB,EAAE,CAAC;AAE7D,uCAAuC;AACvC,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,mBAAmB,EAAE,CAAC;AAEvD,kDAAkD;AAClD,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,sBAAsB,EAAE,CAAC;AAE7D,+CAA+C;AAC/C,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,wBAAwB,EAAE,CAAC;AAEjE,6CAA6C;AAC7C,OAAO,EACL,aAAa,EACb,eAAe,EAEhB,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FindPlacesNearbyPrompt } from './FindPlacesNearbyPrompt.js';
|
|
2
2
|
import { GetDirectionsPrompt } from './GetDirectionsPrompt.js';
|
|
3
|
+
import { SearchAlongRoutePrompt } from './SearchAlongRoutePrompt.js';
|
|
3
4
|
import { ShowReachableAreasPrompt } from './ShowReachableAreasPrompt.js';
|
|
4
5
|
/**
|
|
5
6
|
* Central registry of all available prompts.
|
|
@@ -7,7 +8,7 @@ import { ShowReachableAreasPrompt } from './ShowReachableAreasPrompt.js';
|
|
|
7
8
|
* This module maintains a readonly collection of prompt instances and provides
|
|
8
9
|
* type-safe access methods.
|
|
9
10
|
*/
|
|
10
|
-
declare const ALL_PROMPTS: readonly [FindPlacesNearbyPrompt, GetDirectionsPrompt, ShowReachableAreasPrompt];
|
|
11
|
+
declare const ALL_PROMPTS: readonly [FindPlacesNearbyPrompt, GetDirectionsPrompt, SearchAlongRoutePrompt, ShowReachableAreasPrompt];
|
|
11
12
|
/**
|
|
12
13
|
* Type representing any prompt instance
|
|
13
14
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promptRegistry.d.ts","sourceRoot":"","sources":["../../../src/prompts/promptRegistry.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE;;;;;GAKG;AAGH,QAAA,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"promptRegistry.d.ts","sourceRoot":"","sources":["../../../src/prompts/promptRegistry.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE;;;;;GAKG;AAGH,QAAA,MAAM,WAAW,0GAKP,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,SAAS,cAAc,EAAE,CAEzD;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAExE"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
import { FindPlacesNearbyPrompt } from './FindPlacesNearbyPrompt.js';
|
|
4
4
|
import { GetDirectionsPrompt } from './GetDirectionsPrompt.js';
|
|
5
|
+
import { SearchAlongRoutePrompt } from './SearchAlongRoutePrompt.js';
|
|
5
6
|
import { ShowReachableAreasPrompt } from './ShowReachableAreasPrompt.js';
|
|
6
7
|
/**
|
|
7
8
|
* Central registry of all available prompts.
|
|
@@ -13,6 +14,7 @@ import { ShowReachableAreasPrompt } from './ShowReachableAreasPrompt.js';
|
|
|
13
14
|
const ALL_PROMPTS = [
|
|
14
15
|
new FindPlacesNearbyPrompt(),
|
|
15
16
|
new GetDirectionsPrompt(),
|
|
17
|
+
new SearchAlongRoutePrompt(),
|
|
16
18
|
new ShowReachableAreasPrompt()
|
|
17
19
|
];
|
|
18
20
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promptRegistry.js","sourceRoot":"","sources":["../../../src/prompts/promptRegistry.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,kCAAkC;AAElC,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE;;;;;GAKG;AAEH,0BAA0B;AAC1B,MAAM,WAAW,GAAG;IAClB,IAAI,sBAAsB,EAAE;IAC5B,IAAI,mBAAmB,EAAE;IACzB,IAAI,wBAAwB,EAAE;CACtB,CAAC;AAOX;;;;GAIG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,WAAW,CAAC;AACrB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AAC5D,CAAC"}
|
|
1
|
+
{"version":3,"file":"promptRegistry.js","sourceRoot":"","sources":["../../../src/prompts/promptRegistry.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,kCAAkC;AAElC,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE;;;;;GAKG;AAEH,0BAA0B;AAC1B,MAAM,WAAW,GAAG;IAClB,IAAI,sBAAsB,EAAE;IAC5B,IAAI,mBAAmB,EAAE;IACzB,IAAI,sBAAsB,EAAE;IAC5B,IAAI,wBAAwB,EAAE;CACtB,CAAC;AAOX;;;;GAIG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,WAAW,CAAC;AACrB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { CategoryListResource } from './category-list/CategoryListResource.js';
|
|
2
|
+
import { CategoryListResource } from './category-list/CategoryListResource.js';
|
|
3
|
+
/** Category list for place search (mapbox://categories) */
|
|
4
|
+
export declare const categoryList: CategoryListResource;
|
|
5
|
+
export { getAllResources, getResourceByUri, type ResourceInstance } from './resourceRegistry.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/index.ts"],"names":[],"mappings":"AA+BA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAG/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAG/E,2DAA2D;AAC3D,eAAO,MAAM,YAAY,sBAA4C,CAAC;AAGtE,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,KAAK,gBAAgB,EACtB,MAAM,uBAAuB,CAAC"}
|