Skip to content
htcom-codePublic

Protrus

CI License: MPL 2.0

Protrus hosts signed WebAssembly component modules and swaps them at runtime — in-process, in worker processes, or in hardened OCI containers — behind a /platform REST and MCP control plane. It is a Rust port of Protean, the Spring Boot dynamic module platform, and keeps Protean's control-plane contracts: the REST routes, the MCP tools, the runtime configuration keys and the error shapes.

Where Protean compiles Java source on the server, Protrus deploys pre-built, signed Wasm components: nothing is compiled or evaluated at runtime, and a module reaches only the host capabilities its signed manifest asks for and the host allows.

Contents

Features

  • Runtime lifecycle — install, update (hot swap), rollback, uninstall and approval, with durable revisions and reconcile on restart. A failed candidate never replaces the serving revision.
  • Promotion gates — Ed25519 signatures (required by default), bundled unit tests, capability policy, and candidate verification before a route moves.
  • Isolation per module — in-process (wasmtime), packed worker processes, or OCI container pairs (read-only root filesystem, no capabilities, internal network, verified gateway), chosen per module with isolation_mode.
  • Sharing code — shared libs and LIBRARY modules linked into their dependents in every topology, with propagation when a library changes.
  • Host services and data — named host services (bridge.call), and request-bound, scope-limited database access with PostgreSQL/MySQL provisioning.
  • Control plane — /platform REST, MCP over Streamable HTTP and stdio, a runtime configuration registry with live / future / restart tiers, traces, metrics, and interactive debugging of Wasm guests.

Quick start

Requirements: Rust 1.97 or newer.

cargo build --release -p protrus-host      # builds protrus-host and protrus-worker

Write a bootstrap file for the in-process (async-wasm) topology. Paths must be absolute:

{
  "execution_mode": "async-wasm",
  "state_root": "/srv/protrus/state",
  "artifact_root": "/srv/protrus/artifacts",
  "trusted_signers_hex": {},
  "config": {"mcp.enabled": true}
}

Start the host on a listen address and talk to it:

$ ./target/release/protrus-host host.json 127.0.0.1:8080
{"event":"protrus_host_listening","address":"127.0.0.1:8080"}

$ curl -s http://127.0.0.1:8080/platform/modules
[]
$ curl -s http://127.0.0.1:8080/platform/runtimes
[{"runtimeId":"main","mode":"in-process","scope":null,"state":"LIVE","sinceEpochMs":1795509367120,"moduleIds":[]}]
$ curl -s -X POST http://127.0.0.1:8080/platform/mcp \
    -H 'content-type: application/json' -H 'accept: application/json, text/event-stream' \
    -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
{"jsonrpc":"2.0","id":1,"result":{"tools":[{"name":"protean.list_modules", ...

To deploy something you need a component and a signing key trusted by the host (trusted_signers_hex). The user guide walks through building a component, signing it, deploying it and operating it.

How it works

             /platform REST · MCP · traces · debug
                            │
                    DeploymentService ── gates: signature → tests → policy → verification
                            │                  module store (fs / SQLite / PostgreSQL / MySQL)
          ┌─────────────────┼──────────────────────┐
     in-process          worker                 container
   (async wasmtime)   (pooled processes,     (OCI worker + gateway pair,
                       private sockets)        internal network)

A host runs one topology (execution_mode: async-wasm, worker or oci). A worker host also runs in-process modules, and an OCI host also runs in-process modules, chosen per module by the signed manifest's isolation_mode or the isolation.mode default. Requests are routed by exact (method, path) to the active revision; the control plane never shares a listener with module code.

Documentation

  • User guide — getting started, signing and deploying modules, configuration, isolation and workers, sharing code, host services, debugging, databases.
  • Design documents — the architecture and every decision, including each deliberate difference from Protean (written in Korean).
  • Scenario runbooks — Protean's MCP runbooks replayed against the host binary.
  • Roadmap · Changelog · Security

Relationship to Protean

Protrus ports Protean feature by feature and keeps its external contracts, so Protean's console and MCP clients work against it. Where the runtime differs — Wasm components instead of Java classes, named host services instead of Spring beans, a signed manifest instead of a server-side compile — the difference is recorded as non-parity in the design documents with its reason, user impact and migration note. ROADMAP.md lists what is deliberately not ported.

Contributing

See CONTRIBUTING.md for the build, the invariants every change keeps, and the commit and PR conventions. Please read the Code of Conduct.

License

Copyright (c) 2026 htjulia htjulia1@gmail.com

Licensed under the Mozilla Public License 2.0.

Releases

Packages

Used by

Contributors

Languages