wasm-mcp
v0.2.16Read-only MCP server for the WebAssembly spec: instructions, types, sections, search, proposals.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
spec_version Pinned spec version
Return self-description of this MCP server: package name + version, plus the pinned upstream commit SHA for every spec snapshot baked into the package. Use this first when citing the spec, or to verify the server's freshness and reproducibility.
instruction_get Get instruction
Fetch one WebAssembly instruction by mnemonic (`i32.add`, `br_if`) or binary opcode (`0x6a`, `0xfd 0x89 0x02`) as structured JSON: opcode bytes, category, introducing version, stack type signature, validation/execution prose anchors + spec URLs, and `traps` — the runtime conditions under which it traps (each with the spec's canonical trap name; empty + `can_trap: false` for instructions that never trap). Provide `mnemonic` or `opcode` (mnemonic wins if both match).
| Parameter | Type | Description |
|---|---|---|
mnemonic | string | Instruction mnemonic, e.g. `i32.add`, `br_if`, `local.get`. Case-insensitive. Exact match. |
opcode | string | Binary opcode as hex bytes, e.g. `0x6a`, `6a`, or multi-byte `0xfd 0x89 0x02`. Exact match. Used when `mnemonic` is absent or doesn't match. |
version | string | WebAssembly spec version to query. `latest` (default) is the current served version; `main` is the upstream working draft. |
instruction_list List instructions
Enumerate WebAssembly instructions with optional filters: `category` (control, numeric, parametric, variable, table, memory, ref, i31, struct, array, extern, vec), `introduced_in` (1.0 | 2.0 | 3.0), `prefix` (mnemonic prefix like `i32.`), and `can_trap` (only trapping / only non-trapping instructions). Returns lightweight rows (incl. `can_trap`) sorted by opcode; follow up with instruction_get for full detail incl. trap conditions.
| Parameter | Type | Description |
|---|---|---|
can_trap | boolean | Filter by trapping behavior: `true` keeps only instructions that can trap at runtime, `false` keeps only those that never trap. See instruction_get for the per-instruction trap conditions. |
category | string | Filter by instruction category: control, numeric, parametric, variable, table, memory, ref, i31, struct, array, extern, vec (vector/SIMD). |
introduced_in | string | Filter to instructions introduced in this WebAssembly version: `1.0`, `2.0`, or `3.0`. |
prefix | string | Filter to mnemonics starting with this prefix, e.g. `i32.` or `v128.`. Case-insensitive. |
version | string | WebAssembly spec version to query. `latest` (default) is the current served version; `main` is the upstream working draft. |
instruction_search Search instructions
Search WebAssembly instructions by free-text query, matched against mnemonic (exact > substring), category name, and opcode hex. The entry point when you don't know the exact mnemonic. Returns ranked lightweight hits with a `matched_on` field; follow up with instruction_get.
| Parameter | Type | Description |
|---|---|---|
query * | string | Search text. Matched against mnemonic (exact > substring), category name, and opcode hex. E.g. `extend`, `trunc`, `vec`, `0x6a`. |
limit | integer | Max ranked hits returned. |
version | string | WebAssembly spec version to query. `latest` (default) is the current served version; `main` is the upstream working draft. |
type_get Get type
Look up a WebAssembly type or type form by name: concrete value types (`i32`, `i64`, `f32`, `f64`, `v128`, `funcref`, `externref`, …) or type forms (`functype`, `limits`, `memtype`, `tabletype`, `globaltype`, `reftype`, `valtype`, `rectype`, `heaptype`, …). Returns its classification, sibling members for category types, defining clause prose, SpecTec formal-rule references, and the rendered spec URL.
| Parameter | Type | Description |
|---|---|---|
name * | string | Type or type-form name. Concrete value types: `i32`, `i64`, `f32`, `f64`, `v128`, `funcref`, `externref`, … Type forms: `functype`, `limits`, `memtype`, `tabletype`, `globaltype`, `reftype`, `valtyp… |
version | string | WebAssembly spec version to query. `latest` (default) is the current served version; `main` is the upstream working draft. |
section_get Get spec section
Fetch one spec clause by id or anchor, across `core` / `js-api` / `web-api` (set `spec`). For core: `syntax-numtype`, `valid-unreachable`, `binary-instr`, … For the embedding specs: `modules`, `memories`, `streaming-modules`, … Matches the rendered spec's stable fragment ids. Returns the clause title, cleaned prose, cross-references, the SpecTec `formal_refs` it cites (core), and the rendered URL. Core validation/execution clauses are SpecTec-generated: prose may be terse, but formal_refs + url point to the formal rule.
| Parameter | Type | Description |
|---|---|---|
id * | string | Clause id or anchor. For `core`: `syntax-numtype`, `valid-unreachable`, `binary-instr`, … For `js-api` / `web-api`: `modules`, `memories`, `streaming-modules`, … These match the stable fragment id… |
spec | string | Which WebAssembly spec to query: `core` (default; instructions, types, validation, execution, formats), `js-api` (JavaScript embedding), or `web-api` (Web platform integration). |
version | string | WebAssembly spec version to query. `latest` (default) is the current served version; `main` is the upstream working draft. |
section_list List spec sections
Enumerate spec clauses for navigation, across `core` / `js-api` / `web-api` (set `spec`). Filter by source `path` (core: `intro`, `syntax`, `valid`, `exec`, `binary`, `text`, `appendix`, or sub-paths like `syntax/types`), `anchor_prefix`, `titled_only`, and `max_level`. Returns lightweight rows {id, anchors, title, level, path, url}; follow up with section_get.
| Parameter | Type | Description |
|---|---|---|
anchor_prefix | string | Filter to clauses whose id/anchor starts with this prefix, e.g. `syntax-`, `valid-`, `exec-`. |
max_level | integer | Cap heading depth (1 = page titles only). Anchor-only blocks are unaffected. |
path | string | Filter to a source path / prefix. Top-level areas: `intro`, `syntax` (structure), `valid` (validation), `exec` (execution), `binary`, `text`, `appendix`. Sub-paths like `syntax/types` also work. |
spec | string | Which WebAssembly spec to query: `core` (default; instructions, types, validation, execution, formats), `js-api` (JavaScript embedding), or `web-api` (Web platform integration). |
titled_only | boolean | Drop anchor-only content blocks (keep only clauses with a heading). |
version | string | WebAssembly spec version to query. `latest` (default) is the current served version; `main` is the upstream working draft. |
spec_search Search spec
Full-text search across the section index of a spec (`core` / `js-api` / `web-api`, set `spec`) — clause anchors/ids, titles, and prose. The entry point when you don't know the exact anchor. Returns ranked hits with a `matched_on` field (anchor-exact > title > anchor > prose) and a prose snippet for body matches; follow up with section_get.
| Parameter | Type | Description |
|---|---|---|
query * | string | Search text. Matched against clause anchors/ids, titles, and prose. E.g. `block type`, `trap`, `funcref`, `streaming compilation`. |
limit | integer | Max ranked hits returned. |
spec | string | Which WebAssembly spec to query: `core` (default; instructions, types, validation, execution, formats), `js-api` (JavaScript embedding), or `web-api` (Web platform integration). |
version | string | WebAssembly spec version to query. `latest` (default) is the current served version; `main` is the upstream working draft. |
proposal_list List WebAssembly proposals
List WebAssembly proposals and their phases from the pinned WebAssembly/proposals repository. Filter by `status` (phase-0…phase-5, finished, inactive), `phase` (0–5), `champion` substring, `affects` (finished proposals touching core / js-api / web-api), or `contains` (name/champion substring). Each row carries name, status, phase, champion, affected_specs, spec_version, and the proposal URL.
| Parameter | Type | Description |
|---|---|---|
affects | string | Filter to finished proposals affecting a given spec: `core`, `js-api`, or `web-api`. |
champion | string | Champion substring, case-insensitive. |
contains | string | Name or champion substring, case-insensitive. |
phase | integer | Filter by numeric phase 0–5 (active + finished proposals carry a phase). |
status | string | Filter by lifecycle status: `phase-0`…`phase-5`, `finished` (merged into the spec), or `inactive`. |