wasmcp
A WebAssembly Component Development Kit for the Model Context Protocol
Install
curl -fsSL https://raw.githubusercontent.com/wasmcp/wasmcp/main/install.sh | bash
接入你的智能体
從發布者安裝。不是 PlugMCP 端點。
遠端 URL 還是本機指令? 兩種安裝方式的差異
來自發布者
wasmcpA WebAssembly Component Development Kit for the Model Context Protocol
curl -fsSL https://raw.githubusercontent.com/wasmcp/wasmcp/main/install.sh | bash
Build MCP servers with WebAssembly components
See releases for SBOMs etc.
Or build from source:
cargo install --git https://github.com/wasmcp/wasmcp
Create and run your first MCP tool component:
# Create a component in your favorite language
wasmcp new time-tools --language python
cd time-tools && make && cd ..
# Register it with a short alias
wasmcp registry component add time time-tools/time-tools.wasm
# Compose into an MCP server and run
wasmcp compose server time --runtime wasmtime -o server.wasm
wasmtime serve -Scli -Skeyvalue -Shttp server.wasm # http://0.0.0.0:8080/mcp
Combine multiple tool components - they automatically merge into a unified catalog:
# Create another component
wasmcp new math-tools --language rust
cd math-tools && make && cd ..
wasmcp registry component add math math-tools/target/wasm32-wasip2/release/math_tools.wasm
# Compose both together
wasmcp compose server time math --runtime wasmtime -o combined-server.wasm
wasmtime serve -Scli -Skeyvalue -Shttp combined-server.wasm
See examples/ for more.
wasmcp projects.wasmcp supports both public (unauthenticated) and OAuth 2.1 protected MCP servers via the WASMCP_AUTH_MODE environment variable.
# No environment variables needed (default behavior)
wasmtime serve -Scli -Skeyvalue -Shttp server.wasm
Or explicitly set:
WASMCP_AUTH_MODE=public wasmtime serve -Scli -Skeyvalue -Shttp server.wasm
Requires JWT bearer tokens per MCP OAuth 2.1 spec. Supports two validation patterns:
Per-user client IDs created dynamically. No fixed audience - validation via issuer and signature only.
Required Environment Variables:
WASMCP_AUTH_MODE=oauth - Enable OAuth authenticationJWT_ISSUER - Expected token issuer (e.g., https://your.issuer.com)JWT_JWKS_URI - JWKS endpoint for public key retrievalExample:
WASMCP_AUTH_MODE=oauth \
JWT_ISSUER=https://api.workos.com \
JWT_JWKS_URI=https://api.workos.com/sso/jwks/client_01234567890 \
wasmtime serve -Scli -Skeyvalue -Shttp server.wasm
WebAssembly components are:
These qualities are a perfect match for MCP's server design principals.
- Servers should be extremely easy to build
- Servers should be highly composable
- Servers should not be able to read the whole conversation, nor “see into” other servers
- Features can be added to servers and clients progressively
Server features like tools, resources, prompts, and completions, are implemented by individual WebAssembly components that export the narrow, spec-mapped WIT interfaces defined in spec/2025-06-18/wit/.
wasmcp compose wraps these components with published middleware components from crates/ and composes them together behind a transport component as a complete middleware chain of responsibility that implements an MCP server. The chain terminates with crates/method-not-found, which returns errors for unhandled methods.
Any of the published default wasmcp components can be swapped out for custom implementations during composition, enabling flexible server configurations.
Transport<Protocol>
↓
Middleware₀
↓
Middleware<Feature>₁
↓
Middleware<Feature>₂
↓
...
↓
Middlewareₙ
↓
MethodNotFound
Each component:
tools/call)This enables dynamic composition without complex configuration - like Unix pipes for MCP.
Components can be specified as local paths, registry packages (OCI), aliases, or profiles:
# Local file path
wasmcp compose server ./calculator.wasm -o server.wasm
# Registry package (OCI) - colon identifies it as a registry spec
wasmcp compose server wasmcp:[email protected] -o server.wasm
# Aliases (registered in ~/.config/wasmcp/wasmcp.toml)
wasmcp compose server calc weather -o server.wasm
# Mixed: local path + registry package + alias
wasmcp compose server ./logger.wasm wasmcp:[email protected] weather -o server.wasm
When a client requests tools/list, each component that offers tools contributes their tools, creating a unified catalog automatically.
wasmcp registry allows for simple artifact aliases and reusable composition profiles.
Register short names for frequently-used components:
# Register local components (file paths)
wasmcp registry component add calc ./calculator.wasm
wasmcp registry component add weather ./weather-tools.wasm
# Register from OCI registry (namespace:name@version)
wasmcp registry component add db wasmcp:[email protected]
wasmcp registry component add logger namespace:[email protected]
# Aliases can also reference other aliases
wasmcp registry component add prod-calc calc
# Use aliases in composition
wasmcp compose server calc weather -o server.wasm
wasmcp compose server db logger -o server.wasm
# List and manage
wasmcp registry component list
wasmcp registry component remove calc
Save a list of components to compose together:
# Save: dev = calc + weather
wasmcp registry profile add dev calc weather -o dev.wasm
# Later, rebuild the same server
wasmcp compose server dev
# Creates: ~/.config/wasmcp/composed/dev.wasm
# Or specify a different output location
wasmcp compose server dev -o ./my-server.wasm
# Creates: ./my-server.wasm
Profiles can inherit from other profiles:
wasmcp registry profile add prod logger monitor -o prod.wasm -b dev
# prod = calc + weather + logger + monitor
List and remove:
wasmcp registry profile list
wasmcp registry profile remove dev
View your registry configuration:
wasmcp registry info # Show all
wasmcp registry info --components # Filter to components
wasmcp registry info --profiles # Filter to profiles
Registry data is stored in ~/.config/wasmcp/config.toml (XDG Base Directory).
Write handlers in any language with component toolchain support:
wasmcp new my-handler --language rust # Rust (calculator example)
wasmcp new my-handler --language python # Python (string tools example)
wasmcp new my-handler --language typescript # TypeScript (example tool)
Generated templates demonstrate the capability pattern with working tool implementations.
Published to ghcr.io/wasmcp:
The CLI automatically downloads these when composing.
Apache 2.0
工具
尚無工具清單。遠端伺服器會在首次健康檢查後取得工具清單。
常見問題
在本頁複製適用於 Cursor、Claude Desktop、Claude Code 或 VS Code 的 stdio 設定。它使用發布者的安裝方式,而不是 PlugMCP 代理伺服器。
這筆記錄未列出必要的環境變數。
Wasmcp 透過 stdio 在本機執行。
上次檢查時間:2026-10-28。 Build MCP servers with WebAssembly components