-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Bug report form
- I have done a basic search of the issue tracker to find any existing issues that are similar.
- I have checked that my version is at least the latest stable release available via my installation method.
Describe the bug
When using nushell as an MCP server, piping non-nushell (external) commands hangs forever. For example:
echo "hi" | cat
This command never completes when run through the MCP interface.
I have fixed this before in a different context, and IIRC the issue is related to MCP using stdio for JSON-RPC communication. The external commands stdio gets mixed up with the MCP transport layer.
Possible solutions
I previously fixed this by using HTTP streaming for the RPC transport instead of stdio. However, there is probably a way to make stdio work—perhaps by using child process stdio redirection (pseudo-terminals / PTYs?) so the external commands stdio doesnt conflict with the MCP JSON-RPC stdio.
Stdio transport is really nice for integration with tools like Claude Code, so it would be great to find a solution that preserves stdio as a transport option.
How to reproduce
- Start nushell as an MCP server (
nu --mcp) - Use an MCP client (e.g., Claude Code) to run:
echo "hi" | cat - The command hangs indefinitely
Expected behavior
The command should complete and return hi.
Configuration
Running from main branch (commit 08d27ca7e).