When I pipe the output of an MCP tool call to another process, it gets truncated at 65536 bytes. When the output is a tty or a file, the whole output is received.
❯ mcp-cli call dummy-mcp text 2>/dev/null | wc -c
65536
❯ mcp-cli call dummy-mcp text 2>/dev/null > /tmp/dummy-mcp-text; wc -c /tmp/dummy-mcp-text
200141 /tmp/dummy-mcp-text
Dummy MCP server (FastMCP 3.0.0b1) for testing:
fromfastmcpimportFastMCPmcp=FastMCP("dummy-mcp")
@mcp.tooldeftext() ->str:
return"x"*100000if__name__=="__main__":
mcp.run()
When I pipe the output of an MCP tool call to another process, it gets truncated at 65536 bytes. When the output is a tty or a file, the whole output is received.
Dummy MCP server (FastMCP 3.0.0b1) for testing: