/** * In-Memory Rate Limiter for MCP Server * * Provides per-tool rate limiting using a sliding window counter. * Designed for single-process MCP server usage. */ export interface RateLimitConfig { /** Maximum number of requests allowed in the window */ maxRequests: number; /** Window duration in milliseconds */ windowMs: number; } /** * Default rate limits per tool category */ export declare const DEFAULT_RATE_LIMITS: Record; /** * Explicit tool → category mapping. * Ensures every registered tool resolves to its intended rate limit category * instead of relying on fragile string-parsing heuristics. */ export declare const TOOL_CATEGORIES: Record; export declare class RateLimiter { private windows; private configs; constructor(configs?: Record); /** * Check if a request is allowed under the rate limit. * Returns true if allowed, false if rate limited. */ isAllowed(toolName: string): boolean; /** * Get remaining requests in current window. */ getRemaining(toolName: string): number; /** * Get time until next available request slot (in ms). * Returns 0 if requests are available now. */ getRetryAfter(toolName: string): number; /** * Reset rate limits for a specific tool or all tools. */ reset(toolName?: string): void; private getConfig; private getToolCategory; } //# sourceMappingURL=rate-limiter.d.ts.map