Skip to content

Commit 0d0b1ba

Browse files
committed
chore: remove deprecated methods
1 parent acdd499 commit 0d0b1ba

File tree

5 files changed

+2
-47
lines changed

5 files changed

+2
-47
lines changed

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_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

crates/rust-mcp-sdk/src/mcp_traits/mcp_client.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,6 @@ pub trait McpClient: Sync + Send {
3535
fn client_info(&self) -> &InitializeRequestParams;
3636
fn server_info(&self) -> Option<InitializeResult>;
3737

38-
#[deprecated(since = "0.2.0", note = "Use `client_info()` instead.")]
39-
fn get_client_info(&self) -> &InitializeRequestParams {
40-
self.client_info()
41-
}
42-
43-
#[deprecated(since = "0.2.0", note = "Use `server_info()` instead.")]
44-
fn get_server_info(&self) -> Option<InitializeResult> {
45-
self.server_info()
46-
}
47-
4838
/// Checks whether the server has been initialized with client
4939
fn is_initialized(&self) -> bool {
5040
self.server_info().is_some()
@@ -57,23 +47,12 @@ pub trait McpClient: Sync + Send {
5747
.map(|server_details| server_details.server_info)
5848
}
5949

60-
#[deprecated(since = "0.2.0", note = "Use `server_version()` instead.")]
61-
fn get_server_version(&self) -> Option<Implementation> {
62-
self.server_info()
63-
.map(|server_details| server_details.server_info)
64-
}
65-
6650
/// Returns the server's capabilities.
6751
/// After initialization has completed, this will be populated with the server's reported capabilities.
6852
fn server_capabilities(&self) -> Option<ServerCapabilities> {
6953
self.server_info().map(|item| item.capabilities)
7054
}
7155

72-
#[deprecated(since = "0.2.0", note = "Use `server_capabilities()` instead.")]
73-
fn get_server_capabilities(&self) -> Option<ServerCapabilities> {
74-
self.server_info().map(|item| item.capabilities)
75-
}
76-
7756
/// Checks if the server has tools available.
7857
///
7958
/// This function retrieves the server information and checks if the
@@ -156,10 +135,6 @@ pub trait McpClient: Sync + Send {
156135
self.server_info()
157136
.map(|server_details| server_details.capabilities.logging.is_some())
158137
}
159-
#[deprecated(since = "0.2.0", note = "Use `instructions()` instead.")]
160-
fn get_instructions(&self) -> Option<String> {
161-
self.server_info()?.instructions
162-
}
163138

164139
fn instructions(&self) -> Option<String> {
165140
self.server_info()?.instructions

crates/rust-mcp-sdk/src/mcp_traits/mcp_server.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,6 @@ pub trait McpServer: Sync + Send {
2929

3030
async fn wait_for_initialization(&self);
3131

32-
#[deprecated(since = "0.2.0", note = "Use `client_info()` instead.")]
33-
fn get_client_info(&self) -> Option<InitializeRequestParams> {
34-
self.client_info()
35-
}
36-
37-
#[deprecated(since = "0.2.0", note = "Use `server_info()` instead.")]
38-
fn get_server_info(&self) -> &InitializeResult {
39-
self.server_info()
40-
}
41-
4232
async fn send(
4333
&self,
4434
message: MessageFromServer,

crates/rust-mcp-sdk/src/mcp_traits/request_id_gen.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ use async_trait::async_trait;
1010
#[async_trait]
1111
pub trait RequestIdGen: Send + Sync {
1212
fn next_request_id(&self) -> RequestId;
13+
#[allow(unused)]
1314
fn last_request_id(&self) -> Option<RequestId>;
15+
#[allow(unused)]
1416
fn reset_to(&self, id: u64);
1517

1618
/// Determines the request ID for an outgoing MCP message.

0 commit comments

Comments
 (0)