Purpose
nvim-mcp is an MCP (Model Context Protocol) server used to connect AI agents to a user's running Neovim session. It communicates through Neovim's native msgpack-RPC socket and requires no plugin installation. This tool is suitable for Cursor, Claude Code, Codex, OpenCode, and any MCP-compatible client. The official documentation recommends reading the "Working safely" notes before connecting an agent to Neovim.
Main capabilities
- View editor state: editor mode, working directory, open buffers, window layout, cursor context, folds, selections, marks, and diagnostic information.
- Edit buffers in memory: find and replace or fully rewrite, with instant feedback, full undo support, and no writing to disk before saving.
- Run arbitrary Vim commands: for example :w, :e, :vsplit, macros, or anything that can be entered on the command line.
- Send keystrokes: navigation, entering insert mode, triggering mappings.
- Query LSP diagnostics: errors, warnings, and hints in a single buffer or across the entire session.
- Annotate code with highlights and virtual text: colored line highlights and inline, above-line, or below-line text annotations, without modifying the buffer's actual contents.
- Multi-instance support: automatically discover running sessions and connect to the correct instance. The official description states that anything that can be done in Neovim, the agent can also do; see the project documentation for the complete tool reference.
Usage
nvim-mcp runs through uv (recommended) or Nix.
- Install the launcher.
- uv:
curl -LsSf https://astral.sh/uv/install.sh | sh - Nix: install Nix, and flakes need to be enabled.
- uv:
- Register the MCP server in the client. Taking Cursor (
.cursor/mcp.json) as an example:- Using uv:
{ "mcpServers": { "nvim-mcp": { "command": "uvx", "args": ["nvim-mcp"] } } } - Using Nix:
{ "mcpServers": { "nvim-mcp": { "command": "nix", "args": ["run", "github:paulburgess1357/nvim-mcp"] } } }
- Using uv:
- Add agent rules; the official documentation emphasizes not skipping this step. Without rules, the agent has the tools but does not know when and how to use them, and its behavior will be unreliable. For specific setup, see the configuration guide.
- Start Neovim. On most Linux systems, it will automatically listen on a Unix socket and be discovered by nvim-mcp. If automatic discovery does not work, see the environment variable documentation; when running multiple instances, see the multi-instance documentation.
Verification
Open a file in Neovim and paste the verification content provided in the documentation into the AI agent to confirm that the toolchain is working properly.
Suitable scenarios
Suitable for developers who want AI agents to directly operate a running Neovim session, for example to read context in the editor, perform in-memory edits, run Vim commands, query LSP diagnostics, or annotate code with highlights and virtual text.
Limitations and notes
- Requires Neovim ≥ 0.11; older versions can use it through
--listenandNVIM_ADDRESS. - The tools and agent rules are designed as non-destructive operations: edits are performed in memory, undo history is preserved, and agents are guided to use buffer operations. However, large language models are non-deterministic and have full access to the Neovim API; it should be assumed that they will make mistakes, and working in a version-controlled directory is recommended.
- Licensed under the MIT License; see the project LICENSE for details.
- The Marketplace plugin for Cursor users was still under review at the time, and the official documentation says that once available, it will install both the MCP server and the agent rules (you can skip to step 4); to enable the rules, you can start in chat with something like "Connect to my Neovim instance", or set the rules to "Always" in Settings → Rules to apply them every turn.
- Other information such as fees and pricing is not yet provided.