pub struct McpTransport { /* private fields */ }Expand description
Wrapper around rs-utcp’s MCP transport
Implementations§
Source§impl McpTransport
impl McpTransport
Sourcepub fn new_http(name: String, url: String) -> Self
pub fn new_http(name: String, url: String) -> Self
Create a new MCP transport for HTTP connection
Sourcepub fn new_stdio(
name: String,
command: String,
args: Option<Vec<String>>,
) -> Self
pub fn new_stdio( name: String, command: String, args: Option<Vec<String>>, ) -> Self
Create a new MCP transport for STDIO connection
Sourcepub fn new_stdio_with_env(
name: String,
command: String,
args: Option<Vec<String>>,
env: HashMap<String, String>,
) -> Self
pub fn new_stdio_with_env( name: String, command: String, args: Option<Vec<String>>, env: HashMap<String, String>, ) -> Self
Create a new MCP transport for STDIO connection with environment variables
Sourcepub async fn list_resources(&self) -> Result<ResourceListResult>
pub async fn list_resources(&self) -> Result<ResourceListResult>
List resources from the MCP server.
Sourcepub async fn read_resource(&self, uri: &str) -> Result<ResourceContents>
pub async fn read_resource(&self, uri: &str) -> Result<ResourceContents>
Read a resource by URI from the MCP server.
Sourcepub async fn list_resource_templates(
&self,
) -> Result<ResourceTemplateListResult>
pub async fn list_resource_templates( &self, ) -> Result<ResourceTemplateListResult>
List resource templates from the MCP server.
Sourcepub async fn subscribe_resource(&self, uri: &str) -> Result<()>
pub async fn subscribe_resource(&self, uri: &str) -> Result<()>
Subscribe to resource changes.
Sourcepub async fn unsubscribe_resource(&self, uri: &str) -> Result<()>
pub async fn unsubscribe_resource(&self, uri: &str) -> Result<()>
Unsubscribe from resource changes.
Sourcepub async fn list_prompts(&self) -> Result<PromptListResult>
pub async fn list_prompts(&self) -> Result<PromptListResult>
List prompts from the MCP server.
Sourcepub async fn get_prompt(
&self,
name: &str,
arguments: HashMap<String, String>,
) -> Result<GetPromptResult>
pub async fn get_prompt( &self, name: &str, arguments: HashMap<String, String>, ) -> Result<GetPromptResult>
Get a rendered prompt by name with arguments.
Trait Implementations§
Source§impl Default for McpTransport
impl Default for McpTransport
Source§impl Transport for McpTransport
impl Transport for McpTransport
Source§fn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Connect to the transport.
Source§fn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Disconnect from the transport.
Source§fn is_connected(&self) -> bool
fn is_connected(&self) -> bool
Check if connected.
Source§fn list_tools<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ToolDefinition>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_tools<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ToolDefinition>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List available tools.
Auto Trait Implementations§
impl !Freeze for McpTransport
impl !RefUnwindSafe for McpTransport
impl Send for McpTransport
impl Sync for McpTransport
impl Unpin for McpTransport
impl UnsafeUnpin for McpTransport
impl !UnwindSafe for McpTransport
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
Mutably borrows from an owned value. Read more
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request