Documentation
MCP-RS Documentation
Model Context Protocol implementation in Rust - Production Ready
Overview
π Production-Ready Rust implementation of the Model Context Protocol (MCP) for AI-agent integration with WordPress and beyond.
MCP-RS provides a comprehensive, battle-tested implementation of the MCP (Model Context Protocol) in Rust with complete WordPress integration. Built with a layered architecture, it enables AI agents to perform sophisticated content management through a standardized JSON-RPC interface.
Key Features
π Core Capabilities
- JSON-RPC 2.0 Server: Full-featured JSON-RPC server implementation using
axum - Core Runtime Module: Advanced application lifecycle and resource management
- Multi-Transport Support: Stdio, HTTP, and WebSocket communication protocols
- WebSocket Enhancements (v0.16.0):
- Server mode with connection management and health checks
- LLM streaming (OpenAI GPT-4, Anthropic Claude 3.5 Sonnet)
- Connection pooling with 3 load balancing algorithms (RoundRobin, LeastConnections, Random)
- Real-time metrics, rate limiting (TokenBucket, LeakyBucket, SlidingWindow), and compression (gzip/deflate)
- Plugin Isolation System (v0.16.0):
- Docker runtime support for container-based plugin execution
- Inter-plugin communication with Pub/Sub messaging
- Advanced error handling with circuit breakers and automatic retry
- Enhanced monitoring with resource tracking and performance metrics
- Type-Safe Configuration: TOML-based configuration with environment variable override
- Production-Ready Error Handling: Comprehensive error types with structured logging
- Async/Await: Built on
tokiofor high-performance async operations
π Enterprise-Grade Security (100% Complete - 7 Layers)
- π RBAC (Role-Based Access Control): Fine-grained access control with role hierarchy, column-level permissions, and data masking
- π AES-GCM-256 Encryption: Military-grade encryption with PBKDF2 key derivation (100K iterations)
- β‘ Token Bucket Rate Limiting: Advanced DDoS protection with configurable limits
- π TLS 1.2+ Enforcement: Mandatory secure transport with certificate validation
- π‘οΈ SQL Injection Protection: 11 attack pattern detection with parameterized queries
- π« XSS Attack Protection: 14 attack pattern detection with HTML sanitization
- π Comprehensive Audit Logging: All security events recorded with tamper-resistant logging
ποΈ Database Integration (Production Ready)
- Multi-Engine Support: PostgreSQL, MySQL, Redis, MongoDB, SQLite
- π Dynamic Engine Switching: Zero-downtime switching with intelligent failover
- Enterprise Security: 6-layer security architecture for all database operations
- Advanced Features: Connection pooling, transaction management, schema introspection
- Performance Monitoring: Real-time health checks and query optimization
- Multi-Engine Workflows: Cache-aside patterns and hybrid data architectures
π― WordPress Integration (27 Tools)
- π Content Management: Complete post and page management with SEO support
- πΌοΈ Media Management: Upload, manage, and set featured images
- π·οΈ Taxonomy Management: Categories and tags with hierarchical support
- π¬ Rich Content: YouTube embeds and social media integration
Quick Navigation
π Documentation Sections
- Architecture - System design and technical architecture
- API Reference - Complete API documentation
- Security - Enterprise-grade security features
- Database Guide - Multi-engine database integration
- Guides - Implementation guides and tutorials
- WordPress Integration - WordPress REST API integration
π Getting Started
-
Installation
mcp-rs = "0.1.0" -
Basic Usage
server::McpServer, config::Config, handlers::wordpress::WordPressHandler }; #[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error>> { // Load configuration let config = Config::load("mcp-config.toml")?; // Create server let mut server = McpServer::new(); // Add WordPress handler if configured if let Some(wp_config) = config.wordpress { let handler = WordPressHandler::new(wp_config); server.add_handler("wordpress", Box::new(handler)); } // Start server server.serve(config.server.address()).await?; Ok(()) } -
Configuration
```toml
mcp-config.toml
[server] host = β127.0.0.1β port = 8080
[wordpress] url = βhttps://your-wordpress-site.comβ username = βyour_usernameβ password = βyour_application_passwordβ timeout_seconds = 30
## Current Implementation Status
## β
Completed Features
- WordPress API Handler with full REST API support
- Configuration management system (TOML + environment variables)
- MCP protocol implementation with JSON-RPC
- Error handling and logging infrastructure
- HTTP communication with timeout and retry logic
## π In Development
- Core application modules
- Transport abstraction layer
- Plugin system for dynamic loading
- Performance monitoring and metrics
## π Planned Features
- WebSocket transport support
- stdio transport for CLI integration
- Advanced plugin ecosystem
- Comprehensive monitoring and observability
## Architecture Overview
β Application Layer β β βββ main.rs (Entry Point) β β βββ CLI/Server Startup β βββββββββββββββββββββββββββββββββββββββββββ€ β API Layer β β βββ mcp/ (Protocol Implementation) β β βββ protocol.rs β β βββ JSON-RPC Interface β βββββββββββββββββββββββββββββββββββββββββββ€ β Service Layer β β βββ handlers/ (Feature Implementations)β β βββ plugins/ (Dynamic Plugin System) β βββββββββββββββββββββββββββββββββββββββββββ€ β Core Layer β β βββ Runtime Management β β βββ Registry & Context β β βββ Event System β βββββββββββββββββββββββββββββββββββββββββββ€ β Infrastructure Layer β β βββ transport/ (Communication) β β βββ config/ (Configuration) β β βββ error/ (Error Handling) β βββββββββββββββββββββββββββββββββββββββββββ
```
Use Cases
- WordPress Management: Automate content creation and site management
- API Integration: Connect AI agents to REST APIs and web services
- Tool Orchestration: Create composable tools for complex workflows
- Resource Management: Expose file systems, databases, and other resources
- AI Agent Integration: Standardized interface for AI-driven automation
Contributing
We welcome contributions! Please see our contributing guidelines for details.
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.
Last Updated: November 3, 2025 Version: v0.1.0 (Development)