-
Notifications
You must be signed in to change notification settings - Fork 132
Add --no-log
argument to make it work with IntelliJ
#127
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
base: main
Are you sure you want to change the base?
Conversation
@benconda This PR would be helpful to have in other IDEs too as some MCP clients bubble-up any transport.stderr to be visible to user in UI which is confusing to the user. Can you please review and approve this. |
@@ -32,6 +32,9 @@ const pid = process.pid | |||
// Global debug flag | |||
export let DEBUG = false | |||
|
|||
// Global no-log flag | |||
export let NO_LOG = false |
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.
Might be better to rename this to NO_STDERR_LOG
(and the corresponding cli arg to --no-stderr-log
) to be more explicit and clear.
@@ -71,6 +74,10 @@ export function debugLog(message: string, ...args: any[]) { | |||
} | |||
|
|||
export function log(str: string, ...rest: unknown[]) { | |||
if(NO_LOG) { |
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.
Can we have this control just the console.error below so that the DEBUG log functionality is preserved?
Actually nm, I notice that debugLog
has some console.error
as well ..
if(NO_LOG) { | |
if(!NO_LOG) { | |
console.error |
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.
@benconda But this also brings in a bigger question - wouldn't this result in valid error logs from server being lost? How would the remote server communicate error msgs as per the protocol and how does mcp-remote handle it currently?
IntelliJ fails to connect if output is sent to STDERR
Co-authored-by: Benoit Condaminet <[email protected]>
commit: |
Would love to implement something like this but I have some of the same questions as @mohanraj-r. For now I've just approved the preview run so you should be able to test this with |
IntelliJ fails to connect if output is sent to STDERR