Skip to content

Output is truncated at 65536 bytes when piped to another process #23

Description

@ZoltanLajosKis

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()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions