NeovimMcpServer

Struct NeovimMcpServer 

Source
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

Source

pub fn new() -> Self

Source

pub fn with_connect_mode(connect_mode: Option<String>) -> Self

Source

pub fn router(&self) -> &HybridToolRouter

Source

pub fn generate_shorter_connection_id(&self, target: &str) -> String

Generate shorter connection ID with collision detection

Source

pub fn get_connection( &self, connection_id: &str, ) -> Result<Ref<'_, String, Box<dyn NeovimClientTrait + Send>>, McpError>

Get connection by ID with proper error handling

Source

pub fn get_connections_instruction(&self) -> String

Get dynamic connections info for LLM

Source

pub fn register_dynamic_tool( &self, connection_id: &str, tool: Box<dyn DynamicTool>, ) -> Result<(), McpError>

Register a connection-specific tool with clean name

Source

pub fn unregister_dynamic_tools(&self, connection_id: &str)

Remove all dynamic tools for a connection

Source

pub fn get_dynamic_tool_count(&self, connection_id: &str) -> usize

Get count of dynamic tools for a connection

Source

pub async fn discover_and_register_lua_tools(&self) -> Result<(), McpError>

Source§

impl NeovimMcpServer

Source

pub fn tool_descriptions() -> HashMap<&'static str, &'static str>

Source

pub fn get_tool_extra_description(&self, name: &str) -> Option<String>

Source§

impl NeovimMcpServer

Source

pub fn get_targets_tool_attr() -> Tool

Generated tool metadata function for get_targets

Source

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

Source

pub fn connect_tool_attr() -> Tool

Generated tool metadata function for connect

Source

