Add McpHub and sync with McpView

This commit is contained in:
Saoud Rizwan
2024-12-05 19:00:55 -08:00
parent fa62548b01
commit 17d481d4d1
10 changed files with 577 additions and 215 deletions

View File

@@ -2,6 +2,7 @@
import { ApiConfiguration, ModelInfo } from "./api"
import { HistoryItem } from "./HistoryItem"
import { McpServer } from "./mcp"
// webview will hold state
export interface ExtensionMessage {
@@ -16,6 +17,7 @@ export interface ExtensionMessage {
| "invoke"
| "partialMessage"
| "openRouterModels"
| "mcpServers"
text?: string
action?:
| "chatButtonClicked"
@@ -31,6 +33,7 @@ export interface ExtensionMessage {
filePaths?: string[]
partialMessage?: ClineMessage
openRouterModels?: Record<string, ModelInfo>
mcpServers?: McpServer[]
}
export interface ExtensionState {

View File

@@ -23,6 +23,8 @@ export interface WebviewMessage {
| "openMention"
| "cancelTask"
| "refreshOpenRouterModels"
| "openMcpSettings"
| "retryMcpServer"
text?: string
askResponse?: ClineAskResponse
apiConfiguration?: ApiConfiguration

21
src/shared/mcp.ts Normal file
View File

@@ -0,0 +1,21 @@
export type McpServer = {
name: string
config: string
status: "connected" | "connecting" | "disconnected"
error?: string
tools?: McpTool[]
resources?: McpResource[]
}
export type McpTool = {
name: string
description?: string
inputSchema?: object
}
export type McpResource = {
uri: string
name: string
mimeType?: string
description?: string
}