Skip to content

Commit 36752ed

Browse files
authored
Merge pull request #85 from rust-mcp-stack/refactor/request-id-and-messaging-functions
refactor!: improve request ID generation, remove deprecated methods and adding improvements
2 parents 080b3a5 + 3889c01 commit 36752ed

File tree

28 files changed

+352
-303
lines changed

28 files changed

+352
-303
lines changed

Cargo.lock

Lines changed: 42 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,7 @@ Below is a list of projects that utilize the `rust-mcp-sdk`, showcasing their na
526526
| <a href="https://github.com/FalkorDB/text-to-cypher"><img src="https://avatars.githubusercontent.com/u/140048192?s=64" width="64"/></a> | [text-to-cypher](https://github.com/FalkorDB/text-to-cypher) | A high-performance Rust-based API service that translates natural language text to Cypher queries for graph databases. | [GitHub](https://github.com/FalkorDB/text-to-cypher) |
527527
| <a href="https://github.com/Tuurlijk/notify-mcp"><img src="https://avatars.githubusercontent.com/u/790979?s=64" width="64"/></a> | [notify-mcp](https://github.com/Tuurlijk/notify-mcp) | A Model Context Protocol (MCP) server that provides desktop notification functionality. | [GitHub](https://github.com/Tuurlijk/notify-mcp) |
528528
| <a href="https://github.com/WismutHansen/lst"><img src="https://avatars.githubusercontent.com/u/86825018?s=64" width="64"/></a> | [lst](https://github.com/WismutHansen/lst) | `lst` is a personal lists, notes, and blog posts management application with a focus on plain-text storage, offline-first functionality, and multi-device synchronization. | [GitHub](https://github.com/WismutHansen/lst) |
529+
| <a href="https://github.com/Vaiz/rust-mcp-server"><img src="https://avatars.githubusercontent.com/u/4908982?s=64" width="64"/></a> | [rust-mcp-server](https://github.com/Vaiz/rust-mcp-server) | `rust-mcp-server` allows the model to perform actions on your behalf, such as building, testing, and analyzing your Rust code. | [GitHub](https://github.com/Vaiz/rust-mcp-server) |
529530

530531

531532

crates/rust-mcp-sdk/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,7 @@ Below is a list of projects that utilize the `rust-mcp-sdk`, showcasing their na
526526
| <a href="https://github.com/FalkorDB/text-to-cypher"><img src="https://avatars.githubusercontent.com/u/140048192?s=64" width="64"/></a> | [text-to-cypher](https://github.com/FalkorDB/text-to-cypher) | A high-performance Rust-based API service that translates natural language text to Cypher queries for graph databases. | [GitHub](https://github.com/FalkorDB/text-to-cypher) |
527527
| <a href="https://github.com/Tuurlijk/notify-mcp"><img src="https://avatars.githubusercontent.com/u/790979?s=64" width="64"/></a> | [notify-mcp](https://github.com/Tuurlijk/notify-mcp) | A Model Context Protocol (MCP) server that provides desktop notification functionality. | [GitHub](https://github.com/Tuurlijk/notify-mcp) |
528528
| <a href="https://github.com/WismutHansen/lst"><img src="https://avatars.githubusercontent.com/u/86825018?s=64" width="64"/></a> | [lst](https://github.com/WismutHansen/lst) | `lst` is a personal lists, notes, and blog posts management application with a focus on plain-text storage, offline-first functionality, and multi-device synchronization. | [GitHub](https://github.com/WismutHansen/lst) |
529+
| <a href="https://github.com/Vaiz/rust-mcp-server"><img src="https://avatars.githubusercontent.com/u/4908982?s=64" width="64"/></a> | [rust-mcp-server](https://github.com/Vaiz/rust-mcp-server) | `rust-mcp-server` allows the model to perform actions on your behalf, such as building, testing, and analyzing your Rust code. | [GitHub](https://github.com/Vaiz/rust-mcp-server) |
529530

530531

531532

crates/rust-mcp-sdk/src/error.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,3 @@ impl McpSdkError {
4141
None
4242
}
4343
}
44-
45-
#[deprecated(since = "0.2.0", note = "Use `McpSdkError` instead.")]
46-
pub type MCPSdkError = McpSdkError;

crates/rust-mcp-sdk/src/mcp_handlers/mcp_client_handler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ pub trait ClientHandler: Send + Sync + 'static {
148148
//********************//
149149
async fn handle_error(
150150
&self,
151-
error: RpcError,
151+
error: &RpcError,
152152
runtime: &dyn McpClient,
153153
) -> std::result::Result<(), RpcError> {
154154
Ok(())

crates/rust-mcp-sdk/src/mcp_handlers/mcp_client_handler_core.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub trait ClientHandlerCore: Send + Sync + 'static {
3838
/// - `error` – The error data received from the MCP server.
3939
async fn handle_error(
4040
&self,
41-
error: RpcError,
41+
error: &RpcError,
4242
runtime: &dyn McpClient,
4343
) -> std::result::Result<(), RpcError>;
4444

crates/rust-mcp-sdk/src/mcp_handlers/mcp_server_handler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ pub trait ServerHandler: Send + Sync + 'static {
319319
/// Customize this function in your specific handler to implement behavior tailored to your MCP server's capabilities and requirements.
320320
async fn handle_error(
321321
&self,
322-
error: RpcError,
322+
error: &RpcError,
323323
runtime: &dyn McpServer,
324324
) -> std::result::Result<(), RpcError> {
325325
Ok(())

crates/rust-mcp-sdk/src/mcp_handlers/mcp_server_handler_core.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub trait ServerHandlerCore: Send + Sync + 'static {
4545
/// - `error` – The error data received from the MCP client.
4646
async fn handle_error(
4747
&self,
48-
error: RpcError,
48+
error: &RpcError,
4949
runtime: &dyn McpServer,
5050
) -> std::result::Result<(), RpcError>;
5151
async fn on_server_started(&self, runtime: &dyn McpServer) {

crates/rust-mcp-sdk/src/mcp_macros/tool_box.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,6 @@ macro_rules! tool_box {
5757
)*
5858
]
5959
}
60-
61-
#[deprecated(since = "0.2.0", note = "Use `tools()` instead.")]
62-
pub fn get_tools() -> Vec<rust_mcp_sdk::schema::Tool> {
63-
vec![
64-
$(
65-
$tool::tool(),
66-
)*
67-
]
68-
}
6960
}
7061

7162

0 commit comments

Comments
 (0)