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:
from fastmcp import FastMCP
mcp = FastMCP("dummy-mcp")
@mcp.tool
def text() -> str:
return "x" * 100000
if __name__ == "__main__":
mcp.run()