Skip to content

Documentation / @agentick/mcp / SlidingWindowLimiterOptions

Interface: SlidingWindowLimiterOptions ​

Defined in: server/security/stages.ts:241

Properties ​

keyFn()? ​

optional keyFn: (ctx, op) => string

Defined in: server/security/stages.ts:251

Function that derives the rate-limit key from context + operation. Default: ${ctx.user?.id ?? "anon"}:${op.type}. Override to limit by tool name, tenant, session, or any other dimension.

Parameters ​

ctx ​

MCPRequestContext

op ​

OperationInfo

Returns ​

string


max ​

max: number

Defined in: server/security/stages.ts:245

Max requests allowed per window per key.


onReject()? ​

optional onReject: (key, retryAfterMs) => void

Defined in: server/security/stages.ts:256

Called with the rate-limit key when a request is rejected. Useful for logging / metrics. Optional.

Parameters ​

key ​

string

retryAfterMs ​

number

Returns ​

void


windowMs ​

windowMs: number

Defined in: server/security/stages.ts:243

Window duration in milliseconds.

Released under the ISC License.