Skip to main content

Crate lash_plugin_mcp

Crate lash_plugin_mcp 

Source
Expand description

MCP (Model Context Protocol) integration for lash, packaged as a plugin.

lash-plugin-mcp exposes MCP-compatible servers as a normal lash tool provider. Add the plugin once at [LashCore::builder] time, supply a BTreeMap<String, McpServerConfig>, and every session built from the core gets the configured servers’ tools surfaced under mcp__<server>__<tool> names.

Supported transports (selected per server via the transport field):

  • stdio — spawn a child process and speak JSON-RPC over its pipes.
  • streamable_http — HTTP/JSON streaming transport (newer MCP spec).
  • sse — older HTTP+SSE transport.

Implementation note: the wire-level client is provided by the official rmcp SDK. The plugin owns a single connection pool (McpConnectionPool) that is shared across every session built from the same LashCore, so e.g. stdio servers are spawned once per process rather than per session.

Re-exports§

pub use config::McpServerConfig;
pub use error::McpError;
pub use plugin::McpPluginFactory;
pub use plugin::McpToolProvider;
pub use pool::McpConnectionPool;

Modules§

config
error
naming
Tool name prefixing helpers. Moved verbatim from crates/lash/src/mcp.rs so the mcp__<server>__<tool> naming scheme keeps producing identical names (avoids breaking config files / saved trajectories that reference tools by their full prefixed name).
plugin
PluginFactory for MCP integration. Holds a shared connection pool across every session built from the same LashCore.
pool
Per-core MCP connection pool.