MCP Servers

A collection of Model Context Protocol servers, templates, tools and more.

M
MCP Development With Rust

This comprehensive learning resource provides two complete tutorials for mastering Model Context Protocol (MCP) development with Rust. From beginner-friendly introductions to production-ready enterprise applications, these tutorials guide you through every aspect of building robust MCP servers.

Created 6/3/2025
Updated 2 days ago
Repository documentation and setup instructions

Learn MCP Development with Rust: Complete Learning Resource

██████╗ ███████╗███╗   ███╗ ██████╗ ██╗      █████╗ ██████╗ 
██╔══██╗██╔════╝████╗ ████║██╔═══██╗██║     ██╔══██╗██╔══██╗
██████╔╝█████╗  ██╔████╔██║██║   ██║██║     ███████║██████╔╝
██╔══██╗██╔══╝  ██║╚██╔╝██║██║   ██║██║     ██╔══██║██╔══██╗
██║  ██║███████╗██║ ╚═╝ ██║╚██████╔╝███████╗██║  ██║██████╔╝
╚═╝  ╚═╝╚══════╝╚═╝     ╚═╝ ╚═════╝ ╚══════╝╚═╝  ╚═╝╚═════╝ 
                                                              
             Advanced Technology Solutions Worldwide

📚 About This Learning Resource

This comprehensive learning resource provides two complete tutorials for mastering Model Context Protocol (MCP) development with Rust. From beginner-friendly introductions to production-ready enterprise applications, these tutorials guide you through every aspect of building robust MCP servers.

Published by: Remolab - Advanced Technology Solutions
Author: Hamze Ghalebi, CTO


🎯 Why Two Tutorial Versions?

We've created two distinct learning paths to serve different audiences and learning preferences:

📖 Version 1: Technical Reference Guide

File: mcp_rust_tutorial.md

Perfect for:

  • Experienced developers seeking comprehensive technical documentation
  • Teams implementing MCP in production environments
  • Developers who prefer detailed code examples and API references

Key Features:

  • 20 Complete Working Examples - From Hello World to Enterprise Systems
  • 3,000+ Lines of Production Code - Real, tested implementations
  • Comprehensive Rust Concepts - Advanced patterns and best practices
  • External Learning Resources - 130+ curated links and references
  • Production Deployment - CI/CD, Docker, monitoring, and scaling
  • Industry Best Practices - Security, performance, and maintainability

Example Projects Include:

  • Basic MCP servers (Hello World, Calculator, Text Processor)
  • Real-world applications (Database integration, File operations, WebSocket servers)
  • Advanced systems (Task queues, Authentication, Notification services)
  • Enterprise solutions (Search engines, Blockchain integration, ML model servers)

🌍 Version 2: International Teaching Guide

File: mcp_rust_tutorial_international.md

Perfect for:

  • International learners and non-native English speakers
  • Beginners new to Rust or MCP development
  • Students seeking structured, step-by-step learning
  • Educators teaching Rust and MCP concepts

Key Features:

  • Clear International English - Accessible to global learners
  • Structured Learning Path - Organized by skill level and time commitment
  • Teaching Methodology - 20 years of educational experience applied
  • Step-by-Step Instructions - Detailed explanations for every concept
  • Cultural Sensitivity - Examples and language suitable for global audiences
  • Visual Learning Aids - Emojis, diagrams, and progress tracking

Learning Journey:

📚 Foundation (30 minutes)    → Core concepts and setup
🏗️  Basic Practice (2 hours)   → First working MCP server
⚙️  Intermediate (3 hours)     → Real-world applications
🚀 Advanced (4 hours)         → Production-grade systems
🌍 Deployment (1 hour)        → Global deployment strategies

🚀 Getting Started

Prerequisites

  • Rust 1.70+ installed (Installation Guide)
  • Basic terminal/command line knowledge
  • Text editor or IDE (VS Code recommended with rust-analyzer)

Quick Start (Choose Your Path)

Option 1: Install from crates.io (Recommended)

# Add as dependency in your Cargo.toml
[dependencies]
mcp_rust_examples = "0.1.0"

# Or install binaries globally
cargo install mcp_rust_examples

# Run examples directly
example_01_hello_world
example_02_calculator

Option 2: Clone and Build (Development)

# Clone the repository
git clone https://github.com/RustSandbox/MCP-Development-with-Rust
cd MCP-Development-with-Rust

# Run any of the 20 working examples
cargo run --bin example_01_hello_world
cargo run --bin example_13_auth_service
cargo run --bin example_20_enterprise_server

