### Typical MCP server setup commands (npx, uvx, curl|bash) Source: https://github.com/actcore/actcore.dev/blob/main/src/content/blog/2026-04-23-introducing-act.md Shows the common ways to install and run an MCP server, which run as native processes with full user access. This is the baseline deployment model that ACT aims to replace. ```bash npx -y @some-org/mcp-server # or uvx some-mcp-server # or the occasional curl https://example.com/install.sh | bash ``` -------------------------------- ### Install act and act-build globally with npm Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/install.mdx Install act and act-build globally via npm, placing them on $PATH. ```bash npm install -g @actcore/act @actcore/act-build ``` -------------------------------- ### Verify act installation Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/install.mdx Check the installed version and available subcommands. act --version reports the installed release; act --help should list subcommands run, call, info, skill, pull, session, store, inspect, secret, and login. ```bash act --version act --help ``` -------------------------------- ### SKILL.md example with frontmatter and tool documentation Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/build/skills.mdx Example SKILL.md file with required YAML frontmatter (name, description, metadata.act) and markdown documenting the query tool. The frontmatter fields are required: name must match the component name, description is a one-line summary, and metadata.act must be {}. ```markdown --- name: sqlite description: Query a SQLite database. Useful for structured tabular data. metadata: act: {} --- # SQLite Component Run SQL queries against a database file. ## Tools ### query Execute a SQL statement. Returns JSON rows. ``` query(sql: "SELECT * FROM users LIMIT 10") ``` ``` -------------------------------- ### Example open-session args schema for sqlite Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/host/sessions.mdx Example output of `act session open-args-schema` for the sqlite component. Shows the open-session args schema with a required database_path property. ```json { "title": "OpenArgs", "description": "open-session args: which database file this session connects to.", "type": "object", "properties": { "database_path": { "type": "string", "description": "Path to the SQLite database file." } }, "required": ["database_path"] } ``` -------------------------------- ### Install and authenticate asciinema Source: https://github.com/actcore/actcore.dev/blob/main/scripts/blog/introducing-act/README.md Install asciinema on macOS or pip-based systems, then authenticate the first time, which opens a browser. ```bash brew install asciinema # macOS pipx install asciinema # pip-based systems asciinema auth # first time; opens a browser ``` -------------------------------- ### Set up Rust toolchain for building components Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/install.mdx Install the nightly Rust toolchain and add the wasm32-wasip2 target. Components pin the toolchain with rust-toolchain.toml, so you don't need +nightly flags day-to-day. ```bash rustup toolchain install nightly rustup target add wasm32-wasip2 --toolchain nightly ``` -------------------------------- ### Load a component in the browser with runComponent Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/host/browser.mdx Loads a signed .wasm component in the browser from fetched bytesthor and starts its runtime. This is the foundation for running a component entirely client-side with no server or setup. The `shimBase` option is required and must point to the browser build of `@bytecodealliance/preview2-shim` (e.g., a CDN, bundler-resolved path, or vendored copy). ```ts import { runComponent } from '@actcore/web-runtime'; const wasm = new Uint8Array(await (await fetch('/time.wasm')).arrayBuffer()); const { toolProvider } = await runComponent(wasm, { // Where @bytecodealliance/preview2-shim's browser build lives — a CDN, // your bundler's resolved path, or a vendored copy. shimBase: 'https://esm.sh/@bytecodealliance/preview2-shim@0.19.0/dist/browser/', }); ``` -------------------------------- ### Install act and act-build with cargo Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/install.mdx Compile act and act-build from source using cargo. Requires a recent stable Rust. ```bash cargo install act-cli act-build ``` -------------------------------- ### Starlight project commands Source: https://github.com/actcore/actcore.dev/blob/main/README.md Common npm commands for a Starlight project. Run from the project root: install dependencies, start the dev server at localhost:4321, build the production site to ./dist/, preview the build, run Astro CLI commands, or get CLI help. ```bash npm install ``` ```bash npm run dev ``` ```bash npm run build ``` ```bash npm run preview ``` ```bash npm run astro ... ``` ```bash npm run astro -- --help ``` -------------------------------- ### Run act and act-build with uvx Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/install.mdx Use uvx to run the act and act-build binaries without a permanent install. The package is act-cli, the command it installs is act — hence --from. ```bash uvx --from act-cli act --help uvx --from act-build act-build --help ``` -------------------------------- ### Run act and act-build with npx Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/install.mdx Use npx to run the act and act-build binaries without a permanent install. Caches to ~/.npm/_npx/. ```bash npx @actcore/act --help npx @actcore/act-build --help ``` -------------------------------- ### Install act and act-build with uv or pip Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/install.mdx Install act and act-build using uv tool install or pip. Platform wheels for macOS (x86_64, arm64) and Linux (x86_64, aarch64, riscv64; glibc and musl). No Python is involved at run time. The glibc wheels require glibc 2.34 or newer (riscv64 requires 2.39); on older distributions use the musl build or npm. ```bash uv tool install act-cli uv tool install act-build # or: pip install act-cli act-build ``` -------------------------------- ### Install uv for Python component development Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/install.mdx Install uv via the official script. The act-sdk Python package runs inside componentize-py at build time; uv manages the dev environment. ```bash curl -LsSf https://astral.sh/uv/install.sh | sh ``` -------------------------------- ### std:invalid-args error example Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/host/troubleshooting.mdx Example error message when the host rejects arguments against the component's declared schema. The message names the path and the mismatch. ```console Error: std:invalid-args: arguments do not match the schema for 'query': - at '/sql': want string, but got number ``` -------------------------------- ### Example tests for component tools Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/build/testing.mdx Two async tests: one checks that the component exposes at least one tool, the other calls the 'reverse' tool and asserts the output. ```python async def test_component_exposes_its_tools(client): """A component with no tools is almost always a packaging mistake.""" tools = await client.list_tools() assert len(tools) >= 1 async def test_reverse(client): result = await client.call_tool("reverse", {"text": "hello"}) assert result.content[0].text == "olleh" ``` -------------------------------- ### mcp-bridge usage example (bash) Source: https://github.com/actcore/actcore.dev/blob/main/src/content/blog/2026-05-07-act-07-sessions.md Shows how to run the mcp-bridge and the expected agent interactions. The bridge maps upstream session ids to its own outward-facing ids, so agents never see the upstream id. ```bash act run actpkg.dev/library/mcp-bridge:latest --mcp # then, agent: open_session({"url": "https://upstream.example/mcp", "auth_token": "sk-..."}) # → {"id": "mcp_0", "metadata": {}} # then, agent: tools/list with _meta.std:session-id = mcp_0 ``` -------------------------------- ### Implement session provider with #[session_open] and #[session_close] Source: https://github.com/actcore/actcore.dev/blob/main/src/content/blog/2026-05-07-act-07-sessions.md Use the #[session_open] and #[session_close] macros with act_sdk::SessionRegistry to implement a session provider with minimal boilerplate. The macro derives get-open-session-args-schema from OpenArgs via schemars, decodes metadata-shaped wire args, and emits the full session-provider Guest impl. A full runnable example is available at examples/sessions-counter. ```rust use act_sdk::prelude::*; use act_sdk::SessionRegistry; #[act_component(name = "counter")] mod component { use super::*; pub struct Counter { value: u64 } thread_local! { static SESSIONS: SessionRegistry = SessionRegistry::new("ctr"); } #[derive(Deserialize, JsonSchema)] struct OpenArgs { #[serde(default)] start: u64, } #[session_open] fn open(args: OpenArgs) -> ActResult { Ok(SESSIONS.with(|r| r.insert(Counter { value: args.start }))) } #[session_close] fn close(id: String) { SESSIONS.with(|r| { r.remove(&id); }); } // Tools read std:session-id via ActContext. } ``` -------------------------------- ### MCP client config for ACT component Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/host/transports.mdx Example MCP client configuration for Claude Code or similar, launching the ACT component with the --mcp flag and a filesystem grant for /tmp/db.sqlite. ```json { "mcpServers": { "sqlite": { "command": "npx", "args": ["@actcore/act", "run", "actpkg.dev/library/sqlite", "--mcp", "--grant", "{\"wasi:filesystem\":{\"mode\":\"allowlist\",\"allow\":[{\"path\":\"/tmp/db.sqlite\",\"mode\":\"rw\"}]}}"] } } } ``` -------------------------------- ### MCP client setup for sqlite-dev Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/host/config.mdx JSON configuration for an MCP client that launches the act CLI with the sqlite-dev profile. The client never needs to know about grants because they live in the profile. ```json { "mcpServers": { "sqlite-dev": { "command": "npx", "args": ["@actcore/act", "run", "actpkg.dev/library/sqlite", "--mcp", "--profile", "sqlite-dev", "--session-args", "{\"database_path\":\"/Users/me/dev/app.sqlite\"}"] } } } ``` -------------------------------- ### Override the config path with --config Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/host/config.mdx Uses a custom config file instead of the default ~/.config/act/config.toml. Useful in CI or per-project setups. ```bash act run --mcp --config ./my-config.toml ``` -------------------------------- ### Audit trail output example Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/security/csa-framework-mapping.mdx Example audit trail lines emitted on stderr, showing the artifact digest, policy resolution, capability decisions, and a tool call rollup. ```console audit: actpkg.dev/library/sqlite sha256:cb7715 │ act:credentials=deny wasi:filesystem=allowlist wasi:http=deny wasi:sockets=deny audit: ✓ allow wasi:filesystem write /data/app.sqlite mode:allowlist under /data/** audit: ✗ deny wasi:filesystem read /dev/urandom outside ceiling mode:allowlist audit: ● query ok 0ms args:1e91dd req:005ea7 session:sqlite_0 ``` -------------------------------- ### Audit output showing denial reasons Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/host/troubleshooting.mdx Example console output from an audit showing two 'outside ceiling' denials and a resulting error. Use this to identify which paths were refused. ```console audit: ✗ deny wasi:filesystem read /dev/urandom outside ceiling ``` ```console audit: ✗ deny wasi:filesystem write /data/app.sqlite.lock outside ceiling ``` ```console Error: open-session failed: std:internal: PRAGMA error: access permission denied ``` -------------------------------- ### wasi:http grant rules Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/host/policy.mdx Two example wasi:http rules. The first matches by host wildcard with optional scheme, methods, and ports. The second matches by CIDR, useful for deny rules like blocking loopback except certain ports. ```json {"host": "*.example.com", "scheme": "https", "methods": ["GET","HEAD"], "ports": [443]} {"cidr": "169.254.169.254/32"} ``` -------------------------------- ### Set secrets with act secret set Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/host/credentials.mdx Shows how to define credentials as named fields using the `act secret set` command. The first example sets a username and password, the second sets an API token. Field names are namespaced, and the `std:` namespace is reserved. ```bash act secret set --field acme:username --field acme:password # a password act secret set --field acme:token # an API token ``` -------------------------------- ### act inspect component-manifest piped to jq Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/reference/cli.mdx Prints the decoded act:component manifest verbatim without instantiating anything. This is what CI uses to assert a component is actually packed. The example pipes the output to jq to extract the .std.version field. ```bash act inspect component-manifest my-tool.wasm | jq -r .std.version ``` -------------------------------- ### e2e/pyproject.toml configuration Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/build/testing.mdx Virtual project configuration for the e2e test environment. Sets dependencies, disables package installation, and configures pytest with asyncio mode, a generous timeout, and thread-based timeout method. ```toml [project] requires-python = ">=3.12" dependencies = ["fastmcp", "pytest", "pytest-asyncio", "pytest-timeout"] [tool.uv] package = false [tool.pytest.ini_options] asyncio_mode = "auto" timeout = 300 timeout_method = "thread" ``` -------------------------------- ### act completions for bash, zsh, fish Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/reference/cli.mdx Writes to stdout rather than installing anything — where a completion script belongs is the shell's and the package manager's business. The script is generated from the same definition the binary parses with, so it cannot drift from the flags that actually exist. ```bash act completions bash > /etc/bash_completion.d/act act completions zsh > "${fpath[1]}/_act" act completions fish > ~/.config/fish/completions/act.fish ``` -------------------------------- ### Audit trail output Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/host/policy.mdx Example audit trail output showing resolved policy at startup and per-decision logs. 'outside ceiling' indicates the component never declared the path; a plain denial means the grant didn't cover it. The trail goes to stderr and is not governed by RUST_LOG. ```console audit: actpkg.dev/library/sqlite sha256:cb7715 │ act:credentials=deny wasi:filesystem=allowlist wasi:http=deny wasi:sockets=deny audit: ✓ allow wasi:filesystem write /data/app.sqlite mode:allowlist under /data/** audit: ✗ deny wasi:filesystem read /dev/urandom outside ceiling mode:allowlist ``` -------------------------------- ### act-build init command Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/reference/cli.mdx Scaffolds a new component from a language template. The templates are embedded in the binary, so no external toolchain is needed. Omit the name to scaffold into the current directory. --http and --fs declare capabilities in the generated act.toml; --no-git skips git init. Note: WIT fetch is broken in 0.13.0, so wit/deps/ may be empty and just build fails until dependencies are supplied. ```bash act-build init [name] [-o ] [--http] [--fs] [--description ] ``` -------------------------------- ### act-build command overview Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/reference/cli.mdx Shows the top-level act-build command and its subcommands: init, pack, validate, and push. ```text act-build Commands: init Scaffold a new component from a language template pack Embed act:component, act:skill, and version/description custom sections validate Validate a packed component without modifying it push Publish a WASM component as a CNCF Wasm OCI Artifact ``` -------------------------------- ### Inspect and run a published component with act info and act run Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/components.mdx Shows how to inspect a component's capabilities and requirements with `act info` and then serve it to an agent with `act run`. The `--tools` flag displays what the component does and what it will ask for, while `--mcp` serves it to an agent. ```bash act info actpkg.dev/library/ --tools # what it does, and what it will ask for act run actpkg.dev/library/ --mcp # serve it to an agent ``` -------------------------------- ### Run act with Docker Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/install.mdx Pull the act Docker image and run it to display help. ```bash docker pull ghcr.io/actcore/act:latest docker run --rm ghcr.io/actcore/act --help ``` -------------------------------- ### Scaffold a new Rust component with act-build init Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/build/rust.mdx Initializes a new Rust component project and runs the just init recipe. The act-build init command carries templates inside the binary, so no copier, uvx, or Python toolchain is needed. Pass --http or --fs to declare those capabilities in act.toml. ```bash act-build init rust my-component cd my-component just init ``` -------------------------------- ### act secret Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/reference/cli.mdx Manages stored credentials. There is no `get`: a value is never printed. ```APIDOC ## act secret ### Description Manages stored credentials. There is no `get`: a value is never printed. ### Method CLI ### Endpoint `act secret ` ### Parameters #### Subcommands - **set** - Set a secret. - **delete** - Delete a secret. - **list** - List secret names. ### Request Example ```bash act secret set my-key ``` ### Response #### Success Response Confirmation of the operation. #### Error Response Exits non-zero on error. ``` -------------------------------- ### act-build init Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/reference/cli.mdx Scaffolds a new component from a language template. It creates a working component skeleton ready for building, with optional HTTP and filesystem capabilities. ```APIDOC ## act-build init ### Description Scaffolds a new component from a language template. It creates a working component skeleton ready for building, with optional HTTP and filesystem capabilities. ### Command `act-build init [name] [-o ] [--http] [--fs] [--description ]` ### Parameters - **language** (string) - Required - The template language: `rust` or `python`. - **name** (string) - Optional - Component name; omit to scaffold into current directory. - **-o ** (string) - Optional - Output directory. - **--http** (flag) - Optional - Declare HTTP capability in generated `act.toml`. - **--fs** (flag) - Optional - Declare filesystem capability in generated `act.toml`. - **--description ** (string) - Optional - Description for the component. ### Notes - Templates are embedded in the binary; no external toolchain required. - `--no-git` skips `git init` (not shown in usage but mentioned in text). - Caution: WIT fetch is broken in 0.13.0; dependencies must be supplied manually. ``` -------------------------------- ### Verify the built component with act info Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/build/rust.mdx Prints component metadata and the list of tools. The command should print the component name, version, and the reverse tool with its auto-derived schema. ```bash act info target/wasm32-wasip2/release/component_my_component.wasm --tools ``` -------------------------------- ### Record and upload demo.cast with render.sh --upload Source: https://github.com/actcore/actcore.dev/blob/main/scripts/blog/introducing-act/README.md Records demo.cast, uploads it to asciinema.org, and prints the cast URL and ID. Use after a demo.sh change or for the first recording. ```bash ./render.sh --upload # → records demo.cast, uploads to asciinema.org, prints cast URL + ID ``` -------------------------------- ### Verify tools with act info --tools Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/build/python.mdx Verifies the built component by listing its tools. ```bash act info .wasm --tools ``` -------------------------------- ### Initialize a new Rust component with act-build init Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/components.mdx Initializes a new component project using the Rust toolchain. This is the same toolchain used to build all published components. ```bash act-build init rust my-component ``` -------------------------------- ### Run tests and call the reverse tool Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/build/python.mdx Runs the test suite and then invokes the reverse tool on the built component with the given JSON arguments. ```bash just test act call .wasm reverse --args '{"text":"hello"}' ``` -------------------------------- ### session-provider interface Source: https://github.com/actcore/actcore.dev/blob/main/src/content/blog/2026-05-07-act-07-sessions.md The session-provider interface defines the contract for session management in ACT components. It includes functions to get the JSON schema for open-session arguments, open a session, and close a session. ```APIDOC ## Interface: session-provider ### Description The `session-provider` interface defines the contract for session management in ACT components. It includes functions to get the JSON schema for open-session arguments, open a session, and close a session. ### Functions #### get-open-session-args-schema ##### Description Returns a JSON Schema describing valid arguments for `open-session`. Hosts use this to validate before invoking the component. ##### Signature `async func(metadata: metadata) -> result` ##### Parameters - `metadata` (metadata) - Required - Metadata for the request. ##### Returns - `result` - A JSON Schema string or an error. #### open-session ##### Description Opens a session. `args` carries connection parameters and credentials. ##### Signature `async func(args: metadata, metadata: metadata) -> result` ##### Parameters - `args` (metadata) - Required - Connection parameters and credentials. - `metadata` (metadata) - Required - Metadata for the request. ##### Returns - `result` - A session record or an error. #### close-session ##### Description Polite shutdown — sync, advisory. The host MUST call this for every session it opened, before component deinit. ##### Signature `func(session-id: string)` ##### Parameters - `session-id` (string) - Required - The ID of the session to close. ### Types #### session - `id` (string) - The session ID. - `metadata` (metadata) - Metadata associated with the session. ### Usage Notes Subsequent capability calls (`tool-provider.list-tools`, `tool-provider.call-tool`) pass the returned `id` as `std:session-id` in their metadata. The component does its own state lookup. The host keeps the wasm instance alive as long as it's serving sessions, and closes whatever's still open before it tears the instance down. ``` -------------------------------- ### Skill directory layout Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/build/skills.mdx Shows the required and optional files inside the skill/ directory: SKILL.md is required, EXAMPLES.md and references/ are optional. ```text skill/ ├── SKILL.md # required, with frontmatter ├── EXAMPLES.md # optional └── references/… # optional supporting files ``` -------------------------------- ### act secret set with typed field Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/reference/cli.mdx Use --field NAME=TYPE for a value that isn't a plain string. The example stores a field named acme:token with type std:oauth2. ```bash --field acme:token=std:oauth2 ``` -------------------------------- ### Run a component with a profile Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/host/config.mdx Activates the sqlite-dev profile when running a component via MCP. The profile carries policy and metadata but cannot carry session args; those must be passed on the command line. The --session-args JSON is provided inline. ```bash act run actpkg.dev/library/sqlite --mcp --profile sqlite-dev \ --session-args '{"database_path": "/Users/me/dev/app.sqlite"}' ``` -------------------------------- ### act secret list and rm: manage stored credentials Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/host/credentials.mdx Lists credential metadata (key, kind, description, expiry) without ever printing the value, and removes a stored credential by component and key. There is no act secret get command. ```bash act secret list # key, kind, description, expiry — never a value act secret rm --key ``` -------------------------------- ### act secret subcommands Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/reference/cli.mdx Manages stored credentials. There is no get — a stored value is never printed. list shows key, kind, description, and expiry only. A credential is its set of named fields; no field name is well-known and std: is reserved and refused. ```bash act secret set --field [--key ] [--description ] act secret list act secret rm [--key ] ``` -------------------------------- ### Build the component with just build Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/build/rust.mdx Builds the component using the just build recipe. This runs cargo build --release and then act-build pack to embed the act:component custom section and the contents of skill/ as an Agent Skill tar. ```bash just build ``` -------------------------------- ### Grant access via CLI flags --allow, --deny, --grant Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/host/policy.mdx Use these three flags with `run`, `call`, or `info` to grant access. `--allow` opens a whole class up to the component's ceiling, `--deny` refuses a class outright, and `--grant` provides full control with a JSON object that is repeatable and merged. A grant value is either the string `"open"` or an object with `mode`, `allow`, and `deny`; `allow` and `deny` hold provider-defined constraints. ```bash # Open a whole class, up to the component's declared ceiling act run --mcp --allow wasi:http # Refuse a class outright — including a semantic class the component declares act run --mcp --deny db:drop # Full control: a JSON grant, repeatable and merged act run --mcp --grant '{ "wasi:filesystem": {"mode":"allowlist","allow":[{"path":"/data/**","mode":"rw"}]}, "wasi:http": {"mode":"allowlist","allow":[{"host":"api.example.com","scheme":"https"}]} }' ``` -------------------------------- ### Serve sqlite component over MCP (stdio and HTTP) Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/run-first-component.mdx Serve the sqlite component over MCP using stdio or HTTP. The stdio variant exposes the component for local MCP clients like Claude Code, Claude Desktop, or Cursor. The HTTP variant listens on [::1]:3000 at /mcp for remote or containerized agents. Both use --session-args to pre-open a session and --allow to restrict filesystem access. ```bash act run actpkg.dev/library/sqlite --mcp \ --session-args '{"database_path": "/tmp/actdemo/app.sqlite"}' \ --allow 'fs=/tmp/actdemo/**' ``` ```bash act run actpkg.dev/library/sqlite --mcp --http -l "[::1]:3000" \ --session-args '{"database_path": "/tmp/actdemo/app.sqlite"}' \ --allow 'fs=/tmp/actdemo/**' ``` -------------------------------- ### Run sqlite component over stdio, HTTP, CLI, and browser Source: https://github.com/actcore/actcore.dev/blob/main/src/content/blog/2026-04-23-introducing-act.md Four ways to deploy the same sqlite component: stdio JSON-RPC for Claude Desktop/Cursor/Cline, REST-ish HTTP with SSE, one-shot direct call for scripts/CI, and jco transpile for browser use. The component itself does not change. ```bash # Claude Desktop / Cursor / Cline → stdio JSON-RPC act run actpkg.dev/library/sqlite:latest --mcp \ --fs-policy allowlist --fs-allow /tmp/demo.sqlite # Web backend → REST-ish HTTP with SSE streaming act run actpkg.dev/library/sqlite:latest --http --listen "[::1]:3000" # Script / CI → one-shot direct call act call actpkg.dev/library/sqlite:latest query \ --args '{"sql": "SELECT sqlite_version()"}' \ --metadata '{"database_path":"/tmp/demo.sqlite"}' # Browser tab → jco transpile, no server at all jco transpile actpkg.dev/library/sqlite:latest -o dist/ ``` -------------------------------- ### Rust SDK: define a reverse tool with act_component and act_tool Source: https://github.com/actcore/actcore.dev/blob/main/src/content/blog/2026-04-23-introducing-act.md Minimal Rust component that reverses a string. `#[act_tool]` derives JSON Schema from the function signature; `#[act_component]` emits the WIT export. Build with `cargo build --target wasm32-wasip2 --release` and `act-build pack` to get a `.wasm` that speaks MCP, HTTP, and the CLI. ```rust use act_sdk::prelude::*; #[act_component] mod component { use super::*; #[act_tool(description = "Reverse a string", read_only)] fn reverse(text: String) -> ActResult { Ok(text.chars().rev().collect()) } } ``` -------------------------------- ### Create a new Starlight project Source: https://github.com/actcore/actcore.dev/blob/main/README.md Scaffolds a new Astro project using the Starlight template. Run this command in your terminal to create a new Starlight site. ```bash npm create astro@latest -- --template starlight ``` -------------------------------- ### Run sqlite component with MCP and filesystem allowlist Source: https://github.com/actcore/actcore.dev/blob/main/src/content/blog/2026-04-25-eleven-components.md Run the sqlite component as an MCP server with a filesystem allowlist granting access to /data/app.sqlite. Note: the --fs-policy and --fs-allow flags were replaced by a uniform grant model (--grant, --allow, --deny) in 2026-08. ```bash npx @actcore/act run actpkg.dev/library/sqlite:latest --mcp \ --fs-policy allowlist --fs-allow /data/app.sqlite ``` -------------------------------- ### act command help Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/reference/cli.mdx Top-level `act` command help output listing all subcommands and their purposes. Use it to see the full CLI surface, including `run`, `call`, `info`, `skill`, `pull`, `session`, `store`, `inspect`, `secret`, `login`, and `completions`. ```text act Commands: run Load a .wasm component and serve it over MCP call Call a tool directly and print the result info Show component info and optionally list tools skill Extract embedded Agent Skills from a component pull Pull a component from a registry session Inspect `act:sessions/session-provider` (open-args-schema) store Manage the local component store (list, update, gc) inspect Inspect a component artifact (read-only, no instantiation) secret Manage stored credentials. There is no `get`: a value is never printed login Provision a credential a component declares it expects, by prompting completions Print a shell completion script on stdout ``` -------------------------------- ### act-build pack command Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/reference/cli.mdx Packs a component, embedding metadata and custom sections. Metadata is resolved by merge-patch from the language manifest, optional act.toml sidecar, and --set overrides. --set values are set as strings, so only string-typed fields can be set. Writes act:component, version, description, and act:skill sections. ```bash act-build pack [--set ] ``` -------------------------------- ### Session-of-1 with act run --mcp Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/host/sessions.mdx Session-of-1 style: the host pre-opens one session at startup and serves the component as if sessions did not exist. No virtual tools appear, and a client-supplied std:session-id is ignored. Usual for wiring into an agent. ```bash act run actpkg.dev/library/sqlite --mcp \ --session-args '{"database_path": "/tmp/actdemo/app.sqlite"}' ``` -------------------------------- ### Scaffold a Python ACT component with act-build init Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/build/python.mdx Initializes a new Python ACT component project. The template is embedded in the binary, so no copier or uvx is needed. Pass --http or --fs to declare those capabilities in act.toml. ```bash act-build init python my-component cd my-component just init ``` -------------------------------- ### Inspect component tools with npx @actcore/act info Source: https://github.com/actcore/actcore.dev/blob/main/src/content/blog/2026-04-25-eleven-components.md Inspect the tools exposed by any published actpkg component. Replace with the component name; requires Node.js and the @actcore/act CLI. ```bash npx @actcore/act info actpkg.dev/library/:latest --tools ``` -------------------------------- ### Use shorthand --allow and --deny rules Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/host/policy.mdx Use `--allow` and `--deny` with a rule after `=` for the common case of one directory or one host. Each shorthand is exactly one `--grant` rule parsed by the capability's provider. The table lists aliases: `fs` for `wasi:filesystem`, `http` for `wasi:http`, `sockets` for `wasi:sockets`, and `creds` for `act:credentials`; semantic classes use ``. A rule never exceeds the component's ceiling, IPv6 goes in brackets, and `--allow 'http=…'` takes hosts not CIDR ranges. ```bash act run actpkg.dev/library/sqlite --mcp --allow 'fs=/data/**' # read-write act run --mcp --allow 'fs=~/notes/**:ro' # read-only act run --mcp --allow 'http=https://api.example.com' # one host + scheme act run --mcp --allow 'sockets=db.local:5432/tcp' # host, port, protocol act run --mcp --allow 'db:drop=test_*' # semantic class, by key act run --mcp --allow 'fs=/data/**' --deny 'fs=/data/secret/**' ``` -------------------------------- ### Scaffold a new component with copier Source: https://github.com/actcore/actcore.dev/blob/main/src/content/blog/2026-04-25-eleven-components.md Use this command to scaffold a new component from the Rust or Python template. Replace 'my-component' with your desired component name. ```bash copier copy gh:actcore/act-template-rust my-component ``` -------------------------------- ### act run Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/reference/cli.mdx Serves a component over MCP. Requires a transport: `--mcp` for stdio or `--mcp --http` for MCP over HTTP. `--http` requires `--mcp`, and `--listen` requires `--http`. ```APIDOC ## act run ### Description Serves a component over MCP. Requires a transport: `--mcp` for stdio or `--mcp --http` for MCP over HTTP. `--http` requires `--mcp`, and `--listen` requires `--http`. ### Method CLI ### Endpoint `act run --mcp [--http] [-l ] [--session-args ] [grant flags...]` ### Parameters #### Positional Arguments - **component** (string) - Required - Component reference: local path, HTTP(S) URL, or OCI registry ref. #### Flags - **--mcp** (flag) - Required - Speak MCP on stdio. - **--http** (flag) - Optional - Serve the same MCP server over Streamable HTTP at `/mcp`. - **-l, --listen** (string) - Optional - Listen address. Accepts a port number (binds `[::1]:`) or a full `addr:port`. Defaults to `[::1]:3000`. - **--session-args** (string) - Optional - JSON string to pre-open one session at startup and serve the component as a session-of-1. - **--grant** (string) - Optional - Full JSON grant: `{"": "open" | {"mode":…,"allow":[…],"deny":[…]}}`. Repeatable, merged. - **--allow** (string) - Optional - Open a capability class by id, up to its declared ceiling. Repeatable. - **--deny** (string) - Optional - Deny a capability class by id. Repeatable. - **-m, --metadata** (string) - Optional - Per-call metadata, string value. Repeatable. - **--metadata-json** (string) - Optional - Per-call metadata as a JSON object (typed values). - **--metadata-file** (string) - Optional - Read metadata from a JSON file. - **--max-memory** (string) - Optional - Cap guest linear memory (`512MiB`, `512MB`, or a byte count). - **--no-audit** (flag) - Optional - Disable the audit trail. - **--audit-args** (flag) - Optional - Record full tool arguments instead of a digest. Can expose credentials. - **--credentials-backend** (string) - Optional - Credential store this run reads from (`file:`). - **--profile** (string) - Optional - Activate a profile from `~/.config/act/config.toml`. - **--config** (string) - Optional - Use an alternate config file. ### Request Example ```bash act run ./component.wasm --mcp --http -l 8080 --session-args '{"sessionId":"abc"}' ``` ### Response #### Success Response Serves the component over MCP. No structured response. #### Error Response If no transport is specified, prints an error and exits non-zero. ### Example Error ```console $ act run Error: Specify a transport: --mcp (stdio), or --mcp --http (MCP over HTTP) ``` ``` -------------------------------- ### Inspect and provide session arguments Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/host/troubleshooting.mdx Commands to inspect and provide session arguments for a stateful component. Use when a component is stateful and no session was opened. ```bash act session open-args-schema # what does it want? act call --args '…' --session-args '{"…": "…"}' ``` -------------------------------- ### Pull and plug the sync shim with wkg and wac Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/build/languages.mdx Used to lift a sync-compatible component to the async interface. Pulls the prebuilt shim and composes it with your component using `wac plug`. ```bash wkg oci pull ghcr.io/actcore/act/shim-tools-sync:0.1.0 -o tool_shim.wasm wac plug tool_shim.wasm --plug inner.wasm -o component.wasm ``` -------------------------------- ### Project structure overview Source: https://github.com/actcore/actcore.dev/blob/main/README.md Shows the default folder and file structure of an Astro + Starlight project. Starlight looks for .md or .mdx files in src/content/docs/, images can be added to src/assets/, and static assets like favicons go in public/. ```text . ├── public/ ├── src/ │ ├── assets/ │ ├── content/ │ │ └── docs/ │ └── content.config.ts ├── astro.config.mjs ├── package.json └── tsconfig.json ``` -------------------------------- ### act completions Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/reference/cli.mdx Prints a shell completion script on stdout. ```APIDOC ## act completions ### Description Prints a shell completion script on stdout. ### Method CLI ### Endpoint `act completions` ### Request Example ```bash act completions ``` ### Response #### Success Response Prints the shell completion script. #### Error Response Exits non-zero on error. ``` -------------------------------- ### Re-upload existing demo.cast with render.sh --upload-only Source: https://github.com/actcore/actcore.dev/blob/main/scripts/blog/introducing-act/README.md Re-uploads the existing demo.cast without re-recording. ```bash ./render.sh --upload-only ``` -------------------------------- ### Policy layer precedence Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/host/policy.mdx Shows the precedence order for policy layers: global, then profile, then CLI flags. Later layers win. ```text global [policy] < profile [policy] < CLI --grant/--allow/--deny ``` -------------------------------- ### Run component as MCP server over stdio Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/host/transports.mdx Runs a component as an MCP server over stdio, speaking JSON-RPC 2.0. Tool annotations map to MCP hints. Use with MCP clients like Claude Code, Claude Desktop, Cursor, Cline, or OpenCode. ```bash act run --mcp ``` -------------------------------- ### Filesystem topology bind mount Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/build/manifest.mdx Binds a host directory to a stable guest path so the component's code opens a fixed path regardless of who runs it. Authorization still comes from the allow entries, so keep the host paths in sync. ```toml [[std.capabilities."wasi:filesystem".params.mounts]] type = "bind" guest = "/data" host = "~/.my-component" ``` -------------------------------- ### WIT interface for host import Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/host/credentials.mdx Shows the WIT interface that components use to request secrets from the host. It is a host import, meaning the host implements the store and the component asks. The component never sees filesystem paths, keyrings, or other components' secrets. ```wit list-secrets: async func(session: option) -> result, secret-error>; get-secret: async func(session: string, want: secret-request) -> result; ``` -------------------------------- ### Run the component with just test and act call Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/build/rust.mdx Runs the e2e test suite and calls the reverse tool with the given arguments. The just test command runs pytest driving the component over MCP, and act call invokes the tool directly. ```bash just test # e2e suite: pytest driving the component over MCP act call reverse --args '{"text":"hello"}' ``` -------------------------------- ### Quick iteration with act call Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/build/testing.mdx Command to call a tool directly for quick iteration, faster than a full test run. ```bash act call reverse --args '{"text":"hello"}' ``` -------------------------------- ### Python pyproject.toml manifest with act metadata Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/build/manifest.mdx Shows the base manifest fields and the optional [tool.act.std] table for Python components. The name, version, and description are taken from the [project] section by default. ```toml # pyproject.toml [project] name = "python-eval" version = "0.1.1" description = "Python interpreter" [tool.act.std] # optional overrides/additions ``` -------------------------------- ### Pack and inspect component manifest Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/host/troubleshooting.mdx Commands to pack an unpacked .wasm and verify the component manifest. An unpacked .wasm carries no act:component section, so it declares no ceiling and all grants are refused as outside ceiling. ```bash act-build pack target/wasm32-wasip2/release/.wasm act inspect component-manifest .wasm | jq -r .std.name # "" or missing → still unpacked ``` -------------------------------- ### Inspect component with act info Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/run-first-component.mdx Inspect a published component's metadata, declared capabilities, and exposed tools. The --tools flag lists every tool the component provides. ```bash act info actpkg.dev/library/sqlite --tools ``` -------------------------------- ### Agent-driven sessions with act run --mcp Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/host/sessions.mdx Agent-driven style: with no --session-args, the host synthesises two extra MCP tools (open_session and close_session) from the component's schema. The agent opens sessions itself and passes the id back. ```bash act run actpkg.dev/library/mcp-bridge --mcp ``` -------------------------------- ### openapi-bridge 0.2.0 Source: https://github.com/actcore/actcore.dev/blob/main/src/content/blog/2026-05-07-act-07-sessions.md Loads an OpenAPI 3.x spec at runtime and exposes each operation as a local ACT tool. `open-session({spec_url, headers})` fetches and parses the spec eagerly, so connect or parse failures surface at open time rather than 17 tool calls later. ```APIDOC ## Bridge: openapi-bridge 0.2.0 ### Description Loads an OpenAPI 3.x spec at runtime and exposes each operation as a local ACT tool. `open-session({spec_url, headers})` fetches and parses the spec eagerly, so connect or parse failures surface at open time rather than 17 tool calls later. Path/query/header parameters and JSON request bodies are flattened into a single tool argument schema, auto-named from `operationId` (or synthesised from method + path). ### Usage ```bash # Example usage (not provided in source) ``` ### Notes The parsed spec is cached by `spec_url` so multiple sessions targeting the same API share the parse — opening 10 sessions for the same spec costs one fetch. ``` -------------------------------- ### Call sqlite query with act call and show output Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/run-first-component.mdx Call a tool on a stateful component using act call. The --session-args flag opens a session-of-1 for the sqlite component, and --allow grants filesystem access to /tmp/actdemo/** (read-write; use :ro for read-only). The output shows the query result. ```bash mkdir -p /tmp/actdemo act call actpkg.dev/library/sqlite query \ --args '{"sql": "SELECT sqlite_version()"}' \ --session-args '{"database_path": "/tmp/actdemo/app.sqlite"}' \ --allow 'fs=/tmp/actdemo/**' ``` ```json [ { "sqlite_version()": "3.51.3" } ] ``` -------------------------------- ### One database file Source: https://github.com/actcore/actcore.dev/blob/main/src/content/docs/docs/host/policy.mdx Allows access to a single database file by setting the session database path and allowing filesystem access under /data/**. ```bash act run actpkg.dev/library/sqlite --mcp \ --session-args '{"database_path":"/data/app.db"}' \ --allow 'fs=/data/**' ``` -------------------------------- ### Build LTO-optimized jco-transpile bindgen Source: https://github.com/actcore/actcore.dev/blob/main/vendor/jco-bindgen-lto/README.md Builds the LTO-optimized bindgen from a checkout of bytecodealliance/jco main (has #1732 + #1737). The output files are the three runtime files the bindgen .js needs. ```bash pnpm install pnpm --filter @bytecodealliance/jco-transpile run build:release # → packages/jco-transpile/vendor/js-component-bindgen-component.{js,core.wasm,core2.wasm} ```