Skip to content

Commit c6028b0

Browse files
authored
feat(types): add isMcpRegistry field to MCP protocol types (#710)
## Problem MCP registry UI handling was using hacky type casts like `(params as any).isRegistryActive` to determine if a server is from the registry. This approach is not type-safe and makes the code harder to maintain and understand. ## Solution Add `isMcpRegistry` optional boolean field to MCP protocol types: - `ListMcpServersParams` - `ListMcpServersResult` - `McpServerClickParams` - `McpServerClickResult` (inherited from `McpServerClickParams`) This allows proper type-safe tracking of MCP registry state throughout the protocol communication between server and client. <!--- REMINDER: - Read CONTRIBUTING.md first. - Add test coverage for your changes. - Link to related issues/commits. - Testing: how did you test your changes? - Screenshots if applicable --> ## License By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 97f90cb commit c6028b0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

types/chat.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,7 @@ export interface ListConversationsParams {
576576

577577
export interface ListMcpServersParams {
578578
filter?: Record<string, FilterValue>
579+
isMcpRegistry?: boolean
579580
}
580581

581582
export interface ListRulesParams {
@@ -660,6 +661,7 @@ export interface ListMcpServersResult {
660661
}
661662
list: DetailedListGroup[]
662663
filterOptions?: FilterOption[]
664+
isMcpRegistry?: boolean
663665
}
664666

665667
export type ConversationAction = 'delete' | 'export'
@@ -677,6 +679,7 @@ export interface McpServerClickParams {
677679
id: string
678680
title?: string
679681
optionsValues?: Record<string, string>
682+
isMcpRegistry?: boolean
680683
}
681684

682685
export interface McpServerClickResult extends McpServerClickParams {

0 commit comments

Comments
 (0)