Skip to main content
The Approval Plugin provides Claude Code-style permission management for FrontMCP servers, enabling fine-grained tool authorization with PKCE webhook security.

Why Use Approval?

Tool Permissions

Claude Code-style approval system for sensitive tool execution

Multiple Scopes

Session, user, time-limited, and context-specific approvals

PKCE Security

RFC 7636 PKCE webhooks for secure external approval systems

Audit Trail

Full audit log with grantor/revoker tracking

Installation

How It Works

1

Tool Configuration

Mark tools requiring approval with approval: { required: true } in metadata
2

Approval Check Hook

Before tool execution, the plugin checks if approval exists
3

Approval Request

If not approved, throws ApprovalRequiredError for client handling
4

Grant/Revoke

Approvals are granted via this.approval methods or external webhooks

Quick Start

Basic Setup

Require Approval on Tools

Using the Approval Service

The plugin extends all execution contexts with this.approval:

Approval Scopes


Plugin Options

Basic Configuration

Recheck Mode (Default)

In recheck mode, the plugin polls an external API for approval status:

Webhook Mode with PKCE

For secure external approval systems using PKCE (RFC 7636):

Tool Approval Options

boolean
default:"true"
Whether this tool requires approval before execution
ApprovalScope
default:"'session'"
Default scope for approvals: session, user, time_limited, tool_specific, context_specific
ApprovalScope[]
Restrict which scopes are allowed for this tool
number
Maximum TTL for time-limited approvals (milliseconds)
string
Category for grouping: read, write, delete, execute, admin
string
Risk level hint: low, medium, high, critical
string
Message shown to user when prompting for approval
boolean
default:"false"
Prompt every time, even if previously approved (for highly sensitive operations)
boolean
default:"false"
Skip approval entirely (for safe, read-only operations)
ApprovalContext[]
Contexts that are pre-approved (bypass approval check)

API Reference

ApprovalService Methods

Promise<boolean>
Check if a tool is approved for execution
Promise<void>
Grant session-scoped approval
Promise<void>
Grant user-scoped approval (persists across sessions)
Promise<void>
Grant time-limited approval
Promise<void>
Revoke an existing approval
Promise<ApprovalRecord | undefined>
Get the current approval record for a tool

Approval Audit Trail

Every approval records who granted it and how:

Grantor Factory Functions

Create typed grantors for audit trails:

PKCE Webhook Flow

For external approval systems, the plugin implements RFC 7636 PKCE:

Webhook Request

The plugin sends to your webhook URL:

Callback Response

Your approval system responds to the callback URL:
The sessionId is never sent to external webhooks. PKCE ensures only the original requester can complete the approval flow.

Storage Options

The storage option uses the StorageConfig type from @frontmcp/utils and supports memory, redis, vercel-kv, upstash, and auto.

Auto-Detect (Default)

Memory Storage

Memory storage resets when the process restarts.

Redis Storage

Use Existing Storage Instance


Best Practices

  • Session: Default, most restrictive - good for sensitive operations
  • User: For tools the user has explicitly trusted
  • Time-limited: For temporary elevated access
  • Context-specific: For repository/project-specific permissions
Mark tools with appropriate risk levels to help users make informed decisions:
When integrating with external approval systems, always use webhook mode with PKCE to prevent session hijacking.
Always provide meaningful reason and grantedBy information for compliance and debugging:

Complete Example


Source Code

View the approval plugin source code

Remember Plugin

For session memory storage

Plugin Guide

Learn more about FrontMCP plugins

PKCE RFC 7636

PKCE specification