From 74aa3618fa792d478ea795d27df1e0617a8af209 Mon Sep 17 00:00:00 2001 From: tanish111 Date: Fri, 14 Nov 2025 21:57:20 +0530 Subject: [PATCH 1/3] fix: exclude WASI example from workspace to avoid linker errors on Mac/arm64 Cargo uses the macOS host linker for workspace builds, but that linker cannot resolve WASI WebAssembly imports (such as _wasi:cli/run@0.2.x). As a result, including a WASI crate in the workspace causes builds to fail on macOS systems using arm64. Solution: Mark the WASI example as non-default by excluding it from the workspace members. This makes the WASI package optional, so `cargo build` won't touch it, and it can be built explicitly when needed with: cargo build -p wasi-mcp-example --target wasm32-wasip2 Signed-off-by: tanish111 --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index f224ec59..3a644678 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,6 @@ [workspace] members = ["crates/rmcp", "crates/rmcp-macros", "examples/*"] +exclude = ["examples/wasi"] resolver = "2" [workspace.dependencies] From d1d02db8fa2db2ea987b7d4e09c878a170edf8be Mon Sep 17 00:00:00 2001 From: tanish111 Date: Mon, 17 Nov 2025 23:19:25 +0530 Subject: [PATCH 2/3] fix: make WASI example standalone for CI compatibility Replace workspace inheritance with explicit values in examples/wasi/Cargo.toml since excluded packages cannot inherit from workspace. This fixes CI manifest parsing errors when building WASI example explicitly. Signed-off-by: tanish111 --- examples/wasi/Cargo.toml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/examples/wasi/Cargo.toml b/examples/wasi/Cargo.toml index 4cceb43d..5102c9df 100644 --- a/examples/wasi/Cargo.toml +++ b/examples/wasi/Cargo.toml @@ -1,15 +1,18 @@ [package] name = "wasi-mcp-example" -edition = { workspace = true } -version = { workspace = true } -authors = { workspace = true } -license = { workspace = true } -repository = { workspace = true } -description = { workspace = true } -keywords = { workspace = true } -homepage = { workspace = true } -categories = { workspace = true } -readme = { workspace = true } +edition = "2024" +version = "0.8.5" +authors = ["4t145 "] +license = "MIT" +repository = "https://github.com/modelcontextprotocol/rust-sdk/" +description = "Rust SDK for Model Context Protocol" +keywords = ["mcp", "sdk", "tokio", "modelcontextprotocol"] +homepage = "https://github.com/modelcontextprotocol/rust-sdk" +categories = [ + "network-programming", + "asynchronous", +] +readme = "README.md" publish = false [lib] @@ -18,7 +21,7 @@ crate-type = ["cdylib"] [dependencies] wasi = { version = "0.14.2"} tokio = { version = "1", features = ["rt", "io-util", "sync", "macros", "time"] } -rmcp = { workspace = true, features = ["server", "macros"] } +rmcp = { version = "0.8.5", path = "../../crates/rmcp", features = ["server", "macros"] } serde = { version = "1", features = ["derive"]} tracing-subscriber = { version = "0.3", features = [ "env-filter", From 99919434e5baded30185289f90090175849b2ec3 Mon Sep 17 00:00:00 2001 From: tanish111 Date: Tue, 18 Nov 2025 00:52:43 +0530 Subject: [PATCH 3/3] fix: exclude examples from default builds using default-members Only core crates are built by default, preventing WASI linker errors on macOS while keeping it in workspace for property inheritance. Signed-off-by: tanish111 --- Cargo.toml | 2 +- examples/wasi/Cargo.toml | 25 +++++++++++-------------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3a644678..2abaad0b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [workspace] members = ["crates/rmcp", "crates/rmcp-macros", "examples/*"] -exclude = ["examples/wasi"] +default-members = ["crates/rmcp", "crates/rmcp-macros"] resolver = "2" [workspace.dependencies] diff --git a/examples/wasi/Cargo.toml b/examples/wasi/Cargo.toml index 5102c9df..4cceb43d 100644 --- a/examples/wasi/Cargo.toml +++ b/examples/wasi/Cargo.toml @@ -1,18 +1,15 @@ [package] name = "wasi-mcp-example" -edition = "2024" -version = "0.8.5" -authors = ["4t145 "] -license = "MIT" -repository = "https://github.com/modelcontextprotocol/rust-sdk/" -description = "Rust SDK for Model Context Protocol" -keywords = ["mcp", "sdk", "tokio", "modelcontextprotocol"] -homepage = "https://github.com/modelcontextprotocol/rust-sdk" -categories = [ - "network-programming", - "asynchronous", -] -readme = "README.md" +edition = { workspace = true } +version = { workspace = true } +authors = { workspace = true } +license = { workspace = true } +repository = { workspace = true } +description = { workspace = true } +keywords = { workspace = true } +homepage = { workspace = true } +categories = { workspace = true } +readme = { workspace = true } publish = false [lib] @@ -21,7 +18,7 @@ crate-type = ["cdylib"] [dependencies] wasi = { version = "0.14.2"} tokio = { version = "1", features = ["rt", "io-util", "sync", "macros", "time"] } -rmcp = { version = "0.8.5", path = "../../crates/rmcp", features = ["server", "macros"] } +rmcp = { workspace = true, features = ["server", "macros"] } serde = { version = "1", features = ["derive"]} tracing-subscriber = { version = "0.3", features = [ "env-filter",