π PMCP v1.5.0: Write Once, Deploy Everywhere - WASM/WASI Universal MCP Servers
π PMCP v1.5.0: Write Once, Deploy Everywhere - WASM/WASI Universal MCP Servers
π― Major Release: Platform-Agnostic MCP Architecture
β¨ Headline Feature: Universal WASM Deployment
Write once in Rust, deploy everywhere - The same MCP server code now runs on Cloudflare Workers, Fermyon Spin, and any WASM/WASI-compliant platform, achieving true platform independence similar to the TypeScript SDK architecture.
ποΈ Architecture Revolution: Clean Separation of Logic and Transport
π New Architecture Design
Following the TypeScript SDK's successful pattern, v1.5.0 introduces a clean separation between:
- Core MCP Logic: Platform-agnostic business logic (
WasmMcpServer) - Transport Layer: Thin platform-specific adapters (Cloudflare, Fermyon, etc.)
- Universal API: Consistent interface across all deployment targets
π― Key Achievement
// Same code runs everywhere
let server = WasmMcpServer::builder()
.name("my-mcp-server")
.version("1.0.0")
.tool("calculator", SimpleTool::new(...))
.build();
// Deploy to Cloudflare, Fermyon, or any WASM platformπ Major New Features
π§ WasmMcpServer - Universal MCP Implementation
- Platform-agnostic core: Single implementation for all WASM targets
- Type-safe builder pattern: Compile-time validation of server configuration
- SimpleTool abstraction: Easy tool creation with automatic JSON-RPC handling
- Full MCP protocol compliance: Initialize, tools/list, tools/call, notifications
- Automatic error handling: Built-in validation and error responses
π Multi-Platform Deployment Support
Cloudflare Workers
- Global edge deployment: 200+ locations worldwide
- V8 Isolates: Sub-millisecond cold starts
- KV & Durable Objects: Integrated state management
- Cost-effective: Pay-per-request pricing model
Fermyon Spin
- Standard WASI: Uses
wasm32-wasip1target - Component Model: First-class WASI component support
- Built-in SQLite: Persistent storage capabilities
- Simple deployment: Single
spin deploycommand
π§ͺ Enhanced Testing Infrastructure
MCP Tester Improvements
- Scenario-based testing: YAML/JSON test definitions
- Comprehensive assertions: Success, failure, contains, equals, array operations
- Verbose mode support: Detailed test output with
--verboseflag - HTTP/JSON-RPC alignment: Full protocol compliance testing
Test Scenarios
- calculator-test.yaml: Comprehensive test suite with error cases
- calculator-simple.json: Basic operation validation
- minimal-test.json: Quick connectivity verification
π Transport Layer Improvements
- JSON-RPC notification handling: Proper detection of requests without 'id' field
- Empty response support: Handle 200 OK with no Content-Type (notifications)
- Platform-specific adapters: Minimal boilerplate for each platform
- Error propagation: Consistent error handling across transports
π Performance & Scalability
π Deployment Metrics
| Platform | Cold Start | Global Scale | State Management | Cost Model |
|---|---|---|---|---|
| Cloudflare | 50-200ms | 200+ locations | KV, Durable Objects | Pay-per-request |
| Fermyon | 100-300ms | Regional | SQLite | Instance-based |
| WASI Generic | Varies | Custom | Platform-specific | Flexible |
β‘ Runtime Performance
- Zero overhead abstraction: No performance penalty for platform abstraction
- Compile-time optimization: WASM optimization at build time
- Minimal binary size: ~500KB WASM modules
- Memory efficient: Low memory footprint per request
π οΈ Developer Experience Improvements
π¦ Simplified Development
# Build once
cargo build --target wasm32-unknown-unknown --release
# Deploy anywhere
wrangler deploy # Cloudflare
spin deploy # Fermyon
# ... any WASM platformπ Testing Tools
# Test any deployment with scenarios
mcp-tester scenario https://<your-deployment> test-scenarios/calculator-test.yaml
# Verbose output for debugging
mcp-tester tools --verbose https://<your-deployment>π Comprehensive Documentation
- Platform-specific deployment guides
- Scenario testing documentation
- Architecture overview with examples
- Migration guides from v1.4.x
π§ Technical Improvements
Core SDK
- ServerCore refactoring: Clean separation of concerns
- Protocol version negotiation: Improved compatibility handling
- Type safety enhancements: Stronger compile-time guarantees
- Error recovery: Better error messages and recovery strategies
Quality & Testing
- 100% scenario test pass rate: All test scenarios passing
- Cross-platform validation: Tested on multiple WASM runtimes
- Backward compatibility: Full compatibility with existing MCP clients
- Toyota Way compliance: Zero tolerance for defects
π Migration Guide
From v1.4.x to v1.5.0
- Update dependency:
pmcp = "1.5.0" - Choose deployment model:
- Use
WasmMcpServerfor WASM deployments - Use existing
Serverfor native deployments
- Use
- Platform adapters: Add thin wrapper for your platform
- Test with scenarios: Validate using mcp-tester
Example Migration
// Before (v1.4.x)
let server = Server::builder()
.tool(my_tool_handler)
.build();
// After (v1.5.0) - WASM deployment
let server = WasmMcpServer::builder()
.tool("my_tool", SimpleTool::new(my_tool_handler))
.build();π What's Next
Roadmap
- Additional platform support (Wasmtime, WasmEdge, etc.)
- State management abstractions
- Cross-platform resource handlers
- Enhanced debugging tools
π Acknowledgments
Special thanks to all contributors who made this release possible, especially the work on clean architecture separation and comprehensive testing infrastructure.
π¦ Installation
[dependencies]
pmcp = "1.5.0"π Resources
Breaking Changes: None - Full backward compatibility maintained
Minimum Rust Version: 1.70.0
License: MIT