wasm-mcp

v0.2.16
io.github.xyzzylabs/wasm-mcp Checked 4 days ago Published 4 months ago

Read-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).

ParameterTypeDescription
mnemonicstringInstruction mnemonic, e.g. `i32.add`, `br_if`, `local.get`. Case-insensitive. Exact match.
opcodestringBinary 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.
versionstringWebAssembly 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.

ParameterTypeDescription
can_trapbooleanFilter 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.
categorystringFilter by instruction category: control, numeric, parametric, variable, table, memory, ref, i31, struct, array, extern, vec (vector/SIMD).
introduced_instringFilter to instructions introduced in this WebAssembly version: `1.0`, `2.0`, or `3.0`.
prefixstringFilter to mnemonics starting with this prefix, e.g. `i32.` or `v128.`. Case-insensitive.
versionstringWebAssembly 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.

ParameterTypeDescription
name *stringType or type-form name. Concrete value types: `i32`, `i64`, `f32`, `f64`, `v128`, `funcref`, `externref`, … Type forms: `functype`, `limits`, `memtype`, `tabletype`, `globaltype`, `reftype`, `valtyp…
versionstringWebAssembly 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.

ParameterTypeDescription
id *stringClause 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…
specstringWhich WebAssembly spec to query: `core` (default; instructions, types, validation, execution, formats), `js-api` (JavaScript embedding), or `web-api` (Web platform integration).
versionstringWebAssembly 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.

ParameterTypeDescription
anchor_prefixstringFilter to clauses whose id/anchor starts with this prefix, e.g. `syntax-`, `valid-`, `exec-`.
max_levelintegerCap heading depth (1 = page titles only). Anchor-only blocks are unaffected.
pathstringFilter 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.
specstringWhich WebAssembly spec to query: `core` (default; instructions, types, validation, execution, formats), `js-api` (JavaScript embedding), or `web-api` (Web platform integration).
titled_onlybooleanDrop anchor-only content blocks (keep only clauses with a heading).
versionstringWebAssembly 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.

ParameterTypeDescription
affectsstringFilter to finished proposals affecting a given spec: `core`, `js-api`, or `web-api`.
championstringChampion substring, case-insensitive.
containsstringName or champion substring, case-insensitive.
phaseintegerFilter by numeric phase 0–5 (active + finished proposals carry a phase).
statusstringFilter by lifecycle status: `phase-0`…`phase-5`, `finished` (merged into the spec), or `inactive`.