@@ -130,22 +130,35 @@ export GITHUB_TOOLSETS="${GITHUB_TOOLSETS:-${LPB_GITHUB_TOOLSETS:-all}}"
130130_github_mcp_bin= " /home/lpb/.local/pi-support/bin/github-mcp-server"
131131if [[ ! -x " $_github_mcp_bin " ]]; then
132132 _version=" ${LPB_GITHUB_MCP_SERVER_VERSION:- v1.8.0} "
133+ _asset_name=" github-mcp-server_${_version# v} _Linux_x86_64.tar.gz"
133134 info " Installing GitHub MCP Server v${_version} ..."
134135 mkdir -p /home/lpb/.local/pi-support/bin
135- if curl -fsSL " https://github.com/github/github-mcp-server/releases/download/${_version} /github-mcp-server_${_version# v} _Linux_x86_64.tar.gz" \
136- -o /tmp/github-mcp-server.tar.gz 2> /dev/null; then
137- tar -xzf /tmp/github-mcp-server.tar.gz -C /home/lpb/.local/pi-support/bin
138- chmod +x " $_github_mcp_bin "
139- rm -f /tmp/github-mcp-server.tar.gz
140- chown -R 1000:1000 /home/lpb/.local/pi-support
141- info " GitHub MCP Server v${_version} installed."
136+ # Direct GitHub CDN returns 404 from some networks — use gh API for authenticated downloads
137+ _asset_url=" $( gh api " repos/github/github-mcp-server/releases/tags/${_version} " --jq ' .assets[] | select(.name=="' " $_asset_name " ' ") | .url' 2> /dev/null) "
138+ if [[ -n " $_asset_url " ]]; then
139+ _download_url=" $( gh api " $_asset_url " --jq ' .browser_download_url' ) "
140+ if curl -fsSL " $_download_url " -o /tmp/github-mcp-server.tar.gz 2> /dev/null; then
141+ tar -xzf /tmp/github-mcp-server.tar.gz -C /home/lpb/.local/pi-support/bin
142+ chmod +x " $_github_mcp_bin "
143+ rm -f /tmp/github-mcp-server.tar.gz
144+ chown -R 1000:1000 /home/lpb/.local/pi-support
145+ info " GitHub MCP Server v${_version} installed."
146+ else
147+ warn " Failed to download GitHub MCP Server binary via API."
148+ fi
142149 else
143- warn " Failed to download GitHub MCP Server binary from release page."
144- warn " Please ensure the release exists: https://github.com/github/github-mcp-server/releases"
145- warn " You can manually install it with:"
146- warn " curl -fsSL 'https://github.com/github/github-mcp-server/releases/download/${_version} /github-mcp-server_${_version# v} _Linux_x86_64.tar.gz' -o /tmp/github-mcp-server.tar.gz"
147- warn " tar -xzf /tmp/github-mcp-server.tar.gz -C /home/lpb/.local/pi-support/bin"
148- warn " chmod +x /home/lpb/.local/pi-support/bin/github-mcp-server"
150+ # Fallback: try direct download (may fail from some networks)
151+ if curl -fsSL " https://github.com/github/github-mcp-server/releases/download/${_version} /${_asset_name} " \
152+ -o /tmp/github-mcp-server.tar.gz 2> /dev/null; then
153+ tar -xzf /tmp/github-mcp-server.tar.gz -C /home/lpb/.local/pi-support/bin
154+ chmod +x " $_github_mcp_bin "
155+ rm -f /tmp/github-mcp-server.tar.gz
156+ chown -R 1000:1000 /home/lpb/.local/pi-support
157+ info " GitHub MCP Server v${_version} installed."
158+ else
159+ warn " Failed to download GitHub MCP Server from release page."
160+ warn " Manually install with: curl -fsSL 'https://github.com/github/github-mcp-server/releases/download/${_version} /${_asset_name} ' -o /tmp/github-mcp-server.tar.gz && tar -xzf /tmp/github-mcp-server.tar.gz -C /home/lpb/.local/pi-support/bin && chmod +x /home/lpb/.local/pi-support/bin/github-mcp-server"
161+ fi
149162 fi
150163else
151164 debug " GitHub MCP Server already installed at $_github_mcp_bin "
0 commit comments