pub struct McpServerManager { /* private fields */ }mcp and tools only.Expand description
Manages the full lifecycle of multiple local MCP server child processes.
McpServerManager spawns processes, connects them via TokioChildProcess
transport into McpToolset instances, monitors
health, auto-restarts on crash with exponential backoff, and aggregates tools
from all managed servers behind the Toolset trait.
On Windows each server starts suspended and runs only once it is in a Job Object of its
own, which closes with its connection: stopping, restarting or dropping a server, or the
manager’s process exiting, ends every process the server started (spec 3.2 §10 W1). On
Unix each server leads a session and process group of its own, which closes with its
connection: stopping, restarting or dropping a server sends the group SIGTERM, then
SIGKILL, and returns once every process in it has exited (spec 3.2 §7.7, K-I5).
§Construction
Use McpServerManager::new with a map of server configurations, then chain
builder methods to configure handlers and intervals:
use adk_tool::mcp::manager::{McpServerConfig, McpServerManager};
use std::collections::HashMap;
use std::time::Duration;
let configs = HashMap::from([
("my-server".to_string(), McpServerConfig {
command: "/opt/company/bin/workspace-mcp".to_string(),
args: vec!["--stdio".to_string(), "--root".to_string(), "/srv/workspace".to_string()],
..Default::default()
}),
]);
let manager = McpServerManager::new(configs)
.with_health_check_interval(Duration::from_secs(15))
.with_grace_period(Duration::from_secs(3))
.with_name("my_manager");Implementations§
Source§impl McpServerManager
impl McpServerManager
Sourcepub const DEFAULT_STARTUP_TIMEOUT: Duration
pub const DEFAULT_STARTUP_TIMEOUT: Duration
Default for with_startup_timeout: 30 seconds.
Sourcepub const STATUS_CHANNEL_CAPACITY: usize = 256
pub const STATUS_CHANNEL_CAPACITY: usize = 256
Transitions the status channel retains for a receiver that has not read them (spec 3.2 §10 T1): 256.
Sourcepub fn new(configs: HashMap<String, McpServerConfig>) -> McpServerManager
pub fn new(configs: HashMap<String, McpServerConfig>) -> McpServerManager
Create a new McpServerManager from a map of server configurations.
Each entry is keyed by a unique server ID. Servers with disabled: true
are initialized with ServerStatus::Disabled; all others start as
ServerStatus::Stopped.
No servers are started automatically — call start_server
or start_all to begin spawning processes.
Sourcepub fn from_json(json: &str) -> Result<McpServerManager, AdkError>
pub fn from_json(json: &str) -> Result<McpServerManager, AdkError>
Create a new McpServerManager by parsing a JSON string in Kiro mcp.json format.
The JSON must contain a top-level mcpServers object mapping server IDs
to their configurations. CamelCase JSON field names are automatically
mapped to snake_case Rust fields.
§Errors
Returns AdkError::Tool if the JSON is malformed or missing required fields.
§Example
let json = r#"{
"mcpServers": {
"workspace": {
"command": "/opt/company/bin/workspace-mcp",
"args": ["--stdio", "--root", "/srv/workspace"]
}
}
}"#;
let manager = McpServerManager::from_json(json)?;Sourcepub fn from_json_file(
path: impl AsRef<Path>,
) -> Result<McpServerManager, AdkError>
pub fn from_json_file( path: impl AsRef<Path>, ) -> Result<McpServerManager, AdkError>
Create a new McpServerManager by reading and parsing a JSON file from disk.
The file must contain JSON in Kiro mcp.json format (see from_json).
File reading is synchronous, which is acceptable for config loading at startup.
§Errors
Returns AdkError::Tool if the file cannot be read or the JSON is malformed.
§Example
let manager = McpServerManager::from_json_file("mcp.json")?;Sourcepub fn with_elicitation_handler(
self,
handler: Arc<dyn ElicitationHandler>,
) -> McpServerManager
pub fn with_elicitation_handler( self, handler: Arc<dyn ElicitationHandler>, ) -> McpServerManager
Set the elicitation handler used for all managed server connections.
The handler is preserved across server restarts via Arc sharing.
Sourcepub fn with_resource_notification_handler(
self,
handler: Arc<dyn ResourceNotificationHandler>,
) -> McpServerManager
pub fn with_resource_notification_handler( self, handler: Arc<dyn ResourceNotificationHandler>, ) -> McpServerManager
Set the resource notification handler used for all managed connections.
The handler is retained across manual and automatic server restarts.
Sourcepub fn with_sampling_handler(
self,
handler: Arc<dyn SamplingHandler>,
) -> McpServerManager
Available on crate feature mcp-sampling only.
pub fn with_sampling_handler( self, handler: Arc<dyn SamplingHandler>, ) -> McpServerManager
mcp-sampling only.Set the sampling handler used for all managed server connections.
The handler is preserved across server restarts via Arc sharing.
Only available when the mcp-sampling feature is enabled.
Sourcepub fn with_server_elicitation_handler(
self,
id: impl Into<String>,
handler: Arc<dyn ElicitationHandler>,
) -> McpServerManager
pub fn with_server_elicitation_handler( self, id: impl Into<String>, handler: Arc<dyn ElicitationHandler>, ) -> McpServerManager
Sets the elicitation handler of server id alone, preferred over the shared one
(spec 3.1 §10 T2).
A server without its own handler uses the shared one, or declines.
§Example
use std::collections::HashMap;
use std::sync::Arc;
use adk_tool::mcp::{AutoDeclineElicitationHandler, McpServerManager};
let manager = McpServerManager::new(HashMap::new())
.with_server_elicitation_handler("fs", Arc::new(AutoDeclineElicitationHandler));
assert!(manager.server_elicitation_handler("fs").is_some());
assert!(manager.server_elicitation_handler("other").is_none());Sourcepub fn server_elicitation_handler(
&self,
id: &str,
) -> Option<Arc<dyn ElicitationHandler>>
pub fn server_elicitation_handler( &self, id: &str, ) -> Option<Arc<dyn ElicitationHandler>>
The elicitation handler set for server id alone, if any.
Sourcepub fn with_server_sampling_handler(
self,
id: impl Into<String>,
handler: Arc<dyn SamplingHandler>,
) -> McpServerManager
Available on crate feature mcp-sampling only.
pub fn with_server_sampling_handler( self, id: impl Into<String>, handler: Arc<dyn SamplingHandler>, ) -> McpServerManager
mcp-sampling only.Sourcepub fn server_sampling_handler(
&self,
id: &str,
) -> Option<Arc<dyn SamplingHandler>>
Available on crate feature mcp-sampling only.
pub fn server_sampling_handler( &self, id: &str, ) -> Option<Arc<dyn SamplingHandler>>
mcp-sampling only.The sampling handler set for server id alone, if any.
Sourcepub fn with_health_check_interval(self, interval: Duration) -> McpServerManager
pub fn with_health_check_interval(self, interval: Duration) -> McpServerManager
Set the interval between health check cycles.
Default: 30 seconds.
Sourcepub fn with_grace_period(self, period: Duration) -> McpServerManager
pub fn with_grace_period(self, period: Duration) -> McpServerManager
Set the grace period reserved for managed-session shutdown.
The period covers cancelling the server’s pending MCP tasks and closing its session. Default: 5 seconds.
Sourcepub fn with_name(self, name: impl Into<String>) -> McpServerManager
pub fn with_name(self, name: impl Into<String>) -> McpServerManager
Set the name returned by the Toolset::name() implementation.
Default: "mcp_server_manager".
Sourcepub fn with_schema_limits(self, limits: McpSchemaLimits) -> McpServerManager
pub fn with_schema_limits(self, limits: McpSchemaLimits) -> McpServerManager
Set the size limits applied to the tool schemas of every managed server.
Each managed toolset is named after its server ID, so the warning for a
skipped tool names the server. Default: McpSchemaLimits::default.
§Example
use adk_tool::mcp::{McpSchemaLimits, McpServerManager};
use std::collections::HashMap;
let manager = McpServerManager::new(HashMap::new())
.with_schema_limits(McpSchemaLimits::default().with_max_nodes(20_000));Sourcepub fn with_discovery_limits(
self,
limits: McpDiscoveryLimits,
) -> McpServerManager
pub fn with_discovery_limits( self, limits: McpDiscoveryLimits, ) -> McpServerManager
Set the bounds on each catalog listing of every managed server.
Toolset::tools lists every running server
concurrently, so a server that pages without end or never answers costs
at most timeout and the other servers’ tools still resolve. Default:
McpDiscoveryLimits::default.
§Example
use adk_tool::mcp::{McpDiscoveryLimits, McpServerManager};
use std::collections::HashMap;
use std::time::Duration;
let manager = McpServerManager::new(HashMap::new())
.with_discovery_limits(McpDiscoveryLimits::default().with_timeout(Duration::from_secs(5)));Sourcepub fn with_startup_timeout(self, timeout: Duration) -> McpServerManager
pub fn with_startup_timeout(self, timeout: Duration) -> McpServerManager
Set the longest time a server’s spawn and MCP handshake may take.
A server that has not completed its handshake by then is stopped and marked
ServerStatus::FailedToStart. The other servers’ tools, statuses and
lifecycle calls are not held up while one server starts. Default:
DEFAULT_STARTUP_TIMEOUT.
§Example
use adk_tool::mcp::McpServerManager;
use std::collections::HashMap;
use std::time::Duration;
// `npx` may download its package on first start.
let manager = McpServerManager::new(HashMap::new())
.with_startup_timeout(Duration::from_secs(120));Sourcepub fn subscribe_status_transitions(&self) -> Receiver<ServerStatusTransition>
pub fn subscribe_status_transitions(&self) -> Receiver<ServerStatusTransition>
Subscribes to every ServerStatus transition of every managed server
(spec 3.2 §10 T1).
The manager publishes a ServerStatusTransition (id, from, to) wherever it
changes a server’s status — starts, stops, restarts, the health monitor’s crash and
auto-restart handling, update_server, enable_server, disable_server and
shutdown — while it holds the registry lock, so a receiver sees each server’s
changes in the order they happened. The receiver sees only transitions published
after it subscribed; read all_statuses after subscribing to
learn the state they start from. A receiver more than
STATUS_CHANNEL_CAPACITY transitions behind gets
RecvError::Lagged and resumes at
the oldest one retained.
FailedToStart is the exhausted state: the monitor retries a FailedToStart or
Crashed server only while its RestartPolicy has attempts
left, so a FailedToStart that a server without a policy enters, or that follows
max_restart_attempts failed restarts since the server last ran, is followed by no
further transition until the application starts the server again.
§Example
use adk_tool::mcp::{McpServerConfig, McpServerManager, ServerStatus};
use std::collections::HashMap;
let configs = HashMap::from([("email".to_string(), McpServerConfig::default())]);
let manager = McpServerManager::new(configs);
let mut transitions = manager.subscribe_status_transitions();
manager.disable_server("email").await.unwrap();
let transition = transitions.recv().await.unwrap();
assert_eq!(
(transition.id.as_str(), transition.from, transition.to),
("email", ServerStatus::Stopped, ServerStatus::Disabled)
);Sourcepub fn with_stdio_launcher<F>(self, launcher: F) -> McpServerManager
pub fn with_stdio_launcher<F>(self, launcher: F) -> McpServerManager
Sets the stdio launcher, which builds the command of every start of every managed
server in place of Command::new(&config.command) with the configured arguments and
environment (spec 3.2 §10 T1).
The launcher receives the server’s McpServerConfig on each start, auto-restarts
included, and returns the tokio::process::Command to spawn — for example the
configured server wrapped in an OS sandbox. rmcp pipes the command’s stdin and stdout
for the MCP connection. An error from the launcher fails that start with the error
unchanged and leaves the server FailedToStart. Without a launcher the manager
spawns the configured command, arguments and environment. On Windows the manager
replaces the command’s creation flags with CREATE_SUSPENDED, so the server runs only
once it is in its Job Object (spec 3.2 §10 W1).
§Example
use adk_tool::mcp::McpServerManager;
use std::collections::HashMap;
let manager = McpServerManager::new(HashMap::new()).with_stdio_launcher(|config| {
let mut command = tokio::process::Command::new("/usr/bin/nice");
command.arg(&config.command).args(&config.args).envs(&config.env);
Ok(command)
});Sourcepub async fn start_server(&self, id: &str) -> Result<(), AdkError>
pub async fn start_server(&self, id: &str) -> Result<(), AdkError>
Start a managed MCP server by ID.
Spawns the configured command as a child process, creates a
TokioChildProcess transport, and connects via McpToolset with the
configured elicitation (and optionally sampling) handler. While the
handshake runs the server is ServerStatus::Starting; the registry is not
locked, so other servers keep serving tools and status.
If the server is already Running, this is a no-op and returns Ok(()).
§Errors
Returns AdkError::Tool if:
- The server ID does not exist
- The child process fails to spawn
- The MCP handshake fails or does not finish within the startup timeout
- The server is stopped, updated or removed before its handshake finishes
§Example
manager.start_server("my-server").await?;Sourcepub async fn stop_server(&self, id: &str) -> Result<(), AdkError>
pub async fn stop_server(&self, id: &str) -> Result<(), AdkError>
Stop a managed MCP server by ID.
Cancels the server’s pending MCP tasks (see
McpToolset::cancel_pending_tasks) and then its MCP session, both within
the grace period, waits within it for the child process to exit, drops the
McpToolset connection, and sets the status to Stopped. Tools the server’s
toolset produced fail from then on, and a restart serves new ones.
If the server is not running, this is a no-op and returns Ok(()).
§Errors
Returns AdkError::Tool if the server ID does not exist.
§Example
manager.stop_server("my-server").await?;Sourcepub async fn restart_server(&self, id: &str) -> Result<(), AdkError>
pub async fn restart_server(&self, id: &str) -> Result<(), AdkError>
Restart a managed MCP server by ID.
Sets the status to Restarting, stops the server, then starts it again.
The same ElicitationHandler and SamplingHandler Arcs are preserved
across the restart.
§Errors
Returns AdkError::Tool if:
- The server ID does not exist
- The start phase fails (status set to
FailedToStart)
§Example
manager.restart_server("my-server").await?;Sourcepub async fn server_status(&self, id: &str) -> Result<ServerStatus, AdkError>
pub async fn server_status(&self, id: &str) -> Result<ServerStatus, AdkError>
Return the current ServerStatus for a given server ID.
§Errors
Returns AdkError::Tool if the server ID does not exist.
§Example
let status = manager.server_status("my-server").await?;
assert_eq!(status, ServerStatus::Running);Sourcepub async fn list_server_resources(
&self,
id: &str,
) -> Result<Vec<Resource>, AdkError>
pub async fn list_server_resources( &self, id: &str, ) -> Result<Vec<Resource>, AdkError>
List static resources published by one running managed server.
Sourcepub async fn list_server_resource_templates(
&self,
id: &str,
) -> Result<Vec<ResourceTemplate>, AdkError>
pub async fn list_server_resource_templates( &self, id: &str, ) -> Result<Vec<ResourceTemplate>, AdkError>
List URI templates published by one running managed server.
Sourcepub async fn list_server_prompts(
&self,
id: &str,
) -> Result<Vec<Prompt>, AdkError>
pub async fn list_server_prompts( &self, id: &str, ) -> Result<Vec<Prompt>, AdkError>
List prompt templates published by one running managed server.
Sourcepub async fn read_server_resource(
&self,
id: &str,
uri: &str,
) -> Result<Vec<ResourceContents>, AdkError>
pub async fn read_server_resource( &self, id: &str, uri: &str, ) -> Result<Vec<ResourceContents>, AdkError>
Read one resource from a running managed server.
Sourcepub async fn subscribe_server_resource(
&self,
id: &str,
uri: &str,
) -> Result<(), AdkError>
pub async fn subscribe_server_resource( &self, id: &str, uri: &str, ) -> Result<(), AdkError>
Subscribe to updates for one resource on a running managed server.
Sourcepub async fn unsubscribe_server_resource(
&self,
id: &str,
uri: &str,
) -> Result<(), AdkError>
pub async fn unsubscribe_server_resource( &self, id: &str, uri: &str, ) -> Result<(), AdkError>
Remove a resource subscription from one running managed server.
Sourcepub async fn get_server_prompt(
&self,
id: &str,
name: &str,
arguments: Option<Map<String, Value>>,
) -> Result<GetPromptResult, AdkError>
pub async fn get_server_prompt( &self, id: &str, name: &str, arguments: Option<Map<String, Value>>, ) -> Result<GetPromptResult, AdkError>
Resolve one prompt from a running managed server.
Sourcepub async fn reissue_parked_call(
&self,
parked: &ParkedMcpCall,
responses: BTreeMap<String, Value>,
) -> Result<McpCallOutcome, AdkError>
pub async fn reissue_parked_call( &self, parked: &ParkedMcpCall, responses: BTreeMap<String, Value>, ) -> Result<McpCallOutcome, AdkError>
Re-issues a parked call on the running server it names (spec 3.2 §7.7, §10 T2).
The call’s server_id is the managed
server’s ID; see McpToolset::reissue for what happens per kind.
§Errors
Returns AdkError::Tool when the server is unknown or not running, and as
McpToolset::reissue does.
§Example
let parked: ParkedMcpCall = serde_json::from_str(&checkpoint)?;
let outcome = manager.reissue_parked_call(&parked, responses).await?;Sourcepub async fn call_tool_resumable(
&self,
id: &str,
ctx: Arc<dyn ToolContext>,
name: &str,
arguments: Map<String, Value>,
) -> Result<McpCallOutcome, AdkError>
pub async fn call_tool_resumable( &self, id: &str, ctx: Arc<dyn ToolContext>, name: &str, arguments: Map<String, Value>, ) -> Result<McpCallOutcome, AdkError>
Calls tool name on running server id for an agent’s call, ending it with its
parked form when the server needs input (spec 3.2 §7.7, §10 T2).
This is McpToolset::call_tool_resumable on the server’s connection, run in the
scopes the call’s tool would enter: sampling requests the server sends meanwhile
count against ctx’s run, and elicitations belong to the call. The call id is
ctx’s function call id.
§Errors
Returns AdkError::Tool when the server is unknown or not running, and as
McpToolset::call_tool_resumable does.
§Example
match manager.call_tool_resumable("email", ctx, "send_draft", arguments).await? {
McpCallOutcome::Completed(value) => Ok(value),
McpCallOutcome::Parked(parked) => park(parked).await,
}Sourcepub async fn reissue_parked_call_for(
&self,
ctx: Arc<dyn ToolContext>,
parked: &ParkedMcpCall,
responses: BTreeMap<String, Value>,
) -> Result<McpCallOutcome, AdkError>
pub async fn reissue_parked_call_for( &self, ctx: Arc<dyn ToolContext>, parked: &ParkedMcpCall, responses: BTreeMap<String, Value>, ) -> Result<McpCallOutcome, AdkError>
reissue_parked_call for an agent’s call, run in the
scopes the call’s tool would enter, as
call_tool_resumable runs (spec 3.2 §7.7, §10 T2).
§Errors
§Example
let outcome = manager.reissue_parked_call_for(ctx, &parked, responses).await?;Sourcepub async fn all_statuses(&self) -> HashMap<String, ServerStatus>
pub async fn all_statuses(&self) -> HashMap<String, ServerStatus>
Return a map of all server IDs to their current ServerStatus.
§Example
let statuses = manager.all_statuses().await;
for (id, status) in &statuses {
println!("{id}: {status:?}");
}Sourcepub async fn running_server_count(&self) -> usize
pub async fn running_server_count(&self) -> usize
Return the number of servers currently in ServerStatus::Running status.
§Example
let count = manager.running_server_count().await;
println!("{count} servers running");Sourcepub fn start_monitoring(&self)
pub fn start_monitoring(&self)
Start the background health monitoring task.
Spawns a tokio::spawn task that periodically checks each Running
server by calling McpToolset::is_closed().
If a server’s connection is closed, the monitor sets its status to
Crashed and, if a RestartPolicy is configured, attempts auto-restart
with exponential backoff.
The monitoring loop runs until stop_monitoring
is called, which cancels the background task via the internal
CancellationToken.
§Example
manager.start_monitoring();
// ... later ...
manager.stop_monitoring();Sourcepub fn stop_monitoring(&self)
pub fn stop_monitoring(&self)
Stop the background health monitoring task.
Cancels the monitoring loop spawned by start_monitoring.
This is a no-op if monitoring was never started or has already been stopped.
§Example
manager.stop_monitoring();Sourcepub async fn add_server(
&self,
id: String,
config: McpServerConfig,
) -> Result<(), AdkError>
pub async fn add_server( &self, id: String, config: McpServerConfig, ) -> Result<(), AdkError>
Register a new server configuration at runtime.
The new server is initialized with ServerStatus::Disabled if
config.disabled is true, or ServerStatus::Stopped otherwise.
It will not be started automatically — call
start_server to begin spawning the process.
§Errors
Returns AdkError::Tool if a server with the given ID already exists.
§Example
let config = McpServerConfig {
command: "/opt/company/bin/billing-mcp".to_string(),
args: vec!["--stdio".to_string()],
..Default::default()
};
manager.add_server("new-server".to_string(), config).await?;Sourcepub async fn server_config(&self, id: &str) -> Result<McpServerConfig, AdkError>
pub async fn server_config(&self, id: &str) -> Result<McpServerConfig, AdkError>
Return a copy of one server’s current configuration.
Sourcepub async fn all_configs(&self) -> HashMap<String, McpServerConfig>
pub async fn all_configs(&self) -> HashMap<String, McpServerConfig>
Return a snapshot of every managed server configuration.
Sourcepub async fn update_server(
&self,
id: &str,
config: McpServerConfig,
) -> Result<(), AdkError>
pub async fn update_server( &self, id: &str, config: McpServerConfig, ) -> Result<(), AdkError>
Replace a server configuration at runtime.
A running server is stopped and restarted with the new configuration. If the replacement fails to start, the previous configuration is restored and restarted before the error is returned.
Sourcepub async fn enable_server(&self, id: &str) -> Result<(), AdkError>
pub async fn enable_server(&self, id: &str) -> Result<(), AdkError>
Enable a disabled server without starting it.
Sourcepub async fn disable_server(&self, id: &str) -> Result<(), AdkError>
pub async fn disable_server(&self, id: &str) -> Result<(), AdkError>
Stop and disable a server until it is explicitly enabled again.
Sourcepub async fn to_json(&self) -> Result<String, AdkError>
pub async fn to_json(&self) -> Result<String, AdkError>
Serialize the current in-memory configuration as compatible mcp.json.
Sourcepub async fn save_json_file(
&self,
path: impl AsRef<Path>,
) -> Result<(), AdkError>
pub async fn save_json_file( &self, path: impl AsRef<Path>, ) -> Result<(), AdkError>
Persist the current configuration using an atomic temporary-file rename.
Sourcepub async fn start_all(&self) -> HashMap<String, Result<(), AdkError>>
pub async fn start_all(&self) -> HashMap<String, Result<(), AdkError>>
Start all non-disabled servers and report each result independently.
Collects all server IDs where disabled == false, then starts each one
via start_server. Failures are logged but do not
prevent other servers from starting. The servers complete their MCP
handshakes concurrently, each bounded by the
startup timeout.
§Returns
A HashMap<String, Result<()>> with per-server outcomes. Disabled servers
are not included in the result.
§Example
let results = manager.start_all().await;
for (id, result) in &results {
match result {
Ok(()) => println!("{id}: started"),
Err(e) => eprintln!("{id}: failed to start: {e}"),
}
}Sourcepub async fn shutdown(&self) -> Result<(), AdkError>
pub async fn shutdown(&self) -> Result<(), AdkError>
Shut down all managed servers and stop health monitoring.
This method first stops the health monitoring task, then stops all
running servers by cancelling their pending MCP tasks and MCP sessions
and dropping the child transports. After shutdown, all server statuses
are set to Stopped.
§Example
manager.shutdown().await?;
// All servers are now stopped, safe to drop the managerTrait Implementations§
Source§impl Drop for McpServerManager
impl Drop for McpServerManager
Source§impl Toolset for McpServerManager
impl Toolset for McpServerManager
Source§fn close<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
McpServerManager: 'async_trait,
fn close<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
McpServerManager: 'async_trait,
Leaves every managed server running.
One manager is typically shared, as an Arc, by several agents or runners, and the
application starts its servers, so Runner::close on one runner does not stop
servers another still uses. Call McpServerManager::shutdown to stop them; it
returns once each server’s process has exited or its grace period has elapsed.
Source§fn tools<'life0, 'async_trait>(
&'life0 self,
ctx: Arc<dyn ReadonlyContext>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Arc<dyn Tool>>, AdkError>> + Send + 'async_trait>>where
'life0: 'async_trait,
McpServerManager: 'async_trait,
fn tools<'life0, 'async_trait>(
&'life0 self,
ctx: Arc<dyn ReadonlyContext>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Arc<dyn Tool>>, AdkError>> + Send + 'async_trait>>where
'life0: 'async_trait,
McpServerManager: 'async_trait,
Source§fn process_llm_request<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: Arc<dyn ReadonlyContext>,
_request: &'life1 mut LlmRequest,
) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn process_llm_request<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: Arc<dyn ReadonlyContext>,
_request: &'life1 mut LlmRequest,
) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Auto Trait Implementations§
impl !Freeze for McpServerManager
impl !RefUnwindSafe for McpServerManager
impl !UnwindSafe for McpServerManager
impl Forget for McpServerManager
impl Move for McpServerManager
impl Send for McpServerManagerwhere
Arc<RwLock<HashMap<String, McpServerEntry>>>: Send,
Arc<dyn ElicitationHandler>: Send,
Arc<dyn ResourceNotificationHandler>: Send,
Arc<RwLock<HashMap<String, BTreeSet<String>>>>: Send,
Arc<dyn SamplingHandler>: Send,
RawTable<(String, Arc<dyn ElicitationHandler>)>: Send,
RawTable<(String, Arc<dyn SamplingHandler>)>: Send,
Mutex<CancellationToken>: Send,
Arc<Atomic<bool>>: Send,
RawVecInner: Send,
Arc<Shared<ServerStatusTransition>>: Send,
Arc<dyn Fn(&McpServerConfig) -> Result<Command, AdkError> + Sync + Send>: Send,
impl Sync for McpServerManagerwhere
Arc<RwLock<HashMap<String, McpServerEntry>>>: Sync,
Arc<dyn ElicitationHandler>: Sync,
Arc<dyn ResourceNotificationHandler>: Sync,
Arc<RwLock<HashMap<String, BTreeSet<String>>>>: Sync,
Arc<dyn SamplingHandler>: Sync,
RawTable<(String, Arc<dyn ElicitationHandler>)>: Sync,
RawTable<(String, Arc<dyn SamplingHandler>)>: Sync,
Mutex<CancellationToken>: Sync,
Arc<Atomic<bool>>: Sync,
RawVecInner: Sync,
Arc<Shared<ServerStatusTransition>>: Sync,
Arc<dyn Fn(&McpServerConfig) -> Result<Command, AdkError> + Sync + Send>: Sync,
impl Unpin for McpServerManagerwhere
Arc<RwLock<HashMap<String, McpServerEntry>>>: Unpin,
Arc<dyn ElicitationHandler>: Unpin,
Arc<dyn ResourceNotificationHandler>: Unpin,
Arc<RwLock<HashMap<String, BTreeSet<String>>>>: Unpin,
Arc<dyn SamplingHandler>: Unpin,
*const u8 is !null: Unpin,
Align4<u32>: Unpin,
Align1<u8>: Unpin,
Arc<TreeNode>: Unpin,
Arc<Atomic<bool>>: Unpin,
Arc<Shared<ServerStatusTransition>>: Unpin,
Arc<dyn Fn(&McpServerConfig) -> Result<Command, AdkError> + Sync + Send>: Unpin,
impl UnsafeUnpin for McpServerManagerwhere
*const ArcInner<RwLock<HashMap<String, McpServerEntry>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<RwLock<HashMap<String, McpServerEntry>>>>: UnsafeUnpin,
*const ArcInner<dyn ElicitationHandler> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn ElicitationHandler>>: UnsafeUnpin,
*const ArcInner<dyn ResourceNotificationHandler> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn ResourceNotificationHandler>>: UnsafeUnpin,
*const ArcInner<RwLock<HashMap<String, BTreeSet<String>>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<RwLock<HashMap<String, BTreeSet<String>>>>>: UnsafeUnpin,
*const ArcInner<dyn SamplingHandler> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn SamplingHandler>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<(String, Arc<dyn ElicitationHandler>)>: UnsafeUnpin,
PhantomData<(String, Arc<dyn SamplingHandler>)>: UnsafeUnpin,
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
*const ArcInner<TreeNode> is !null: UnsafeUnpin,
PhantomData<ArcInner<TreeNode>>: UnsafeUnpin,
*const ArcInner<Atomic<bool>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Atomic<bool>>>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<Shared<ServerStatusTransition>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Shared<ServerStatusTransition>>>: UnsafeUnpin,
*const ArcInner<dyn Fn(&McpServerConfig) -> Result<Command, AdkError> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(&McpServerConfig) -> Result<Command, AdkError> + Sync + Send>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> MaybeSend for Twhere
T: Send,
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.