Skip to content

cosmonic-labs/openapi2mcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenAPI to MCP Server Generator

Usage

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]

Building and running from source

Run as a CLI

# 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

About

Create MCP Servers that compile to Wasm given an OpenAPI spec

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •