MCP Builder • Rust AI Agent SDK

MCPBuilder: Builder for MCP

MCPBuilder

Defined in the MCP module.

Rust AI Agent SDK

Builder for MCP

Fields

NameTypeDescription
configMCPConfig–
toolsVec<MCPTool>–

Methods

name

rust
fn name(mut self, name: impl Into<String>) -> Self

Set server name

Parameters:

NameType
nameimpl Into&lt;String&gt;

server

rust
fn server(mut self, command: impl Into<String>, args: &[&str]) -> Self

Set stdio server

Parameters:

NameType
commandimpl Into&lt;String&gt;
args&[&str]

http

rust
fn http(mut self, url: impl Into<String>) -> Self

Set HTTP server

Parameters:

NameType
urlimpl Into&lt;String&gt;

websocket

rust
fn websocket(mut self, url: impl Into<String>) -> Self

Set WebSocket server

Parameters:

NameType
urlimpl Into&lt;String&gt;

config

rust
fn config(mut self, config: MCPConfig) -> Self

Set config

Parameters:

NameType
configMCPConfig

security

rust
fn security(mut self, security: SecurityConfig) -> Self

Set security

Parameters:

NameType
securitySecurityConfig

tool

rust
fn tool(mut self, tool: MCPTool) -> Self

Add a tool (for testing)

Parameters:

NameType
toolMCPTool

build

rust
fn build(self) -> Result<MCP>

Build the MCP client

Source

View on GitHub

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


Related Documentation