MCP Builder • Rust AI Agent SDK
MCPBuilder: Builder for MCP
MCPBuilder
Defined in the MCP module.
Rust AI Agent SDK
Builder for MCP
Fields
| Name | Type | Description |
|---|---|---|
config | MCPConfig | – |
tools | Vec<MCPTool> | – |
Methods
name
fn name(mut self, name: impl Into<String>) -> SelfSet server name
Parameters:
| Name | Type |
|---|---|
name | impl Into<String> |
server
fn server(mut self, command: impl Into<String>, args: &[&str]) -> SelfSet stdio server
Parameters:
| Name | Type |
|---|---|
command | impl Into<String> |
args | &[&str] |
http
fn http(mut self, url: impl Into<String>) -> SelfSet HTTP server
Parameters:
| Name | Type |
|---|---|
url | impl Into<String> |
websocket
fn websocket(mut self, url: impl Into<String>) -> SelfSet WebSocket server
Parameters:
| Name | Type |
|---|---|
url | impl Into<String> |
config
fn config(mut self, config: MCPConfig) -> SelfSet config
Parameters:
| Name | Type |
|---|---|
config | MCPConfig |
security
fn security(mut self, security: SecurityConfig) -> SelfSet security
Parameters:
| Name | Type |
|---|---|
security | SecurityConfig |
tool
fn tool(mut self, tool: MCPTool) -> SelfAdd a tool (for testing)
Parameters:
| Name | Type |
|---|---|
tool | MCPTool |
build
fn build(self) -> Result<MCP>Build the MCP client
Source
View on GitHubpraisonai/src/mcp/mod.rs at line 539