-
-
Notifications
You must be signed in to change notification settings - Fork 558
Fix: Disable notifications for Cline to prevent UI clutter #269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… UI notifications
…id Cline UI notifications" This reverts commit 1c03e97.
|
CodeAnt AI is reviewing your PR. Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
WalkthroughThe PR adds client-specific configuration to the MCP stdio transport layer, enabling notifications to be selectively disabled for certain clients. It includes version bumps across configuration and manifest files, new documentation describing the notification architecture and problem statement, and transport modifications to query notification status and support per-client behavior. Changes
Sequence DiagramsequenceDiagram
participant MCP Client
participant Server
participant Transport as FilteredStdioServerTransport
participant Console/Stdout
MCP Client->>Server: initialize(clientInfo)
activate Server
Server->>Server: Capture current client name
Server->>Transport: configureForClient(clientName)
activate Transport
Transport->>Transport: Normalize and store client name<br/>Set disableNotifications flag
deactivate Transport
alt Notifications Disabled for Client
Server->>Transport: enableNotifications()
activate Transport
Transport->>Transport: Flush buffered messages to stderr
Transport->>Console/Stdout: Write summary to stderr
Transport->>Transport: Clear buffer, early return
deactivate Transport
else Notifications Enabled for Client
Server->>Transport: enableNotifications()
activate Transport
Transport->>MCP Client: Replay buffered log notifications
Transport->>Transport: Clear buffer, enable notifications
deactivate Transport
end
Server->>MCP Client: initialize response
deactivate Server
Note over Transport: Future messages either<br/>emit as notifications or<br/>pass through based on<br/>client config
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
CodeAnt AI finished reviewing your PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (8)
.claude/settings.local.json(1 hunks)CLINE_NOTIFICATION_PROBLEM.md(1 hunks)CUSTOM_STDIO_EXPLANATION.md(1 hunks)package.json(1 hunks)server.json(1 hunks)src/custom-stdio.ts(5 hunks)src/server.ts(1 hunks)src/version.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-05-25T16:02:52.184Z
Learnt from: tillahoffmann
Repo: wonderwhy-er/DesktopCommanderMCP PR: 137
File: src/index.ts:160-162
Timestamp: 2025-05-25T16:02:52.184Z
Learning: In stateless MCP server implementations using the modelcontextprotocol/typescript-sdk, the pattern of calling both transport.close() and server.close() in the request close event handler is the official recommended approach according to the documentation at https://github.com/modelcontextprotocol/typescript-sdk.
Applied to files:
CUSTOM_STDIO_EXPLANATION.mdsrc/server.ts
📚 Learning: 2025-05-25T16:02:52.184Z
Learnt from: tillahoffmann
Repo: wonderwhy-er/DesktopCommanderMCP PR: 137
File: src/index.ts:160-162
Timestamp: 2025-05-25T16:02:52.184Z
Learning: In stateless MCP server implementations using the modelcontextprotocol/typescript-sdk, the correct pattern is to call both transport.close() and server.close() in the request close event handler. This is the official recommended approach according to the documentation for ensuring complete isolation between requests and preventing request ID collisions in concurrent scenarios.
Applied to files:
CUSTOM_STDIO_EXPLANATION.mdsrc/server.ts
| this.clientName = clientName.toLowerCase(); | ||
|
|
||
| // Detect Cline and disable notifications | ||
| if (this.clientName.includes('cline') || | ||
| this.clientName.includes('vscode') || | ||
| this.clientName === 'claude-dev') { | ||
| this.disableNotifications = true; | ||
| process.stderr.write(`[INFO] Desktop Commander: Notifications disabled for ${clientName}\n`); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reset disableNotifications for non-Cline clients
Once disableNotifications is set to true it never gets flipped back, so if a Cline session connects first, every subsequent client (e.g., Claude Desktop) will also have notifications suppressed in the same process. Please reset this.disableNotifications to false before applying the client-specific checks so the flag reflects the current client.
public configureForClient(clientName: string) {
this.clientName = clientName.toLowerCase();
-
- // Detect Cline and disable notifications
- if (this.clientName.includes('cline') ||
- this.clientName.includes('vscode') ||
- this.clientName === 'claude-dev') {
+ // Default to notifications enabled unless explicitly disabled
+ this.disableNotifications = false;
+
+ // Detect Cline-like clients and disable notifications
+ if (this.clientName.includes('cline') ||
+ this.clientName.includes('vscode') ||
+ this.clientName === 'claude-dev') {
this.disableNotifications = true;
process.stderr.write(`[INFO] Desktop Commander: Notifications disabled for ${clientName}\n`);
}
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| this.clientName = clientName.toLowerCase(); | |
| // Detect Cline and disable notifications | |
| if (this.clientName.includes('cline') || | |
| this.clientName.includes('vscode') || | |
| this.clientName === 'claude-dev') { | |
| this.disableNotifications = true; | |
| process.stderr.write(`[INFO] Desktop Commander: Notifications disabled for ${clientName}\n`); | |
| } | |
| this.clientName = clientName.toLowerCase(); | |
| // Default to notifications enabled unless explicitly disabled | |
| this.disableNotifications = false; | |
| // Detect Cline-like clients and disable notifications | |
| if (this.clientName.includes('cline') || | |
| this.clientName.includes('vscode') || | |
| this.clientName === 'claude-dev') { | |
| this.disableNotifications = true; | |
| process.stderr.write(`[INFO] Desktop Commander: Notifications disabled for ${clientName}\n`); | |
| } |
🤖 Prompt for AI Agents
In src/custom-stdio.ts around lines 101 to 109, reset this.disableNotifications
to false before performing client-specific checks so the flag reflects the
current client; then run the existing checks (contains 'cline' or 'vscode' or
equals 'claude-dev') and set this.disableNotifications = true only when the
current client meets those conditions and log the message—this ensures a new
non-Cline client won't inherit a previous connection's disabled state.
User description
Problem
Cline (VSCode extension) displays MCP

notifications/messageprominently in its UI, creating visual clutter for users. Unlike Claude Desktop which handles notifications gracefully, Cline shows them as visible notifications that disrupt the user experience.Solution
Implemented automatic client detection to disable JSON-RPC notifications specifically for Cline while maintaining them for other clients like Claude Desktop.