-
-
Notifications
You must be signed in to change notification settings - Fork 260
feat(build-tools): Add build pipeline workflow with 4 new tools #362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
paul-maas
wants to merge
8
commits into
getsentry:main
Choose a base branch
from
paul-maas:feature/build-tools
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a7c906d
feat(build-tools): Add build pipeline workflow with 4 new tools
paul-maas 048d4a3
feat(scripts): Add serve-mcp.sh for Docker/remote MCP access
paul-maas 4592243
fix(build-tools): Address PR review findings from Cursor Bugbot and S…
paul-maas 68a0698
fix(scripts): Handle empty args array in serve-mcp.sh
paul-maas fdb060b
fix(config): Remove Sentry MCP server and fix supergateway child spaw…
paul-maas 3cd7bba
fix(command): Enrich PATH at module level for homebrew/MacPorts tools
paul-maas 1342b10
fix(scripts): Add PID tracking and signal propagation to prevent zomb…
paul-maas 8d80ec7
fix(scripts): Add supergateway patch for unhandled async send rejection
paul-maas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,3 @@ | ||
| { | ||
| "mcpServers": { | ||
| "sentry": { | ||
| "type": "http", | ||
| "url": "https://mcp.sentry.dev/mcp" | ||
| } | ||
| } | ||
| "mcpServers": {} | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| id: codesign_app | ||
| module: mcp/tools/build-tools/codesign_app | ||
| names: | ||
| mcp: codesign_app | ||
| cli: codesign | ||
| description: Code-sign and optionally notarize a macOS application or DMG. | ||
| outputSchema: | ||
| schema: xcodebuildmcp.output.command-result | ||
| version: "1" | ||
| predicates: | ||
| - hideWhenXcodeAgentMode | ||
| annotations: | ||
| title: Code Sign App | ||
| readOnlyHint: false | ||
| destructiveHint: false | ||
| openWorldHint: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| id: create_dmg | ||
| module: mcp/tools/build-tools/create_dmg | ||
| names: | ||
| mcp: create_dmg | ||
| cli: dmg | ||
| description: Create DMG disk image from built macOS application. | ||
| outputSchema: | ||
| schema: xcodebuildmcp.output.command-result | ||
| version: "1" | ||
| predicates: | ||
| - hideWhenXcodeAgentMode | ||
| annotations: | ||
| title: Create DMG | ||
| readOnlyHint: false | ||
| destructiveHint: false | ||
| openWorldHint: false | ||
| nextSteps: | ||
| - label: Sign the app | ||
| toolId: codesign_app | ||
| priority: 1 | ||
| when: success |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| id: pfctl_anchor | ||
| module: mcp/tools/build-tools/pfctl_anchor | ||
| names: | ||
| mcp: pfctl_anchor | ||
| cli: pfctl | ||
| description: Inspect PF firewall anchor rules (read-only). Cannot modify firewall state. Requires passwordless sudo for pfctl on host. | ||
| outputSchema: | ||
| schema: xcodebuildmcp.output.command-result | ||
| version: "1" | ||
| annotations: | ||
| title: PF Anchor Inspector | ||
| readOnlyHint: true | ||
| destructiveHint: false | ||
| openWorldHint: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| id: xcodegen_generate | ||
| module: mcp/tools/build-tools/xcodegen_generate | ||
| names: | ||
| mcp: xcodegen_generate | ||
| cli: xcodegen | ||
| description: Generate Xcode project from xcodegen spec (project.yml). | ||
| outputSchema: | ||
| schema: xcodebuildmcp.output.command-result | ||
| version: "1" | ||
| predicates: | ||
| - hideWhenXcodeAgentMode | ||
| annotations: | ||
| title: Xcodegen Generate | ||
| readOnlyHint: false | ||
| destructiveHint: false | ||
| openWorldHint: false | ||
| nextSteps: | ||
| - label: Build macOS app | ||
| toolId: build_macos | ||
| priority: 1 | ||
| when: success |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| id: build-tools | ||
| title: Build Pipeline Tools | ||
| description: Extended build pipeline — project generation (xcodegen), DMG creation, code signing/notarization, and PF firewall anchor inspection. | ||
| tools: | ||
| - xcodegen_generate | ||
| - create_dmg | ||
| - codesign_app | ||
| - pfctl_anchor |
56 changes: 56 additions & 0 deletions
56
schemas/structured-output/xcodebuildmcp.output.command-result/1.schema.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "$id": "https://xcodebuildmcp.com/schemas/structured-output/xcodebuildmcp.output.command-result/1.schema.json", | ||
| "title": "Command Result", | ||
| "description": "Structured output envelope for shell command execution results.", | ||
| "type": "object", | ||
| "additionalProperties": false, | ||
| "allOf": [ | ||
| { | ||
| "$ref": "https://xcodebuildmcp.com/schemas/structured-output/_defs/common.schema.json#/$defs/errorConsistency" | ||
| } | ||
| ], | ||
| "properties": { | ||
| "schema": { | ||
| "const": "xcodebuildmcp.output.command-result" | ||
| }, | ||
| "schemaVersion": { | ||
| "const": "1" | ||
| }, | ||
| "didError": { | ||
| "type": "boolean" | ||
| }, | ||
| "error": { | ||
| "type": ["string", "null"] | ||
| }, | ||
| "data": { | ||
| "anyOf": [ | ||
| { | ||
| "type": "object", | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "command": { | ||
| "type": "string", | ||
| "description": "The tool/command that was executed" | ||
| }, | ||
| "summary": { | ||
| "$ref": "https://xcodebuildmcp.com/schemas/structured-output/_defs/common.schema.json#/$defs/statusSummary" | ||
| }, | ||
| "output": { | ||
| "type": "string", | ||
| "description": "Stdout from the command" | ||
| }, | ||
| "diagnostics": { | ||
| "$ref": "https://xcodebuildmcp.com/schemas/structured-output/_defs/common.schema.json#/$defs/basicDiagnostics" | ||
| } | ||
| }, | ||
| "required": ["command", "summary", "diagnostics"] | ||
| }, | ||
| { | ||
| "type": "null" | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| "required": ["schema", "schemaVersion", "didError", "error", "data"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| #!/usr/bin/env bash | ||
| # ensure-mcp-server.sh — Start the MCP bridge if not already running. | ||
| # | ||
| # Idempotent: safe to call on every container start, cron, or manually. | ||
| # Checks if port is already in use before spawning. | ||
| # | ||
| # Usage: | ||
| # ./scripts/ensure-mcp-server.sh # default port 9090 | ||
| # ./scripts/ensure-mcp-server.sh --port 8080 # custom port | ||
| # WORKFLOWS="build-tools" ./scripts/ensure-mcp-server.sh | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" | ||
| PORT=9090 | ||
|
|
||
| # Parse --port from args | ||
| prev_arg="" | ||
| for arg in "$@"; do | ||
| if [[ "$prev_arg" == "--port" ]]; then | ||
| PORT="$arg" | ||
| fi | ||
| prev_arg="$arg" | ||
| done | ||
|
|
||
| # --- PID file management --- | ||
| LOG_DIR="${SCRIPT_DIR}/../logs" | ||
| mkdir -p "$LOG_DIR" | ||
| LOG_FILE="${LOG_DIR}/mcp-server.log" | ||
| PID_FILE="${LOG_DIR}/mcp-server-${PORT}.pid" | ||
|
|
||
| stop_old_process() { | ||
| if [[ ! -f "$PID_FILE" ]]; then | ||
| return | ||
| fi | ||
| local old_pid | ||
| old_pid=$(cat "$PID_FILE") | ||
| if kill -0 "$old_pid" 2>/dev/null; then | ||
| echo "[ensure-mcp] Stopping previous server (PID $old_pid)..." | ||
| kill -TERM "$old_pid" 2>/dev/null || true | ||
| # Wait up to 5s for graceful shutdown (serve-mcp.sh trap propagates to children) | ||
| local i=0 | ||
| while kill -0 "$old_pid" 2>/dev/null && (( i < 10 )); do | ||
| sleep 0.5 | ||
| (( i++ )) | ||
| done | ||
| if kill -0 "$old_pid" 2>/dev/null; then | ||
| echo "[ensure-mcp] Force-killing old server (PID $old_pid)..." | ||
| kill -9 "$old_pid" 2>/dev/null || true | ||
| fi | ||
| fi | ||
| rm -f "$PID_FILE" | ||
| } | ||
|
|
||
| # Check if already running and healthy on this port | ||
| if [[ -f "$PID_FILE" ]]; then | ||
| old_pid=$(cat "$PID_FILE") | ||
| if kill -0 "$old_pid" 2>/dev/null && lsof -ti :"$PORT" -sTCP:LISTEN >/dev/null 2>&1; then | ||
| echo "[ensure-mcp] Server already running (PID $old_pid, port $PORT)" | ||
| exit 0 | ||
| fi | ||
| # Stale PID file or port not listening — clean up | ||
| stop_old_process | ||
| fi | ||
|
|
||
| # Port in use but no PID file — something else owns it | ||
| if lsof -ti :"$PORT" -sTCP:LISTEN >/dev/null 2>&1; then | ||
| echo "[ensure-mcp] ERROR: Port $PORT in use by another process" | ||
| lsof -ti :"$PORT" -sTCP:LISTEN | ||
| exit 1 | ||
| fi | ||
|
|
||
| # --- Launch --- | ||
| echo "[ensure-mcp] Starting MCP server on port $PORT..." | ||
| nohup "$SCRIPT_DIR/serve-mcp.sh" --port "$PORT" "$@" \ | ||
| >> "$LOG_FILE" 2>&1 & | ||
|
|
||
| SERVER_PID=$! | ||
| echo "$SERVER_PID" > "$PID_FILE" | ||
|
|
||
| # Wait briefly to confirm it started | ||
| sleep 2 | ||
| if kill -0 "$SERVER_PID" 2>/dev/null; then | ||
| echo "[ensure-mcp] MCP server running (PID $SERVER_PID, port $PORT)" | ||
| echo "[ensure-mcp] Log: $LOG_FILE" | ||
| else | ||
| echo "[ensure-mcp] ERROR: MCP server failed to start. Check $LOG_FILE" | ||
| rm -f "$PID_FILE" | ||
| exit 1 | ||
| fi |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated Sentry MCP config removal appears accidental
Low Severity
The Sentry MCP server configuration was removed from
.mcp.json. This change seems accidentally included, as it's unrelated to the PR's purpose of adding build-tools and isn't mentioned in the PR description.Reviewed by Cursor Bugbot for commit fdb060b. Configure here.