Skip to content

Commit 51dcc5b

Browse files
committed
fix merge main into head
1 parent 888d809 commit 51dcc5b

File tree

1 file changed

+1
-52
lines changed

1 file changed

+1
-52
lines changed

src/services/mcp/McpHub.ts

Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -117,57 +117,6 @@ export class McpHub {
117117
this.initializeProjectMcpServers()
118118
}
119119

120-
public setupWorkspaceFoldersWatcher(): void {
121-
// Skip if test environment is detected
122-
if (process.env.NODE_ENV === "test" || process.env.JEST_WORKER_ID !== undefined) {
123-
return
124-
}
125-
this.disposables.push(
126-
vscode.workspace.onDidChangeWorkspaceFolders(async () => {
127-
await this.updateProjectMcpServers()
128-
this.watchProjectMcpFile()
129-
}),
130-
)
131-
}
132-
133-
private watchProjectMcpFile(): void {
134-
this.projectMcpWatcher?.dispose()
135-
136-
this.projectMcpWatcher = vscode.workspace.createFileSystemWatcher("**/.roo/mcp.json", false, false, false)
137-
138-
this.disposables.push(
139-
this.projectMcpWatcher.onDidChange(async () => {
140-
await this.updateProjectMcpServers()
141-
}),
142-
this.projectMcpWatcher.onDidCreate(async () => {
143-
await this.updateProjectMcpServers()
144-
}),
145-
this.projectMcpWatcher.onDidDelete(async () => {
146-
await this.cleanupProjectMcpServers()
147-
}),
148-
)
149-
150-
this.disposables.push(this.projectMcpWatcher)
151-
}
152-
153-
private async updateProjectMcpServers(): Promise<void> {
154-
// Only clean up and initialize project servers, not affecting global servers
155-
await this.cleanupProjectMcpServers()
156-
await this.initializeProjectMcpServers()
157-
}
158-
159-
private async cleanupProjectMcpServers(): Promise<void> {
160-
// Only filter and delete project servers
161-
const projectServers = this.connections.filter((conn) => conn.server.source === "project")
162-
163-
for (const conn of projectServers) {
164-
await this.deleteConnection(conn.server.name)
165-
}
166-
167-
// Notify webview of changes after cleanup
168-
await this.notifyWebviewOfServerChanges()
169-
}
170-
171120
/**
172121
* Validates and normalizes server configuration
173122
* @param config The server configuration to validate
@@ -452,7 +401,7 @@ export class McpHub {
452401

453402
private async connectToServer(
454403
name: string,
455-
config: z.infer<typeof StdioConfigSchema>,
404+
config: z.infer<typeof ServerConfigSchema>,
456405
source: "global" | "project" = "global",
457406
): Promise<void> {
458407
// Remove existing connection if it exists

0 commit comments

Comments
 (0)