Created
August 26, 2025 08:19
-
-
Save RafalWilinski/a0c4a986198870b8e4d7c4d3d3e42c24 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# Script to download, unpack, and run the Buildkite MCP server | |
# Usage: ./scripts/run-buildkite-mcp-server.sh | |
set -e # Exit on any error | |
# Configuration | |
DOWNLOAD_URL="https://github.com/buildkite/buildkite-mcp-server/releases/download/v0.5.11/buildkite-mcp-server_Linux_x86_64.tar.gz" | |
ARCHIVE_NAME="buildkite-mcp-server_Linux_x86_64.tar.gz" | |
EXTRACTED_DIR="buildkite-mcp-server" | |
BINARY_NAME="buildkite-mcp-server" | |
# Create a temporary directory for downloads | |
TEMP_DIR=$(mktemp -d) | |
echo "Working in temporary directory: $TEMP_DIR" | |
# Cleanup function | |
cleanup() { | |
echo "Cleaning up temporary files..." | |
rm -rf "$TEMP_DIR" | |
} | |
trap cleanup EXIT | |
# Download the archive | |
echo "Downloading Buildkite MCP server..." | |
cd "$TEMP_DIR" | |
curl -L -o "$ARCHIVE_NAME" "$DOWNLOAD_URL" | |
if [ ! -f "$ARCHIVE_NAME" ]; then | |
echo "Error: Failed to download the archive" | |
exit 1 | |
fi | |
echo "Download completed successfully" | |
# Extract the archive | |
echo "Extracting archive..." | |
tar -xzf "$ARCHIVE_NAME" | |
# Find the binary (it might be in a subdirectory or directly in the temp dir) | |
BINARY_PATH="" | |
if [ -f "$BINARY_NAME" ]; then | |
BINARY_PATH="./$BINARY_NAME" | |
elif [ -f "$EXTRACTED_DIR/$BINARY_NAME" ]; then | |
BINARY_PATH="./$EXTRACTED_DIR/$BINARY_NAME" | |
else | |
# Search for the binary in extracted contents | |
BINARY_PATH=$(find . -name "$BINARY_NAME" -type f | head -1) | |
fi | |
if [ -z "$BINARY_PATH" ] || [ ! -f "$BINARY_PATH" ]; then | |
echo "Error: Could not find the binary '$BINARY_NAME' in the extracted archive" | |
echo "Contents of extracted archive:" | |
ls -la | |
exit 1 | |
fi | |
# Make the binary executable | |
chmod +x "$BINARY_PATH" | |
echo "Archive extracted successfully" | |
echo "Binary found at: $BINARY_PATH" | |
# Run the binary | |
echo "Running Buildkite MCP server..." | |
echo "Press Ctrl+C to stop the server" | |
echo "----------------------------------------" | |
"$BINARY_PATH" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment