pub struct SessionRpcMcp<'a> { /* private fields */ }Expand description
session.mcp.* RPCs.
Implementations§
Source§impl<'a> SessionRpcMcp<'a>
impl<'a> SessionRpcMcp<'a>
Sourcepub fn oauth(&self) -> SessionRpcMcpOauth<'a>
pub fn oauth(&self) -> SessionRpcMcpOauth<'a>
session.mcp.oauth.* sub-namespace.
Sourcepub async fn list(&self) -> Result<McpServerList, Error>
pub async fn list(&self) -> Result<McpServerList, Error>
Lists MCP servers configured for the session and their connection status.
Wire method: session.mcp.list.
§Returns
MCP servers configured for the session, with their connection status.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Sourcepub async fn enable(&self, params: McpEnableRequest) -> Result<(), Error>
pub async fn enable(&self, params: McpEnableRequest) -> Result<(), Error>
Enables an MCP server for the session.
Wire method: session.mcp.enable.
§Parameters
params- Name of the MCP server to enable for the session.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Sourcepub async fn disable(&self, params: McpDisableRequest) -> Result<(), Error>
pub async fn disable(&self, params: McpDisableRequest) -> Result<(), Error>
Disables an MCP server for the session.
Wire method: session.mcp.disable.
§Parameters
params- Name of the MCP server to disable for the session.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Sourcepub async fn reload(&self) -> Result<(), Error>
pub async fn reload(&self) -> Result<(), Error>
Reloads MCP server connections for the session.
Wire method: session.mcp.reload.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Sourcepub async fn execute_sampling(
&self,
params: McpExecuteSamplingParams,
) -> Result<McpSamplingExecutionResult, Error>
pub async fn execute_sampling( &self, params: McpExecuteSamplingParams, ) -> Result<McpSamplingExecutionResult, Error>
Runs an MCP sampling inference on behalf of an MCP server.
Wire method: session.mcp.executeSampling.
§Parameters
params- Identifiers and raw MCP CreateMessageRequest params used to run a sampling inference.
§Returns
Outcome of an MCP sampling execution: success result, failure error, or cancellation.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Sourcepub async fn cancel_sampling_execution(
&self,
params: McpCancelSamplingExecutionParams,
) -> Result<McpCancelSamplingExecutionResult, Error>
pub async fn cancel_sampling_execution( &self, params: McpCancelSamplingExecutionParams, ) -> Result<McpCancelSamplingExecutionResult, Error>
Cancels an in-flight MCP sampling execution by request ID.
Wire method: session.mcp.cancelSamplingExecution.
§Parameters
params- The requestId previously passed to executeSampling that should be cancelled.
§Returns
Indicates whether an in-flight sampling execution with the given requestId was found and cancelled.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Sourcepub async fn set_env_value_mode(
&self,
params: McpSetEnvValueModeParams,
) -> Result<McpSetEnvValueModeResult, Error>
pub async fn set_env_value_mode( &self, params: McpSetEnvValueModeParams, ) -> Result<McpSetEnvValueModeResult, Error>
Sets how environment-variable values supplied to MCP servers are resolved (direct or indirect).
Wire method: session.mcp.setEnvValueMode.
§Parameters
params- Mode controlling how MCP server env values are resolved (directorindirect).
§Returns
Env-value mode recorded on the session after the update.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Sourcepub async fn remove_git_hub(&self) -> Result<McpRemoveGitHubResult, Error>
pub async fn remove_git_hub(&self) -> Result<McpRemoveGitHubResult, Error>
Removes the auto-managed github MCP server when present.
Wire method: session.mcp.removeGitHub.
§Returns
Indicates whether the auto-managed github MCP server was removed (false when nothing to remove).
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Trait Implementations§
Source§impl<'a> Clone for SessionRpcMcp<'a>
impl<'a> Clone for SessionRpcMcp<'a>
Source§fn clone(&self) -> SessionRpcMcp<'a>
fn clone(&self) -> SessionRpcMcp<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more