Skip to main content
A plugin groups related tools with shared authentication. This guide walks through building one from scratch, using the GitHub plugin as a reference.

Plugin structure

Every plugin exports a Plugin object created by definePlugin:

Tool definition

Each tool is defined with defineTool:

Handler context

The handler receives a PluginContext with five properties:

Requesting approval

For destructive tools, call ctx.elicit() before performing the action:
ctx.elicit() takes a single object with: Returns { executionId, approved, data? }.

Registering your plugin

Register the plugin as a source via the server API: