diff --git a/src/main.ts b/src/main.ts index d8487b7..3098a91 100644 --- a/src/main.ts +++ b/src/main.ts @@ -18,7 +18,6 @@ export default class MCPServerPlugin extends Plugin { // Auto-generate API key if not set if (!this.settings.apiKey || this.settings.apiKey.trim() === '') { - console.log('Generating new API key...'); this.settings.apiKey = generateApiKey(); await this.saveSettings(); } @@ -30,7 +29,6 @@ export default class MCPServerPlugin extends Plugin { } const legacySettings = this.settings as LegacySettings; if ('enableCORS' in legacySettings || 'allowedOrigins' in legacySettings) { - console.log('Migrating legacy CORS settings...'); delete legacySettings.enableCORS; delete legacySettings.allowedOrigins; await this.saveSettings(); diff --git a/src/server/mcp-server.ts b/src/server/mcp-server.ts index cd71f93..d982757 100644 --- a/src/server/mcp-server.ts +++ b/src/server/mcp-server.ts @@ -102,7 +102,6 @@ export class MCPServer { return new Promise((resolve, reject) => { try { this.server = this.app.listen(this.settings.port, '127.0.0.1', () => { - console.log(`MCP Server listening on http://127.0.0.1:${this.settings.port}/mcp`); resolve(); }); @@ -126,7 +125,6 @@ export class MCPServer { if (err) { reject(err); } else { - console.log('MCP Server stopped'); this.server = null; resolve(); } diff --git a/src/ui/notifications.ts b/src/ui/notifications.ts index 0dbab1c..896e866 100644 --- a/src/ui/notifications.ts +++ b/src/ui/notifications.ts @@ -93,7 +93,7 @@ export class NotificationManager { // Log to console if enabled if (this.settings.logToConsole) { - console.log(`[MCP] Tool call: ${toolName}`, args); + console.debug(`[MCP] Tool call: ${toolName}`, args); } } diff --git a/tests/notifications.test.ts b/tests/notifications.test.ts index 703c3d4..d14e697 100644 --- a/tests/notifications.test.ts +++ b/tests/notifications.test.ts @@ -160,7 +160,7 @@ describe('NotificationManager', () => { settings.logToConsole = true; manager = new NotificationManager(app, settings); - const consoleSpy = jest.spyOn(console, 'log').mockImplementation(); + const consoleSpy = jest.spyOn(console, 'debug').mockImplementation(); manager.showToolCall('read_note', { path: 'test.md' }); @@ -173,7 +173,7 @@ describe('NotificationManager', () => { }); it('should not log to console when disabled', () => { - const consoleSpy = jest.spyOn(console, 'log').mockImplementation(); + const consoleSpy = jest.spyOn(console, 'debug').mockImplementation(); manager.showToolCall('read_note', { path: 'test.md' });