v0.3.0 · World

stdio-transport

A WIT framework for composing Model Context Protocol servers as WebAssembly components.

https://modelcontextprotocol.io/specification/2025-06-18/schema Transport components terminate the transport layer protocol and forward the MCP request resource and output stream handle to the first handler in the chain.

Middleware components intercept an MCP request resource. They can modify the request context before passing the resource to the next handler.

Handler components process specific MCP methods and can forward the request resource to the next handler in the chain.

The initialize method handler is the final handler in the chain. It processes the initialize MCP request using the server capabilities added to the request context by upstream handlers and middleware. Transport world for stdio-based MCP communication.

This world provides MCP server functionality over standard I/O, suitable for command-line tools and local process communication.

Exports

Imports

I
wasi:io/error 0.2.3
I
wasi:io/poll 0.2.3
A poll API intended to let users wait for I/O events on multiple handles at once.
I
wasi:io/streams 0.2.3
WASI I/O is an I/O abstraction API which is currently focused on providing stream types.
I
types
Core MCP data types and aliases
I
error
Error handling for MCP operations.
I
request
MCP request types
I
incoming-handler
Handler interface for incoming MCP requests.
I
wasi:cli/environment 0.2.3
I
wasi:cli/exit 0.2.3
I
wasi:cli/stdin 0.2.3
I
wasi:cli/stdout 0.2.3
I
wasi:cli/stderr 0.2.3
I
wasi:cli/terminal-input 0.2.3
Terminal input.
I
wasi:cli/terminal-output 0.2.3
Terminal output.
I
wasi:cli/terminal-stdin 0.2.3
An interface providing an optional terminal-input for stdin as a link-time authority.
I
wasi:cli/terminal-stdout 0.2.3
An interface providing an optional terminal-output for stdout as a link-time authority.
I
wasi:cli/terminal-stderr 0.2.3
An interface providing an optional terminal-output for stderr as a link-time authority.
I
wasi:clocks/monotonic-clock 0.2.3
WASI Monotonic Clock is a clock API intended to let users measure elapsed time.
I
wasi:clocks/wall-clock 0.2.3
WASI Wall Clock is a clock API intended to let users query the current time. The name "wall" makes an analogy to a "clock on the wall", which is not necessarily monotonic as it may be reset.
I
wasi:filesystem/types 0.2.3
WASI filesystem is a filesystem API primarily intended to let users run WASI programs that access their files on their existing filesystems, without significant overhead.
I
wasi:filesystem/preopens 0.2.3
I
wasi:sockets/network 0.2.3
I
wasi:sockets/instance-network 0.2.3
This interface provides a value-export of the default network handle..
I
wasi:sockets/udp 0.2.3
I
wasi:sockets/udp-create-socket 0.2.3
I
wasi:sockets/tcp 0.2.3
I
wasi:sockets/tcp-create-socket 0.2.3
I
wasi:sockets/ip-name-lookup 0.2.3
I
wasi:random/random 0.2.3
WASI Random is a random data API.
I
wasi:random/insecure 0.2.3
The insecure interface for insecure pseudo-random numbers.
I
wasi:random/insecure-seed 0.2.3
The insecure-seed interface for seeding hash-map DoS resistance.