Skip to main content

MCPBuilder

Defined in the MCP module.
Rust AI Agent SDK Builder for MCP

Fields

NameTypeDescription
configMCPConfig-
toolsVec<MCPTool>-

Methods

name

fn name(mut self, name: impl Into<String>) -> Self
Set server name Parameters:
NameType
nameimpl Into&lt;String&gt;

server

fn server(mut self, command: impl Into<String>, args: &[&str]) -> Self
Set stdio server Parameters:
NameType
commandimpl Into&lt;String&gt;
args&[&str]

http

fn http(mut self, url: impl Into<String>) -> Self
Set HTTP server Parameters:
NameType
urlimpl Into&lt;String&gt;

websocket

fn websocket(mut self, url: impl Into<String>) -> Self
Set WebSocket server Parameters:
NameType
urlimpl Into&lt;String&gt;

config

fn config(mut self, config: MCPConfig) -> Self
Set config Parameters:
NameType
configMCPConfig

security

fn security(mut self, security: SecurityConfig) -> Self
Set security Parameters:
NameType
securitySecurityConfig

tool

fn tool(mut self, tool: MCPTool) -> Self
Add a tool (for testing) Parameters:
NameType
toolMCPTool

build

fn build(self) -> Result<MCP>
Build the MCP client

Source

View on GitHub

praisonai/src/mcp/mod.rs at line 539