pub struct ProxyHandler { /* private fields */ }Implementations§
Source§impl ProxyHandler
impl ProxyHandler
pub async fn new( store: Arc<dyn MemoryStore>, router: Arc<MemoryRouter>, embedder: LazyEmbedder, upstreams: Arc<UpstreamManager>, context: Arc<SessionContext>, injection: Arc<InjectionEngine>, compliance: Arc<ComplianceStore>, ) -> Self
Sourcepub fn save_memory_tool_attr() -> Tool
pub fn save_memory_tool_attr() -> Tool
Generated tool metadata function for save_memory
Sourcepub fn search_memory_tool_attr() -> Tool
pub fn search_memory_tool_attr() -> Tool
Generated tool metadata function for search_memory
Sourcepub fn session_start_tool_attr() -> Tool
pub fn session_start_tool_attr() -> Tool
Generated tool metadata function for session_start
Sourcepub fn report_compliance_tool_attr() -> Tool
pub fn report_compliance_tool_attr() -> Tool
Generated tool metadata function for report_compliance
Sourcepub fn get_compliance_report_tool_attr() -> Tool
pub fn get_compliance_report_tool_attr() -> Tool
Generated tool metadata function for get_compliance_report
Sourcepub fn notify_response_tool_attr() -> Tool
pub fn notify_response_tool_attr() -> Tool
Generated tool metadata function for notify_response
Sourcepub fn infer_outcome_tool_attr() -> Tool
pub fn infer_outcome_tool_attr() -> Tool
Generated tool metadata function for infer_outcome
Sourcepub fn run_promote_tool_attr() -> Tool
pub fn run_promote_tool_attr() -> Tool
Generated tool metadata function for run_promote
Sourcepub fn run_dedup_tool_attr() -> Tool
pub fn run_dedup_tool_attr() -> Tool
Generated tool metadata function for run_dedup
Sourcepub fn run_decay_tool_attr() -> Tool
pub fn run_decay_tool_attr() -> Tool
Generated tool metadata function for run_decay
Sourcepub fn confirm_read_tool_attr() -> Tool
pub fn confirm_read_tool_attr() -> Tool
Generated tool metadata function for confirm_read
Sourcepub fn list_inbox_tool_attr() -> Tool
pub fn list_inbox_tool_attr() -> Tool
Generated tool metadata function for list_inbox
Sourcepub fn review_memory_tool_attr() -> Tool
pub fn review_memory_tool_attr() -> Tool
Generated tool metadata function for review_memory
Sourcepub fn delete_memory_tool_attr() -> Tool
pub fn delete_memory_tool_attr() -> Tool
Generated tool metadata function for delete_memory
Trait Implementations§
Source§impl Clone for ProxyHandler
impl Clone for ProxyHandler
Source§impl ServerHandler for ProxyHandler
impl ServerHandler for ProxyHandler
Source§async fn list_tools(
&self,
_request: Option<PaginatedRequestParams>,
_context: RequestContext<RoleServer>,
) -> Result<ListToolsResult, McpError>
async fn list_tools( &self, _request: Option<PaginatedRequestParams>, _context: RequestContext<RoleServer>, ) -> Result<ListToolsResult, McpError>
Aggregate local + upstream tools. Local tools win name conflicts;
across upstreams the first connection providing a name wins — the
same first-wins rule the upstream forwarding index (register_index)
uses, so tools/list never advertises a tool tools/call would route
somewhere else. These manual impls override the #[tool_handler]
generated ones, which only saw the local router — the reason upstream
tools were previously neither listed nor callable (issue #3).
Source§fn get_info(&self) -> ServerConfig
fn get_info(&self) -> ServerConfig
Source§async fn call_tool(
&self,
request: CallToolRequestParams,
context: RequestContext<RoleServer>,
) -> Result<CallToolResponse, McpError>
async fn call_tool( &self, request: CallToolRequestParams, context: RequestContext<RoleServer>, ) -> Result<CallToolResponse, McpError>
tools/call request from a client. Read moreasync fn list_resources( &self, _request: Option<PaginatedRequestParams>, _context: RequestContext<RoleServer>, ) -> Result<ListResourcesResult, McpError>
async fn read_resource( &self, request: ReadResourceRequestParams, _context: RequestContext<RoleServer>, ) -> Result<ReadResourceResponse, McpError>
async fn list_prompts( &self, _request: Option<PaginatedRequestParams>, _context: RequestContext<RoleServer>, ) -> Result<ListPromptsResult, McpError>
async fn get_prompt( &self, request: GetPromptRequestParams, _context: RequestContext<RoleServer>, ) -> Result<GetPromptResponse, McpError>
fn ping( &self, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture
fn initialize( &self, request: InitializeRequestParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<InitializeResult, ErrorData>> + MaybeSendFuture
Source§fn negotiate_initialize(
&self,
request: &InitializeRequestParams,
) -> Result<InitializeResult, ErrorData>
fn negotiate_initialize( &self, request: &InitializeRequestParams, ) -> Result<InitializeResult, ErrorData>
initialize response for request, negotiating the
protocol version against Self::supported_protocol_versions. Read moreSource§fn supported_protocol_versions(&self) -> Cow<'static, [ProtocolVersion]>
fn supported_protocol_versions(&self) -> Cow<'static, [ProtocolVersion]>
Source§fn discover(
&self,
context: RequestContext<RoleServer>,
) -> impl Future<Output = Result<DiscoverResult, ErrorData>> + MaybeSendFuture
fn discover( &self, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<DiscoverResult, ErrorData>> + MaybeSendFuture
fn complete( &self, request: CompleteRequestParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<CompleteResult, ErrorData>> + MaybeSendFuture
fn set_level( &self, request: SetLevelRequestParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture
fn list_resource_templates( &self, request: Option<PaginatedRequestParams>, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<ListResourceTemplatesResult, ErrorData>> + MaybeSendFuture
Source§fn accepted_subscription_filter(
&self,
requested: &SubscriptionFilter,
) -> Option<SubscriptionFilter>
fn accepted_subscription_filter( &self, requested: &SubscriptionFilter, ) -> Option<SubscriptionFilter>
Source§fn listen(
&self,
context: SubscriptionContext,
) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture
fn listen( &self, context: SubscriptionContext, ) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture
Source§fn subscribe(
&self,
request: SubscribeRequestParams,
context: RequestContext<RoleServer>,
) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture
fn subscribe( &self, request: SubscribeRequestParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture
resources/subscribe is legacy-only; implement accepted_subscription_filter and listen for protocol version 2026-07-28
Source§fn unsubscribe(
&self,
request: UnsubscribeRequestParams,
context: RequestContext<RoleServer>,
) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture
fn unsubscribe( &self, request: UnsubscribeRequestParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture
resources/unsubscribe is legacy-only; subscriptions/listen is cancelled through its request lifecycle
fn on_custom_request( &self, request: CustomRequest, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<CustomResult, ErrorData>> + MaybeSendFuture
fn on_cancelled( &self, notification: CancelledNotificationParam, context: NotificationContext<RoleServer>, ) -> impl Future<Output = ()> + MaybeSendFuture
fn on_progress( &self, notification: ProgressNotificationParam, context: NotificationContext<RoleServer>, ) -> impl Future<Output = ()> + MaybeSendFuture
fn on_initialized( &self, context: NotificationContext<RoleServer>, ) -> impl Future<Output = ()> + MaybeSendFuture
fn on_roots_list_changed( &self, context: NotificationContext<RoleServer>, ) -> impl Future<Output = ()> + MaybeSendFuture
fn on_custom_notification( &self, notification: CustomNotification, context: NotificationContext<RoleServer>, ) -> impl Future<Output = ()> + MaybeSendFuture
Source§fn get_task(
&self,
request: GetTaskParams,
context: RequestContext<RoleServer>,
) -> impl Future<Output = Result<GetTaskResult, ErrorData>> + MaybeSendFuture
fn get_task( &self, request: GetTaskParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<GetTaskResult, ErrorData>> + MaybeSendFuture
tasks/get: return the current DetailedTask state.Source§fn update_task(
&self,
request: UpdateTaskParams,
context: RequestContext<RoleServer>,
) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture
fn update_task( &self, request: UpdateTaskParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture
tasks/update: accept responses to outstanding in-task
input requests. Returns an empty acknowledgement on success.Source§fn cancel_task(
&self,
request: CancelTaskParams,
context: RequestContext<RoleServer>,
) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture
fn cancel_task( &self, request: CancelTaskParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture
tasks/cancel: cooperative cancellation. Returns an empty
acknowledgement; the task’s observable status may lag.Source§fn list_skills(
&self,
request: Option<PaginatedRequestParams>,
context: RequestContext<RoleServer>,
) -> impl Future<Output = Result<ListSkillsResult, ErrorData>> + MaybeSendFuture
fn list_skills( &self, request: Option<PaginatedRequestParams>, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<ListSkillsResult, ErrorData>> + MaybeSendFuture
skills/list: one page of the skills this server serves.Source§fn get_skill(
&self,
request: GetSkillRequestParams,
context: RequestContext<RoleServer>,
) -> impl Future<Output = Result<GetSkillResult, ErrorData>> + MaybeSendFuture
fn get_skill( &self, request: GetSkillRequestParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<GetSkillResult, ErrorData>> + MaybeSendFuture
skills/get: the entry for one skill, or -32602 when the
server does not serve a skill at that URI.Source§fn read_resource_directory(
&self,
request: ReadResourceDirectoryRequestParams,
context: RequestContext<RoleServer>,
) -> impl Future<Output = Result<ListResourcesResult, ErrorData>> + MaybeSendFuture
fn read_resource_directory( &self, request: ReadResourceDirectoryRequestParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<ListResourcesResult, ErrorData>> + MaybeSendFuture
resources/directory/read: the direct children of a
directory resource, or -32602 when the URI is not a directory.Auto Trait Implementations§
impl !RefUnwindSafe for ProxyHandler
impl !UnwindSafe for ProxyHandler
impl Forget for ProxyHandler
impl Freeze for ProxyHandlerwhere
*const ArcInner<dyn MemoryStore> is !null: Freeze,
PhantomData<ArcInner<dyn MemoryStore>>: Freeze,
*const ArcInner<MemoryRouter> is !null: Freeze,
PhantomData<ArcInner<MemoryRouter>>: Freeze,
*const ArcInner<LazyEmbedderInner> is !null: Freeze,
PhantomData<ArcInner<LazyEmbedderInner>>: Freeze,
*const ArcInner<UpstreamManager> is !null: Freeze,
PhantomData<ArcInner<UpstreamManager>>: Freeze,
*const ArcInner<SessionContext> is !null: Freeze,
PhantomData<ArcInner<SessionContext>>: Freeze,
*const ArcInner<InjectionEngine> is !null: Freeze,
PhantomData<ArcInner<InjectionEngine>>: Freeze,
*const ArcInner<ComplianceStore> is !null: Freeze,
PhantomData<ArcInner<ComplianceStore>>: Freeze,
*const ArcInner<ResponseExtractor> is !null: Freeze,
PhantomData<ArcInner<ResponseExtractor>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<(Cow<'static, str>, ToolRoute<ProxyHandler>)>: Freeze,
PhantomData<(Cow<'static, str>, ())>: Freeze,
*const ArcInner<dyn Fn() + Send + Sync> is !null: Freeze,
PhantomData<ArcInner<dyn Fn() + Send + Sync>>: Freeze,
impl Move for ProxyHandler
impl Send for ProxyHandlerwhere
Arc<dyn MemoryStore>: Send,
Arc<MemoryRouter>: Send,
Arc<LazyEmbedderInner>: Send,
Arc<UpstreamManager>: Send,
Arc<SessionContext>: Send,
Arc<InjectionEngine>: Send,
Arc<ComplianceStore>: Send,
Arc<ResponseExtractor>: Send,
RawTable<(Cow<'static, str>, ToolRoute<ProxyHandler>)>: Send,
RawTable<(Cow<'static, str>, ())>: Send,
Arc<dyn Fn() + Send + Sync>: Send,
impl Sync for ProxyHandlerwhere
Arc<dyn MemoryStore>: Sync,
Arc<MemoryRouter>: Sync,
Arc<LazyEmbedderInner>: Sync,
Arc<UpstreamManager>: Sync,
Arc<SessionContext>: Sync,
Arc<InjectionEngine>: Sync,
Arc<ComplianceStore>: Sync,
Arc<ResponseExtractor>: Sync,
RawTable<(Cow<'static, str>, ToolRoute<ProxyHandler>)>: Sync,
RawTable<(Cow<'static, str>, ())>: Sync,
Arc<dyn Fn() + Send + Sync>: Sync,
impl Unpin for ProxyHandlerwhere
Arc<dyn MemoryStore>: Unpin,
Arc<MemoryRouter>: Unpin,
Arc<LazyEmbedderInner>: Unpin,
Arc<UpstreamManager>: Unpin,
Arc<SessionContext>: Unpin,
Arc<InjectionEngine>: Unpin,
Arc<ComplianceStore>: Unpin,
Arc<ResponseExtractor>: Unpin,
*const u8 is !null: Unpin,
&'static str: Unpin,
String: Unpin,
Arc<dyn for<'s> Fn(ToolCallContext<'s, ProxyHandler>) -> Pin<Box<dyn Future<Output = Result<CallToolResponse, ErrorData>> + Send + 's>> + Send + Sync>: Unpin,
Arc<Map<String, Value>>: Unpin,
*const LeafNode<String, Value> is !null: Unpin,
Box<(String, Value)>: Unpin,
Arc<dyn Fn() + Send + Sync>: Unpin,
impl UnsafeUnpin for ProxyHandlerwhere
*const ArcInner<dyn MemoryStore> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn MemoryStore>>: UnsafeUnpin,
*const ArcInner<MemoryRouter> is !null: UnsafeUnpin,
PhantomData<ArcInner<MemoryRouter>>: UnsafeUnpin,
*const ArcInner<LazyEmbedderInner> is !null: UnsafeUnpin,
PhantomData<ArcInner<LazyEmbedderInner>>: UnsafeUnpin,
*const ArcInner<UpstreamManager> is !null: UnsafeUnpin,
PhantomData<ArcInner<UpstreamManager>>: UnsafeUnpin,
*const ArcInner<SessionContext> is !null: UnsafeUnpin,
PhantomData<ArcInner<SessionContext>>: UnsafeUnpin,
*const ArcInner<InjectionEngine> is !null: UnsafeUnpin,
PhantomData<ArcInner<InjectionEngine>>: UnsafeUnpin,
*const ArcInner<ComplianceStore> is !null: UnsafeUnpin,
PhantomData<ArcInner<ComplianceStore>>: UnsafeUnpin,
*const ArcInner<ResponseExtractor> is !null: UnsafeUnpin,
PhantomData<ArcInner<ResponseExtractor>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<(Cow<'static, str>, ToolRoute<ProxyHandler>)>: UnsafeUnpin,
PhantomData<(Cow<'static, str>, ())>: UnsafeUnpin,
*const ArcInner<dyn Fn() + Send + Sync> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn() + Send + Sync>>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<R, S> DynService<R> for Swhere
R: ServiceRole,
S: Service<R>,
impl<R, S> DynService<R> for Swhere
R: ServiceRole,
S: Service<R>,
fn handle_request( &self, request: <R as ServiceRole>::PeerReq, context: RequestContext<R>, ) -> Pin<Box<dyn Future<Output = Result<<R as ServiceRole>::Resp, ErrorData>> + Send + '_>>
fn handle_notification( &self, notification: <R as ServiceRole>::PeerNot, context: NotificationContext<R>, ) -> Pin<Box<dyn Future<Output = Result<(), ErrorData>> + Send + '_>>
fn get_info(&self) -> <R as ServiceRole>::Info
Source§fn supported_protocol_versions(&self) -> Cow<'static, [ProtocolVersion]>
fn supported_protocol_versions(&self) -> Cow<'static, [ProtocolVersion]>
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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 moreSource§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<H> Service<RoleServer> for Hwhere
H: ServerHandler,
impl<H> Service<RoleServer> for Hwhere
H: ServerHandler,
async fn handle_request( &self, request: <RoleServer as ServiceRole>::PeerReq, context: RequestContext<RoleServer>, ) -> Result<<RoleServer as ServiceRole>::Resp, ErrorData>
async fn handle_notification( &self, notification: <RoleServer as ServiceRole>::PeerNot, context: NotificationContext<RoleServer>, ) -> Result<(), ErrorData>
fn get_info(&self) -> <RoleServer as ServiceRole>::Info
Source§fn supported_protocol_versions(&self) -> Cow<'static, [ProtocolVersion]>
fn supported_protocol_versions(&self) -> Cow<'static, [ProtocolVersion]>
initialize
negotiation may agree to. Read moreSource§impl<S> ServiceExt<RoleServer> for Swhere
S: Service<RoleServer>,
impl<S> ServiceExt<RoleServer> for Swhere
S: Service<RoleServer>,
Source§fn serve_with_ct<T, E, A>(
self,
transport: T,
ct: CancellationToken,
) -> impl Future<Output = Result<RunningService<RoleServer, S>, ServerInitializeError>> + MaybeSendFuture
fn serve_with_ct<T, E, A>( self, transport: T, ct: CancellationToken, ) -> impl Future<Output = Result<RunningService<RoleServer, S>, ServerInitializeError>> + MaybeSendFuture
Source§fn into_dyn(self) -> Box<dyn DynService<R>>
fn into_dyn(self) -> Box<dyn DynService<R>>
Source§fn serve<T, E, A>(
self,
transport: T,
) -> impl Future<Output = Result<RunningService<R, Self>, <R as ServiceRole>::InitializeError>> + MaybeSendFuture
fn serve<T, E, A>( self, transport: T, ) -> impl Future<Output = Result<RunningService<R, Self>, <R as ServiceRole>::InitializeError>> + MaybeSendFuture
transport and return a running service. Read more