This document outlines the process for compiling this crate's source code on your local machine.
Ensure you have the following installed:
- The latest stable version of Rust
cargo-nextestfor running testscargo-makefor running tasks like tests
1- Clone the repository:
git clone https://github.com/rust-mcp-stack/rust-mcp-sdk
cd rust-mcp-sdk2- Install dependencies: The Rust project uses Cargo for dependency management. To install dependencies, run:
cargo buildExample projects can be found in the /examples folder of the repository. Build and run instructions are available in their respective README.md files.
You can run examples by passing the example project name to Cargo using the -p argument, like this:
cargo run -p simple-mcp-client-stdioYou can build the examples in a similar way. The following command builds the project and generates the binary at target/release/hello-world-mcp-server-stdio:
cargo build -p hello-world-mcp-server-stdio --releaseWe follow the default Rust formatting style enforced by rustfmt. To format your code, run:
cargo fmtAdditionally, we use Clippy for linting Rust code. You can check for linting issues by running:
cargo make clippyPlease ensure your code is formatted and free of Clippy warnings before submitting any changes.
We use cargo-nextest to run our test suite.
To run the tests, use:
cargo make test