Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.agentfront.dev/llms.txt

Use this file to discover all available pages before exploring further.

Introduction to FrontMCP Plugins

Plugins extend FrontMCP servers with reusable functionality. They hook into the server lifecycle and can modify tool behavior, add new capabilities, and integrate with external services.

What Are Plugins?

Plugins are modular extensions that:
  • Add tools to your server
  • Intercept and modify tool calls
  • Provide shared services
  • Integrate with external systems

Plugin Architecture

┌─────────────────────────────────────┐
│           FrontMCP Server           │
├─────────────────────────────────────┤
│  ┌─────────┐  ┌─────────┐  ┌─────┐  │
│  │ Cache   │  │Remember │  │Code │  │
│  │ Plugin  │  │ Plugin  │  │Call │  │
│  └────┬────┘  └────┬────┘  └──┬──┘  │
│       │            │          │     │
│  ─────┴────────────┴──────────┴───  │
│              Plugin API             │
├─────────────────────────────────────┤
│                Apps                 │
│         (Tools, Resources)          │
└─────────────────────────────────────┘

Installing Plugins

npm install @frontmcp/plugins

Using Plugins

import { FrontMcp } from '@frontmcp/sdk';
import { CachePlugin } from '@frontmcp/plugins';

@FrontMcp({
  name: 'my-server',
  plugins: [
    new CachePlugin({
      ttl: 60000,
      storage: 'memory'
    })
  ]
})
export class MyServer {}

Plugin Lifecycle

Plugins hook into server lifecycle:
interface Plugin {
  name: string;

  // Called when server starts
  onInit?(server: Server): Promise<void>;

  // Called when server stops
  onDestroy?(): Promise<void>;

  // Called before each tool execution
  beforeTool?(context: ToolContext): Promise<void>;

  // Called after each tool execution
  afterTool?(context: ToolContext, result: any): Promise<any>;

  // Called on errors
  onError?(error: Error, context: ToolContext): Promise<void>;
}

Plugin Categories

CategoryExamples
CachingCache, Redis, Memcached
MemoryRemember, Context, History
ExecutionCodeCall, Sandbox, Worker
IntegrationDatabase, API, Webhook
ObservabilityLogging, Metrics, Tracing

Next Steps

Cache Plugin

Add response caching

Create Plugins

Build custom plugins