Migrate openMcpSettings protobus (#3778)
* migrate openMcpSettings * changeset --------- Co-authored-by: Elephant Lumps <celestial_vault@Elephants-MacBook-Pro.local>
This commit is contained in:
1 parent
b9551c960a
commit
cf0af8a3f0
8 files changed
+34
-15
No files matched your search
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"claude-dev": minor
|
||||
---
|
||||
|
||||
Migrate openMcpSettings to protobus
|
||||
@@ -15,6 +15,7 @@ service McpService {
|
||||
rpc deleteMcpServer(StringRequest) returns (McpServers);
|
||||
rpc toggleToolAutoApprove(ToggleToolAutoApproveRequest) returns (McpServers);
|
||||
rpc refreshMcpMarketplace(EmptyRequest) returns (McpMarketplaceCatalog);
|
||||
rpc openMcpSettings(EmptyRequest) returns (Empty);
|
||||
}
|
||||
|
||||
message ToggleMcpServerRequest {
|
||||
|
||||
@@ -316,13 +316,6 @@ export class Controller {
|
||||
await this.fetchUserCreditsData()
|
||||
break
|
||||
}
|
||||
case "openMcpSettings": {
|
||||
const mcpSettingsFilePath = await this.mcpHub?.getMcpSettingsFilePath()
|
||||
if (mcpSettingsFilePath) {
|
||||
await handleFileServiceRequest(this, "openFile", { value: mcpSettingsFilePath })
|
||||
}
|
||||
break
|
||||
}
|
||||
case "fetchMcpMarketplace": {
|
||||
await this.fetchMcpMarketplace(message.bool)
|
||||
break
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { Controller } from ".."
|
||||
import { Empty, EmptyRequest } from "@shared/proto/common"
|
||||
import { openFile as openFileIntegration } from "@integrations/misc/open-file"
|
||||
|
||||
/**
|
||||
* Opens the MCP settings file in the editor
|
||||
* @param controller The controller instance
|
||||
* @param _request Empty request
|
||||
* @returns Empty response
|
||||
*/
|
||||
export async function openMcpSettings(controller: Controller, _request: EmptyRequest): Promise<Empty> {
|
||||
const mcpSettingsFilePath = await controller.mcpHub?.getMcpSettingsFilePath()
|
||||
if (mcpSettingsFilePath) {
|
||||
await openFileIntegration(mcpSettingsFilePath)
|
||||
}
|
||||
return Empty.create()
|
||||
}
|
||||
@@ -15,7 +15,6 @@ export interface WebviewMessage {
|
||||
| "reportBug"
|
||||
| "openInBrowser"
|
||||
| "showChatView"
|
||||
| "openMcpSettings"
|
||||
| "openExtensionSettings"
|
||||
| "requestVsCodeLmModels"
|
||||
| "showAccountViewClicked"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { VSCodeButton, VSCodeLink } from "@vscode/webview-ui-toolkit/react"
|
||||
import { vscode } from "@/utils/vscode"
|
||||
import styled from "styled-components"
|
||||
import { LINKS } from "@/constants"
|
||||
import { McpServiceClient } from "@/services/grpc-client"
|
||||
|
||||
type AddLocalServerFormProps = {
|
||||
onServerAdded: () => void
|
||||
@@ -22,7 +22,9 @@ const AddLocalServerForm = ({ onServerAdded }: AddLocalServerFormProps) => {
|
||||
appearance="primary"
|
||||
style={{ width: "100%", marginBottom: "5px", marginTop: 8 }}
|
||||
onClick={() => {
|
||||
vscode.postMessage({ type: "openMcpSettings" })
|
||||
McpServiceClient.openMcpSettings({}).catch((error) => {
|
||||
console.error("Error opening MCP settings:", error)
|
||||
})
|
||||
}}>
|
||||
Open cline_mcp_settings.json
|
||||
</VSCodeButton>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { useRef, useState } from "react"
|
||||
import { vscode } from "@/utils/vscode"
|
||||
import { VSCodeButton, VSCodeLink, VSCodeTextField } from "@vscode/webview-ui-toolkit/react"
|
||||
import { LINKS } from "@/constants"
|
||||
import { McpServiceClient } from "@/services/grpc-client"
|
||||
@@ -116,7 +115,9 @@ const AddRemoteServerForm = ({ onServerAdded }: { onServerAdded: () => void }) =
|
||||
appearance="secondary"
|
||||
style={{ width: "100%", marginBottom: "5px", marginTop: 15 }}
|
||||
onClick={() => {
|
||||
vscode.postMessage({ type: "openMcpSettings" })
|
||||
McpServiceClient.openMcpSettings({}).catch((error) => {
|
||||
console.error("Error opening MCP settings:", error)
|
||||
})
|
||||
}}>
|
||||
Edit Configuration
|
||||
</VSCodeButton>
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { VSCodeButton, VSCodeLink } from "@vscode/webview-ui-toolkit/react"
|
||||
import { vscode } from "@/utils/vscode"
|
||||
import { useExtensionState } from "@/context/ExtensionStateContext"
|
||||
|
||||
import { UiServiceClient } from "@/services/grpc-client"
|
||||
import { UiServiceClient, McpServiceClient } from "@/services/grpc-client"
|
||||
|
||||
import ServersToggleList from "./ServersToggleList"
|
||||
const InstalledServersView = () => {
|
||||
@@ -40,7 +39,9 @@ const InstalledServersView = () => {
|
||||
appearance="secondary"
|
||||
style={{ width: "100%", marginBottom: "5px" }}
|
||||
onClick={() => {
|
||||
vscode.postMessage({ type: "openMcpSettings" })
|
||||
McpServiceClient.openMcpSettings({}).catch((error) => {
|
||||
console.error("Error opening MCP settings:", error)
|
||||
})
|
||||
}}>
|
||||
<span className="codicon codicon-server" style={{ marginRight: "6px" }}></span>
|
||||
Configure MCP Servers
|
||||
|
||||
Reference in new issue
Block a user