Skip to main content

McpServer

Struct McpServer 

Source
pub struct McpServer {
    sessions: Arc<SessionManager>,
    tool_router: ToolRouter<Self>,
    prompt_router: PromptRouter<Self>,
}
Expand description

MCP server running every tool call on the Session shared by all MCP clients.

One instance is constructed per MCP connection or request by the StreamableHttpService factory wired in main.rs. The tool_router and prompt_router fields are built once at construction time from the #[tool_router] / #[prompt_router] attribute macros applied further down in this module.

Cheap to clone — only Arc and small router structs.

Fields§

§sessions: Arc<SessionManager>

The session manager, to get the session shared by all MCP clients on each call.

§tool_router: ToolRouter<Self>

The router auto-generated from #[tool_router] annotations.

§prompt_router: PromptRouter<Self>

The router auto-generated from #[prompt_router] annotations.

Implementations§

Source§

impl McpServer

Source

async fn call_api<R: Request>( &self, tool_name: &str, request: R, ) -> Result<CallToolResult, McpError>

Runs a request of the API on the session. Requests running as jobs go through McpServer::call_job instead.

§Returns

The response as structured content, or the error as a tool error, so a failed request doesn’t end the MCP session.

Source

async fn call_job<R: Request>( &self, tool_name: &str, request: R, context: RequestContext<RoleServer>, ) -> Result<JobToolResponse, McpError>

Runs a request of the API that runs as a job on the session.

§Returns

A task for the job if the client supports tasks. Otherwise, the state of the job after waiting for it a while, or its error as a tool error if it failed.

Source

fn task_job(&self, task_id: &str) -> Result<(Arc<Session>, u64), McpError>

Returns the MCP session and the job of a task.

§Errors

Fails if the task ID isn’t of a job of the current MCP session.

Source§

impl McpServer

Source

pub fn session_status_tool_attr() -> Tool

Generated tool metadata function for session_status

Source

pub fn session_status( &self, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn pack_info_tool_attr() -> Tool

Generated tool metadata function for pack_info

Source

pub fn pack_info( &self, params: Parameters<GetPackInfo>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn list_files_tool_attr() -> Tool

Generated tool metadata function for list_files

Source

pub fn list_files( &self, params: Parameters<ListFiles>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn table_info_tool_attr() -> Tool

Generated tool metadata function for table_info

Source

pub fn table_info( &self, params: Parameters<GetTableInfo>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn table_rows_tool_attr() -> Tool

Generated tool metadata function for table_rows

Source

pub fn table_rows( &self, params: Parameters<GetTableRows>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn table_definition_tool_attr() -> Tool

Generated tool metadata function for table_definition

Source

pub fn table_definition( &self, params: Parameters<GetTableDefinition>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn set_game_tool_attr() -> Tool

Generated tool metadata function for set_game

Source

pub fn set_game( &self, params: Parameters<SetGame>, context: RequestContext<RoleServer>, ) -> Pin<Box<dyn Future<Output = Result<JobToolResponse, McpError>> + Send + '_>>

Source

pub fn generate_dependencies_cache_tool_attr() -> Tool

Generated tool metadata function for generate_dependencies_cache

Source

pub fn generate_dependencies_cache( &self, params: Parameters<GenerateDependenciesCache>, context: RequestContext<RoleServer>, ) -> Pin<Box<dyn Future<Output = Result<JobToolResponse, McpError>> + Send + '_>>

Source

pub fn rebuild_dependencies_tool_attr() -> Tool

Generated tool metadata function for rebuild_dependencies

Source

pub fn rebuild_dependencies( &self, params: Parameters<RebuildDependencies>, context: RequestContext<RoleServer>, ) -> Pin<Box<dyn Future<Output = Result<JobToolResponse, McpError>> + Send + '_>>

Source

pub fn dependency_tables_tool_attr() -> Tool

Generated tool metadata function for dependency_tables

Source

pub fn dependency_tables( &self, params: Parameters<ListDependencyTables>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn run_diagnostics_tool_tool_attr() -> Tool

Generated tool metadata function for run_diagnostics

Source

pub fn run_diagnostics_tool( &self, params: Parameters<RunDiagnostics>, context: RequestContext<RoleServer>, ) -> Pin<Box<dyn Future<Output = Result<JobToolResponse, McpError>> + Send + '_>>

Source

pub fn list_diagnostics_tool_attr() -> Tool

Generated tool metadata function for list_diagnostics

Source

pub fn list_diagnostics( &self, params: Parameters<ListDiagnostics>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn ignore_diagnostics_tool_attr() -> Tool

Generated tool metadata function for ignore_diagnostics

Source

pub fn ignore_diagnostics( &self, params: Parameters<IgnoreDiagnostics>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn run_search_tool_attr() -> Tool

Generated tool metadata function for run_search

Source

pub fn list_search_matches_tool_attr() -> Tool

Generated tool metadata function for list_search_matches

Source

pub fn list_search_matches( &self, params: Parameters<ListSearchMatches>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn replace_search_matches_tool_attr() -> Tool

Generated tool metadata function for replace_search_matches

Source

pub fn replace_search_matches( &self, params: Parameters<ReplaceSearchMatches>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn column_values_tool_attr() -> Tool

Generated tool metadata function for column_values

Source

pub fn column_values( &self, params: Parameters<GetColumnValues>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn unused_numbers_tool_attr() -> Tool

Generated tool metadata function for unused_numbers

Source

pub fn unused_numbers( &self, params: Parameters<GetUnusedNumbers>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn find_definition_tool_attr() -> Tool

Generated tool metadata function for find_definition

Source

pub fn find_definition( &self, params: Parameters<FindDefinition>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn find_usages_tool_attr() -> Tool

Generated tool metadata function for find_usages

Source

pub fn find_usages( &self, params: Parameters<FindUsages>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn find_loc_tool_attr() -> Tool

Generated tool metadata function for find_loc

Source

pub fn find_loc( &self, params: Parameters<FindLoc>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn loc_source_tool_attr() -> Tool

Generated tool metadata function for loc_source

Source

pub fn loc_source( &self, params: Parameters<GetLocSource>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn row_locs_tool_attr() -> Tool

Generated tool metadata function for row_locs

Source

pub fn row_locs( &self, params: Parameters<GetRowLocs>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn pack_settings_tool_attr() -> Tool

Generated tool metadata function for pack_settings

Source

pub fn pack_settings( &self, params: Parameters<GetPackSettings>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn update_pack_settings_tool_attr() -> Tool

Generated tool metadata function for update_pack_settings

Source

pub fn update_pack_settings( &self, params: Parameters<UpdatePackSettings>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn list_notes_tool_attr() -> Tool

Generated tool metadata function for list_notes

Source

pub fn list_notes( &self, params: Parameters<ListNotes>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn add_note_tool_attr() -> Tool

Generated tool metadata function for add_note

Source

pub fn add_note( &self, params: Parameters<AddNote>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn delete_note_tool_attr() -> Tool

Generated tool metadata function for delete_note

Source

pub fn delete_note( &self, params: Parameters<DeleteNote>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn schema_tables_tool_attr() -> Tool

Generated tool metadata function for schema_tables

Source

pub fn schema_tables( &self, params: Parameters<ListSchemaTables>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn patch_column_tool_attr() -> Tool

Generated tool metadata function for patch_column

Source

pub fn patch_column( &self, params: Parameters<PatchColumn>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn remove_patches_tool_attr() -> Tool

Generated tool metadata function for remove_patches

Source

pub fn remove_patches( &self, params: Parameters<RemovePatches>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn update_schemas_tool_attr() -> Tool

Generated tool metadata function for update_schemas

Source

pub fn update_schemas( &self, params: Parameters<UpdateSchemas>, context: RequestContext<RoleServer>, ) -> Pin<Box<dyn Future<Output = Result<JobToolResponse, McpError>> + Send + '_>>

Source

pub fn update_schema_from_assembly_kit_tool_attr() -> Tool

Generated tool metadata function for update_schema_from_assembly_kit

Source

pub fn update_schema_from_assembly_kit( &self, params: Parameters<UpdateSchemaFromAssemblyKit>, context: RequestContext<RoleServer>, ) -> Pin<Box<dyn Future<Output = Result<JobToolResponse, McpError>> + Send + '_>>

Source

pub fn merge_tables_tool_attr() -> Tool

Generated tool metadata function for merge_tables

Source

pub fn merge_tables( &self, params: Parameters<MergeTables>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn upgrade_table_tool_attr() -> Tool

Generated tool metadata function for upgrade_table

Source

pub fn upgrade_table( &self, params: Parameters<UpgradeTable>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn rename_key_tool_attr() -> Tool

Generated tool metadata function for rename_key

Source

pub fn rename_key( &self, params: Parameters<RenameKey>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn add_key_deletes_tool_attr() -> Tool

Generated tool metadata function for add_key_deletes

Source

pub fn add_key_deletes( &self, params: Parameters<AddKeyDeletes>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn export_tsv_tool_attr() -> Tool

Generated tool metadata function for export_tsv

Source

pub fn export_tsv( &self, params: Parameters<ExportTsv>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn import_tsv_tool_attr() -> Tool

Generated tool metadata function for import_tsv

Source

pub fn import_tsv( &self, params: Parameters<ImportTsv>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn optimizer_options_tool_attr() -> Tool

Generated tool metadata function for optimizer_options

Source

pub fn optimizer_options( &self, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn patch_siege_ai_tool_attr() -> Tool

Generated tool metadata function for patch_siege_ai

Source

pub fn patch_siege_ai( &self, params: Parameters<PatchSiegeAi>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn pack_map_tool_attr() -> Tool

Generated tool metadata function for pack_map

Source

pub fn pack_map( &self, params: Parameters<PackMap>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn generate_missing_locs_tool_attr() -> Tool

Generated tool metadata function for generate_missing_locs

Source

pub fn generate_missing_locs( &self, params: Parameters<GenerateMissingLocs>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn update_anim_ids_tool_attr() -> Tool

Generated tool metadata function for update_anim_ids

Source

pub fn update_anim_ids( &self, params: Parameters<UpdateAnimIds>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn anims_by_skeleton_tool_attr() -> Tool

Generated tool metadata function for anims_by_skeleton

Source

pub fn anims_by_skeleton( &self, params: Parameters<AnimsBySkeleton>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn export_gltf_tool_attr() -> Tool

Generated tool metadata function for export_gltf

Source

pub fn export_gltf( &self, params: Parameters<ExportGltf>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn set_video_format_tool_attr() -> Tool

Generated tool metadata function for set_video_format

Source

pub fn set_video_format( &self, params: Parameters<SetVideoFormat>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn live_export_tool_attr() -> Tool

Generated tool metadata function for live_export

Source

pub fn live_export( &self, params: Parameters<LiveExport>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn init_mymod_tool_attr() -> Tool

Generated tool metadata function for init_mymod

Source

pub fn init_mymod( &self, params: Parameters<InitMyMod>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn startpos_campaigns_tool_attr() -> Tool

Generated tool metadata function for startpos_campaigns

Source

pub fn startpos_campaigns( &self, params: Parameters<GetStartposCampaigns>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn start_startpos_tool_attr() -> Tool

Generated tool metadata function for start_startpos

Source

pub fn start_startpos( &self, params: Parameters<StartStartpos>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn finish_startpos_tool_attr() -> Tool

Generated tool metadata function for finish_startpos

Source

pub fn finish_startpos( &self, params: Parameters<FinishStartpos>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn validate_startpos_tool_attr() -> Tool

Generated tool metadata function for validate_startpos

Source

pub fn validate_startpos( &self, params: Parameters<ValidateStartpos>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn generate_startpos_tool_attr() -> Tool

Generated tool metadata function for generate_startpos

Source

pub fn generate_startpos( &self, params: Parameters<GenerateStartpos>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn extract_startpos_tables_tool_attr() -> Tool

Generated tool metadata function for extract_startpos_tables

Source

pub fn extract_startpos_tables( &self, params: Parameters<ExtractStartposTables>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn keep_startpos_campaign_tool_attr() -> Tool

Generated tool metadata function for keep_startpos_campaign

Source

pub fn keep_startpos_campaign( &self, params: Parameters<KeepStartposCampaign>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn compare_startpos_tables_tool_attr() -> Tool

Generated tool metadata function for compare_startpos_tables

Source

pub fn compare_startpos_tables( &self, params: Parameters<CompareStartposTables>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn optimize_pack_tool_attr() -> Tool

Generated tool metadata function for optimize_pack

Source

pub fn optimize_pack( &self, params: Parameters<OptimizePack>, context: RequestContext<RoleServer>, ) -> Pin<Box<dyn Future<Output = Result<JobToolResponse, McpError>> + Send + '_>>

Source

pub fn run_lua_tests_tool_attr() -> Tool

Generated tool metadata function for run_lua_tests

Source

pub fn run_lua_tests( &self, params: Parameters<RunLuaTests>, context: RequestContext<RoleServer>, ) -> Pin<Box<dyn Future<Output = Result<JobToolResponse, McpError>> + Send + '_>>

Source

pub fn check_update_tool_attr() -> Tool

Generated tool metadata function for check_update

Source

pub fn check_update( &self, params: Parameters<CheckUpdate>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn apply_update_tool_attr() -> Tool

Generated tool metadata function for apply_update

Source

pub fn apply_update( &self, params: Parameters<ApplyUpdate>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn read_file_tool_attr() -> Tool

Generated tool metadata function for read_file

Source

pub fn read_file( &self, params: Parameters<ReadFile>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn write_file_tool_attr() -> Tool

Generated tool metadata function for write_file

Source

pub fn write_file( &self, params: Parameters<WriteFile>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn list_animpack_tool_attr() -> Tool

Generated tool metadata function for list_animpack

Source

pub fn list_animpack( &self, params: Parameters<ListAnimPack>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn add_to_animpack_tool_attr() -> Tool

Generated tool metadata function for add_to_animpack

Source

pub fn add_to_animpack( &self, params: Parameters<AddToAnimPack>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn extract_from_animpack_tool_attr() -> Tool

Generated tool metadata function for extract_from_animpack

Source

pub fn extract_from_animpack( &self, params: Parameters<ExtractFromAnimPack>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn delete_from_animpack_tool_attr() -> Tool

Generated tool metadata function for delete_from_animpack

Source

pub fn delete_from_animpack( &self, params: Parameters<DeleteFromAnimPack>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn raw_definitions_tool_attr() -> Tool

Generated tool metadata function for raw_definitions

Source

pub fn raw_definitions( &self, params: Parameters<GetRawDefinitions>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn set_definition_tool_attr() -> Tool

Generated tool metadata function for set_definition

Source

pub fn set_definition( &self, params: Parameters<SetDefinition>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn delete_definition_tool_attr() -> Tool

Generated tool metadata function for delete_definition

Source

pub fn delete_definition( &self, params: Parameters<DeleteDefinition>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn referencing_columns_tool_attr() -> Tool

Generated tool metadata function for referencing_columns

Source

pub fn referencing_columns( &self, params: Parameters<GetReferencingColumns>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn table_patches_tool_attr() -> Tool

Generated tool metadata function for table_patches

Source

pub fn table_patches( &self, params: Parameters<GetTablePatches>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn missing_definitions_tool_attr() -> Tool

Generated tool metadata function for missing_definitions

Source

pub fn missing_definitions( &self, params: Parameters<GetMissingDefinitions>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn import_patches_tool_attr() -> Tool

Generated tool metadata function for import_patches

Source

pub fn import_patches( &self, params: Parameters<ImportPatches>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn reference_values_tool_attr() -> Tool

Generated tool metadata function for reference_values

Source

pub fn reference_values( &self, params: Parameters<GetReferenceValues>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn list_translations_tool_attr() -> Tool

Generated tool metadata function for list_translations

Source

pub fn list_translations( &self, params: Parameters<ListTranslations>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn generate_vanilla_texts_tool_attr() -> Tool

Generated tool metadata function for generate_vanilla_texts

Source

pub fn generate_vanilla_texts( &self, params: Parameters<GenerateVanillaTexts>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn job_status_tool_attr() -> Tool

Generated tool metadata function for job_status

Source

pub fn job_status( &self, params: Parameters<GetJobStatus>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn wait_for_job_tool_attr() -> Tool

Generated tool metadata function for wait_for_job

Source

pub fn wait_for_job( &self, params: Parameters<WaitForJob>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn cancel_job_tool_attr() -> Tool

Generated tool metadata function for cancel_job

Source

pub fn cancel_job( &self, params: Parameters<CancelJob>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn new_pack_tool_attr() -> Tool

Generated tool metadata function for new_pack

Source

pub fn new_pack( &self, params: Parameters<NewPack>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn open_pack_tool_attr() -> Tool

Generated tool metadata function for open_pack

Source

pub fn open_pack( &self, params: Parameters<OpenPack>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn open_vanilla_packs_tool_attr() -> Tool

Generated tool metadata function for open_vanilla_packs

Source

pub fn open_vanilla_packs( &self, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn close_pack_tool_attr() -> Tool

Generated tool metadata function for close_pack

Source

pub fn close_pack( &self, params: Parameters<ClosePack>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn close_all_packs_tool_attr() -> Tool

Generated tool metadata function for close_all_packs

Source

pub fn close_all_packs( &self, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn save_pack_tool_attr() -> Tool

Generated tool metadata function for save_pack

Source

pub fn save_pack( &self, params: Parameters<SavePack>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn update_pack_tool_attr() -> Tool

Generated tool metadata function for update_pack

Source

pub fn update_pack( &self, params: Parameters<UpdatePack>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn create_file_tool_attr() -> Tool

Generated tool metadata function for create_file

Source

pub fn create_file( &self, params: Parameters<CreateFile>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn add_files_from_disk_tool_attr() -> Tool

Generated tool metadata function for add_files_from_disk

Source

pub fn add_files_from_disk( &self, params: Parameters<AddFilesFromDisk>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn copy_files_tool_attr() -> Tool

Generated tool metadata function for copy_files

Source

pub fn copy_files( &self, params: Parameters<CopyFiles>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn delete_files_tool_attr() -> Tool

Generated tool metadata function for delete_files

Source

pub fn delete_files( &self, params: Parameters<DeleteFiles>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn rename_files_tool_attr() -> Tool

Generated tool metadata function for rename_files

Source

pub fn rename_files( &self, params: Parameters<RenameFiles>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn duplicate_files_tool_attr() -> Tool

Generated tool metadata function for duplicate_files

Source

pub fn duplicate_files( &self, params: Parameters<DuplicateFiles>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn extract_files_tool_attr() -> Tool

Generated tool metadata function for extract_files

Source

pub fn extract_files( &self, params: Parameters<ExtractFiles>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn edit_table_tool_attr() -> Tool

Generated tool metadata function for edit_table

Source

pub fn edit_table( &self, params: Parameters<EditTable>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn new(sessions: Arc<SessionManager>) -> Self

Source

fn tool_router() -> ToolRouter<Self>

Source§

impl McpServer

Source

pub fn open_and_inspect_pack_prompt_attr() -> Prompt

Source

pub fn open_and_inspect_pack( &self, ) -> Pin<Box<dyn Future<Output = Vec<PromptMessage>> + Send + '_>>

Source

pub fn edit_db_table_prompt_attr() -> Prompt

Source

pub fn edit_db_table( &self, ) -> Pin<Box<dyn Future<Output = Vec<PromptMessage>> + Send + '_>>

Source

pub fn create_new_mod_prompt_attr() -> Prompt

Source

pub fn create_new_mod( &self, ) -> Pin<Box<dyn Future<Output = Vec<PromptMessage>> + Send + '_>>

Source

pub fn search_and_replace_prompt_attr() -> Prompt

Source

pub fn search_and_replace( &self, ) -> Pin<Box<dyn Future<Output = Vec<PromptMessage>> + Send + '_>>

Source

pub fn manage_dependencies_prompt_attr() -> Prompt

Source

pub fn manage_dependencies( &self, ) -> Pin<Box<dyn Future<Output = Vec<PromptMessage>> + Send + '_>>

Source

pub fn run_diagnostics_prompt_attr() -> Prompt

Source

pub fn run_diagnostics( &self, ) -> Pin<Box<dyn Future<Output = Vec<PromptMessage>> + Send + '_>>

Source

pub fn schema_operations_prompt_attr() -> Prompt

Source

pub fn schema_operations( &self, ) -> Pin<Box<dyn Future<Output = Vec<PromptMessage>> + Send + '_>>

Source

pub fn file_operations_prompt_attr() -> Prompt

Source

pub fn file_operations( &self, ) -> Pin<Box<dyn Future<Output = Vec<PromptMessage>> + Send + '_>>

Source

pub fn troubleshooting_prompt_attr() -> Prompt

Source

pub fn troubleshooting( &self, ) -> Pin<Box<dyn Future<Output = Vec<PromptMessage>> + Send + '_>>

Source

pub fn tsv_workflow_prompt_attr() -> Prompt

Source

pub fn tsv_workflow( &self, ) -> Pin<Box<dyn Future<Output = Vec<PromptMessage>> + Send + '_>>

Source

pub fn translation_workflow_prompt_attr() -> Prompt

Source

pub fn translation_workflow( &self, ) -> Pin<Box<dyn Future<Output = Vec<PromptMessage>> + Send + '_>>

Source

fn prompt_router() -> PromptRouter<McpServer>

Trait Implementations§

Source§

impl Clone for McpServer

Source§

fn clone(&self) -> McpServer

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ServerHandler for McpServer

Source§

async fn call_tool( &self, request: CallToolRequestParams, context: RequestContext<RoleServer>, ) -> Result<CallToolResponse, McpError>

Calls a tool, reporting params rmcp can’t parse like the API’s own invalid params, instead of as plain text.

Stops waiting for the tool if the client cancels the call, as rmcp drops its response. The request keeps running on the session.

Source§

async fn cancel_task( &self, request: CancelTaskParams, _context: RequestContext<RoleServer>, ) -> Result<(), McpError>

Cancels the job of a task if it hasn’t started. Running jobs finish anyway, which tasks allow.

Source§

async fn discover( &self, _context: RequestContext<RoleServer>, ) -> Result<DiscoverResult, McpError>

Return this server’s discovery information.
Source§

async fn list_tools( &self, _request: Option<PaginatedRequestParams>, _context: RequestContext<RoleServer>, ) -> Result<ListToolsResult, McpError>

Source§

fn get_info(&self) -> ServerInfo

Source§

async fn get_task( &self, request: GetTaskParams, _context: RequestContext<RoleServer>, ) -> Result<GetTaskResult, McpError>

SEP-2663 tasks/get: return the current [DetailedTask] state.
Source§

async fn get_prompt( &self, request: GetPromptRequestParams, context: RequestContext<RoleServer>, ) -> Result<GetPromptResponse, McpError>

Source§

async fn list_prompts( &self, _request: Option<PaginatedRequestParams>, _context: RequestContext<RoleServer>, ) -> Result<ListPromptsResult, McpError>

Source§

async fn list_resources( &self, _request: Option<PaginatedRequestParams>, _context: RequestContext<RoleServer>, ) -> Result<ListResourcesResult, McpError>

Source§

async fn list_resource_templates( &self, _request: Option<PaginatedRequestParams>, _context: RequestContext<RoleServer>, ) -> Result<ListResourceTemplatesResult, McpError>

Source§

async fn read_resource( &self, request: ReadResourceRequestParams, _context: RequestContext<RoleServer>, ) -> Result<ReadResourceResponse, McpError>

Source§

fn get_tool(&self, name: &str) -> Option<Tool>

Get a tool definition by name. Read more
§

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

§

fn supported_protocol_versions(&self) -> Cow<'static, [ProtocolVersion]>

Return the protocol versions supported by this server. Read more
§

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 accepted_subscription_filter( &self, requested: &SubscriptionFilter, ) -> Option<SubscriptionFilter>

Return the subset of a requested notification filter this server accepts. Read more
§

fn listen( &self, context: SubscriptionContext, ) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture

Run one established subscription until it is cancelled or closed gracefully. Read more
§

fn subscribe( &self, request: SubscribeRequestParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture

👎Deprecated:

resources/subscribe is legacy-only; implement accepted_subscription_filter and listen for protocol version 2026-07-28

§

fn unsubscribe( &self, request: UnsubscribeRequestParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture

👎Deprecated:

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

§

fn update_task( &self, request: UpdateTaskParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture

SEP-2663 tasks/update: accept responses to outstanding in-task input requests. Returns an empty acknowledgement on success.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

§

impl<R, S> DynService<R> for S
where 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

§

fn supported_protocol_versions(&self) -> Cow<'static, [ProtocolVersion]>

See [Service::supported_protocol_versions].
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
§

impl<T> MaybeSend for T

§

impl<T> MaybeSync for T

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<H> Service<RoleServer> for H
where 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

§

fn supported_protocol_versions(&self) -> Cow<'static, [ProtocolVersion]>

The protocol versions this service can speak, bounding what initialize negotiation may agree to. Read more
§

impl<S> ServiceExt<RoleServer> for S
where S: Service<RoleServer>,

§

fn serve_with_ct<T, E, A>( self, transport: T, ct: CancellationToken, ) -> impl Future<Output = Result<RunningService<RoleServer, S>, ServerInitializeError>> + MaybeSendFuture
where T: IntoTransport<RoleServer, E, A>, E: Error + Send + Sync + 'static, S: Sized,

§

fn into_dyn(self) -> Box<dyn DynService<R>>

Convert this service to a dynamic boxed service Read more
§

fn serve<T, E, A>( self, transport: T, ) -> impl Future<Output = Result<RunningService<R, Self>, <R as ServiceRole>::InitializeError>> + MaybeSendFuture
where T: IntoTransport<R, E, A>, E: Error + Send + Sync + 'static, Self: Sized,

§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more