Expand description
Plugin system for dynamically loading and managing MCP tools, resources, and prompts.
The plugin system allows you to:
- Load tools/resources/prompts from external libraries
- Hot reload plugins during development
- Create a plugin ecosystem with shareable components
- Sandbox untrusted plugins with WASM
§Example
use mcp_kit::prelude::*;
use mcp_kit::plugin::{McpPlugin, PluginManager};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let mut plugin_manager = PluginManager::new();
// Load plugins
plugin_manager.load_from_path("./plugins/weather.so")?;
let server = McpServer::builder()
.name("plugin-server")
.version("1.0.0")
.with_plugin_manager(plugin_manager)
.build()
.serve_stdio()
.await?;
Ok(())
}Modules§
- registry
- Plugin registry for discovering and downloading plugins
Structs§
- Plugin
Config - Configuration for a plugin instance
- Plugin
Manager - Manages plugin lifecycle and registration
- Plugin
Metadata - Metadata about a loaded plugin
- Plugin
Permissions - Plugin permissions/capabilities
- Prompt
Definition - Prompt definition from a plugin
- Resource
Definition - Resource definition from a plugin
- Tool
Definition - Tool definition from a plugin
Traits§
- McpPlugin
- Core trait that all MCP plugins must implement.