Plugin

Trait Plugin 

Source
pub trait Plugin: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn on_load(&mut self, config: &JsonValue) -> Result<()>;
    fn transform_canon(&self, canon: &mut Canon) -> Result<()>;
    fn transform_output(
        &self,
        target: &str,
        value: &mut JsonValue,
    ) -> Result<()>;
}
Expand description

Trait for MCP-Sync plugins.

Plugins can hook into various stages of the sync process to transform configurations.

Required Methods§

Source

fn name(&self) -> &str

Returns the plugin name for logging and identification.

Source

fn on_load(&mut self, config: &JsonValue) -> Result<()>

Called when the plugin is loaded with its configuration.

§Arguments
  • config - Plugin-specific configuration from mcp.yaml
Source

fn transform_canon(&self, canon: &mut Canon) -> Result<()>

Transforms the canonical configuration before syncing to targets.

This hook is called once per sync operation, before any target sync.

§Arguments
  • canon - Mutable reference to the canonical configuration
Source

fn transform_output(&self, target: &str, value: &mut JsonValue) -> Result<()>

Transforms the output for a specific target before writing.

This hook is called for each target file that will be written.

§Arguments
  • target - Name of the target (e.g., “Antigravity”, “Claude”)
  • value - Mutable reference to the JSON value being written

Implementors§