Examples Overview
This section provides practical examples demonstrating the key features and capabilities of the SCIM Server library. Each example is designed to showcase specific functionality with clear, executable code that you can run and modify.
How to Use These Examples
All examples are located in the examples/
directory of the repository. Each example can be run directly:
# Basic examples
cargo run --example basic_usage
cargo run --example multi_tenant_example
# MCP examples (require mcp feature)
cargo run --example mcp_server_example --features mcp
Example Categories
🚀 Core Examples
Learn the fundamental building blocks of SCIM server implementation:
- Basic Usage - Essential CRUD operations with users and groups
- Multi-Tenant Server - Complete tenant isolation and management
- Group Management - Working with groups and member relationships
🔧 Advanced Features
Explore sophisticated server capabilities:
- ETag Concurrency Control - Prevent data conflicts with version control
- Operation Handlers - Framework-agnostic request/response handling
- Builder Pattern Configuration - Flexible server setup and configuration
🤖 MCP Integration (AI Agents)
See how AI agents can interact with your SCIM server:
- MCP Server - Expose SCIM operations as AI tools
- MCP with ETag Support - Version-aware AI operations
- Simple MCP Demo - Quick AI integration setup
- MCP STDIO Server - Standard I/O protocol server
🔐 Security & Authentication
Implement robust security patterns:
- Compile-Time Auth - Type-safe authentication patterns
- Role-Based Access Control - Advanced permission management
🛠️ Infrastructure & Operations
Production-ready operational patterns:
- Logging Backends - Structured logging with multiple backends
- Logging Configuration - Comprehensive logging setup
- Provider Modes - Different provider implementation patterns
- Automated Capabilities - Dynamic capability discovery
Learning Path
New to SCIM? Start with Basic Usage to understand core concepts.
Building multi-tenant systems? Progress to Multi-Tenant Server for isolation patterns.
Adding AI capabilities? Explore the MCP Integration examples starting with Simple MCP Demo.
Production deployment? Review ETag Concurrency Control and logging examples.
Running Examples
Prerequisites
- Rust 1.75 or later
- Clone the scim-server repository
Basic Examples
cd scim-server
cargo run --example basic_usage
MCP Examples
# Enable MCP feature for AI integration examples
cargo run --example mcp_server_example --features mcp
Development Setup
# Run with logging to see detailed output
RUST_LOG=debug cargo run --example multi_tenant_example
Key Concepts Demonstrated
Each example showcases different aspects of the SCIM Server library:
ScimServer
- Central orchestration componentResourceProvider
- Business logic abstractionStorageProvider
- Data persistence layer- Multi-Tenant Context - Tenant isolation
- Schema System - Validation and extensions
- MCP Integration - AI agent support
Related Documentation
- Getting Started Guide - Step-by-step tutorials
- Architecture Overview - System design principles
- API Reference - Complete API documentation
Contributing Examples
Have an interesting use case or pattern? Examples are welcome! See the contribution guidelines for details on adding new examples.