From 079b8d8c985fa6f3044202bc9d776c2b95fc6cfa Mon Sep 17 00:00:00 2001 From: Dmitriy Kovalenko Date: Tue, 19 May 2026 17:28:48 -0700 Subject: [PATCH 1/2] fix: use GITHUB_TOKEN in install-mcp.sh to avoid rate limiting (#486) Co-Authored-By: Claude Sonnet 4.5 --- README.md | 6 ++++++ install-mcp.sh | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 11b2c3fd..4623589d 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,12 @@ irm https://raw.githubusercontent.com/dmtrKovalenko/fff.nvim/main/install-mcp.ps The scripts live at [`install-mcp.sh`](./install-mcp.sh) and [`install-mcp.ps1`](./install-mcp.ps1) if you want to read them first. +> **Note**: If you hit GitHub API rate limiting (403 errors), set `GITHUB_TOKEN` with a [personal access token](https://github.com/settings/tokens) to get 5000 requests/hour instead of 60: +> ```bash +> export GITHUB_TOKEN=ghp_your_token_here +> curl -L https://dmtrkovalenko.dev/install-fff-mcp.sh | bash +> ``` + It prints the exact wiring instructions for your client. Once the server is connected, ask the agent to "use fff" and it picks up the `ffgrep`, `fffind`, and `fff-multi-grep` tools. ### Recommended agent prompt diff --git a/install-mcp.sh b/install-mcp.sh index c63f26c5..daf1a752 100755 --- a/install-mcp.sh +++ b/install-mcp.sh @@ -60,7 +60,14 @@ detect_platform() { get_latest_release_tag() { local target="$1" local releases_json - releases_json=$(curl -fsSL "https://api.github.com/repos/${REPO}/releases") \ + local curl_args=(-fsSL) + + # Use GitHub token if available to avoid rate limiting + if [ -n "${GITHUB_TOKEN:-}" ]; then + curl_args+=(-H "Authorization: token $GITHUB_TOKEN") + fi + + releases_json=$(curl "${curl_args[@]}" "https://api.github.com/repos/${REPO}/releases") \ || error "Failed to fetch releases from https://github.com/${REPO}/releases" # Find the first release that contains an fff-mcp binary for our platform From 8690e1aeefecd807e4941ff0773b718e126d5946 Mon Sep 17 00:00:00 2001 From: Dmitriy Kovalenko Date: Wed, 20 May 2026 13:53:26 -0700 Subject: [PATCH 2/2] fix: use gh auth token instead of GITHUB_TOKEN env in install-mcp.sh --- install-mcp.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/install-mcp.sh b/install-mcp.sh index daf1a752..ebd50bc6 100755 --- a/install-mcp.sh +++ b/install-mcp.sh @@ -62,9 +62,13 @@ get_latest_release_tag() { local releases_json local curl_args=(-fsSL) - # Use GitHub token if available to avoid rate limiting - if [ -n "${GITHUB_TOKEN:-}" ]; then - curl_args+=(-H "Authorization: token $GITHUB_TOKEN") + # Use gh CLI token if available to avoid rate limiting + if command -v gh &>/dev/null; then + local gh_token + gh_token="$(gh auth token 2>/dev/null || true)" + if [ -n "$gh_token" ]; then + curl_args+=(-H "Authorization: token $gh_token") + fi fi releases_json=$(curl "${curl_args[@]}" "https://api.github.com/repos/${REPO}/releases") \