> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Builder • Rust AI Agent SDK

> MCPBuilder: Builder for MCP

# MCPBuilder

> Defined in the [**MCP**](../modules/mcp) module.

<Badge color="orange">Rust AI Agent SDK</Badge>

Builder for MCP

## Fields

| Name     | Type                 | Description |
| -------- | -------------------- | ----------- |
| `config` | `MCPConfig`          | -           |
| `tools`  | `Vec&lt;MCPTool&gt;` | -           |

## Methods

### `name`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn name(mut self, name: impl Into<String>) -> Self
```

Set server name

**Parameters:**

| Name   | Type                      |
| ------ | ------------------------- |
| `name` | `impl Into&lt;String&gt;` |

### `server`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn server(mut self, command: impl Into<String>, args: &[&str]) -> Self
```

Set stdio server

**Parameters:**

| Name      | Type                      |
| --------- | ------------------------- |
| `command` | `impl Into&lt;String&gt;` |
| `args`    | `&[&str]`                 |

### `http`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn http(mut self, url: impl Into<String>) -> Self
```

Set HTTP server

**Parameters:**

| Name  | Type                      |
| ----- | ------------------------- |
| `url` | `impl Into&lt;String&gt;` |

### `websocket`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn websocket(mut self, url: impl Into<String>) -> Self
```

Set WebSocket server

**Parameters:**

| Name  | Type                      |
| ----- | ------------------------- |
| `url` | `impl Into&lt;String&gt;` |

### `config`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn config(mut self, config: MCPConfig) -> Self
```

Set config

**Parameters:**

| Name     | Type        |
| -------- | ----------- |
| `config` | `MCPConfig` |

### `security`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn security(mut self, security: SecurityConfig) -> Self
```

Set security

**Parameters:**

| Name       | Type             |
| ---------- | ---------------- |
| `security` | `SecurityConfig` |

### `tool`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn tool(mut self, tool: MCPTool) -> Self
```

Add a tool (for testing)

**Parameters:**

| Name   | Type      |
| ------ | --------- |
| `tool` | `MCPTool` |

### `build`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn build(self) -> Result<MCP>
```

Build the MCP client

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/mcp/mod.rs#L539">
  `praisonai/src/mcp/mod.rs` at line 539
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust MCP" icon="plug" href="/docs/rust/mcp" />

  <Card title="Rust Resources" icon="folder" href="/docs/rust/resources" />

  <Card title="Rust Agent UI" icon="display" href="/docs/rust/agent-ui-agui" />

  <Card title="Rust AGUI" icon="display" href="/docs/rust/agui" />
</CardGroup>
