If you haven't already, install wash
curl -fsSL https://raw.githubusercontent.com/wasmcloud/wash/refs/heads/main/install.sh | bash
Install the latest release as a wash plugin:
wash plugin install ghcr.io/cosmonic-labs/plugins/openapi2mcp:0.5.0
Start with an MCP project, using our template to get started:
wash new --git https://github.com/cosmonic-labs/mcp-server-template-ts.git "my-mcp-server"
Generate MCP tools into the server project from an OpenAPI specification:
wash openapi2mcp [path/to/open/yaml/or/json] --project-path [path/to/generated/mcp/server]
# cargo run -- -i [path/to/open/yaml/or/json] --project-path [path/to/generated/mcp/server]
wash new --git https://github.com/cosmonic-labs/mcp-server-template-ts.git "tests/petstore/generated"
cargo run -- -i tests/petstore/input.json --project-path tests/petstore/generated
Use as a wash plugin
Compile to Wasm targeting WASIp2:
cargo build --target wasm32-wasip2 --release
Install as a wash
plugin:
wash plugin install ./target/wasm32-wasip2/release/openapi2mcp.wasm
Run as wash
plugin:
# wash openapi2mcp [path/to/open/yaml/or/json] --project-path [path/to/generated/mcp/server]
wash new --git https://github.com/cosmonic-labs/mcp-server-template-ts.git tests/petstore/generated
wash openapi2mcp tests/petstore/input.json --project-path tests/petstore/generated