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-nextest
for running testscargo-make
for running tasks like tests
1- Clone the repository:
git clone https://github.com/rust-mcp-stack/rust-mcp-sdk
cd rust-mcp-sdk
2- Install dependencies: The Rust project uses Cargo for dependency management. To install dependencies, run:
cargo build
Example 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
You 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
:
cargo build -p hello-world-mcp-server --release
We follow the default Rust formatting style enforced by rustfmt
. To format your code, run:
cargo fmt
Additionally, we use Clippy for linting Rust code. You can check for linting issues by running:
cargo make clippy
Please 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