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..ebd50bc6 100755 --- a/install-mcp.sh +++ b/install-mcp.sh @@ -60,7 +60,18 @@ 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 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") \ || error "Failed to fetch releases from https://github.com/${REPO}/releases" # Find the first release that contains an fff-mcp binary for our platform