Rust SDK for the ACT protocol — define tools as plain functions, compile to .wasm, serve over MCP or HTTP.
Quick start
use *;
# or
Workspace crates
| Crate | Description |
|---|---|
act-sdk |
SDK with #[act_component] and #[act_tool] macros |
act-sdk-macros |
Proc macro implementation |
act-types |
Shared types, CBOR utilities, JSON-RPC and MCP wire formats |
Features
#[act_tool]— derive tool metadata, JSON Schema, and CBOR serialization from a plain Rust function- Streaming — mark tools with
streamingand useActContextto emit progress events - Typed config — define a config struct, get automatic JSON Schema generation and validation
- MCP + HTTP — same
.wasmworks with both transports, zero code changes
Examples
| Example | What it shows |
|---|---|
hello-sdk |
Basic tools, streaming with ctx.send_progress() |
config-sdk |
Typed component configuration |
http-client-sdk |
Outbound HTTP via WASI |
hello-world |
Minimal component without SDK (raw wit-bindgen) |
http-client |
Raw HTTP client without SDK |
counter |
Stateful counter |
Building
Requires Rust nightly (for wasm32-wasip2 async support):
# Build all examples
# Run tests (host-side, not wasm)
See rust-toolchain.toml for the pinned toolchain.
License
Licensed under either of Apache License, Version 2.0 or MIT License at your option.