pub struct NeovimMcpServer {
pub nvim_clients: Arc<DashMap<String, Box<dyn NeovimClientTrait + Send>>>,
pub hybrid_router: HybridToolRouter,
pub connect_mode: Option<String>,
}Fields§
§nvim_clients: Arc<DashMap<String, Box<dyn NeovimClientTrait + Send>>>§hybrid_router: HybridToolRouter§connect_mode: Option<String>Implementations§
Source§impl NeovimMcpServer
impl NeovimMcpServer
pub fn new() -> Self
pub fn with_connect_mode(connect_mode: Option<String>) -> Self
pub fn router(&self) -> &HybridToolRouter
Sourcepub fn generate_shorter_connection_id(&self, target: &str) -> String
pub fn generate_shorter_connection_id(&self, target: &str) -> String
Generate shorter connection ID with collision detection
Sourcepub fn get_connection(
&self,
connection_id: &str,
) -> Result<Ref<'_, String, Box<dyn NeovimClientTrait + Send>>, McpError>
pub fn get_connection( &self, connection_id: &str, ) -> Result<Ref<'_, String, Box<dyn NeovimClientTrait + Send>>, McpError>
Get connection by ID with proper error handling
Sourcepub fn get_connections_instruction(&self) -> String
pub fn get_connections_instruction(&self) -> String
Get dynamic connections info for LLM
Sourcepub fn register_dynamic_tool(
&self,
connection_id: &str,
tool: Box<dyn DynamicTool>,
) -> Result<(), McpError>
pub fn register_dynamic_tool( &self, connection_id: &str, tool: Box<dyn DynamicTool>, ) -> Result<(), McpError>
Register a connection-specific tool with clean name
Sourcepub fn unregister_dynamic_tools(&self, connection_id: &str)
pub fn unregister_dynamic_tools(&self, connection_id: &str)
Remove all dynamic tools for a connection
Sourcepub fn get_dynamic_tool_count(&self, connection_id: &str) -> usize
pub fn get_dynamic_tool_count(&self, connection_id: &str) -> usize
Get count of dynamic tools for a connection
pub async fn discover_and_register_lua_tools(&self) -> Result<(), McpError>
Source§impl NeovimMcpServer
impl NeovimMcpServer
pub fn tool_descriptions() -> HashMap<&'static str, &'static str>
pub fn get_tool_extra_description(&self, name: &str) -> Option<String>
Source§impl NeovimMcpServer
impl NeovimMcpServer
Sourcepub fn get_targets_tool_attr() -> Tool
pub fn get_targets_tool_attr() -> Tool
Generated tool metadata function for get_targets
pub fn get_targets( &self, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>
Sourcepub fn connect_tool_attr() -> Tool
pub fn connect_tool_attr() -> Tool
Generated tool metadata function for connect
pub fn connect( &self, Parameters: Parameters<ConnectNvimRequest>, ctx: RequestContext<RoleServer>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>
Sourcepub fn connect_tcp_tool_attr() -> Tool
pub fn connect_tcp_tool_attr() -> Tool
Generated tool metadata function for connect_tcp
pub fn connect_tcp( &self, Parameters: Parameters<ConnectNvimRequest>, ctx: RequestContext<RoleServer>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>
Sourcepub fn disconnect_tool_attr() -> Tool
pub fn disconnect_tool_attr() -> Tool
Generated tool metadata function for disconnect
pub fn disconnect( &self, Parameters: Parameters<ConnectionRequest>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>
Sourcepub fn list_buffers_tool_attr() -> Tool
pub fn list_buffers_tool_attr() -> Tool
Generated tool metadata function for list_buffers
pub fn list_buffers( &self, Parameters: Parameters<ConnectionRequest>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>
Sourcepub fn exec_lua_tool_attr() -> Tool
pub fn exec_lua_tool_attr() -> Tool
Generated tool metadata function for exec_lua
pub fn exec_lua( &self, Parameters: Parameters<ExecuteLuaRequest>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>
Sourcepub fn wait_for_lsp_ready_tool_attr() -> Tool
pub fn wait_for_lsp_ready_tool_attr() -> Tool
Generated tool metadata function for wait_for_lsp_ready
pub fn wait_for_lsp_ready( &self, Parameters: Parameters<WaitForLspReadyRequest>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>
Sourcepub fn read_tool_attr() -> Tool
pub fn read_tool_attr() -> Tool
Generated tool metadata function for read
pub fn read( &self, Parameters: Parameters<BufferReadRequest>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>
Sourcepub fn buffer_diagnostics_tool_attr() -> Tool
pub fn buffer_diagnostics_tool_attr() -> Tool
Generated tool metadata function for buffer_diagnostics
pub fn buffer_diagnostics( &self, Parameters: Parameters<BufferRequest>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>
Sourcepub fn lsp_clients_tool_attr() -> Tool
pub fn lsp_clients_tool_attr() -> Tool
Generated tool metadata function for lsp_clients
pub fn lsp_clients( &self, Parameters: Parameters<ConnectionRequest>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>
Sourcepub fn lsp_workspace_symbols_tool_attr() -> Tool
pub fn lsp_workspace_symbols_tool_attr() -> Tool
Generated tool metadata function for lsp_workspace_symbols
pub fn lsp_workspace_symbols( &self, Parameters: Parameters<WorkspaceSymbolsParams>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>
Sourcepub fn lsp_code_actions_tool_attr() -> Tool
pub fn lsp_code_actions_tool_attr() -> Tool
Generated tool metadata function for lsp_code_actions
pub fn lsp_code_actions( &self, Parameters: Parameters<CodeActionsParams>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>
Sourcepub fn lsp_hover_tool_attr() -> Tool
pub fn lsp_hover_tool_attr() -> Tool
Generated tool metadata function for lsp_hover
pub fn lsp_hover( &self, Parameters: Parameters<HoverParam>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>
Sourcepub fn lsp_document_symbols_tool_attr() -> Tool
pub fn lsp_document_symbols_tool_attr() -> Tool
Generated tool metadata function for lsp_document_symbols
pub fn lsp_document_symbols( &self, Parameters: Parameters<DocumentSymbolsParams>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>
Sourcepub fn lsp_references_tool_attr() -> Tool
pub fn lsp_references_tool_attr() -> Tool
Generated tool metadata function for lsp_references
pub fn lsp_references( &self, Parameters: Parameters<ReferencesParams>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>
Sourcepub fn lsp_definition_tool_attr() -> Tool
pub fn lsp_definition_tool_attr() -> Tool
Generated tool metadata function for lsp_definition
pub fn lsp_definition( &self, Parameters: Parameters<DefinitionParams>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>
Sourcepub fn lsp_type_definition_tool_attr() -> Tool
pub fn lsp_type_definition_tool_attr() -> Tool
Generated tool metadata function for lsp_type_definition
pub fn lsp_type_definition( &self, Parameters: Parameters<TypeDefinitionParams>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>
Sourcepub fn lsp_implementations_tool_attr() -> Tool
pub fn lsp_implementations_tool_attr() -> Tool
Generated tool metadata function for lsp_implementations
pub fn lsp_implementations( &self, Parameters: Parameters<ImplementationParams>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>
Sourcepub fn lsp_declaration_tool_attr() -> Tool
pub fn lsp_declaration_tool_attr() -> Tool
Generated tool metadata function for lsp_declaration
pub fn lsp_declaration( &self, Parameters: Parameters<DeclarationParams>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>
Sourcepub fn lsp_resolve_code_action_tool_attr() -> Tool
pub fn lsp_resolve_code_action_tool_attr() -> Tool
Generated tool metadata function for lsp_resolve_code_action
pub fn lsp_resolve_code_action( &self, Parameters: Parameters<ResolveCodeActionParams>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>
Sourcepub fn lsp_apply_edit_tool_attr() -> Tool
pub fn lsp_apply_edit_tool_attr() -> Tool
Generated tool metadata function for lsp_apply_edit
pub fn lsp_apply_edit( &self, Parameters: Parameters<ApplyWorkspaceEditParams>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>
Sourcepub fn lsp_rename_tool_attr() -> Tool
pub fn lsp_rename_tool_attr() -> Tool
Generated tool metadata function for lsp_rename
pub fn lsp_rename( &self, Parameters: Parameters<RenameParams>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>
Sourcepub fn lsp_formatting_tool_attr() -> Tool
pub fn lsp_formatting_tool_attr() -> Tool
Generated tool metadata function for lsp_formatting
pub fn lsp_formatting( &self, Parameters: Parameters<DocumentFormattingParams>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>
Sourcepub fn lsp_range_formatting_tool_attr() -> Tool
pub fn lsp_range_formatting_tool_attr() -> Tool
Generated tool metadata function for lsp_range_formatting
pub fn lsp_range_formatting( &self, Parameters: Parameters<DocumentRangeFormattingParams>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>
Sourcepub fn lsp_organize_imports_tool_attr() -> Tool
pub fn lsp_organize_imports_tool_attr() -> Tool
Generated tool metadata function for lsp_organize_imports
pub fn lsp_organize_imports( &self, Parameters: Parameters<LspOrganizeImportsParams>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>
Sourcepub fn cursor_position_tool_attr() -> Tool
pub fn cursor_position_tool_attr() -> Tool
Generated tool metadata function for cursor_position
pub fn cursor_position( &self, Parameters: Parameters<ConnectionRequest>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>
Generated tool metadata function for navigate
Sourcepub fn lsp_call_hierarchy_prepare_tool_attr() -> Tool
pub fn lsp_call_hierarchy_prepare_tool_attr() -> Tool
Generated tool metadata function for lsp_call_hierarchy_prepare
pub fn lsp_call_hierarchy_prepare( &self, Parameters: Parameters<CallHierarchyPrepareParams>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>
Sourcepub fn lsp_call_hierarchy_incoming_calls_tool_attr() -> Tool
pub fn lsp_call_hierarchy_incoming_calls_tool_attr() -> Tool
Generated tool metadata function for lsp_call_hierarchy_incoming_calls
pub fn lsp_call_hierarchy_incoming_calls( &self, Parameters: Parameters<CallHierarchyIncomingCallsParams>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>
Sourcepub fn lsp_call_hierarchy_outgoing_calls_tool_attr() -> Tool
pub fn lsp_call_hierarchy_outgoing_calls_tool_attr() -> Tool
Generated tool metadata function for lsp_call_hierarchy_outgoing_calls
pub fn lsp_call_hierarchy_outgoing_calls( &self, Parameters: Parameters<CallHierarchyOutgoingCallsParams>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>
Sourcepub fn lsp_type_hierarchy_prepare_tool_attr() -> Tool
pub fn lsp_type_hierarchy_prepare_tool_attr() -> Tool
Generated tool metadata function for lsp_type_hierarchy_prepare
pub fn lsp_type_hierarchy_prepare( &self, Parameters: Parameters<TypeHierarchyPrepareParams>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>
Sourcepub fn lsp_type_hierarchy_supertypes_tool_attr() -> Tool
pub fn lsp_type_hierarchy_supertypes_tool_attr() -> Tool
Generated tool metadata function for lsp_type_hierarchy_supertypes
pub fn lsp_type_hierarchy_supertypes( &self, Parameters: Parameters<TypeHierarchySupertypesParams>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>
Sourcepub fn lsp_type_hierarchy_subtypes_tool_attr() -> Tool
pub fn lsp_type_hierarchy_subtypes_tool_attr() -> Tool
Generated tool metadata function for lsp_type_hierarchy_subtypes