You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The implementation follows the MCP specification for filtering capabilities:
Server Capabilities: Servers can now declare support for filtering with the filtering capability, including whether list change notifications are supported.
Group Primitive: Groups are collections of tools that separate the server's toolspace by functionality or use case.
Tag Primitive: Tags are labels that can be attached to tools to denote cross-cutting concerns like status or operational safety.
Filter Parameter: The tools/list method now accepts a filter parameter that allows filtering tools by groups and tags.
Tool Definition: Tools can now be associated with groups and tags, which are included in the tool definition.
The implementation is fully backward compatible - if the filter parameter is omitted, all tools are returned as before.
In src/types.ts
* Added a new filtering capability to the ServerCapabilitiesSchema to allow servers to declare support for filtering groups and tags
* Created new schemas for groups and tags:
GroupSchema: Defines a group that contains tools, with name, title, and description
TagSchema: Defines a tag that can be attached to tools, with name and description
* Extended the ToolSchema to include optional groups and tags properties
* Added a ToolsFilterSchema to define filter parameters for the tools/list request
* Extended the ListToolsRequestSchema to include the filter parameter
* Added new request/response schemas for group and tag operations:
ListGroupsRequestSchema and ListGroupsResultSchema
ListTagsRequestSchema and ListTagsResultSchema
* Added notification schemas for group and tag list changes:
GroupListChangedNotificationSchema
TagListChangedNotificationSchema
Added type exports for all the new schemas
In src/client/index.ts
Added client-side methods to support the new filtering capabilities:
* Added imports for the new types and schemas
* Implemented listGroups() method to request a list of groups from the server
* Implemented listTags() method to request a list of tags from the server
* Updated the listTools() method to properly handle the filter parameter
In src/server/mcp.ts
Added server-side implementation for filtering capabilities:
* Added imports for the new types
* Added registration of the filtering capability in the McpServer constructor
* Added storage for registered groups and tags with _registeredGroups and _registeredTags properties
* Implemented request handlers for groups and tags:
- setGroupRequestHandlers() for handling group-related requests
- setTagRequestHandlers() for handling tag-related requests
* Updated the ListToolsRequestSchema handler to support filtering by groups and tags
* Extended the RegisteredTool type to include groups and tags
* Added methods to send group and tag list changed notifications:
- sendGroupListChanged()
- sendTagListChanged()
* Added methods to register groups and tags:
- registerGroup(): Registers a group with name, title, and description
- registerTag(): Registers a tag with name and description
0 commit comments