> ## 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 Server • Rust AI Agent SDK

> MCPServer: MCP server for exposing tools.

# MCPServer

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

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

MCP server for exposing tools.

## Fields

| Name        | Type                     | Description          |
| ----------- | ------------------------ | -------------------- |
| `name`      | `String`                 | Server name          |
| `tools`     | `Vec&lt;MCPTool&gt;`     | Registered tools     |
| `resources` | `Vec&lt;MCPResource&gt;` | Registered resources |
| `running`   | `bool`                   | Running status       |

## Methods

### `new`

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

Create a new MCP server

**Parameters:**

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

### `register_tool`

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

Register a tool

**Parameters:**

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

### `register_resource`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn register_resource(&mut self, resource: MCPResource) -> ()
```

Register a resource

**Parameters:**

| Name       | Type          |
| ---------- | ------------- |
| `resource` | `MCPResource` |

### `tools`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn tools(&self) -> &[MCPTool]
```

Get registered tools

### `resources`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn resources(&self) -> &[MCPResource]
```

Get registered resources

### `is_running`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn is_running(&self) -> bool
```

Check if running

### `start`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
async fn start(&mut self) -> Result<()>
```

Start the server (placeholder)

### `stop`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
async fn stop(&mut self) -> Result<()>
```

Stop the server

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/mcp/mod.rs#L605">
  `praisonai/src/mcp/mod.rs` at line 605
</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" />
</CardGroup>
