github-mcp-server icon indicating copy to clipboard operation
github-mcp-server copied to clipboard

Add built-in safeguards against GitHub API rate limiting

Open advancedresearcharray opened this issue 5 months ago • 1 comments

Summary

  • Adds a shared RateLimitTransport HTTP layer that throttles rapid API calls, tracks X-RateLimit-* headers, and proactively waits when quota is nearly exhausted
  • Automatically retries 429 and secondary-rate-limit 403 responses after honoring Retry-After
  • Wires the transport into stdio and HTTP server client creation so REST, GraphQL, and raw requests share per-token rate limit state

Closes #2037

Test plan

  • [x] go test ./pkg/http/transport/... -run RateLimit
  • [x] go test ./pkg/github/... -run RequestDeps_Initializes
  • [ ] Verify rapid tool invocations from an agent no longer exhaust quota as quickly
  • [ ] Confirm rate-limited responses are retried after the indicated wait period

advancedresearcharray avatar Jun 06 '26 17:06 advancedresearcharray

Merge-ready check-in

This PR looks ready for maintainer review/merge when you have a moment.

  • Change: Add built-in safeguards against GitHub API rate limiting
  • CI: green / passing
  • Review: REVIEW_REQUIRED (mergeable: MERGEABLE)

Happy to rebase or address any remaining feedback. Thanks for maintaining the project.

advancedresearcharray avatar Jun 12 '26 17:06 advancedresearcharray