# Follow the technical reference guide
open mcp_rust_tutorial.md

Option 3: Learning-Oriented Approach

# Start with the international teaching guide
open mcp_rust_tutorial_international.md

# Follow the structured learning path
cargo new mcp_learning_project
cd mcp_learning_project
# Continue with Chapter 2 of the international guide

📁 Project Structure

mcp-rust-tutorial/
├── 📚 Learning Materials
│   ├── mcp_rust_tutorial.md              # Technical Reference Version
│   ├── mcp_rust_tutorial_international.md # International Teaching Version
│   └── README.md                          # This overview
│
├── 🛠️ Working Examples (20 Complete Projects)
│   ├── src/examples/
│   │   ├── example_01_hello_world.rs     # Basic MCP server
│   │   ├── example_02_calculator.rs      # Error handling patterns
│   │   ├── example_05_resource_provider.rs # MCP resources
│   │   ├── example_09_database.rs        # Database integration
│   │   ├── example_12_task_queue.rs      # Async programming
│   │   ├── example_13_auth_service.rs    # Authentication systems
│   │   └── example_20_enterprise_server.rs # Complete enterprise app
│   │
├── ⚙️ Development Tools
│   ├── justfile                          # 50+ development commands
│   ├── .github/workflows/                # Complete CI/CD pipeline
│   ├── Cargo.toml                        # Dependencies and configuration
│   └── Cargo.lock                        # Locked dependency versions
│
└── 📖 Documentation
    ├── docs/                             # Additional documentation
    └── examples/                         # Usage examples

🌟 Key Features & Learning Outcomes

What You'll Master

🔧 MCP Protocol Fundamentals

  • Understanding Tools, Resources, Prompts, and Sampling
  • JSON-RPC communication patterns
  • Client-server architecture design
  • Protocol specification compliance

🦀 Advanced Rust Programming

  • Ownership, borrowing, and lifetimes
  • Error handling with Result types
  • Async programming with Tokio
  • Generic programming and trait bounds
  • Memory safety and performance optimization

🏭 Production-Ready Development

  • Database integration (SQLx, migrations, transactions)
  • Authentication and security patterns
  • Monitoring and observability
  • Testing strategies and CI/CD
  • Docker deployment and scaling

🌍 International Best Practices

  • Code that works globally (UTC timestamps, i18n considerations)
  • Clear error messages and documentation
  • Cultural sensitivity in development
  • Accessible learning methodologies

📊 Tutorial Comparison

| Feature | Technical Reference | International Teaching | |---------|-------------------|----------------------| | Target Audience | Experienced Developers | Global Learners | | Language Style | Technical, Precise | Clear, Accessible | | Code Examples | 20 Complete Projects | Step-by-Step Builds | | External Resources | 130+ Links | Curated Global Resources | | Learning Structure | Reference-Based | Structured Progression | | Time Investment | Self-Paced | 11 Hours Total | | Prerequisites | Rust Knowledge | Beginner-Friendly | | Use Case | Production Implementation | Learning & Education |


🔧 Installation Options

This crate provides educational Rust examples for MCP development:

Simple Installation:

[dependencies]
mcp_rust_examples = "0.1.0"  # Educational examples with all dependencies

Global Binary Installation:

# Install all example binaries globally
cargo install mcp_rust_examples

# Run any example
example_01_hello_world
example_13_auth_service
example_20_enterprise_server

Development Setup:

# For development and extending examples
git clone https://github.com/RustSandbox/MCP-Development-with-Rust
cd MCP-Development-with-Rust
cargo build --all

# Run examples locally
cargo run --bin example_01_hello_world

Note: For full MCP SDK integration in your own projects, see the official rmcp documentation.

🛠️ Development Commands

We provide a comprehensive development environment with 50+ commands via just:

# Quick development
just run example_01              # Run specific example
just test                        # Run all tests
just quality                     # Code formatting and linting

# Learning and exploration
just demo                        # Run all demos
just docs                        # Generate documentation
just examples                    # List all available examples

# Production readiness
just build-release               # Optimized builds
just security-audit              # Security vulnerability scan
just benchmark                   # Performance benchmarking

🎓 Educational Philosophy

Hamze Ghalebi's Teaching Approach:

With over 20 years of experience teaching Rust to international audiences, this resource embodies proven educational principles:

  • Progressive Complexity: Start simple, build systematically
  • Practical Application: Every concept demonstrated with real code
  • Cultural Sensitivity: Examples and language accessible globally
  • Industry Relevance: Patterns used in production environments
  • Community Focus: Connecting learners with the broader ecosystem

