Skip to content

Conversation

@zmofei
Copy link
Member

@zmofei zmofei commented Sep 25, 2025

This pull request introduces a new annotation system for all tools in the MCP server, standardizes tool structure via a new BaseTool abstract class, and ensures that all tools expose consistent metadata. It also adds comprehensive tests to verify the presence and correctness of these annotations. These changes improve the extensibility, maintainability, and introspection of the tool system.

Tool architecture and annotation improvements:

  • Introduced a new abstract class BaseTool in src/tools/BaseTool.ts that standardizes tool structure and enforces the presence of annotations and related metadata on all tools. This includes a unified installTo method and logging helper.
  • Refactored MapboxApiBasedTool and all tool classes (e.g., CategoryListTool, CategorySearchTool, DirectionsTool, IsochroneTool, MatrixTool, ReverseGeocodeTool, SearchAndGeocodeTool, StaticMapImageTool, VersionTool) to extend from BaseTool, and added a required annotations property to each, specifying title, readOnlyHint, destructiveHint, idempotentHint, and openWorldHint. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]

Testing and validation:

  • Added a new test suite test/tools/annotations.test.ts to ensure all tools have the required annotations, can be installed to the server, and that annotation values (such as readOnlyHint and openWorldHint) are correct for each tool type.

Build and package updates:

  • Added a new script dev:inspect to package.json for easier development and inspection of the MCP server.
  • Bumped the package version from 0.5.1 to 0.5.2 to reflect these changes.

Other minor changes:

  • Cleaned up and removed now-unnecessary code from tool classes, such as redundant logging and installation methods, as these are now handled by BaseTool. [1] [2]
  • Updated server instantiation in src/index.ts to remove unused capabilities.

@zmofei zmofei marked this pull request as ready for review September 25, 2025 13:59
@zmofei zmofei requested a review from a team as a code owner September 25, 2025 13:59
Copy link
Contributor

@alexisraykhel alexisraykhel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good! :) I like how you unified some functionality, too.

@zmofei zmofei merged commit 20d86ea into main Sep 30, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants