Define a plugin
What plugins can do
- Register providers (and export them to the host app)
- Contribute adapters, tools, resources, prompts
- Participate in lifecycle via hooks (see Advanced → Hooks)
import { Plugin } from '@frontmcp/sdk';
@Plugin({
name: 'Cache Plugin',
description: 'Adds transparent response caching for tools/resources',
providers: [CacheProvider], // plugin-scoped providers
exports: [CacheProvider], // re-export to host app
adapters: [SpecNormalizerAdapter], // optionally attach adapters
tools: [WarmCacheTool], // and tools/resources/prompts if desired
resources: [],
prompts: [],
})
export default class CachePlugin {}
@App({
name: 'Billing',
plugins: [CachePlugin, ObservabilityPlugin],
})
export default class BillingApp {}
Was this page helpful?