Skip to main content

PluginDeclaration

Struct PluginDeclaration 

Source
#[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 u8

MCP 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: ListToolsFn

Returns list of tools as JSON array

See ListToolsFn for details.

§execute_tool: ExecuteToolFn

Execute a tool by name

See ExecuteToolFn for details.

§free_string: FreeStringFn

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

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.