Enhancement: make stderr of server subprocess configurable #191
+2
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This enhancement allows the creator of the stdio_client to pass a stream other than sys.stderr to become the stderr output.
Motivation and Context
This change allows a client to implement something similar to that of Claude Desktop where the error log stream goes to a specific named output destination if desired. (e.g. "mcp-server-XServer.log") Without this, all subprocess servers can only write to the same stderr stream.
If there is a way to achieve the same effect without a code change that would be very acceptable, but I could not determine a way to do that.
How Has This Been Tested?
This has been tested in a fork of "oterm", a terminal-based client, with ollama. Without this modification log and error messages from servers are written to the screen.
Breaking Changes
There should be no change to existing code.
Types of changes
Checklist
Additional context
I regret I do not have a self-contained test to submit, yet.