Skip to content

Conversation

@dcramer
Copy link
Member

@dcramer dcramer commented Oct 31, 2025

Implements rate limiting for MCP clients at 60 requests per minute per IP to protect against high traffic volumes. Built on Cloudflare rate limit bindings with privacy-preserving SHA-256 IP hashing.

Key changes:

  • Add MCP_RATE_LIMITER binding (60 req/60s per IP)
  • Create reusable rate-limiter utility with graceful degradation
  • Create client-ip utility for consistent IP extraction across routes
  • Apply rate limiting before OAuth processing in index.ts
  • Update app.ts and search.ts to use centralized IP extraction
  • Add error handling and Sentry logging when IP cannot be extracted
  • Update tests to include required CF-Connecting-IP headers

🤖 Generated with Claude Code

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

Implements rate limiting for MCP clients at 60 requests per minute per IP
to protect against high traffic volumes. Built on Cloudflare rate limit
bindings with privacy-preserving SHA-256 IP hashing.

Key changes:
- Add MCP_RATE_LIMITER binding (60 req/60s per IP)
- Create reusable rate-limiter utility with graceful degradation
- Create client-ip utility for consistent IP extraction across routes
- Apply rate limiting before OAuth processing in index.ts
- Update app.ts and search.ts to use centralized IP extraction
- Add error handling and Sentry logging when IP cannot be extracted
- Update tests to include required CF-Connecting-IP headers

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Code <noreply@anthropic.com>
@dcramer dcramer merged commit a6a5a76 into main Oct 31, 2025
14 checks passed
@dcramer dcramer deleted the rate-limit-mcp branch October 31, 2025 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants