Purpose
nvim-mcp is a Model Context Protocol (MCP) server designed to integrate seamlessly with Neovim instances, enabling AI assistants to interact with the editor through connections and access diagnostic information as structured resources.
Key Capabilities
- Multi-connection support: Manage multiple concurrent Neovim instances.
- LSP integration: Provides a complete LSP workflow, including code actions, hover, and diagnostics.
- Universal document identifiers: Supports operating on files via buffer ID, relative path, or absolute path.
- MCP resources: Provides structured diagnostic data through a connection-aware URI scheme.
- Multi-transport support: Supports both stdio and HTTP server transport modes.
- Dynamic tool system (experimental): User-extensible custom tools.
- Plugin integration: Automatic setup through a Neovim plugin.
Usage
It can be installed and run in the following ways:
- Install from crates.io using Cargo.
- This repository is a flake that exposes the server as the default package and app, allowing it to be run directly without installing anything, or installed into a profile.
- Install the Neovim plugin and server binary via a snippet, and register them declaratively with Claude Code, without a cargo install build step and without manually running claude mcp add.
- This method registers the nvim MCP server for each project, so the manual claude mcp add step below can be skipped.
Tip: git generates one-off Neovim instances to edit commit, merge, and rebase messages. If these instances load the full configuration, they will each call setup() and register an extra socket in the same git root directory. This can be ensured by guarding that call so that each repository has exactly one socket.
When setting up the Neovim integration, a plugin manager such as lazy.nvim can be used. When configuring claude or other MCP clients, refer to the usage guide, tool reference (which contains a complete reference for all 26 MCP tools), resources (MCP resources and URI scheme), and development documentation.
The basic development setup and complete development guide can be found in the development documentation, which includes the testing process and contribution guidelines.
Use Cases
- LSP hover translation.
- Diagnostic analysis and code fixes.
- Intelligent context retrieval.
- More use cases can be found in Discussions.
Limitations
The materials do not provide relevant limitation information.