pub fn connect( &self, Parameters: Parameters<ConnectNvimRequest>, ctx: RequestContext<RoleServer>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn connect_tcp_tool_attr() -> Tool

Generated tool metadata function for connect_tcp

Source

pub fn connect_tcp( &self, Parameters: Parameters<ConnectNvimRequest>, ctx: RequestContext<RoleServer>, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpError>> + Send + '_>>

Source

pub fn disconnect_tool_attr() -> Tool

Generated tool metadata function for disconnect

Source

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

Source

pub fn list_buffers_tool_attr() -> Tool

Generated tool metadata function for list_buffers

Source

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

Source

pub fn exec_lua_tool_attr() -> Tool

Generated tool metadata function for exec_lua

Source

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

Source

pub fn wait_for_lsp_ready_tool_attr() -> Tool

Generated tool metadata function for wait_for_lsp_ready

Source

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

Source

pub fn read_tool_attr() -> Tool

Generated tool metadata function for read

Source

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

Source

pub fn buffer_diagnostics_tool_attr() -> Tool

Generated tool metadata function for buffer_diagnostics

Source

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

Source

pub fn lsp_clients_tool_attr() -> Tool

Generated tool metadata function for lsp_clients

Source

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

Source

pub fn lsp_workspace_symbols_tool_attr() -> Tool

Generated tool metadata function for lsp_workspace_symbols

Source

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

Source

pub fn lsp_code_actions_tool_attr() -> Tool

Generated tool metadata function for lsp_code_actions

Source

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

Source

pub fn lsp_hover_tool_attr() -> Tool

Generated tool metadata function for lsp_hover

Source

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

Source

pub fn lsp_document_symbols_tool_attr() -> Tool

Generated tool metadata function for lsp_document_symbols

Source

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

Source

pub fn lsp_references_tool_attr() -> Tool

Generated tool metadata function for lsp_references

Source

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

Source

pub fn lsp_definition_tool_attr() -> Tool

Generated tool metadata function for lsp_definition

Source

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

Source

pub fn lsp_type_definition_tool_attr() -> Tool

Generated tool metadata function for lsp_type_definition

Source

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

Source

pub fn lsp_implementations_tool_attr() -> Tool

Generated tool metadata function for lsp_implementations

Source

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

Source

pub fn lsp_declaration_tool_attr() -> Tool

Generated tool metadata function for lsp_declaration

Source

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

Source

pub fn lsp_resolve_code_action_tool_attr() -> Tool

Generated tool metadata function for lsp_resolve_code_action

Source

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

Source

pub fn lsp_apply_edit_tool_attr() -> Tool

Generated tool metadata function for lsp_apply_edit

Source

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

Source

pub fn lsp_rename_tool_attr() -> Tool

Generated tool metadata function for lsp_rename

Source

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

Source

pub fn lsp_formatting_tool_attr() -> Tool

Generated tool metadata function for lsp_formatting

Source

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

Source

pub fn lsp_range_formatting_tool_attr() -> Tool

Generated tool metadata function for lsp_range_formatting

Source

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

Source

pub fn lsp_organize_imports_tool_attr() -> Tool

Generated tool metadata function for lsp_organize_imports

Source

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

Source

pub fn cursor_position_tool_attr() -> Tool

Generated tool metadata function for cursor_position

Source

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

Source

pub fn navigate_tool_attr() -> Tool

Generated tool metadata function for navigate

Source

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

Source

pub fn lsp_call_hierarchy_prepare_tool_attr() -> Tool

Generated tool metadata function for lsp_call_hierarchy_prepare

Source

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

Source

pub fn lsp_call_hierarchy_incoming_calls_tool_attr() -> Tool

Generated tool metadata function for lsp_call_hierarchy_incoming_calls

Source

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

Source

pub fn lsp_call_hierarchy_outgoing_calls_tool_attr() -> Tool

Generated tool metadata function for lsp_call_hierarchy_outgoing_calls

Source

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

Source

pub fn lsp_type_hierarchy_prepare_tool_attr() -> Tool

Generated tool metadata function for lsp_type_hierarchy_prepare

Source

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

Source

pub fn lsp_type_hierarchy_supertypes_tool_attr() -> Tool

Generated tool metadata function for lsp_type_hierarchy_supertypes

Source

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

Source

pub fn lsp_type_hierarchy_subtypes_tool_attr() -> Tool

Generated tool metadata function for lsp_type_hierarchy_subtypes

Source

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

Trait Implementations§

Source§

impl Default for NeovimMcpServer

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl ServerHandler for NeovimMcpServer

Source§

fn get_info(&self) -> ServerInfo

Source§

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

Source§

async fn read_resource( &self, __arg1: ReadResourceRequestParam, _: RequestContext<RoleServer>, ) -> Result<ReadResourceResult, McpError>

Source§

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

Source§

async fn call_tool( &self, __arg1: CallToolRequestParam, context: RequestContext<RoleServer>, ) -> Result<CallToolResult, McpError>

Source§

fn ping( &self, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<(), ErrorData>> + Send

Source§

fn initialize( &self, request: InitializeRequestParam, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<InitializeResult, ErrorData>> + Send

Source§

fn complete( &self, request: CompleteRequestParam, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<CompleteResult, ErrorData>> + Send

Source§

fn set_level( &self, request: SetLevelRequestParam, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<(), ErrorData>> + Send

Source§

fn get_prompt( &self, request: GetPromptRequestParam, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<GetPromptResult, ErrorData>> + Send

Source§

fn list_prompts( &self, request: Option<PaginatedRequestParam>, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<ListPromptsResult, ErrorData>> + Send

Source§

fn list_resource_templates( &self, request: Option<PaginatedRequestParam>, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<ListResourceTemplatesResult, ErrorData>> + Send

Source§

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

Source§

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

Source§

fn on_cancelled( &self, notification: CancelledNotificationParam, context: NotificationContext<RoleServer>, ) -> impl Future<Output = ()> + Send

Source§

fn on_progress( &self, notification: ProgressNotificationParam, context: NotificationContext<RoleServer>, ) -> impl Future<Output = ()> + Send

Source§

fn on_initialized( &self, context: NotificationContext<RoleServer>, ) -> impl Future<Output = ()> + Send

Source§

fn on_roots_list_changed( &self, context: NotificationContext<RoleServer>, ) -> impl Future<Output = ()> + Send

Source§

fn on_custom_notification( &self, notification: CustomClientNotification, context: NotificationContext<RoleServer>, ) -> impl Future<Output = ()> + Send

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

impl<R, S> DynService<R> for S
where R: ServiceRole, S: Service<R>,

Source§

fn handle_request( &self, request: <R as ServiceRole>::PeerReq, context: RequestContext<R>, ) -> Pin<Box<dyn Future<Output = Result<<R as ServiceRole>::Resp, ErrorData>> + Send + '_>>

Source§

fn handle_notification( &self, notification: <R as ServiceRole>::PeerNot, context: NotificationContext<R>, ) -> Pin<Box<dyn Future<Output = Result<(), ErrorData>> + Send + '_>>

Source§

fn get_info(&self) -> <R as ServiceRole>::Info

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: 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
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: 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
Source§

impl<H> Service<RoleServer> for H
where H: ServerHandler,

Source§

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

Source§

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

Source§

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

Convert this service to a dynamic boxed service Read more
Source§

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

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

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> ErasedDestructor for T
where T: 'static,