#[repr(C)]pub struct PluginDeclaration {
pub api_version: *const u8,
pub list_tools: ListToolsFn,
pub execute_tool: ExecuteToolFn,
pub free_string: FreeStringFn,
pub configure: Option<ConfigureFn>,
pub init: Option<InitFn>,
pub get_config_schema: Option<GetConfigSchemaFn>,
}Expand description
Plugin declaration exported by each plugin
This structure must be exported as a static with the name plugin_declaration.
Use the declare_plugin! macro for automatic version management.
Fields§
§api_version: *const u8MCP Plugin API version the plugin was built against (e.g., “0.1.0”)
This is automatically set from the mcp-plugin-api crate version. The C ABI is stable across Rust compiler versions, so only the API version matters for compatibility checking.
list_tools: ListToolsFnReturns list of tools as JSON array
See ListToolsFn for details.
execute_tool: ExecuteToolFnExecute a tool by name
See ExecuteToolFn for details.
free_string: FreeStringFnFunction to free memory allocated by the plugin
See FreeStringFn for details.
configure: Option<ConfigureFn>Optional configuration function called after plugin is loaded
See ConfigureFn for details.
init: Option<InitFn>Optional initialization function called after configuration
See InitFn for details.
get_config_schema: Option<GetConfigSchemaFn>Optional function to get configuration schema
See GetConfigSchemaFn for details.