Example of building, composing, and deploying multiple MCP (Model Context Protocol) tool components and middelware using wasmcp.
This project demonstrates:
- Building multiple MCP tool components using
wasmcp - Composing components into a single WASM module
- Deploying to multiple runtimes:
- wash - Local wasmCloud development
- Cosmonic - Kubernetes with Cosmonic Control
- wasmtime - Direct WebAssembly runtime
This project includes both:
- tool components (providing primitive operations)
- middleware components (composing tools into higher-level capabilities)
For detailed documentation on middleware/tool chaining patterns, see components/README.md
- wasmcp
- wkg (WebAssembly package manager)
- Rust toolchain
- Docker
- kind (Kubernetes in Docker) - for Cosmonic deployment
- kubectl - for Cosmonic deployment
- helm - for Cosmonic deployment
- wash (wasmCloud shell) - for local development
- wkg (WebAssembly package manager)
- wasmtime
- Create environment configuration:
make env-setup
# Edit .env with your values:
# - COSMONIC_LICENSE_KEY (for Cosmonic deployment)
# - GITHUB_TOKEN (with write:packages scope, for publishing)
# - GITHUB_USER (for publishing)# Build and run locally
make wash
# Access at http://localhost:8080/mcp# Complete setup and deploy (handles everything automatically)
make cosmonic
# Access via NodePort shown in output# Run with wasmtime
make wasmtime
# Note: Currently in developmentThis project includes custom Rust-based management tools for different runtimes:
Manages local wasmCloud development environment:
- Auto-starts wash if not running
- Manages component lifecycle
- Handles HTTP provider and link configuration
- Validates links after creation
Location: tools/wash-manager/
Manages Kubernetes deployment with Cosmonic Control:
- Auto-creates kind cluster if needed
- Auto-installs Cosmonic Control and HostGroup
- Generates manifests from templates
- Provides deployment endpoints
Location: tools/cosmonic-manager/
Templates: manifests/templates/
httptrigger.yaml.tpl- Cosmonic HTTPTrigger deploymentdeployment.yaml.tpl- Standard Kubernetes deployment
make build- Build all components and compose themmake build-components- Build individual componentsmake compose- Compose components into single WASM
make wash- Build and run in wash runtimemake wash-start- Start wash runtimemake wash-stop- Stop wash runtime and clean upmake wash-status- Check wash runtime statusmake wash-clean- Clean up wash configurations and links
make cosmonic- Build and deploy to Cosmonicmake cosmonic-setup- Set up cluster and install Cosmonic Controlmake cosmonic-deploy- Deploy to Cosmonic clustermake cosmonic-status- Check Cosmonic deployment statusmake cosmonic-clean- Clean up Cosmonic deployment
make wasmtime- Run with wasmtime runtime (in development)
make publish VERSION=x.x.x- Publish composed WASM to ghcr.io
make setup- Complete Cosmonic setup (cluster + Cosmonic Control)make env-setup- Create .env file from templatemake validate- Validate environment and dependencies
make test- Test the deployed MCP server (Cosmonic)
make cleanup- Interactive cleanupmake cleanup-all- Clean everything (cluster, registry, artifacts)make cleanup-cluster- Delete only the kind clustermake clean- Clean build artifacts only
make wash-manager- Build the wash-manager toolmake cosmonic-manager- Build the cosmonic-manager tool
Create .env from the template:
# GitHub Configuration (for publishing)
GITHUB_TOKEN=your_github_token_here
GITHUB_USER=your_github_username
# Cosmonic Configuration (for Kubernetes deployment)
COSMONIC_LICENSE_KEY=your_cosmonic_license_key_here
# Deployment Configuration
VERSION=0.2.0
CLUSTER_NAME=cosmonic-cluster
NAMESPACE=default
APP_NAME=mcp-multi-tools