-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Description
Overview
Every MCP tool call currently makes a live Google Maps API request. Adding a cache layer and rate limiting will reduce latency, lower API costs, and prevent quota exhaustion.
Proposed Work
Caching
- Introduce an in-memory LRU cache (e.g.,
lru-cache) keyed on the serialized request parameters - Configurable TTL per tool (e.g., place details can be cached longer than nearby search)
- Cache bypass via an optional
noCacheparameter or environment variable
Rate Limiting
- Respect Google Maps API quotas (requests per second / per day)
- Implement a simple token-bucket or sliding-window rate limiter
- Return a graceful error message when the rate limit is reached rather than crashing
Configuration
- Expose cache TTL and rate limit settings via environment variables with sensible defaults
Acceptance Criteria
- Repeated identical requests within TTL are served from cache without a network call
- Exceeding the configured rate limit returns a structured error to the MCP client
- All settings have documented defaults in README
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels