pub struct Bus {
pub db: PgPool,
pub hub: EventHub,
pub backends: Backends,
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§backends: BackendsWhere each conversation’s bodies live. Postgres for everyone unless an operator routed a team elsewhere and started the server with a broker.
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 create_conversation_tool_attr() -> Tool
pub fn create_conversation_tool_attr() -> Tool
Generated tool metadata function for create_conversation
Sourcepub fn list_conversations_tool_attr() -> Tool
pub fn list_conversations_tool_attr() -> Tool
Generated tool metadata function for list_conversations
Sourcepub fn invite_to_conversation_tool_attr() -> Tool
pub fn invite_to_conversation_tool_attr() -> Tool
Generated tool metadata function for invite_to_conversation
Sourcepub fn join_conversation_tool_attr() -> Tool
pub fn join_conversation_tool_attr() -> Tool
Generated tool metadata function for join_conversation
Sourcepub fn leave_conversation_tool_attr() -> Tool
pub fn leave_conversation_tool_attr() -> Tool
Generated tool metadata function for leave_conversation
Sourcepub fn remove_conversation_member_tool_attr() -> Tool
pub fn remove_conversation_member_tool_attr() -> Tool
Generated tool metadata function for remove_conversation_member
Sourcepub fn archive_conversation_tool_attr() -> Tool
pub fn archive_conversation_tool_attr() -> Tool
Generated tool metadata function for archive_conversation
Sourcepub fn transfer_membership_tool_attr() -> Tool
pub fn transfer_membership_tool_attr() -> Tool
Generated tool metadata function for transfer_membership
Sourcepub fn send_conversation_message_tool_attr() -> Tool
pub fn send_conversation_message_tool_attr() -> Tool
Generated tool metadata function for send_conversation_message
Sourcepub fn read_conversation_tool_attr() -> Tool
pub fn read_conversation_tool_attr() -> Tool
Generated tool metadata function for read_conversation
Sourcepub fn get_conversation_message_tool_attr() -> Tool
pub fn get_conversation_message_tool_attr() -> Tool
Generated tool metadata function for get_conversation_message
Sourcepub fn ack_message_tool_attr() -> Tool
pub fn ack_message_tool_attr() -> Tool
Generated tool metadata function for ack_message
Sourcepub fn get_message_receipts_tool_attr() -> Tool
pub fn get_message_receipts_tool_attr() -> Tool
Generated tool metadata function for get_message_receipts
Sourcepub fn fetch_conversation_inbox_tool_attr() -> Tool
pub fn fetch_conversation_inbox_tool_attr() -> Tool
Generated tool metadata function for fetch_conversation_inbox
Sourcepub fn confirm_inbox_delivery_tool_attr() -> Tool
pub fn confirm_inbox_delivery_tool_attr() -> Tool
Generated tool metadata function for confirm_inbox_delivery
Sourcepub fn conversation_inbox_status_tool_attr() -> Tool
pub fn conversation_inbox_status_tool_attr() -> Tool
Generated tool metadata function for conversation_inbox_status
Sourcepub fn wait_for_conversation_updates_tool_attr() -> Tool
pub fn wait_for_conversation_updates_tool_attr() -> Tool
Generated tool metadata function for wait_for_conversation_updates
Sourcepub fn create_project_tool_attr() -> Tool
pub fn create_project_tool_attr() -> Tool
Generated tool metadata function for create_project
Sourcepub fn list_projects_tool_attr() -> Tool
pub fn list_projects_tool_attr() -> Tool
Generated tool metadata function for list_projects
Sourcepub fn grant_project_access_tool_attr() -> Tool
pub fn grant_project_access_tool_attr() -> Tool
Generated tool metadata function for grant_project_access
Sourcepub fn recover_conversation_history_tool_attr() -> Tool
pub fn recover_conversation_history_tool_attr() -> Tool
Generated tool metadata function for recover_conversation_history
pub fn conversations_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
Sourcepub fn list_sessions_tool_attr() -> Tool
pub fn list_sessions_tool_attr() -> Tool
Generated tool metadata function for list_sessions
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>
Source§impl Bus
impl Bus
Sourcepub fn register_session_tool_attr() -> Tool
pub fn register_session_tool_attr() -> Tool
Generated tool metadata function for register_session
Sourcepub fn resume_session_tool_attr() -> Tool
pub fn resume_session_tool_attr() -> Tool
Generated tool metadata function for resume_session
Sourcepub fn renew_session_tool_attr() -> Tool
pub fn renew_session_tool_attr() -> Tool
Generated tool metadata function for renew_session
Sourcepub fn revoke_session_tool_attr() -> Tool
pub fn revoke_session_tool_attr() -> Tool
Generated tool metadata function for revoke_session
pub fn sessions_router() -> ToolRouter<Self>
Trait Implementations§
Source§impl ServerHandler for Bus
impl ServerHandler for Bus
Source§async fn list_tools(
&self,
_request: Option<PaginatedRequestParams>,
context: RequestContext<RoleServer>,
) -> Result<ListToolsResult, ErrorData>
async fn list_tools( &self, _request: Option<PaginatedRequestParams>, context: RequestContext<RoleServer>, ) -> Result<ListToolsResult, ErrorData>
The catalogue this caller’s team actually has.
An off capability is not only a refusal at call time: advertising eighteen tools that every call rejects is a catalogue that lies, and the model reading it wastes a turn finding out. The per-call check stays exactly where it was — a catalogue is not an authorization boundary.
fn get_info(&self) -> ServerConfig
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 morefn 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 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
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> 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 more