pub struct NostrMCPProxy { /* private fields */ }Expand description
Proxy that connects to a remote MCP server via Nostr.
Implementations§
Source§impl NostrMCPProxy
impl NostrMCPProxy
Sourcepub async fn new<T>(signer: T, config: ProxyConfig) -> Result<Self>where
T: IntoNostrSigner,
pub async fn new<T>(signer: T, config: ProxyConfig) -> Result<Self>where
T: IntoNostrSigner,
Create a new proxy.
Sourcepub async fn start(&mut self) -> Result<UnboundedReceiver<JsonRpcMessage>>
pub async fn start(&mut self) -> Result<UnboundedReceiver<JsonRpcMessage>>
Start the proxy. Returns a receiver for incoming responses/notifications.
Sourcepub async fn send(&self, message: &JsonRpcMessage) -> Result<()>
pub async fn send(&self, message: &JsonRpcMessage) -> Result<()>
Send an MCP request to the remote server.
Source§impl NostrMCPProxy
impl NostrMCPProxy
Sourcepub async fn serve_client_handler<T, H>(
signer: T,
config: ProxyConfig,
handler: H,
) -> Result<RunningService<RoleClient, H>>where
T: IntoNostrSigner,
H: ClientHandler,
pub async fn serve_client_handler<T, H>(
signer: T,
config: ProxyConfig,
handler: H,
) -> Result<RunningService<RoleClient, H>>where
T: IntoNostrSigner,
H: ClientHandler,
Start a proxy directly from an rmcp client handler.
This additive API keeps the existing new/start/send flow intact,
while also allowing direct handler.serve(transport) style usage.
Auto Trait Implementations§
impl !Freeze for NostrMCPProxy
impl !RefUnwindSafe for NostrMCPProxy
impl Send for NostrMCPProxy
impl Sync for NostrMCPProxy
impl Unpin for NostrMCPProxy
impl UnsafeUnpin for NostrMCPProxy
impl !UnwindSafe for NostrMCPProxy
Blanket Implementations§
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> 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>
Converts
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>
Converts
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 more