Skip to content

Plugin Overview

air ships 19 built-in plugins. Add them to the use array — they execute in array order.

typescript
import { defineServer, cachePlugin, retryPlugin } from '@airmcp-dev/core';

defineServer({
  use: [retryPlugin({ maxRetries: 3 }), cachePlugin({ ttlMs: 60_000 })],
});

Plugins by category

Stability

PluginDescription
timeoutPluginTimeout warning (default: 30s)
retryPluginExponential backoff retry (default: 3 retries, 200ms)
circuitBreakerPluginBlock calls after consecutive failures (default: 5, 30s reset)
fallbackPluginCall alternate tool on failure

Performance

PluginDescription
cachePluginParam-hash caching (default: 60s TTL, 1000 entries)
dedupPluginDeduplicate concurrent identical calls (default: 1s window)
queuePluginLimit concurrent executions (default: 10, per-tool configurable)

Security

PluginDescription
authPluginAPI key or Bearer token auth
sanitizerPluginStrip HTML/control chars (default: 10000 chars)
validatorPluginCustom validation rules

Network

PluginDescription
corsPluginHTTP/SSE CORS headers
webhookPluginSend tool events to webhook URL

Data

PluginDescription
transformPluginDeclarative input/output transformation (per-tool/global)
i18nPluginResponse localization ( substitution)

Monitoring

PluginDescription
jsonLoggerPluginStructured JSON logging (ELK/Datadog compatible)
perUserRateLimitPluginPer-user rate limiting

Dev / Test

PluginDescription
dryrunPluginSkip handler (schema check / middleware testing)

Custom Plugins

Build your own — meta, middleware, hooks, tools.

Released under the Apache-2.0 License.