Remote MCP Kernel
A microkernel-based MCP (Model Context Protocol) server with OAuth authentication and multiple transport protocols.
Features
- 🔧 Microkernel Architecture - Modular design with independent handlers
- 🔐 OAuth Authentication - Secure authentication with multiple providers
- 🚀 Multiple Transport Protocols - SSE (Server-Sent Events) and HTTP support
- 📡 MCP Protocol Support - Full Model Context Protocol implementation
- 🔌 Pluggable Handlers - Extensible handler system
- 🎯 Runtime Composition - Dynamic service configuration
Installation
Add this to your Cargo.toml:
[]
= "0.1.0-alpha.1"
Quick Start
Basic MCP Server
use MicrokernelServer;
use ;
use McpOAuthProvider;
async
OAuth-Only Server
use MicrokernelServer;
use McpOAuthProvider;
async
Architecture
The Remote MCP Kernel follows a microkernel architecture where:
- Core Kernel - Minimal core with basic routing and composition
- Handlers - Independent, composable service handlers
- OAuth Provider - Centralized authentication service
- Transport Protocols - Multiple communication methods (SSE, HTTP)
Handler Types
- SSE Handler - Server-Sent Events for real-time communication
- Streamable HTTP Handler - HTTP-based streaming communication
- OAuth Handler - Authentication and authorization endpoints
Configuration
The server can be configured through environment variables or programmatically:
use Config;
let config = from_env?;
Examples
The crate includes several examples:
oauth_standard_mcp_server- Standard MCP server with OAuthoauth_cognito_mcp_server- AWS Cognito integrationoauth_cognito_dynamodb_mcp_server- Full AWS integration
Run examples with:
OAuth Providers
Supports multiple OAuth providers:
- GitHub - GitHub OAuth integration
- AWS Cognito - AWS Cognito User Pools
- Generic - Custom OAuth provider support
Transport Protocols
Server-Sent Events (SSE)
Real-time, unidirectional communication from server to client:
let sse_handler = new;
Streamable HTTP
Bidirectional HTTP-based communication:
let streamable_handler = new;
Error Handling
The kernel provides comprehensive error handling:
use ;
Security
- OAuth 2.0 with PKCE support
- Secure token validation
- CORS configuration
- Request authentication middleware
Development
# Run tests
# Run with specific features
# Build documentation
License
This project is licensed under the MIT License - see the LICENSE file for details.
Related Crates
oauth-provider-rs- OAuth 2.0 provider implementationrmcp- Model Context Protocol implementation