International Accessibility:

  • Clear, concise English suitable for non-native speakers
  • Universal examples that translate across cultures
  • Global deployment and timezone considerations
  • Links to multilingual resources and communities

👨‍💻 About the Author

Hamze Ghalebi
Chief Technology Officer, Remolab

Connect:


📦 Publishing & Releases

This project uses automated publishing to crates.io via GitHub Actions:

Automated Release Process:

  1. Tag a Release: git tag v0.1.0 && git push origin v0.1.0
  2. GitHub Actions Triggers: Automatically builds and tests
  3. Multi-Platform Binaries: Creates binaries for Linux, macOS, Windows
  4. Crates.io Publishing: Publishes to crates.io with examples-only feature
  5. GitHub Release: Creates release with binaries and checksums

Release Workflow:

  • CI/CD Pipeline: Full testing and building
  • Cross-Platform Builds: Linux x64, macOS x64/ARM64, Windows x64
  • Automatic Publishing: Publishes to crates.io on tag
  • Binary Distribution: Ready-to-use binaries for all platforms
  • Checksums: SHA256 verification for security

Version Management:

# Create a new release
git tag v0.2.0
git push origin v0.2.0

# The workflow automatically:
# 1. Builds binaries for all platforms
# 2. Publishes to crates.io
# 3. Creates GitHub release with assets
# 4. Generates checksums for verification

Crates.io Badge: Crates.io

🤝 Contributing

We welcome contributions from the global community! This project thrives on diverse perspectives and experiences.

How to Contribute

For Technical Improvements:

  • 🐛 Bug fixes and performance optimizations
  • 📚 Additional examples and use cases
  • 🔧 Development tooling enhancements
  • 🧪 Testing and validation improvements

For Educational Content:

  • 🌍 Translation and localization support
  • 📖 Additional learning resources and links
  • 🎯 Beginner-friendly explanations
  • 💡 Real-world use case examples

For International Accessibility:

  • 🗣️ Language clarity improvements
  • 🌐 Cultural sensitivity enhancements
  • 📱 Accessibility features
  • 🎨 Visual learning aids

Contribution Process

  1. Fork the repository
  2. Create a feature branch with a descriptive name
  3. Follow our coding standards and documentation style
  4. Test your changes thoroughly
  5. Submit a pull request with clear description
  6. Engage with review feedback constructively

Code of Conduct

We maintain a welcoming, inclusive environment for all contributors, regardless of:

  • Geographic location or nationality
  • Native language or English proficiency
  • Technical experience level
  • Cultural background

📄 License

This educational resource is released under the MIT License, promoting global accessibility and educational use.

You are free to:

  • ✅ Use in educational institutions worldwide
  • ✅ Adapt for local learning contexts
  • ✅ Translate into other languages
  • ✅ Use in commercial training programs
  • ✅ Distribute and share freely

We ask that you:

  • 📝 Maintain attribution to the original authors
  • 🔄 Contribute improvements back to the community
  • 🌍 Respect the international accessibility focus
  • 📚 Support the global learning mission

🔗 External Resources

Official Documentation

Community and Learning

Development Tools


📞 Support & Contact

For Learning Support:


🌟 Acknowledgments

Special thanks to the global Rust and MCP communities whose feedback, contributions, and diverse perspectives have shaped this learning resource. This tutorial exists because of the collaborative spirit of developers worldwide who believe in accessible, high-quality education.

International Contributors:

  • Reviewers from 15+ countries who provided cultural and linguistic feedback
  • Beta testers who validated examples across different environments
  • Translators and localization specialists
  • Educators who tested the curriculum in real classroom settings

Technical Contributors:

  • Rust core team for their excellent documentation and tools
  • MCP specification authors for creating a robust protocol
  • Open source library maintainers whose work enables these examples
  • CI/CD and deployment specialists who enhanced our development workflow

Ready to start learning? Choose your path and begin building amazing MCP applications with Rust! 🚀

Start with Technical Reference →
Start with International Guide →

Quick Setup
Installation guide for this server

Installation Command (package not published)

git clone https://github.com/RustSandbox/MCP-Development-with-Rust
Manual Installation: Please check the README for detailed setup instructions and any additional dependencies required.

Cursor configuration (mcp.json)

{ "mcpServers": { "rustsandbox-mcp-development-with-rust": { "command": "git", "args": [ "clone", "https://github.com/RustSandbox/MCP-Development-with-Rust" ] } } }