github-mcp-server
github-mcp-server copied to clipboard
Add built-in safeguards against GitHub API rate limiting
Summary
- Adds a shared
RateLimitTransportHTTP layer that throttles rapid API calls, tracksX-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
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.