XcodeBuildMCP icon indicating copy to clipboard operation
XcodeBuildMCP copied to clipboard

[Feature]: Filter build output for warnings and errors

Open codeman9 opened this issue 6 months ago • 13 comments

Feature Description

Often, when I use the tool build_sim_id_ws the context is blown away with a single invocation. I'm guessing this is because the build log output is filled with things like compiler commands that don't really matter to my LLM agent. It would be nice if these tools could have a flag that the agent could set that would filter all the cruft out and just present the LLM with warnings, errors, test failures, etc.

My agent often resorts to commands like this instead:

cd /Users/cody/Desktop/MyProject && mkdir -p tmp/build_output && xcodebuild -workspace MyProject.xcworkspace -scheme MyProject -destination "id=[simulator id]" test > tmp/build_output/test_restructured_$(date +"%Y%m%d_%H%M%S").log 2>&1 && echo "Tests completed successfully" || echo "Tests failed - check log file"

and if there are issues then it will further grep into the output file to find them. For reference some of my build logs are nearly 20MB of text.

Use Cases

  • Building and testing iOS apps in a large codebase

Example Interactions

Prompt: Build and run the tests and fix the errors and warnings that you find.

codeman9 avatar Jun 11 '25 16:06 codeman9

Thanks for this. We already suppress the build output and only parse errors and warnings. But I'll test it to make sure it's still working as expected.

cameroncooke avatar Jun 12 '25 18:06 cameroncooke

I figured out that this happens mainly when the LLM doesn't put preferXcodebuild: true in the parameters and the make system is used.

codeman9 avatar Jun 18 '25 15:06 codeman9

That makes sense, the incremental build output isn't parsed like normal xcodebuild, so it's more verbose. I will improve this but experimental builds is still experimental and I'm not 100% happy with it. It's something I want to spend more time on.

cameroncooke avatar Jun 20 '25 18:06 cameroncooke

Hi everyone! I have the exact same issue with the latest version of the server. It worked before but now the LLM get only one line of the build result. I tested it with/without incremental build, and also with/without preferXcodebuild.

Any insights on this issue? I also work on a large codebase, I don't know if it can help

Here is the only error I got from the build_sim_id_ws tool:

Error: ⚠️ Warning: 
     ${SOURCE_ROOT}Warning: unknown environment variable SWIFT_DEBUG_INFORMATION_FORMAT

Aurazion avatar Jun 23 '25 09:06 Aurazion

Hi everyone! I have the exact same issue with the latest version of the server. It worked before but now the LLM get only one line of the build result. I tested it with/without incremental build, and also with/without preferXcodebuild.

Any insights on this issue? I also work on a large codebase, I don't know if it can help

Here is the only error I got from the build_sim_id_ws tool:

Error: ⚠️ Warning: 
     ${SOURCE_ROOT}Warning: unknown environment variable SWIFT_DEBUG_INFORMATION_FORMAT

What client are you using?

cameroncooke avatar Jun 23 '25 10:06 cameroncooke

Hi everyone! I have the exact same issue with the latest version of the server. It worked before but now the LLM get only one line of the build result. I tested it with/without incremental build, and also with/without preferXcodebuild. Any insights on this issue? I also work on a large codebase, I don't know if it can help Here is the only error I got from the build_sim_id_ws tool:

Error: ⚠️ Warning: 
     ${SOURCE_ROOT}Warning: unknown environment variable SWIFT_DEBUG_INFORMATION_FORMAT

What client are you using?

I'm on Cursor, and got the same issue with Claude Code or integrated agents The thing is, with integrated agents (using claude-4-sonnet), I can see the errors in addition of the warnings, but it looks like the agent doesn't see them.

Aurazion avatar Jun 23 '25 10:06 Aurazion

@Aurazion thank you for the quick reply. There is a bug in Claude Code where it only sees the first item in the response which I've raised here https://github.com/anthropics/claude-code/issues/1804

Regarding Cursor that is surprising, are you using incremental build support?

cameroncooke avatar Jun 23 '25 10:06 cameroncooke

@Aurazion would you be able to put a repo project together so I can test it? As it's not something I've seen in testing so I'm wondering if there is a specific issue that is maybe causing the parser to fail to parse errors from the build output.

cameroncooke avatar Jun 23 '25 10:06 cameroncooke

Ok so with Claude Code it's a known issue 😅 Regarding Cursor, it run build_sim_id_ws (without incremental build support), then I can see errors in the content block, but it goes into an "infinite loop", for instance:

I'll build the XXXXX project for the iPhone 16 Pro simulator to check for compilation errors.

With the same content block every time.

Aurazion avatar Jun 23 '25 10:06 Aurazion

@Aurazion would you be able to put a repo project together so I can test it? As it's not something I've seen in testing so I'm wondering if there is a specific issue that is maybe causing the parser to fail to parse errors from the build output.

It's a private repo from my company unfortunately, but I'll try to see if we can meet, and I'll try to reach out to you on X if you're available 🙏

Aurazion avatar Jun 23 '25 10:06 Aurazion

@cameroncooke I can't send you a DM on X because my account is not certified. I let you try on your side with my account on my GitHub profile if you can.

Otherwise, is there a way to filter the build output only with errors? This way I'll be able to see if this is an issue with the size of the logs (~27MB on my side)

Aurazion avatar Jun 23 '25 10:06 Aurazion

I’ll reach out to you later maybe we can jump on a call.

Cameron.

On Mon, 23 Jun 2025 at 11:46, Julien PIERRE-LOUIS @.***> wrote:

Aurazion left a comment (cameroncooke/XcodeBuildMCP#68) https://github.com/cameroncooke/XcodeBuildMCP/issues/68#issuecomment-2995924604

@cameroncooke https://github.com/cameroncooke I can't send you a DM on X because my account is not certified. I let you try on your side with my account on my GitHub profile if you can.

Otherwise, is there a way to filter the build output only with errors? This way I'll be able to see if this is an issue with the size of the logs (~27MB on my side)

— Reply to this email directly, view it on GitHub https://github.com/cameroncooke/XcodeBuildMCP/issues/68#issuecomment-2995924604, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEZ6SJBPAESB5AXGN3F52T3E7LI3AVCNFSM6AAAAAB7DBWXDCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSOJVHEZDINRQGQ . You are receiving this because you were mentioned.Message ID: @.***>

cameroncooke avatar Jun 23 '25 10:06 cameroncooke

Did y'all ever crack this nut? I love the MCP server but it's destroying my Claude Code usage allowance.

JonCrawford avatar Aug 05 '25 23:08 JonCrawford