Skip to content

Commit 68b348b

Browse files
committed
remove unused mcp log
1 parent f8b9f6a commit 68b348b

File tree

1 file changed

+1
-31
lines changed

1 file changed

+1
-31
lines changed

src/services/mcp/McpHub.ts

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,6 @@ export class McpHub {
625625
alwaysAllow: alwaysAllowConfig.includes(tool.name),
626626
}))
627627

628-
console.log(`[MCP] Fetched tools for ${serverName}:`, tools)
629628
return tools
630629
} catch (error) {
631630
console.error(`Failed to fetch tools for ${serverName}:`, error)
@@ -707,7 +706,6 @@ export class McpHub {
707706
for (const name of currentNames) {
708707
if (!newNames.has(name)) {
709708
await this.deleteConnection(name, source)
710-
console.log(`Deleted MCP server: ${name} from ${source}`)
711709
}
712710
}
713711

@@ -739,7 +737,6 @@ export class McpHub {
739737
this.setupFileWatcher(name, validatedConfig, source)
740738
await this.deleteConnection(name, source)
741739
await this.connectToServer(name, validatedConfig, source)
742-
console.log(`Reconnected ${source} MCP server with updated config: ${name}`)
743740
} catch (error) {
744741
this.showErrorMessage(`Failed to reconnect MCP server ${name}`, error)
745742
}
@@ -766,15 +763,13 @@ export class McpHub {
766763
if (config.type === "stdio") {
767764
// Setup watchers for custom watchPaths if defined
768765
if (config.watchPaths && config.watchPaths.length > 0) {
769-
console.log(`Setting up custom path watchers for ${name} MCP server...`)
770766
const watchPathsWatcher = chokidar.watch(config.watchPaths, {
771767
// persistent: true,
772768
// ignoreInitial: true,
773769
// awaitWriteFinish: true,
774770
})
775771

776772
watchPathsWatcher.on("change", async (changedPath) => {
777-
console.log(`Detected change in custom path ${changedPath}. Restarting server ${name}...`)
778773
try {
779774
// Pass the source from the config to restartConnection
780775
await this.restartConnection(name, source)
@@ -789,7 +784,6 @@ export class McpHub {
789784
// Also setup the fallback build/index.js watcher if applicable
790785
const filePath = config.args?.find((arg: string) => arg.includes("build/index.js"))
791786
if (filePath) {
792-
console.log(`Setting up build/index.js watcher for ${name} MCP server...`)
793787
// we use chokidar instead of onDidSaveTextDocument because it doesn't require the file to be open in the editor
794788
const indexJsWatcher = chokidar.watch(filePath, {
795789
// persistent: true,
@@ -798,7 +792,6 @@ export class McpHub {
798792
})
799793

800794
indexJsWatcher.on("change", async () => {
801-
console.log(`Detected change in ${filePath}. Restarting server ${name}...`)
802795
try {
803796
// Pass the source from the config to restartConnection
804797
await this.restartConnection(name, source)
@@ -877,7 +870,7 @@ export class McpHub {
877870
const projectConfig = JSON.parse(projectContent)
878871
projectServerOrder = Object.keys(projectConfig.mcpServers || {})
879872
} catch (error) {
880-
console.error("Failed to read project MCP config:", error)
873+
// Silently continue with empty project server order
881874
}
882875
}
883876

@@ -902,15 +895,6 @@ export class McpHub {
902895
return aIsGlobal ? 1 : -1
903896
})
904897

905-
// Add debug logging for server order
906-
console.log(
907-
"[MCP] Sorted servers for webview:",
908-
sortedConnections.map((conn) => ({
909-
name: conn.server.name,
910-
source: conn.server.source || "global",
911-
})),
912-
)
913-
914898
// Send sorted servers to webview
915899
await this.providerRef.deref()?.postMessageToWebview({
916900
type: "mcpServers",
@@ -1186,9 +1170,6 @@ export class McpHub {
11861170
shouldAllow: boolean,
11871171
): Promise<void> {
11881172
try {
1189-
console.log(
1190-
`Toggling tool ${toolName} for server ${serverName} (source: ${source}) to ${shouldAllow ? "allow" : "disallow"}`,
1191-
)
11921173
// Find the connection with matching name and source
11931174
const connection = this.findConnection(serverName, source)
11941175

@@ -1246,18 +1227,7 @@ export class McpHub {
12461227
// Update the tools list to reflect the change
12471228
if (connection) {
12481229
// Explicitly pass the source to ensure we're updating the correct server's tools
1249-
console.log(`Updating tools list for ${serverName} (source: ${source})`)
12501230
connection.server.tools = await this.fetchToolsList(serverName, source)
1251-
1252-
// Log the updated tools list for debugging
1253-
console.log(
1254-
`Updated tools list for ${serverName} (source: ${source}):`,
1255-
connection.server.tools.map((tool) => ({
1256-
name: tool.name,
1257-
alwaysAllow: tool.alwaysAllow,
1258-
})),
1259-
)
1260-
12611231
await this.notifyWebviewOfServerChanges()
12621232
}
12631233
} catch (error) {

0 commit comments

Comments
 (0)