> ## 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.

# Plugins Overview

> Extend FrontMCP servers with cross-cutting capabilities using plugins

Plugins are powerful components that add cross-cutting functionality to your MCP servers. Instead of implementing features like caching, authentication, or observability in every tool, plugins provide reusable capabilities that work across all your tools and apps.

## Why Use Plugins?

<CardGroup cols={2}>
  <Card title="Zero Duplication" icon="clone">
    Add capabilities like caching or code execution once and apply them to all tools automatically.
  </Card>

  <Card title="Composable" icon="cubes">
    Mix and match plugins to build exactly the features you need without coupling.
  </Card>

  <Card title="Cross-App" icon="arrows-split-up-and-left">
    Plugins work across all apps in your server, providing consistent behavior everywhere.
  </Card>

  <Card title="Production-Ready" icon="rocket">
    Battle-tested implementations for common needs like caching, rate limiting, and monitoring.
  </Card>
</CardGroup>

## Official Plugins

These plugins are maintained by the FrontMCP team and included in `@frontmcp/plugins`.

<CardGroup cols={1}>
  <Card title="Remember Plugin" icon="brain" href="/frontmcp/plugins/remember-plugin">
    Encrypted session memory with scoped storage and tool approval system for secure AI agent interactions.

    **Features:**

    * Encrypted AES-256-GCM storage with HKDF-SHA256 scope-based key derivation and unique IV per entry
    * Multiple scopes: session, user, tool, global
    * Tool approval system with audit trails
    * Multiple backends: Memory, Redis, Vercel KV, Upstash
    * Branded payloads for semantic categorization

    **Best for:** Session memory, user preferences, tool permissions, conversation context
  </Card>

  <Card title="CodeCall Plugin" icon="code" href="/frontmcp/plugins/codecall/overview">
    Hide large toolsets behind a code-first meta-API. Instead of exposing hundreds of tools directly, CodeCall provides
    search, describe, and execute capabilities that let models write JavaScript plans to orchestrate your tools.

    **Features:**

    * Search and discover tools dynamically
    * Generate JavaScript execution plans
    * Defense-in-depth security with Enclave (AST validation + runtime sandboxing)
    * Multi-app tool orchestration
    * Direct invocation mode for simple cases

    **Best for:** Large toolsets, OpenAPI-generated tools, multi-app workflows, complex tool orchestration
  </Card>

  <Card title="Cache Plugin" icon="database" href="/frontmcp/plugins/cache-plugin">
    Transparently cache tool responses to reduce redundant computation and improve response times. Works with both
    in-memory and Redis backends.

    **Features:**

    * Deterministic input-based cache keys
    * Configurable TTL per tool
    * Sliding window for hot data
    * Redis support for multi-instance deployments
    * Opt-in per-tool caching

    **Best for:** Expensive computations, API rate limiting, multi-tenant data, frequently accessed resources
  </Card>
</CardGroup>

<Note>More official plugins are coming soon! Rate limiting, observability, and validation plugins are in development.</Note>

## Community Plugins

Community plugins are created and maintained by the FrontMCP community. While not officially supported, they extend FrontMCP's capabilities with specialized features.

<Warning>
  Community plugins are not maintained by the FrontMCP team. Please review the code and security practices before using
  them in production.
</Warning>

### How to Find Community Plugins

