In this section: Hands-On Examples

Chapter 13 UMA code example

Portable MCP runtime tutorial

This tutorial is the repo reference application. It composes discoverable capabilities into workflows, lets AI propose without becoming authoritative, and explains the execution through CLI, JSON, MCP, and a browser app.

Tutorial route

Keep the final chapter’s navigation close to the lesson so the source, the examples index, and the previous step remain visible up front.

What you will learn

  • how WASM MCP exposes discovery and invocation surfaces
  • how the UMA runtime validates and executes selected capabilities
  • how AI-backed capabilities participate with explicit fallback reporting

Prerequisites

  • Rust 1.76 or newer
  • wasm32-wasip1 target
  • Node.js 20 or newer
  • npm
  • Wasmtime on your PATH

Run this setup command before the lab if your machine does not already have the target installed.

rustup target add wasm32-wasip1

Full tutorial

  1. Enter the example
    cd chapter-13-portable-mcp-runtime
  2. Set up pinned model artifacts
    ./scripts/setup_models.sh
  3. Build the PlannerAI WASI module
    ./scripts/build_planner_ai_wasi.sh
  4. Build the SummarizerAI WASI module
    ./scripts/build_summarizer_ai_wasi.sh
  5. Build the TranslatorFr WASI module
    ./scripts/build_translator_ai_wasi.sh
  6. List workflows
    ./scripts/list_labs.sh
  7. Run the French AI report workflow
    ./scripts/run_lab.sh use-case-2-ai-report
  8. Render the workflow as JSON
    cargo run --manifest-path rust/Cargo.toml -- render use-case-2-ai-report json
  9. Run the MCP server smoke check
    ./scripts/smoke_mcp_server.sh
  10. Run the full chapter smoke path
    ./scripts/smoke_portable_mcp_labs.sh

What to inspect

After each command, look for these proof points. They are the signals that connect the code example back to the UMA architecture claim.

  • capability selection
  • runtime validation result
  • structured report JSON
  • explicit provider fallback reporting when used

Acceptance check

The chapter-level validation path is:

./scripts/smoke_portable_mcp_labs.sh

Return to the repository root for the final acceptance gate:

cd ..
./scripts/smoke_reader_paths.sh

Where to go next

This chapter closes the validated learning path and links to the live reference application.