pub struct Bus {
pub db: PgPool,
pub hub: EventHub,
pub tool_router: ToolRouter<Self>,
}Expand description
The MCP server. Cheap to clone: PgPool and EventHub are Arcs
internally, and the tool router is rebuilt per session by the transport’s
service factory.
Fields§
§db: PgPool§hub: EventHub§tool_router: ToolRouter<Self>Implementations§
Source§impl Bus
impl Bus
Sourcepub fn attach_file_tool_attr() -> Tool
pub fn attach_file_tool_attr() -> Tool
Generated tool metadata function for attach_file
Sourcepub fn get_attachment_tool_attr() -> Tool
pub fn get_attachment_tool_attr() -> Tool
Generated tool metadata function for get_attachment
pub fn attachments_router() -> ToolRouter<Self>
Source§impl Bus
impl Bus
Sourcepub fn wait_for_updates_tool_attr() -> Tool
pub fn wait_for_updates_tool_attr() -> Tool
Generated tool metadata function for wait_for_updates
pub fn events_router() -> ToolRouter<Self>
Source§impl Bus
impl Bus
Sourcepub fn acquire_lock_tool_attr() -> Tool
pub fn acquire_lock_tool_attr() -> Tool
Generated tool metadata function for acquire_lock
Sourcepub fn release_lock_tool_attr() -> Tool
pub fn release_lock_tool_attr() -> Tool
Generated tool metadata function for release_lock
Sourcepub fn list_locks_tool_attr() -> Tool
pub fn list_locks_tool_attr() -> Tool
Generated tool metadata function for list_locks
pub fn locks_router() -> ToolRouter<Self>
Source§impl Bus
impl Bus
Sourcepub fn list_channels_tool_attr() -> Tool
pub fn list_channels_tool_attr() -> Tool
Generated tool metadata function for list_channels
Sourcepub fn create_channel_tool_attr() -> Tool
pub fn create_channel_tool_attr() -> Tool
Generated tool metadata function for create_channel
Sourcepub fn post_message_tool_attr() -> Tool
pub fn post_message_tool_attr() -> Tool
Generated tool metadata function for post_message
Sourcepub fn read_messages_tool_attr() -> Tool
pub fn read_messages_tool_attr() -> Tool
Generated tool metadata function for read_messages
Sourcepub fn ask_agent_tool_attr() -> Tool
pub fn ask_agent_tool_attr() -> Tool
Generated tool metadata function for ask_agent
Sourcepub fn search_messages_tool_attr() -> Tool
pub fn search_messages_tool_attr() -> Tool
Generated tool metadata function for search_messages
pub fn messaging_router() -> ToolRouter<Self>
Source§impl Bus
impl Bus
Sourcepub fn set_note_tool_attr() -> Tool
pub fn set_note_tool_attr() -> Tool
Generated tool metadata function for set_note
Sourcepub fn get_note_tool_attr() -> Tool
pub fn get_note_tool_attr() -> Tool
Generated tool metadata function for get_note
Sourcepub fn list_notes_tool_attr() -> Tool
pub fn list_notes_tool_attr() -> Tool
Generated tool metadata function for list_notes
Sourcepub fn search_notes_tool_attr() -> Tool
pub fn search_notes_tool_attr() -> Tool
Generated tool metadata function for search_notes
Sourcepub fn delete_note_tool_attr() -> Tool
pub fn delete_note_tool_attr() -> Tool
Generated tool metadata function for delete_note
pub fn notes_router() -> ToolRouter<Self>
Source§impl Bus
impl Bus
Sourcepub fn heartbeat_tool_attr() -> Tool
pub fn heartbeat_tool_attr() -> Tool
Generated tool metadata function for heartbeat
Sourcepub fn list_agents_tool_attr() -> Tool
pub fn list_agents_tool_attr() -> Tool
Generated tool metadata function for list_agents
pub fn presence_router() -> ToolRouter<Self>
Source§impl Bus
impl Bus
Sourcepub fn create_task_tool_attr() -> Tool
pub fn create_task_tool_attr() -> Tool
Generated tool metadata function for create_task
Sourcepub fn list_tasks_tool_attr() -> Tool
pub fn list_tasks_tool_attr() -> Tool
Generated tool metadata function for list_tasks
Sourcepub fn get_task_tool_attr() -> Tool
pub fn get_task_tool_attr() -> Tool
Generated tool metadata function for get_task
Sourcepub fn claim_task_tool_attr() -> Tool
pub fn claim_task_tool_attr() -> Tool
Generated tool metadata function for claim_task
Sourcepub fn claim_next_task_tool_attr() -> Tool
pub fn claim_next_task_tool_attr() -> Tool
Generated tool metadata function for claim_next_task
Sourcepub fn renew_task_lease_tool_attr() -> Tool
pub fn renew_task_lease_tool_attr() -> Tool
Generated tool metadata function for renew_task_lease
Sourcepub fn release_task_tool_attr() -> Tool
pub fn release_task_tool_attr() -> Tool
Generated tool metadata function for release_task
Sourcepub fn complete_task_tool_attr() -> Tool
pub fn complete_task_tool_attr() -> Tool
Generated tool metadata function for complete_task
pub fn tasks_router() -> ToolRouter<Self>
Source§impl Bus
impl Bus
Sourcepub fn whoami_tool_attr() -> Tool
pub fn whoami_tool_attr() -> Tool
Generated tool metadata function for whoami
Sourcepub fn team_digest_tool_attr() -> Tool
pub fn team_digest_tool_attr() -> Tool
Generated tool metadata function for team_digest
pub fn core_router() -> ToolRouter<Self>
Trait Implementations§
Source§impl ServerHandler for Bus
impl ServerHandler for Bus
fn get_info(&self) -> ServerInfo
Source§async fn call_tool(
&self,
request: CallToolRequestParams,
context: RequestContext<RoleServer>,
) -> Result<CallToolResponse, ErrorData>
async fn call_tool( &self, request: CallToolRequestParams, context: RequestContext<RoleServer>, ) -> Result<CallToolResponse, ErrorData>
tools/call request from a client. Read moreasync fn list_tools( &self, _request: Option<PaginatedRequestParams>, _context: RequestContext<RoleServer>, ) -> Result<ListToolsResult, ErrorData>
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 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 get_prompt( &self, request: GetPromptRequestParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<GetPromptResponse, ErrorData>> + MaybeSendFuture
fn list_prompts( &self, request: Option<PaginatedRequestParams>, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<ListPromptsResult, ErrorData>> + MaybeSendFuture
fn list_resources( &self, request: Option<PaginatedRequestParams>, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<ListResourcesResult, ErrorData>> + MaybeSendFuture
fn list_resource_templates( &self, request: Option<PaginatedRequestParams>, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<ListResourceTemplatesResult, ErrorData>> + MaybeSendFuture
fn read_resource( &self, request: ReadResourceRequestParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<ReadResourceResponse, 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.Auto Trait Implementations§
impl !RefUnwindSafe for Bus
impl !UnwindSafe for Bus
impl Freeze for Bus
impl Send for Bus
impl Sync for Bus
impl Unpin for Bus
impl UnsafeUnpin for Bus
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
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 more