Skip to main content

hyperlane_plugin_mcp/
type.rs

1use super::*;
2
3/// Boxed `Send` future returned by an async MCP tool handler.
4pub type McpToolFuture = Pin<Box<dyn Future<Output = Result<McpToolResult, McpError>> + Send>>;
5
6/// Thread-safe async MCP tool handler receiving tool arguments JSON.
7pub type McpToolHandler = Arc<dyn Fn(Value) -> McpToolFuture + Send + Sync>;
8
9/// Boxed `Send` future returned by an async MCP resource reader.
10pub type McpResourceFuture =
11    Pin<Box<dyn Future<Output = Result<McpResourceContent, McpError>> + Send>>;
12
13/// Thread-safe async MCP resource reader receiving the requested URI.
14pub type McpResourceHandler = Arc<dyn Fn(String) -> McpResourceFuture + Send + Sync>;
15
16/// Boxed `Send` future returned by an async MCP prompt renderer.
17pub type McpPromptFuture = Pin<Box<dyn Future<Output = Result<Value, McpError>> + Send>>;
18
19/// Thread-safe async MCP prompt handler receiving optional prompt arguments JSON.
20pub type McpPromptHandler = Arc<dyn Fn(Value) -> McpPromptFuture + Send + Sync>;