← Prompts
Reference Copilot Instructions Collection

Best practices for building Model Context Protocol servers in Rust using the official rmcp SDK with async/await patterns

Best practices for building Model Context Protocol servers in Rust using the official rmcp SDK with async/await patterns

# Rust MCP Server Development Best Practices

This guide provides best practices for building Model Context Protocol (MCP) servers using the official Rust SDK (`rmcp`).

## Installation and Setup

### Add Dependencies

Add the `rmcp` crate to your `Cargo.toml`:

```toml
[dependencies]
rmcp = { version = "0.8.1", features = ["server"] }
tokio = { version = "1", features = ["full"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
anyhow = "1.0"
tracing = "0.1"
tracing-subscriber = "0.3"
```

For macros support:

```toml
[dependencies]

Sign in to view the full prompt.

Sign In

Classification

Reference Documentation, cheatsheets, setup guides
Scope Project
This codebase
Manual Manually placed / Persistent