rust-sdk/examples/servers/Cargo.toml
4t145 4597d1f047
Server wasm compatibility (#15)
* add axum sse example

* fix: make the sse axum folder name correct

* feat: add common modules for Axum SSE example

This commit adds supporting modules for the Axum Server-Sent Events (SSE) example:
- Added `counter.rs` with a simple counter router implementation
- Added `jsonrpc_frame_codec.rs` for decoding JSON-RPC frames
- Created a `mod.rs` to expose these modules
- Removed the previous SSE example configuration from Cargo.toml

* refactor: remove main.rs and update Cargo.toml for WASM compatibility

This commit makes two key changes:
1. Removes the main.rs file and make it a example
2. Add a wasi_std_io example

* refactor: simplify WASI I/O handling in example and fmt

Merged AsyncInputStream and AsyncOutputStream into a single WasiFd struct with std_in() and std_out() methods, reducing code duplication and improving clarity of the WASI standard I/O example.

* move examples to root
2025-03-14 11:21:33 -07:00

43 lines
No EOL
1.1 KiB
TOML

[package]
name = "mcp-server-examples"
version = "0.1.0"
edition = "2021"
publish = false
[dependencies]
mcp-server = { path = "../../crates/mcp-server" }
mcp-core = { path = "../../crates/mcp-core" }
mcp-macros = { path = "../../crates/mcp-macros" }
tokio = { version = "1", features = ["io-util"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
anyhow = "1.0"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tracing-appender = "0.2"
futures = "0.3"
[dev-dependencies]
tokio-util = { version = "0.7", features = ["io", "codec"]}
rand = { version = "0.8" }
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
axum = { version = "0.8", features = ["macros"] }
tokio = { version = "1", features = ["full"] }
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
tokio = { version = "1", features = ["io-util", "rt", "time", "macros"] }
wasi = { version = "0.11.0+wasi-snapshot-preview1" }
[[example]]
name = "counter-server"
path = "src/counter_server.rs"
[[example]]
name = "axum"
path = "src/axum.rs"
[[example]]
name = "wasi_std_io"
path = "src/wasi_std_io.rs"