You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(github-mcp): repair binary install — asset names are version-less; download via gh API octet-stream instead of blocked direct CDN
- Release tarballs are named github-mcp-server_Linux_x86_64.tar.gz (no version
in the filename), so the previous asset-name construction never matched and
install silently failed (server pointed at a missing binary).
- Direct GitHub CDN returns 404 from this network; switch to authenticated gh
API asset endpoint (Accept: application/octet-stream).
- Export GITHUB_PERSONAL_ACCESS_TOKEN (canonical env var the binary reads) in
start.sh alongside GITHUB_TOKEN; mcp.json now resolves it.
info "Installing GitHub MCP Server v${_version}..."
138
140
mkdir -p /home/lpb/.local/pi-support/bin
139
-
# Direct GitHub CDN returns 404 from some container networks — use gh API for authenticated downloads
140
-
_asset_url="$(gh api "repos/github/github-mcp-server/releases/tags/${_version}" --jq '.assets[] | select(.name=="'"$_asset_name"'") | .url'2>/dev/null)"
141
-
if [[ -n"$_asset_url" ]];then
142
-
_download_url="$(gh api "$_asset_url" --jq '.browser_download_url')"
143
-
if curl -fsSL "$_download_url" -o /tmp/github-mcp-server.tar.gz 2>/dev/null;then
141
+
# Direct GitHub CDN (github.com/.../releases/download/...) returns 404 from
142
+
# this network, and gh's .browser_download_url resolves to that same blocked
143
+
# URL. Instead download the release asset via the authenticated gh API
144
+
# octet-stream endpoint (redirects to object storage). Match by filename
145
+
# substring — full-string `==` on asset .name intermittently fails in gh's
146
+
# gojq, so use `contains`.
147
+
# Release tarball names carry NO version (github-mcp-server_Linux_x86_64.tar.gz).
148
+
# Match by the OS_ARCH substring only.
149
+
_asset_match="Linux_x86_64"
150
+
_asset_id="$(gh api "repos/github/github-mcp-server/releases/tags/${_version}" --jq '.assets[] | select(.name | contains("'"$_asset_match"'")) | .id'2>/dev/null | head -1)"
151
+
if [[ -n"$_asset_id" ]];then
152
+
if gh api -H "Accept: application/octet-stream""repos/github/github-mcp-server/releases/assets/${_asset_id}"> /tmp/github-mcp-server.tar.gz 2>/dev/null;then
144
153
tar -xzf /tmp/github-mcp-server.tar.gz -C /home/lpb/.local/pi-support/bin
145
154
chmod +x "$_github_mcp_bin"
146
155
rm -f /tmp/github-mcp-server.tar.gz
@@ -150,18 +159,8 @@ if [[ ! -x "$_github_mcp_bin" ]]; then
150
159
warn "Failed to download GitHub MCP Server binary via gh API."
151
160
fi
152
161
else
153
-
# Fallback: try direct download (may fail from some networks)
154
-
if curl -fsSL "https://github.com/github/github-mcp-server/releases/download/${_version}/${_asset_name}" \
155
-
-o /tmp/github-mcp-server.tar.gz 2>/dev/null;then
156
-
tar -xzf /tmp/github-mcp-server.tar.gz -C /home/lpb/.local/pi-support/bin
157
-
chmod +x "$_github_mcp_bin"
158
-
rm -f /tmp/github-mcp-server.tar.gz
159
-
chown -R 1000:1000 /home/lpb/.local/pi-support
160
-
info "GitHub MCP Server v${_version} installed."
161
-
else
162
-
warn "Failed to download GitHub MCP Server from release page."
0 commit comments