<Steps>
  <Step title="Search npm">
    Search for packages tagged with `frontmcp-plugin` or `mcp-plugin`:

    ```bash theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
    npm search frontmcp-plugin
    ```
  </Step>

  <Step title="Check GitHub Topics">
    Browse repositories tagged with [`frontmcp-plugin`](https://github.com/topics/frontmcp-plugin) on GitHub.
  </Step>

  <Step title="Join the Community">
    Visit the [FrontMCP Discussions](https://github.com/agentfront/frontmcp/discussions) to discover and share plugins.
  </Step>
</Steps>

### Featured Community Plugins

<Info>
  This section is for community-contributed plugins. If you've created a plugin, submit a PR to add it here!
</Info>

<CardGroup cols={2}>
  <Card title="Submit Your Plugin" icon="plus" href="https://github.com/agentfront/frontmcp/discussions">
    Created a plugin? Share it with the community! Submit a PR to add your plugin to this page.
  </Card>

  <Card title="Plugin Template" icon="code-branch" href="https://github.com/agentfront/frontmcp/tree/main/libs/plugins">
    Use the official plugin structure as a template for building your own plugins.
  </Card>
</CardGroup>

## Creating Custom Plugins

You can create custom plugins to add any cross-cutting capability to FrontMCP. Plugins use the `@Plugin` decorator, extend `DynamicPlugin`, and hook into the tool execution lifecycle via `@ToolHook` decorators.

### Basic Plugin Structure

```ts theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
import { DynamicPlugin, Plugin, ToolHook, FlowCtxOf } from '@frontmcp/sdk';

@Plugin({
  name: 'my-plugin',
  description: 'My custom plugin',
})
export default class MyCustomPlugin extends DynamicPlugin {
  // Runs BEFORE tool execution
  @ToolHook.Will('execute', { priority: 1000 })
  async beforeExecute(flowCtx: FlowCtxOf<'tools:call-tool'>) {
    const { tool, toolContext } = flowCtx.state;
    if (!tool || !toolContext) return;
    console.log(`About to execute tool: ${tool.fullName}`);
  }

  // Runs AFTER tool execution
  @ToolHook.Did('execute', { priority: 1000 })
  async afterExecute(flowCtx: FlowCtxOf<'tools:call-tool'>) {
    const { tool, toolContext } = flowCtx.state;
    if (!tool || !toolContext) return;
    console.log(`Tool ${tool.fullName} completed`);
  }
}
```

### Plugin Best Practices

<AccordionGroup>
  <Accordion title="1. Minimal Overhead">
    * Keep plugin logic lightweight
    * Avoid blocking operations in hooks
    * Use async operations efficiently
    * Cache expensive computations
    * Consider performance impact on every tool call
  </Accordion>

  <Accordion title="2. Error Handling">
    * Always handle errors gracefully
    * Provide clear error messages
    * Don't swallow errors silently
    * Log failures appropriately
    * Consider fallback strategies
  </Accordion>

  <Accordion title="3. Configuration">
    * Support both plugin-level and tool-level configuration
    * Provide sensible defaults
    * Make features opt-in when possible
    * Document all configuration options
    * Validate configuration at initialization
  </Accordion>

  <Accordion title="4. Composability">
    * Don't assume other plugins are present
    * Avoid global state
    * Use dependency injection for shared resources
    * Document plugin interactions
    * Test with common plugin combinations
  </Accordion>

  <Accordion title="5. Documentation">
    * Provide clear usage examples
    * Document hooks and lifecycle
    * Explain performance characteristics
    * Include migration guides
    * Show integration with common tools
  </Accordion>
</AccordionGroup>

### Publishing Your Plugin

When publishing a community plugin:

1. **Package Name:** Use the pattern `@yourscope/frontmcp-plugin-name` or `frontmcp-plugin-name`
2. **Keywords:** Include `frontmcp`, `frontmcp-plugin`, `mcp`, `plugin`
3. **README:** Include installation, usage, examples, and performance considerations
4. **License:** Use a permissive license (MIT, Apache 2.0, etc.)
5. **Tests:** Include comprehensive test coverage including hook behavior
6. **TypeScript:** Provide TypeScript types and declarations

```json package.json theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
{
  "name": "@yourscope/frontmcp-plugin-myfeature",
  "version": "1.0.0",
  "description": "FrontMCP plugin for MyFeature",
  "keywords": ["frontmcp", "frontmcp-plugin", "mcp", "plugin", "myfeature"],
  "peerDependencies": {
    "@frontmcp/sdk": "^0.4.0"
  }
}
```

## Plugin Comparison

Choose the right plugin for your use case:

| Plugin       | Best For                  | Overhead | Scope        | Complexity  |
| ------------ | ------------------------- | -------- | ------------ | ----------- |
| **Remember** | Session memory, approvals | Low      | Per-session  | Low         |
| **CodeCall** | Large toolsets, workflows | Low      | Cross-app    | Medium      |
| **Cache**    | Expensive operations      | Minimal  | Per-tool     | Low         |
| **Custom**   | Any cross-cutting feature | Varies   | Configurable | Medium-High |

## Next Steps

<CardGroup cols={2}>
  <Card title="Remember Plugin" icon="brain" href="/frontmcp/plugins/remember-plugin">
    Learn how to use session memory and approvals
  </Card>

  <Card title="CodeCall Plugin" icon="code" href="/frontmcp/plugins/codecall/overview">
    Learn how to use the CodeCall plugin
  </Card>

  <Card title="Cache Plugin" icon="database" href="/frontmcp/plugins/cache-plugin">
    Learn how to use the Cache plugin
  </Card>

  <Card title="Join Community" icon="users" href="https://github.com/agentfront/frontmcp/discussions">
    Get help and share your plugins
  </Card>
</CardGroup>

## Resources

<CardGroup cols={2}>
  <Card title="SDK Documentation" icon="book-open" href="/frontmcp/getting-started/welcome">
    Learn about the FrontMCP SDK and plugin interfaces
  </Card>

  <Card title="Source Code" icon="github" href="https://github.com/agentfront/frontmcp/tree/main/libs/plugins">
    View the official plugins source code
  </Card>

  <Card title="npm Package" icon="npm" href="https://www.npmjs.com/package/@frontmcp/plugins">
    Install the official plugins package
  </Card>

  <Card title="Contributing Guide" icon="code-pull-request" href="https://github.com/agentfront/frontmcp/blob/main/CONTRIBUTING.md">
    Contribute to FrontMCP plugins
  </Card>
</CardGroup>

## Related Guides

<CardGroup cols={2}>
  <Card title="Enclave" icon="shield-halved" href="https://github.com/agentfront/enclave">
    Secure code execution with Enclave (available as a separate repository)
  </Card>

  <Card title="AST Guard" icon="shield-check" href="https://github.com/agentfront/enclave/tree/main/libs/ast-guard">
    AST validation and security rules (available as a separate repository)
  </Card>
</CardGroup>
