Skip to content

Commit 947935b

Browse files
committed
fix: Improve stderr handling in ExecuteToolHandler
1 parent 8f4e6df commit 947935b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/mcp_shell_server/server.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,9 @@ async def run_tool(self, arguments: dict) -> Sequence[TextContent]:
9898
if result.get("stdout"):
9999
content.append(TextContent(type="text", text=result["stdout"]))
100100

101-
# Add stderr if present and not a process group message
101+
# Add stderr if present (filter out specific messages)
102102
stderr = result.get("stderr")
103-
if stderr and not stderr.startswith(
104-
"bash: cannot set terminal process group"
105-
):
103+
if stderr and "cannot set terminal process group" not in stderr:
106104
content.append(TextContent(type="text", text=stderr))
107105

108106
except asyncio.TimeoutError as e:

0 commit comments

Comments
 (0)