Skip to content

Commit a113661

Browse files
committed
fix: build errors for WASI target
* The `cargo build` command failed for the WASI target with the following error: ``` warning: /home/dennis/code/mcp/rust-sdk/crates/rmcp/Cargo.toml: unused manifest key: dependencies.rmcp-macros.version warning: /home/dennis/code/mcp/rust-sdk/examples/simple-chat-client/Cargo.toml: unused manifest key: dependencies.rmcp.no-default-features error: There are multiple `wasi` packages in your project, and the specification `wasi` is ambiguous. Please re-run this command with one of the following specifications: [email protected] [email protected]+wasi-0.2.4 ``` It seems that the command got confused about the package name when trying to build on a fresh machine. The solution for this is the renaming of the package. * The commands in the documentation are changed accordingly. * Enhance also the documentation a little bit.
1 parent 57e14c5 commit a113661

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

examples/wasi/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
2-
31
[package]
4-
name = "wasi"
2+
name = "wasi-mcp-example"
53
edition = { workspace = true }
64
version = { workspace = true }
75
authors = { workspace = true }

examples/wasi/README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1+
# Example for WASI-p2
2+
3+
Build:
4+
15
```sh
2-
cargo build -p wasi --target wasm32-wasip2
3-
npx @modelcontextprotocol/inspector wasmtime target/wasm32-wasip2/debug/wasi.wasm
6+
cargo build -p wasi-mcp-example --target wasm32-wasip2
47
```
8+
9+
Run:
10+
11+
```
12+
npx @modelcontextprotocol/inspector wasmtime target/wasm32-wasip2/debug/wasi_mcp_example.wasm
13+
```
14+
15+
*Note:* Change `wasmtime` to a different installed run time, if needed.
16+
17+
The printed URL of the MCP inspector can be opened and a connection to the module established via `STDIO`.

0 commit comments

Comments
 (0)