Skip to content

Add option to truncate/limit build output size #188

@thomasttvo

Description

@thomasttvo

Problem

When using build_device session-set-defaults (and likely other build tools), the response contains the full xcodebuild output which can be ~14k+ tokens. This is expensive when using AI assistants that charge per token.

Claude Code shows this warning:

⚠ Large MCP response (~14.0k tokens), this can fill up context quickly

Proposed Solution

Add a configuration option to control output verbosity/size:

  1. Environment variable like XCODEBUILDMCP_MAX_OUTPUT_LINES=100 or XCODEBUILDMCP_OUTPUT_VERBOSITY=minimal
  2. Tool parameter like maxOutputLines or verbosity
  3. Smart truncation - by default only return errors/warnings and last N lines of output, with option to get full output

Current Workaround

Using bash directly with output piping, but this loses the benefits of the MCP tool.

Thanks for the great tool!

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