Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions crates/rust-mcp-sdk/src/mcp_traits/mcp_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,22 @@ pub trait McpClient: Sync + Send {
.map(|server_details| server_details.capabilities.logging.is_some())
}

/// Checks if the server supports argument autocompletion suggestions.
///
/// This function retrieves the server information and checks if the
/// server has completions capabilities listed. If the server info has
/// not been retrieved yet, it returns `None`. Otherwise, it returns
/// `Some(true)` if completions is supported, or `Some(false)` if not.
///
/// # Returns
/// - `None` if server information is not yet available.
/// - `Some(true)` if completions is supported by the server.
/// - `Some(false)` if completions is not supported by the server.
fn server_supports_completion(&self) -> Option<bool> {
self.server_info()
.map(|server_details| server_details.capabilities.completions.is_some())
}

fn instructions(&self) -> Option<String> {
self.server_info()?.instructions
}
Expand Down
3 changes: 3 additions & 0 deletions crates/rust-mcp-sdk/src/schema.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#[cfg(feature = "2025_06_18")]
pub use rust_mcp_schema::*;

#[cfg(not(feature = "2025_06_18"))]
pub use rust_mcp_schema::{ParseProtocolVersionError, ProtocolVersion};

#[cfg(all(
feature = "2025_03_26",
not(any(feature = "2024_11_05", feature = "2025_06_18"))
Expand Down
4 changes: 1 addition & 3 deletions examples/hello-world-mcp-server-stdio/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
mod handler;
mod tools;

use std::sync::Arc;

use handler::MyServerHandler;
use rust_mcp_sdk::schema::{
Implementation, InitializeResult, ServerCapabilities, ServerCapabilitiesTools,
LATEST_PROTOCOL_VERSION,
};

use rust_mcp_sdk::{
error::SdkResult,
mcp_server::{server_runtime, ServerRuntime},
McpServer, StdioTransport, TransportOptions,
};
use std::sync::Arc;

#[tokio::main]
async fn main() -> SdkResult<()> {
Expand Down