> ## 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.

# Transport Config • Rust AI Agent SDK

> TransportConfig: Transport configuration for MCP.

# TransportConfig

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

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

Transport configuration for MCP.

## Fields

| Name             | Type                   | Description                      |
| ---------------- | ---------------------- | -------------------------------- |
| `transport_type` | `TransportType`        | Transport type                   |
| `command`        | `Option&lt;String&gt;` | Command for stdio transport      |
| `args`           | `Vec&lt;String&gt;`    | Arguments for stdio transport    |
| `url`            | `Option&lt;String&gt;` | URL for HTTP/WebSocket transport |
| `headers`        | `HashMap&lt;String`    | Headers for HTTP transport       |
| `env`            | `HashMap&lt;String`    | Environment variables            |
| `timeout`        | `u32`                  | Connection timeout in seconds    |

## Methods

### `stdio`

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

Create a new stdio transport config

**Parameters:**

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

### `http`

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

Create a new HTTP transport config

**Parameters:**

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

### `websocket`

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

Create a new WebSocket transport config

**Parameters:**

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

### `env`

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

Add an environment variable

**Parameters:**

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

### `header`

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

Add a header

**Parameters:**

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

### `timeout`

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

Set timeout

**Parameters:**

| Name      | Type  |
| --------- | ----- |
| `timeout` | `u32` |

## Source

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

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Configuration" icon="gear" href="/docs/rust/configuration" />

  <Card title="Rust Installation" icon="download" href="/docs/rust/installation" />
</CardGroup>
