Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
## Unreleased

### Removed

- **version_tool**: Removed from the tool list — version info is now available as a resource at `mapbox://version` with zero token overhead

### New Features

- **mapbox://version resource**: Server version, git SHA, tag, and branch accessible via `readResource('mapbox://version')`

## 0.10.0 - 2026-03-04

### New Features
Expand Down
4 changes: 4 additions & 0 deletions src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,17 @@ import { httpRequest } from '../utils/httpPipeline.js';

// Export all resource classes
export { CategoryListResource } from './category-list/CategoryListResource.js';
export { VersionResource } from './version/VersionResource.js';

// Import resource classes for instantiation
import { CategoryListResource } from './category-list/CategoryListResource.js';
import { VersionResource } from './version/VersionResource.js';

// Export pre-configured resource instances with short, clean names
/** Category list for place search (mapbox://categories) */
export const categoryList = new CategoryListResource({ httpRequest });
/** Server version info (mapbox://version) */
export const version = new VersionResource();

// Export registry functions for batch access
export {
Expand Down
4 changes: 3 additions & 1 deletion src/resources/resourceRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
import { CategoryListResource } from './category-list/CategoryListResource.js';
import { TemporaryDataResource } from './temporary/TemporaryDataResource.js';
import { StaticMapUIResource } from './ui-apps/StaticMapUIResource.js';
import { VersionResource } from './version/VersionResource.js';
import { httpRequest } from '../utils/httpPipeline.js';

// Central registry of all resources
export const ALL_RESOURCES = [
// INSERT NEW RESOURCE INSTANCE HERE
new CategoryListResource({ httpRequest }),
new TemporaryDataResource(),
new StaticMapUIResource()
new StaticMapUIResource(),
new VersionResource()
] as const;

export type ResourceInstance = (typeof ALL_RESOURCES)[number];
Expand Down
33 changes: 33 additions & 0 deletions src/resources/version/VersionResource.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright (c) Mapbox, Inc.
// Licensed under the MIT License.

import { BaseResource } from '../BaseResource.js';
import { getVersionInfo } from '../../utils/versionUtils.js';
import type { ReadResourceResult } from '@modelcontextprotocol/sdk/types.js';

/**
* Resource exposing MCP server version information.
*
* Available URI:
* - mapbox://version
*/
export class VersionResource extends BaseResource {
readonly uri = 'mapbox://version';
readonly name = 'Mapbox MCP Server Version';
readonly description =
'Version information for the Mapbox MCP server, including version number, git SHA, tag, and branch.';
readonly mimeType = 'application/json';

async read(): Promise<ReadResourceResult> {
const info = getVersionInfo();
return {
contents: [
{
uri: this.uri,
mimeType: 'application/json',
text: JSON.stringify(info, null, 2)
}
]
};
}
}
7 changes: 0 additions & 7 deletions src/tools/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ export { ReverseGeocodeTool } from './reverse-geocode-tool/ReverseGeocodeTool.js
export { SearchAndGeocodeTool } from './search-and-geocode-tool/SearchAndGeocodeTool.js';
export { SimplifyTool } from './simplify-tool/SimplifyTool.js';
export { StaticMapImageTool } from './static-map-image-tool/StaticMapImageTool.js';
export { VersionTool } from './version-tool/VersionTool.js';

// Import tool classes for instantiation
import { AreaTool } from './area-tool/AreaTool.js';
import { BearingTool } from './bearing-tool/BearingTool.js';
Expand All @@ -72,8 +70,6 @@ import { ReverseGeocodeTool } from './reverse-geocode-tool/ReverseGeocodeTool.js
import { SearchAndGeocodeTool } from './search-and-geocode-tool/SearchAndGeocodeTool.js';
import { SimplifyTool } from './simplify-tool/SimplifyTool.js';
import { StaticMapImageTool } from './static-map-image-tool/StaticMapImageTool.js';
import { VersionTool } from './version-tool/VersionTool.js';

// Export pre-configured tool instances with short, clean names
// Note: Import path already indicates these are tools, so we omit the "Tool" suffix

Expand Down Expand Up @@ -137,9 +133,6 @@ export const simplify = new SimplifyTool();
/** Generate static map images */
export const staticMapImage = new StaticMapImageTool({ httpRequest });

/** Get version information */
export const version = new VersionTool();

// Export registry functions for batch access
export {
getCoreTools,
Expand Down
2 changes: 0 additions & 2 deletions src/tools/toolRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import { ResourceReaderTool } from './resource-reader-tool/ResourceReaderTool.js
import { ReverseGeocodeTool } from './reverse-geocode-tool/ReverseGeocodeTool.js';
import { StaticMapImageTool } from './static-map-image-tool/StaticMapImageTool.js';
import { SearchAndGeocodeTool } from './search-and-geocode-tool/SearchAndGeocodeTool.js';
import { VersionTool } from './version-tool/VersionTool.js';
import { httpRequest } from '../utils/httpPipeline.js';

/**
Expand All @@ -42,7 +41,6 @@ export const CORE_TOOLS = [
new BufferTool(),
new PointInPolygonTool(),
new DistanceTool(),
new VersionTool(),
new CategorySearchTool({ httpRequest }),
new DirectionsTool({ httpRequest }),
new IsochroneTool({ httpRequest }),
Expand Down
6 changes: 0 additions & 6 deletions src/tools/version-tool/VersionTool.input.schema.ts

This file was deleted.

15 changes: 0 additions & 15 deletions src/tools/version-tool/VersionTool.output.schema.ts

This file was deleted.

82 changes: 0 additions & 82 deletions src/tools/version-tool/VersionTool.ts

This file was deleted.

161 changes: 0 additions & 161 deletions test/tools/version-tool/VersionTool.output.schema.test.ts

This file was deleted.

Loading
Loading